Message ID | a44e9ac5-44e2-d575-9e30-02483cc7ffd1@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | RDMA/siw: remove namespace check from siw_netdev_event() | expand |
> -----Original Message----- > From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Sent: Sunday, 2 April 2023 07:10 > To: Bernard Metzler <BMT@zurich.ibm.com>; Jason Gunthorpe <jgg@ziepe.ca>; > Leon Romanovsky <leon@kernel.org> > Cc: OFED mailing list <linux-rdma@vger.kernel.org>; > syzbot+5e70d01ee8985ae62a3b@syzkaller.appspotmail.com; syzkaller-bugs > <syzkaller-bugs@googlegroups.com> > Subject: [EXTERNAL] [PATCH] RDMA/siw: remove namespace check from > siw_netdev_event() > > syzbot is reporting that siw_netdev_event(NETDEV_UNREGISTER) cannot destroy > siw_device created after unshare(CLONE_NEWNET) due to net namespace check. > It seems that this check was by error there and should be removed. > > Reported-by: syzbot <syzbot+5e70d01ee8985ae62a3b@syzkaller.appspotmail.com> > Link: INVALID URI REMOVED > 3A__syzkaller.appspot.com_bug-3Fextid- > 3D5e70d01ee8985ae62a3b&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=2TaYXQ0T- > r8ZO1PP1alNwU_QJcRRLfmYTAgd3QCvqSc&m=Vq8ic5smZk4c30D3-f7meZj_nIZP- > Js0SjZLqzyh5UT4cXVOTulkVhB0SFMVjdV3&s=voUxLOC4jZQi8diPtrEU3qUWKJDq_w2d- > dWLDKd0nUo&e= > Suggested-by: Jason Gunthorpe <jgg@ziepe.ca> > Suggested-by: Leon Romanovsky <leon@kernel.org> > Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface") > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > --- > drivers/infiniband/sw/siw/siw_main.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/infiniband/sw/siw/siw_main.c > b/drivers/infiniband/sw/siw/siw_main.c > index dacc174604bf..65b5cda5457b 100644 > --- a/drivers/infiniband/sw/siw/siw_main.c > +++ b/drivers/infiniband/sw/siw/siw_main.c > @@ -437,9 +437,6 @@ static int siw_netdev_event(struct notifier_block *nb, > unsigned long event, > > dev_dbg(&netdev->dev, "siw: event %lu\n", event); > > - if (dev_net(netdev) != &init_net) > - return NOTIFY_OK; > - > base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW); > if (!base_dev) > return NOTIFY_OK; > -- > 2.18.4 Thanks Tetsuo. Yes, that namespace check is useless. Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
On Sun, 02 Apr 2023 14:10:13 +0900, Tetsuo Handa wrote: > syzbot is reporting that siw_netdev_event(NETDEV_UNREGISTER) cannot destroy > siw_device created after unshare(CLONE_NEWNET) due to net namespace check. > It seems that this check was by error there and should be removed. > > Applied, thanks! [1/1] RDMA/siw: remove namespace check from siw_netdev_event() https://git.kernel.org/rdma/rdma/c/3ffe884d48b7a9 Best regards,
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c index dacc174604bf..65b5cda5457b 100644 --- a/drivers/infiniband/sw/siw/siw_main.c +++ b/drivers/infiniband/sw/siw/siw_main.c @@ -437,9 +437,6 @@ static int siw_netdev_event(struct notifier_block *nb, unsigned long event, dev_dbg(&netdev->dev, "siw: event %lu\n", event); - if (dev_net(netdev) != &init_net) - return NOTIFY_OK; - base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW); if (!base_dev) return NOTIFY_OK;
syzbot is reporting that siw_netdev_event(NETDEV_UNREGISTER) cannot destroy siw_device created after unshare(CLONE_NEWNET) due to net namespace check. It seems that this check was by error there and should be removed. Reported-by: syzbot <syzbot+5e70d01ee8985ae62a3b@syzkaller.appspotmail.com> Link: https://syzkaller.appspot.com/bug?extid=5e70d01ee8985ae62a3b Suggested-by: Jason Gunthorpe <jgg@ziepe.ca> Suggested-by: Leon Romanovsky <leon@kernel.org> Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> --- drivers/infiniband/sw/siw/siw_main.c | 3 --- 1 file changed, 3 deletions(-)