[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHmSwVpR2oq2yqUG@zeniv-ca.linux.org.uk>
Date: Fri, 16 Apr 2021 13:36:01 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Zhongjun Tan <hbut_tan@....com>
Cc: casey@...aufler-ca.com, jmorris@...ei.org, serge@...lyn.com,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, Zhongjun Tan <tanzhongjun@...ong.com>
Subject: Re: [PATCH] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()
On Fri, Apr 16, 2021 at 05:53:03PM +0800, Zhongjun Tan wrote:
> @@ -710,13 +711,14 @@ 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);
> + if (!arg) {
> + rc = -ENOMEM;
> + goto free_mnt_opts;
> rc = smack_add_opt(token, arg, mnt_opts);
if (arg)
rc = smack_add_opt(token, arg, mnt_opts);
else
rc = -ENOMEM;
and no other changes are needed anywhere...
Powered by blists - more mailing lists