From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB2B32E8881 for ; Tue, 23 Sep 2025 11:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758628501; cv=none; b=NdFrLTmdVC5+T8OsYNUa5Sjvu1KZxk6H5pCuHR77Cr1JlpZQa+X+97gW5+QHnUA9fmny8dR6JnKTRtHNaBsI8X8fdkb+iusoZg8z/bb6dFFL7Ox96quO3Eqbs53pB4BtC88OgoiZkszIa8L47xymankip1D4obrnGuHmwgYsAnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758628501; c=relaxed/simple; bh=QA6cRqhcpdLpAWirm6EGftRJEfBt1QUnxbDN9YyZymg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I2DPgFWoNhZXs52leeDgGCijLu0ekLR5xCoVy0bQ12YL/nzoBe7BLoAZL8HvEhZmUovru+JgTcoW3gcD66Ga60tu+ncRljNmHSejKZMHCX2dv8d93olCn8VTV9gr53yq25A3Jy6PO16oIh2zK64fDdkvr1NGYXnVR0JWrifWWuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=of1pDfB8; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="of1pDfB8" Message-ID: <178b8313-654d-411a-b9b6-c5e468ab1c80@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1758628487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tJ6TFLUv8Lt32fbF+Mh4OLsiVkeX5RLzlYeIcdSd4OU=; b=of1pDfB8UiuM+oOq/XljmA059f1LAgZq6bMrFXp1hQ3MYyBMeoZgshZdLUEWwx7Ijl0V7y wSstXglVnfR5LnL9tgaXyO7F9ZZDsN0h5i27sZ/ZEQoB9Us7DelARS9op3+6BPrMQ0kWtu Ntw3xhgLyOXwl6Pd6Tp1842LbvLWD7M= Date: Tue, 23 Sep 2025 12:54:42 +0100 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net] octeontx2-pf: Fix potential use after free in otx2_tc_add_flow() To: Dan Carpenter , Subbaraya Sundeep Cc: Sunil Goutham , Geetha sowjanya , hariprasad , Bharat Bhushan , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 23/09/2025 12:19, Dan Carpenter wrote: > This code calls kfree_rcu(new_node, rcu) and then dereferences "new_node" > and then dereferences it on the next line. Two lines later, we take > a mutex so I don't think this is an RCU safe region. Re-order it to do > the dereferences before queuing up the free. > > Fixes: 68fbff68dbea ("octeontx2-pf: Add police action for TC flower") > Signed-off-by: Dan Carpenter Reviewed-by: Vadim Fedorenko