https://bugzilla.novell.com/show_bug.cgi?id=237270 sbeattie@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbeattie@novell.com ------- Comment #3 from sbeattie@novell.com 2007-01-27 00:50 MST ------- Frankly, security_getprocattr() presents a craptacular interface. The proc_pid_attr_read() function wants a length returned (strlen) that does not include a trailing \0, or else it will emit the \0 when /proc/pid/attr/* is read from. But audit_log_task_context() kmallocs a string based on the length returned when size=0 is passed to security_getprocattr(), which means that a security_getprocattr() implementation has to return strlen+1 when size=0 if storage is to be allocated for the \0. Looking at the selinux code and experimenting with a RHEL5b2 box, selinux does terminate the string and returns the length including the trailing \0 and thus the /proc/self/attr/current file contains it: [root@vmrhel5 ~]# hexdump -C /proc/self/attr/current 00000000 72 6f 6f 74 3a 73 79 73 74 65 6d 5f 72 3a 75 6e |root:system_r:un| 00000010 63 6f 6e 66 69 6e 65 64 5f 74 3a 73 30 2d 73 30 |confined_t:s0-s0| 00000020 3a 63 30 2e 63 31 30 32 33 00 |:c0.c1023.| 0000002a We used to null terminate the string, but didn't want the null garbage in the /proc/self/attr/current file. I don't think it broke any of our tools to have a null terminated string there; but we'd need to revalidate. Fixing proc_pid_attr_read() to expect a null terminated string might be the best way to fix this issue. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.