mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
LSM/SELinux: Interfaces to allow FS to control mount options
Introduce new LSM interfaces to allow an FS to deal with their own mount options. This includes a new string parsing function exported from the LSM that an FS can use to get a security data blob and a new security data blob. This is particularly useful for an FS which uses binary mount data, like NFS, which does not pass strings into the vfs to be handled by the loaded LSM. Also fix a BUG() in both SELinux and SMACK when dealing with binary mount data. If the binary mount data is less than one page the copy_page() in security_sb_copy_data() can cause an illegal page fault and boom. Remove all NFSisms from the SELinux code since they were broken by past NFS changes. Signed-off-by: Eric Paris <[email protected]> Acked-by: Stephen Smalley <[email protected]> Acked-by: Casey Schaufler <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
29e8c3c304
commit
e000752989
7 changed files with 204 additions and 134 deletions
|
|
@ -189,17 +189,10 @@ static void smack_sb_free_security(struct super_block *sb)
|
|||
* Copy the Smack specific mount options out of the mount
|
||||
* options list.
|
||||
*/
|
||||
static int smack_sb_copy_data(struct file_system_type *type, void *orig,
|
||||
void *smackopts)
|
||||
static int smack_sb_copy_data(char *orig, char *smackopts)
|
||||
{
|
||||
char *cp, *commap, *otheropts, *dp;
|
||||
|
||||
/* Binary mount data: just copy */
|
||||
if (type->fs_flags & FS_BINARY_MOUNTDATA) {
|
||||
copy_page(smackopts, orig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
otheropts = (char *)get_zeroed_page(GFP_KERNEL);
|
||||
if (otheropts == NULL)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue