Re: [net v1] devlink: fix xa_alloc_cyclic error handling
From: Michal Swiatkowski <hidden>
Date: 2025-03-11 09:20:49
On Mon, Mar 10, 2025 at 12:42:13PM +0100, Pierre Riteau wrote:
On Tue, 18 Feb 2025 at 12:56, Paolo Abeni [off-list ref] wrote:quoted
On 2/14/25 2:58 PM, Michal Swiatkowski wrote:quoted
On Fri, Feb 14, 2025 at 02:44:49PM +0100, Andrew Lunn wrote:quoted
On Fri, Feb 14, 2025 at 02:24:53PM +0100, Michal Swiatkowski wrote:quoted
Pierre Riteau [off-list ref] found suspicious handling an error from xa_alloc_cyclic() in scheduler code [1]. The same is done in devlink_rel_alloc().If the same bug exists twice it might exist more times. Did you find this instance by searching the whole tree? Or just networking? This is also something which would be good to have the static analysers check for. I wounder if smatch can check this? AndrewYou are right, I checked only net folder and there are two usage like that in drivers. I will send v2 with wider fixing, thanks.While at that, please add the suitable fixes tag(s). Thanks, PaoloHello, I haven't seen a v2 patch from Michal Swiatkowski. Would it be okay to at least merge this net/devlink/core.c fix for inclusion in 6.14? I can send a revised patch adding the Fixes tag. Driver fixes could be addressed separately.
Sorry that I didn't send v2, but I have seen that Dan wrote to Jiri about this code and also found more places to fix. I assumed that he will send a fix for all cases that he found. Dan, do you plan to send it or I should send v2? Thanks, Michal
Thanks, Pierre