lkml.org 
[lkml]   [2021]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()
On Fri, 16 Apr 2021 13:36:01 +0000
Al Viro <viro@zeniv.linux.org.uk> wrote:

> 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...

update patch v3 , just four codes and no other changes are needed.

\
 
 \ /
  Last update: 2021-04-19 05:00    [W:0.052 / U:4.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site