diff options
author | José Bollo <jose.bollo@open.eurogiciel.org> | 2014-01-08 09:53:05 -0500 |
---|---|---|
committer | Casey Schaufler <casey@schaufler-ca.com> | 2014-04-11 17:33:59 -0400 |
commit | 55dfc5da1a9b7e623b6f35620c74280555df0288 (patch) | |
tree | 684c885270fdf52de7639aba8ebcc4dd86836b96 /security/smack | |
parent | f64410ec665479d7b4b77b7519e814253ed0f686 (diff) |
Minor improvement of 'smack_sb_kern_mount'
Fix a possible memory access fault when transmute is true and isp is NULL.
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index d814e35987be..efa42991235e 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -413,9 +413,11 @@ static int smack_sb_kern_mount(struct super_block *sb, int flags, void *data) | |||
413 | * Initialize the root inode. | 413 | * Initialize the root inode. |
414 | */ | 414 | */ |
415 | isp = inode->i_security; | 415 | isp = inode->i_security; |
416 | if (inode->i_security == NULL) { | 416 | if (isp == NULL) { |
417 | inode->i_security = new_inode_smack(sp->smk_root); | 417 | isp = new_inode_smack(sp->smk_root); |
418 | isp = inode->i_security; | 418 | if (isp == NULL) |
419 | return -ENOMEM; | ||
420 | inode->i_security = isp; | ||
419 | } else | 421 | } else |
420 | isp->smk_inode = sp->smk_root; | 422 | isp->smk_inode = sp->smk_root; |
421 | 423 | ||