From: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
To: Parav Pandit <parav@nvidia.com>,
mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com,
jgg@ziepe.ca, yanjunz@nvidia.com, bmt@zurich.ibm.com,
linux-rdma@vger.kernel.org
Cc: hch@lst.de, syzbot+34dc2fea3478e659af01@syzkaller.appspotmail.com
Subject: Re: [PATCH] RDMA: Fix software RDMA drivers for dma mapping error
Date: Fri, 30 Oct 2020 08:04:21 -0400 [thread overview]
Message-ID: <c3e63243-765e-adba-69f3-30e286cd8b7d@cornelisnetworks.com> (raw)
In-Reply-To: <20201030093803.278830-1-parav@nvidia.com>
On 10/30/2020 5:38 AM, Parav Pandit wrote:
> A cited commit in fixes tag avoided setting dma_mask of the ib_device.
> Commit [1] made dma_mask as mandetory field to be setup even for
> dma_virt_ops based dma devices. Due to which below call trace occurred.
>
> Fix it by setting empty DMA MASK for software based RDMA devices.
>
> WARNING: CPU: 1 PID: 8488 at kernel/dma/mapping.c:149
> dma_map_page_attrs+0x493/0x700 kernel/dma/mapping.c:149 Modules linked in:
> CPU: 1 PID: 8488 Comm: syz-executor144 Not tainted 5.9.0-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine,
> BIOS Google 01/01/2011
> RIP: 0010:dma_map_page_attrs+0x493/0x700 kernel/dma/mapping.c:149
> Trace:
> dma_map_single_attrs include/linux/dma-mapping.h:279 [inline]
> ib_dma_map_single include/rdma/ib_verbs.h:3967 [inline]
> ib_mad_post_receive_mads+0x23f/0xd60
> drivers/infiniband/core/mad.c:2715
> ib_mad_port_start drivers/infiniband/core/mad.c:2862 [inline]
> ib_mad_port_open drivers/infiniband/core/mad.c:3016 [inline]
> ib_mad_init_device+0x72b/0x1400 drivers/infiniband/core/mad.c:3092
> add_client_context+0x405/0x5e0 drivers/infiniband/core/device.c:680
> enable_device_and_get+0x1d5/0x3c0
> drivers/infiniband/core/device.c:1301
> ib_register_device drivers/infiniband/core/device.c:1376 [inline]
> ib_register_device+0x7a7/0xa40 drivers/infiniband/core/device.c:1335
> rxe_register_device+0x46d/0x570
> drivers/infiniband/sw/rxe/rxe_verbs.c:1182
> rxe_add+0x12fe/0x16d0 drivers/infiniband/sw/rxe/rxe.c:247
> rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:507
> rxe_newlink drivers/infiniband/sw/rxe/rxe.c:269 [inline]
> rxe_newlink+0xb7/0xe0 drivers/infiniband/sw/rxe/rxe.c:250
> nldev_newlink+0x30e/0x540 drivers/infiniband/core/nldev.c:1555
> rdma_nl_rcv_msg+0x367/0x690 drivers/infiniband/core/netlink.c:195
> rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
> rdma_nl_rcv+0x2f2/0x440 drivers/infiniband/core/netlink.c:259
> netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
> netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
> netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919
> sock_sendmsg_nosec net/socket.c:651 [inline]
> sock_sendmsg+0xcf/0x120 net/socket.c:671
> ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353
> ___sys_sendmsg+0xf3/0x170 net/socket.c:2407
> __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440
> do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
> entry_SYSCALL_64_after_hwframe+0x44/0xa9
> RIP: 0033:0x443699
>
> [1] commit f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")
>
> Reported-by: syzbot+34dc2fea3478e659af01@syzkaller.appspotmail.com
> Fixes: e0477b34d9d1 ("RDMA: Explicitly pass in the dma_device to ib_register_device")
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> ---
Patch did not apply cleanly in rxe but I took the hunk for rdmavt and it
seems to do the trick. So for the rvt bits:
Tested-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
next prev parent reply other threads:[~2020-10-30 12:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 9:38 [PATCH] RDMA: Fix software RDMA drivers for dma mapping error Parav Pandit
2020-10-30 9:48 ` Guoqing Jiang
2020-10-30 12:04 ` Dennis Dalessandro [this message]
2020-10-30 12:17 ` Jason Gunthorpe
2020-10-30 12:19 ` Dennis Dalessandro
2020-10-30 12:45 ` Parav Pandit
2020-10-30 15:01 ` hch
2020-10-30 15:01 ` Christoph Hellwig
2020-11-01 4:28 ` Zhu Yanjun
2020-11-01 9:20 ` Zhu Yanjun
2020-11-02 19:20 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3e63243-765e-adba-69f3-30e286cd8b7d@cornelisnetworks.com \
--to=dennis.dalessandro@cornelisnetworks.com \
--cc=bmt@zurich.ibm.com \
--cc=dledford@redhat.com \
--cc=hch@lst.de \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@cornelisnetworks.com \
--cc=parav@nvidia.com \
--cc=syzbot+34dc2fea3478e659af01@syzkaller.appspotmail.com \
--cc=yanjunz@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox