[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH7PR21MB3263E61F0A8CA25545B47173CED09@PH7PR21MB3263.namprd21.prod.outlook.com>
Date: Thu, 19 May 2022 17:50:07 +0000
From: Long Li <longli@...rosoft.com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Leon Romanovsky <leon@...nel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [PATCH 12/12] RDMA/mana_ib: Add a driver for Microsoft Azure
Network Adapter
> Subject: Re: [PATCH 12/12] RDMA/mana_ib: Add a driver for Microsoft Azure
> Network Adapter
>
> On Thu, May 19, 2022 at 05:57:01AM +0000, Long Li wrote:
>
> > > > +
> > > > + err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd),
> > > > +udata->inlen));
> > >
> > > Skeptical this min is correct, many other drivers get this wrong.
> >
> > I think this is correct. This is to prevent user-mode passing more data that may
> overrun the kernel buffer.
>
> And what happens when udata->inlen is, say, 0?
Thanks. I'll add check before calling ib_copy_from_udata().
Long
Powered by blists - more mailing lists