[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181226195047.GJ10329@mtr-leonro.mtl.com>
Date: Wed, 26 Dec 2018 21:50:47 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Kangjie Lu <kjlu@....edu>
Cc: pakki001@....edu, Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Parav Pandit <parav@...lanox.com>,
Daniel Jurgens <danielj@...lanox.com>,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] infiniband: fix a missing check of nla_put
On Tue, Dec 25, 2018 at 08:05:48PM -0600, Kangjie Lu wrote:
> nla_put() may fail. The fix adds a check for its return value, and
> returns -EMSGSIZE if it fails.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
> drivers/infiniband/core/addr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
The same comment as on previous patch, lack of netlink cancel.
Thanks
>
> diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> index 0dce94e3c495..32d033ebaa5b 100644
> --- a/drivers/infiniband/core/addr.c
> +++ b/drivers/infiniband/core/addr.c
> @@ -178,7 +178,8 @@ static int ib_nl_ip_send_msg(struct rdma_dev_addr *dev_addr,
> /* Construct the family header first */
> header = skb_put(skb, NLMSG_ALIGN(sizeof(*header)));
> header->ifindex = dev_addr->bound_dev_if;
> - nla_put(skb, attrtype, size, daddr);
> + if (nla_put(skb, attrtype, size, daddr))
> + return -EMSGSIZE;
>
> /* Repair the nlmsg header length */
> nlmsg_end(skb, nlh);
> --
> 2.17.2 (Apple Git-113)
>
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists