Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35FE2C83F11 for ; Sun, 27 Aug 2023 18:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbjH0S0B (ORCPT ); Sun, 27 Aug 2023 14:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbjH0SZs (ORCPT ); Sun, 27 Aug 2023 14:25:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BCB128 for ; Sun, 27 Aug 2023 11:25:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD4C261194 for ; Sun, 27 Aug 2023 18:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC371C433C8; Sun, 27 Aug 2023 18:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693160744; bh=Kio/PhpcDRGIHs+Xfp7sdA/o592CmqAIPInJFhzbtIk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2RCCUQIPoaPLexCsf8Z4llyDxEj/evS9AuAO+miImGolwmp6GvDFCTUzx6OKVjMPD YLKfvyen10YGcP8jKd+ZtR2Vy5qHYg3y1Ob8pCYJeEwJ92pRtOU2cpPbaizV5LVtJp egGFF/WTB3Cw07S52Hw6Qthem2HAtYNsTPxKGHw4= Date: Sun, 27 Aug 2023 20:25:41 +0200 From: Greg KH To: Oliver Hartkopp Cc: edumazet@google.com, kuba@kernel.org, william.xuanziyang@huawei.com, stable@vger.kernel.org Subject: Re: [PATCH stable < v6.0] can: raw: add missing refcount for memory leak fix Message-ID: <2023082735-joyous-peso-f0a9@gregkh> References: <20230827110945.3458-1-socketcan@hartkopp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230827110945.3458-1-socketcan@hartkopp.net> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sun, Aug 27, 2023 at 01:09:45PM +0200, Oliver Hartkopp wrote: > Commit ee8b94c8510c ("can: raw: fix receiver memory leak") introduced > a new reference to the CAN netdevice that has assigned CAN filters. > But this new ro->dev reference did not maintain its own refcount which > lead to another KASAN use-after-free splat found by Eric Dumazet. > > This patch ensures a proper refcount for the CAN nedevice. > > Fixes: ee8b94c8510c ("can: raw: fix receiver memory leak") > Reported-by: Eric Dumazet > Cc: Ziyang Xuan > Signed-off-by: Oliver Hartkopp > --- > net/can/raw.c | 34 +++++++++++++++++++++++++--------- > 1 file changed, 25 insertions(+), 9 deletions(-) Now queued up, thanks. greg k-h