]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/addr: Be strict with gid size
authorLeon Romanovsky <leonro@nvidia.com>
Mon, 5 Apr 2021 07:44:34 +0000 (10:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:47:24 +0000 (08:47 +0200)
commitdefb759f8886aceab2d6f5cf6e0a6d5020350ec2
treea86773d2b8d29f22015de93f534baff46fb0ad84
parent4dc4f3d72eafba68429f632d3e01bec9fcaf7f9f
RDMA/addr: Be strict with gid size

[ Upstream commit d1c803a9ccd7bd3aff5e989ccfb39ed3b799b975 ]

The nla_len() is less than or equal to 16.  If it's less than 16 then end
of the "gid" buffer is uninitialized.

Fixes: ae43f8286730 ("IB/core: Add IP to GID netlink offload")
Link: https://lore.kernel.org/r/20210405074434.264221-1-leon@kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/addr.c