Skip to contentSkip to conversation

Kernel Oops from afsd under the selinux kernel

DISCUSSION Stephen D. Smalley 2 participants 2 messages Dec 3, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines

I'm getting the following Oops running on a redhat 7.1 system with the LSM/selinux patches. kernel 2.4.19. The system runs well in enforcing mode (however this test is in non-enforcing mode because I can't really do the policy changes until I have a working afsd.

You might try the attached patch to see if it helps. The AFS code might bypass alloc_inode() when allocating inodes, in which case the inode would not have an allocated security structure upon entry to inode_doinit.

--
Stephen Smalley, NSA
[email protected]

Index: lsm-2.4/security/selinux/hooks.c
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/hooks.c,v retrieving revision 1.22

security/selinux/hooks.c +0 -2
diff -u -r1.22 hooks.c
@@ -652,14 +652,12 @@
 	struct dentry *dentry;
 	int rc;
 
-#ifndef _SELINUX_KERNEL_PATCH_
 	if (!isec) {
 		rc = inode_alloc_security(inode);
 		if (rc)
 			return rc;
 		isec = inode->i_security;
 	}
-#endif
 
 	if (isec->initialized) {
 		/* Already initialized. */
#1 lore raw

Thanks!

removing the #ifndef _SELINUX_KERNEL_PATCH_ -- #endif ca line 650++ indeed solves it -- is this adding significant overhead? .. should I patch afsd to call alloc_inode() so the test isn't being added to all calls?

forrest

On Tue, 3 Dec 2002 15:08:28 -0500 (EST) (unchecked - local sync NTPstrat4) "Stephen D. Smalley" <[email protected]> did inscribe thusly:

Quoted 6 lines
Quoted 5 lines

I'm getting the following Oops running on a redhat 7.1 system with the LSM/selinux patches. kernel 2.4.19. The system runs well in enforcing mode (however this test is in non-enforcing mode because I can't really do the policy changes until I have a working afsd.

Quoted 8 lines

You might try the attached patch to see if it helps. The AFS code might bypass alloc_inode() when allocating inodes, in which case the inode would not have an allocated security structure upon entry to inode_doinit.

--
Stephen Smalley, NSA
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.