From: Kamalesh B. <kam...@li...> - 2009-01-30 10:26:53
|
* Serge E. Hallyn <se...@us...> [2009-01-29 12:23:49]: > Quoting CAI Qian (ca...@cc...): > > Hi, > > > > to me the test here has a different testing focus -- try to read every entry in /proc > > > > filesystem. Those entries belong to this filesystem, so we'll read them the same > > > > way. Who knows if those entries will not give us a hang or panic or behaving > > > > badly with certain read buffers? SELinux test suite may or may not catch those > > > > kind of bugs. > > > > > > Then add tests in there... > > > > > > > No, they do not belong there, because we are focus on testing of proc > > filesystem here. The test case here should not care about the content it > > read, but rather what the kernel behaves when to read those files. > > Then the dummy lsm I suggested is the only way to really test what you > want :) > > > > In fact, the logical course given your concern would be to write a > > > kernel module defining an LSM allowing random long write to and reads > > > from /proc/$$/attr/ so you can test the procfs bits of that API (if > > > you could still write an LSM as a module :). It should be doable to > > > push a 'debug' LSM into the upstream kernel which just serves to > > > facilitate such testing. > > > > > > Anyway I've made my own position clear, and I think Kamalesh's patch > > > implements precisely what Stephen suggested. > > > > > > > Stephen's suggestion is something we should take. I agree Kamalesh's > > patch has included his suggestion. Unfortunately, there are other issues > > with Kamalesh's patch that have been pointed out in the last email. > > Sorry, I've looked back through the thread, but don't see the other > issues you're talking about. > > -serge Please find the results after applying the patch selinux disabled ----------------- proc01 0 INFO : /proc/acpi/event: open: known issue: Device or resource busy proc01 0 INFO : /proc/sys/net/ipv6/route/flush: is write-only. proc01 0 INFO : /proc/sys/net/ipv4/route/flush: is write-only. proc01 0 INFO : /proc/sys/fs/binfmt_misc/register: is write-only. proc01 0 INFO : /proc/sysrq-trigger: is write-only. proc01 0 INFO : /proc/kmsg: read: known issue: Resource temporarily unavailable proc01 0 INFO : /proc/self/task/2893/mem: read: known issue: Input/output error proc01 0 INFO : /proc/self/task/2893/attr/current: read: known issue: Invalid argument proc01 0 INFO : /proc/self/task/2893/attr/prev: read: known issue: Invalid argument proc01 0 INFO : /proc/self/task/2893/attr/exec: read: known issue: Invalid argument proc01 0 INFO : /proc/self/task/2893/attr/fscreate: read: known issue: Invalid argument proc01 0 INFO : /proc/self/task/2893/attr/keycreate: read: known issue: Invalid argument proc01 0 INFO : /proc/self/task/2893/attr/sockcreate: read: known issue: Invalid argument proc01 0 INFO : /proc/self/mem: read: known issue: Input/output error proc01 0 INFO : /proc/self/attr/current: read: known issue: Invalid argument proc01 0 INFO : /proc/self/attr/prev: read: known issue: Invalid argument proc01 0 INFO : /proc/self/attr/exec: read: known issue: Invalid argument proc01 0 INFO : /proc/self/attr/fscreate: read: known issue: Invalid argument proc01 0 INFO : /proc/self/attr/keycreate: read: known issue: Invalid argument proc01 0 INFO : /proc/self/attr/sockcreate: read: known issue: Invalid argument proc01 1 PASS : readproc() completed successfully, total read: 1095917 bytes, 885 objs selinux disabled (changing {"read", "/proc/self/task/[0-9]*/attr/*", EIO and {"read", "/proc/self/task/[0-9]*/attr/*", EIO}) ---------------- proc01 0 INFO : /proc/acpi/event: open: known issue: Device or resource busy proc01 0 INFO : /proc/sys/net/ipv6/route/flush: is write-only. proc01 0 INFO : /proc/sys/net/ipv4/route/flush: is write-only. proc01 0 INFO : /proc/sys/fs/binfmt_misc/register: is write-only. proc01 0 INFO : /proc/sysrq-trigger: is write-only. proc01 0 INFO : /proc/kmsg: read: known issue: Resource temporarily unavailable proc01 0 INFO : /proc/self/task/2991/mem: read: known issue: Input/output error proc01 1 FAIL : /proc/self/task/2991/attr/current: read: Invalid argument proc01 2 FAIL : /proc/self/task/2991/attr/prev: read: Invalid argument proc01 3 FAIL : /proc/self/task/2991/attr/exec: read: Invalid argument proc01 4 FAIL : /proc/self/task/2991/attr/fscreate: read: Invalid argument proc01 5 FAIL : /proc/self/task/2991/attr/keycreate: read: Invalid argument proc01 6 FAIL : /proc/self/task/2991/attr/sockcreate: read: Invalid argument proc01 0 INFO : /proc/self/mem: read: known issue: Input/output error proc01 7 FAIL : /proc/self/attr/current: read: Invalid argument proc01 8 FAIL : /proc/self/attr/prev: read: Invalid argument proc01 9 FAIL : /proc/self/attr/exec: read: Invalid argument proc01 10 FAIL : /proc/self/attr/fscreate: read: Invalid argument proc01 11 FAIL : /proc/self/attr/keycreate: read: Invalid argument proc01 12 FAIL : /proc/self/attr/sockcreate: read: Invalid argument proc01 13 FAIL : readproc() failed with 12 errors. selinux enabled ---------------- proc01 0 INFO : /proc/acpi/event: open: known issue: Device or resource busy proc01 0 INFO : /proc/sys/net/ipv6/route/flush: is write-only. proc01 0 INFO : /proc/sys/net/ipv4/route/flush: is write-only. proc01 0 INFO : /proc/sys/fs/binfmt_misc/register: is write-only. proc01 0 INFO : /proc/sysrq-trigger: is write-only. proc01 0 INFO : /proc/kmsg: read: known issue: Resource temporarily unavailable proc01 0 INFO : /proc/self/task/2875/mem: read: known issue: Input/output error proc01 0 INFO : /proc/self/mem: read: known issue: Input/output error proc01 1 PASS : readproc() completed successfully, total read: 1096865 bytes, 885 objs the EINVAL is returned only when the LSM is does not support the interface, and found_errno() checks for the know return value or else it handled the way the unknow error is hanlded. -- Thanks & Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. |