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] [day] [month] [year] [list]
Message-ID:
 <DM6PR21MB1481F3E311D498B7855D7652CACD2@DM6PR21MB1481.namprd21.prod.outlook.com>
Date: Mon, 17 Jun 2024 12:56:35 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Michael Kelley <mhklinux@...look.com>, "linux-hyperv@...r.kernel.org"
	<linux-hyperv@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>
CC: Dexuan Cui <decui@...rosoft.com>, "stephen@...workplumber.org"
	<stephen@...workplumber.org>, KY Srinivasan <kys@...rosoft.com>, Paul
 Rosswurm <paulros@...rosoft.com>, "olaf@...fle.de" <olaf@...fle.de>, vkuznets
	<vkuznets@...hat.com>, "davem@...emloft.net" <davem@...emloft.net>,
	"wei.liu@...nel.org" <wei.liu@...nel.org>, "edumazet@...gle.com"
	<edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
	"pabeni@...hat.com" <pabeni@...hat.com>, "leon@...nel.org" <leon@...nel.org>,
	Long Li <longli@...rosoft.com>, "ssengar@...ux.microsoft.com"
	<ssengar@...ux.microsoft.com>, "linux-rdma@...r.kernel.org"
	<linux-rdma@...r.kernel.org>, "daniel@...earbox.net" <daniel@...earbox.net>,
	"john.fastabend@...il.com" <john.fastabend@...il.com>, "bpf@...r.kernel.org"
	<bpf@...r.kernel.org>, "ast@...nel.org" <ast@...nel.org>, "hawk@...nel.org"
	<hawk@...nel.org>, "tglx@...utronix.de" <tglx@...utronix.de>,
	"shradhagupta@...ux.microsoft.com" <shradhagupta@...ux.microsoft.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2, net-next] net: mana: Add support for page sizes other
 than 4KB on ARM64



> -----Original Message-----
> From: Michael Kelley <mhklinux@...look.com>
> Sent: Sunday, June 16, 2024 12:04 AM
> To: Haiyang Zhang <haiyangz@...rosoft.com>; linux-hyperv@...r.kernel.org;
> netdev@...r.kernel.org
> Cc: Dexuan Cui <decui@...rosoft.com>; stephen@...workplumber.org; KY
> Srinivasan <kys@...rosoft.com>; Paul Rosswurm <paulros@...rosoft.com>;
> olaf@...fle.de; vkuznets <vkuznets@...hat.com>; davem@...emloft.net;
> wei.liu@...nel.org; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; leon@...nel.org; Long Li <longli@...rosoft.com>;
> ssengar@...ux.microsoft.com; linux-rdma@...r.kernel.org;
> daniel@...earbox.net; john.fastabend@...il.com; bpf@...r.kernel.org;
> ast@...nel.org; hawk@...nel.org; tglx@...utronix.de;
> shradhagupta@...ux.microsoft.com; linux-kernel@...r.kernel.org
> Subject: RE: [PATCH v2, net-next] net: mana: Add support for page sizes
> other than 4KB on ARM64
 
> > diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > index 1332db9a08eb..aa215e2e9606 100644
> > --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > @@ -182,7 +182,7 @@ int mana_gd_alloc_memory(struct gdma_context *gc,
> unsigned int length,
> >  	dma_addr_t dma_handle;
> >  	void *buf;
> >
> > -	if (length < PAGE_SIZE || !is_power_of_2(length))
> > +	if (length < MANA_MIN_QSIZE || !is_power_of_2(length))
> >  		return -EINVAL;
> 
> Since mana_gd_alloc_memory() is a somewhat generic function that wraps
> dma_alloc_coherent(), checking the length against MANA_MIN_QSIZE is
> unexpected.  In looking at the call graph, I see that
> mana_gd_alloc_memory()
> is used in creating queues, but all the callers already ensure that the
> minimum
> size requirement is met.  For robustness, having a check here seems OK,
> but
> I would have expected checking against MANA_PAGE_SIZE, since that's the
> DMA-related concept.
 
I will update this and the other checking in mana_gd_create_dma_region()
to MANA_PAGE_SIZE.

Thanks,
- Haiyang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ