Message ID | 20210419025517.551-1-hbut_tan@163.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v3] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts() | expand |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 223a6da..020929f 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -710,7 +710,10 @@ static int smack_sb_eat_lsm_opts(char *options, void **mnt_opts) token = match_opt_prefix(from, len, &arg); if (token != Opt_error) { arg = kmemdup_nul(arg, from + len - arg, GFP_KERNEL); - rc = smack_add_opt(token, arg, mnt_opts); + if (arg) + rc = smack_add_opt(token, arg, mnt_opts); + else + rc = -ENOMEM; if (unlikely(rc)) { kfree(arg); if (*mnt_opts)