lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 May 2022 09:49:00 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Long Li <longli@...rosoft.com>
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

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?
 
> > > +	// map to the page indexed by ucontext->doorbell
> > 
> > Not kernel style, be sure to run checkpatch and fix the egregious things.
> > 
> > > +static void mana_ib_disassociate_ucontext(struct ib_ucontext
> > > +*ibcontext) { }
> > 
> > Does this driver actually support disassociate? Don't define this function if it
> > doesn't.
> > 
> > I didn't see any mmap zapping so I guess it doesn't.
> 
> The user-mode deals with zapping.
> I see the following comments on rdma_umap_priv_init():
> 
> /* RDMA drivers supporting disassociation must have their user space designed
>  * to cope in some way with their IO pages going to the zero page. */
> 
> Is there any other additional work for the kernel driver to support
> disassociate? It seems uverbs_user_mmap_disassociate() has done all
> the zapping when destroying a ucontext.

Nope, that looks OK then
 
> I will open PR to rdma-core. The current version of the driver
> supports queue pair type IB_QPT_RAW_PACKET. The test case will be
> limited to querying device and load/unload. Running traffic tests
> will require DPDK (or other user-mode program making use of
> IB_QPT_RAW_PACKET).
> 
> Is it acceptable to develop test cases for this driver without
> traffic/data tests?

I'm not keen on that, even EFA was able to do simple traffic.

Even with RAW_PACKET I would expect the driver to be able to send/recv
using standard verbs as RAW_PACKET is a common feature.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ