diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 12:45:15 +1000 |
|---|---|---|
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 12:45:15 +1000 |
| commit | 829e4e7e2a710572e71f80fadaee9b4dc3044643 (patch) | |
| tree | c6c50106cb5829b110865782254a5bb26a1d0054 /security | |
| parent | 87473733404a7f7bcd7b9ad361e6ae14258fa98f (diff) | |
| parent | b50503990d8889a73bc412fd976ef00951cdb2b5 (diff) | |
| download | linux-next-829e4e7e2a710572e71f80fadaee9b4dc3044643.tar.gz linux-next-829e4e7e2a710572e71f80fadaee9b4dc3044643.zip | |
Merge branch 'next' of git://github.com/cschaufler/smack-next
Diffstat (limited to 'security')
| -rw-r--r-- | security/smack/smack_access.c | 7 | ||||
| -rw-r--r-- | security/smack/smack_lsm.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index d2186e2757be..585e5e35710b 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c @@ -465,12 +465,9 @@ char *smk_parse_smack(const char *string, int len) if (i == 0 || i >= SMK_LONGLABEL) return ERR_PTR(-EINVAL); - smack = kzalloc(i + 1, GFP_NOFS); - if (smack == NULL) + smack = kstrndup(string, i, GFP_NOFS); + if (!smack) return ERR_PTR(-ENOMEM); - - strncpy(smack, string, i); - return smack; } diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 6207762dbdb1..001831458fa2 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -766,13 +766,6 @@ static int smack_set_mnt_opts(struct super_block *sb, if (sp->smk_flags & SMK_SB_INITIALIZED) return 0; - if (inode->i_security == NULL) { - int rc = lsm_inode_alloc(inode); - - if (rc) - return rc; - } - if (!smack_privileged(CAP_MAC_ADMIN)) { /* * Unprivileged mounts don't get to specify Smack values. |
