tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git  
keys-intercept
head:   c851eb7ccfe5790cf61e58980a4020a7515fdac0
commit: eff294a56406acb033f57450097c21dd5177de6d [20/21] Add namespace tags 
that can be used for matching without pinning a ns
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
kernel/pid_namespace.c:120 create_pid_namespace() warn: passing zero to 
'ERR_PTR'

vim +/ERR_PTR +120 kernel/pid_namespace.c

49f4d8b93ccf94 Eric W. Biederman 2012-08-02   70  static struct pid_namespace 
*create_pid_namespace(struct user_namespace *user_ns,
49f4d8b93ccf94 Eric W. Biederman 2012-08-02   71        struct pid_namespace 
*parent_pid_ns)
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   72  {
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   73        struct pid_namespace 
*ns;
ed469a63c37a99 Alexey Dobriyan   2009-06-17   74        unsigned int level = 
parent_pid_ns->level + 1;
f333c700c6100b Eric W. Biederman 2016-08-08   75        struct ucounts *ucounts;
f2302505775fd1 Andrew Vagin      2012-10-25   76        int err;
f2302505775fd1 Andrew Vagin      2012-10-25   77  
a2b426267c5677 Eric W. Biederman 2017-04-29   78        err = -EINVAL;
a2b426267c5677 Eric W. Biederman 2017-04-29   79        if 
(!in_userns(parent_pid_ns->user_ns, user_ns))
a2b426267c5677 Eric W. Biederman 2017-04-29   80                goto out;
a2b426267c5677 Eric W. Biederman 2017-04-29   81  
df75e7748bae1c Eric W. Biederman 2016-09-22   82        err = -ENOSPC;
f333c700c6100b Eric W. Biederman 2016-08-08   83        if (level > 
MAX_PID_NS_LEVEL)
f333c700c6100b Eric W. Biederman 2016-08-08   84                goto out;
f333c700c6100b Eric W. Biederman 2016-08-08   85        ucounts = 
inc_pid_namespaces(user_ns);
f333c700c6100b Eric W. Biederman 2016-08-08   86        if (!ucounts)
f2302505775fd1 Andrew Vagin      2012-10-25   87                goto out;
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   88  
f2302505775fd1 Andrew Vagin      2012-10-25   89        err = -ENOMEM;
84406c153a5bfa Pavel Emelyanov   2008-07-25   90        ns = 
kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL);
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   91        if (ns == NULL)
f333c700c6100b Eric W. Biederman 2016-08-08   92                goto out_dec;
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   93  
95846ecf9dac50 Gargi Sharma      2017-11-17   94        idr_init(&ns->idr);
74bd59bb39eb08 Pavel Emelyanov   2008-02-08   95  
eff294a56406ac David Howells     2021-02-04   96        err = 
init_ns_common(&ns->ns, false);
98f842e675f96f Eric W. Biederman 2011-06-15   97        if (err)
eff294a56406ac David Howells     2021-02-04   98                goto out_free;
33c429405a2c8d Al Viro           2014-11-01   99        ns->ns.ops = 
&pidns_operations;
98f842e675f96f Eric W. Biederman 2011-06-15  100  
eff294a56406ac David Howells     2021-02-04  101        ns->pid_cachep = 
create_pid_cachep(level);
eff294a56406ac David Howells     2021-02-04  102        if (ns->pid_cachep == 
NULL)
eff294a56406ac David Howells     2021-02-04  103                goto out_free;

"err" not set on this path.

eff294a56406ac David Howells     2021-02-04  104  
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  105        ns->level = level;
ed469a63c37a99 Alexey Dobriyan   2009-06-17  106        ns->parent = 
get_pid_ns(parent_pid_ns);
49f4d8b93ccf94 Eric W. Biederman 2012-08-02  107        ns->user_ns = 
get_user_ns(user_ns);
f333c700c6100b Eric W. Biederman 2016-08-08  108        ns->ucounts = ucounts;
e8cfbc245e2488 Gargi Sharma      2017-11-17  109        ns->pid_allocated = 
PIDNS_ADDING;
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  110  
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  111        return ns;
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  112  
eff294a56406ac David Howells     2021-02-04  113  out_free:
95846ecf9dac50 Gargi Sharma      2017-11-17  114        idr_destroy(&ns->idr);
eff294a56406ac David Howells     2021-02-04  115        
destroy_ns_common(&ns->ns);
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  116        
kmem_cache_free(pid_ns_cachep, ns);
f333c700c6100b Eric W. Biederman 2016-08-08  117  out_dec:
f333c700c6100b Eric W. Biederman 2016-08-08  118        
dec_pid_namespaces(ucounts);
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  119  out:
4308eebbeb2026 Eric W. Biederman 2011-03-23 @120        return ERR_PTR(err);
74bd59bb39eb08 Pavel Emelyanov   2008-02-08  121  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected] 

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to