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]
Message-ID: <11241110-6bd5-4b06-8d4c-55e52c571ff6@davidwei.uk>
Date: Tue, 20 Jan 2026 19:44:39 -0800
From: David Wei <dw@...idwei.uk>
To: Jakub Kicinski <kuba@...nel.org>, Daniel Borkmann <daniel@...earbox.net>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, davem@...emloft.net,
 razor@...ckwall.org, pabeni@...hat.com, willemb@...gle.com, sdf@...ichev.me,
 john.fastabend@...il.com, martin.lau@...nel.org, jordan@...fe.io,
 maciej.fijalkowski@...el.com, magnus.karlsson@...el.com, toke@...hat.com,
 yangzhenze@...edance.com, wangdongdong.6@...edance.com
Subject: Re: [PATCH net-next v7 05/16] net: Proxy net_mp_{open,close}_rxq for
 leased queues

On 2026-01-20 18:04, Jakub Kicinski wrote:
> On Thu, 15 Jan 2026 09:25:52 +0100 Daniel Borkmann wrote:
>>   	if (!netdev_need_ops_lock(dev))
>>   		return -EOPNOTSUPP;
>> -
>>   	if (rxq_idx >= dev->real_num_rx_queues) {
>>   		NL_SET_ERR_MSG(extack, "rx queue index out of range");
>>   		return -ERANGE;
>>   	}
>> -	rxq_idx = array_index_nospec(rxq_idx, dev->real_num_rx_queues);
>>   
>> +	rxq_idx = array_index_nospec(rxq_idx, dev->real_num_rx_queues);
> 
> The white space changes here look haphazard.
> 
>> +	rxq = netif_get_rx_queue_lease_locked(&dev, &rxq_idx);
> 
> I really hate this function but I don't have any great suggestion on
> how to make it better. I'd prefer if there was a clear separation
> between the case where we call directly, vs where swapped the queue.
> Instead of replacing pointers passed in by reference :| And that'd
> remove the conditional locking too.

Yeah :/ I will clean up the unnecessary whitespace changes and pull out
the checks at least. The current way makes it easier for the callers as
they don't need to distinguish between direct vs swapped. But, I do
appreciate how awful it feels.

I can try moving netif_get_rx_queue_lease_locked() out into the callers
and see how that feels instead. __net_mp_open_rxq() will then fail for
virtual netdevs.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ