]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/bnxt_re: Fix uninitialized struct bit field rsvd1
authorColin Ian King <colin.king@canonical.com>
Wed, 23 Jun 2021 18:24:37 +0000 (19:24 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 24 Jun 2021 12:16:42 +0000 (09:16 -0300)
commit23a36bd11161c640da5bfcbb0f7a2d140be955ba
tree3f59e951b4909ad403af6cd1222be8f9d98e7678
parentf98aeafbd482c4ddc871a9f4211c044f26f353ae
RDMA/bnxt_re: Fix uninitialized struct bit field rsvd1

The bit field rsvd1 in resp is not being initialized and garbage data is
being copied from the stack back to userspace via the ib_copy_to_udata
call. Fix this by setting the entire struct resp to zero; this will ensure
that further new bit fields in the future will be zero'd too.

Link: https://lore.kernel.org/r/20210623182437.163801-1-colin.king@canonical.com
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 0f94b1f50b20 ("RDMA/bnxt_re: Update ABI to pass wqe-mode to user space")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
[jgg: remove extra zeroing]
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c