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:   Tue, 28 Feb 2023 16:47:25 +0100
From:   Alexander Lobakin <aleksander.lobakin@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     Geoff Levand <geoff@...radead.org>, <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Alexander Lobakin <alexandr.lobakin@...el.com>,
        Alexander Duyck <alexander.duyck@...il.com>,
        Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net v6 1/2] net/ps3_gelic_net: Fix RX sk_buff length

From: Jakub Kicinski <kuba@...nel.org>
Date: Mon, 27 Feb 2023 18:20:40 -0800

> On Sun, 26 Feb 2023 02:25:42 +0000 Geoff Levand wrote:
>> +	napi_buff = napi_alloc_frag_align(GELIC_NET_MAX_MTU,
>> +		GELIC_NET_RXBUF_ALIGN);
> 
> You're changing how the buffers are allocated.
> 
>> +	if (unlikely(!napi_buff)) {
>> +		descr->skb = NULL;
>> +		descr->buf_addr = 0;
>> +		descr->buf_size = 0;
> 
> Wiping the descriptors on failure.
> 
>> +		return -ENOMEM;
>> +	}
> 
> And generally reshuffling the code.
> 
> Once again - please don't do any of that in a bug fix.
> Describe precisely what the problem is and fix that problem,

IIRC the original problem is that the skb linear parts are not always
aligned to a boundary which this particular HW requires. So initially
there was something like "allocate len + alignment - 1, then
PTR_ALIGN()", but I said that it's a waste of memory and we shouldn't do
that, using napi_alloc_frag_align() instead.
I guess if that would've been described, this could go as a fix? I don't
think wasting memory is a good fix, even if we need to change the
allocation scheme...

> Once the fix is accepted you can send separate patches with 
> other improvements.

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ