Skip to contentSkip to conversation

Kernel Patch 2.4.20

DISCUSSION Brian May 2 participants 2 messages May 1, 2003 SELinux security module

lore
Share & tools
lore

Brian May

author
#0 lore raw
Quoted 1 line

From Russell's kernel patch, version 2003.04.07-1.

-int init_private_file(struct file *filp, struct dentry *dentry, int mode) +int open_private_file(struct file *filp, struct dentry *dentry, int flags)

Is there any good reason for renaming this function?

Is the new function backword compatable with the old version?

This change breaks the UML HPPFS filesystem (whatever that is...) which has a number of calls to init_private_file.

Signature · 6 lines
Brian May <[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.
#1 lore raw
Quoted 11 lines · Brian May
Quoted 1 line

From Russell's kernel patch, version 2003.04.07-1.

(quoted diff) +1 -1
-int init_private_file(struct file *filp, struct dentry *dentry, int mode)
+int open_private_file(struct file *filp, struct dentry *dentry, int flags)

Is there any good reason for renaming this function?

Is the new function backword compatable with the old version?

This change breaks the UML HPPFS filesystem (whatever that is...) which has a number of calls to init_private_file.

When the LSM changes to init_private_file (to allocate a security structure for the file, and add a corresponding routine for releasing private files that also frees the security structure) were submitted for merging into mainline 2.5, we were asked by the kernel developers to:
1) Rename the init_private_file function to force people to update any callers to also call the function for releasing it (close_private_file). Otherwise, a memory leak will occur since the security structure won't be freed.
2) Change the interface to take a flags argument rather than a mode so that callers can set O_LARGEFILE properly. The mode is now computed from the flags, as in dentry_open.

These changes were accepted into mainline 2.5 and then back ported to the 2.4 LSM patch. We updated all callers of init_private_file that are in the mainline kernel, but naturally out-of-tree patches or modules will need to be updated.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.