OSDN Git Service

IB/uverbs: Allow an empty namespace in ioctl() framework
authorMatan Barak <matanb@mellanox.com>
Sun, 17 Jun 2018 09:59:54 +0000 (12:59 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 19 Jun 2018 16:53:02 +0000 (10:53 -0600)
commit19b9def25852caf710b978cd27955090650f115b
tree016cbeb1b578c662b41573af8ba96a469331a088
parent2d9c1bd7e177bd8b460403db9513b0a223e46ab8
IB/uverbs: Allow an empty namespace in ioctl() framework

The ioctl parser framework wrongly assumed that each namespace is
populated. This could lead to NULL dereferences. Fix the parser to
always check that a given namespace indeed exists.

Fixes: fac9658cabb9 ("IB/core: Add new ioctl interface")
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_ioctl.c