From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BD6242DE6F1; Thu, 3 Jul 2025 15:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751556103; cv=none; b=Mkc9u2bjW7180Bva4uxBqJ1OK6vD9aa3upwBqyVNUyQL3XaQa9N6EreA0xc0V/iXODw31Z4eM3unKS4OslBH1YmWQ09viK4aEcEjjMtCdojmEJ+rRkdoyoZLkQbDBIAuo01iOQwOeycUsONDamyH2Bw7w/aYB6Iqd7Z0fesFRCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751556103; c=relaxed/simple; bh=sH7m0M7bc/0uleufpSY1ZSrk2yEkLBwP9r3VG5JqG8c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WP4eBluKpbDJmLsxiOKxLt9Yzxf7Jca6D7QGyjuIQ9gW7o93vWT/5I0cM/47j2giamhuAub7TpkWNNqAlo4I9CvCZ2G7AGp1OY2KTnHtEdkUao0IByBwVXR6H22kYQdv6vXq6u+mKlkCHtTHCwL/Swrdh2XOeVw2Di/dYap7U8Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sH7PQz+g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sH7PQz+g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7ACC4CEE3; Thu, 3 Jul 2025 15:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751556103; bh=sH7m0M7bc/0uleufpSY1ZSrk2yEkLBwP9r3VG5JqG8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sH7PQz+gbQ0xrJXuGUyaHVYKjHCKhD/vWGmR5xBR0jhiCGUFEumSsPpbm3yugHgA5 xWR8d7hsdja7BKK2XtY5oSXKu7ZiWyaA97qRLWtZM78w7+/to2T77TQyDoPNgn/MNl OdiBhM5oOy5fgX331uvqX6vPIzMqSNx0qxurNsvg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+1316233c4c6803382a8b@syzkaller.appspotmail.com, Eric Dumazet , Cong Wang , Gengming Liu , Simon Horman , "David S. Miller" , Sasha Levin Subject: [PATCH 6.1 076/132] atm: clip: prevent NULL deref in clip_push() Date: Thu, 3 Jul 2025 16:42:45 +0200 Message-ID: <20250703143942.399934711@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703143939.370927276@linuxfoundation.org> References: <20250703143939.370927276@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit b993ea46b3b601915ceaaf3c802adf11e7d6bac6 ] Blamed commit missed that vcc_destroy_socket() calls clip_push() with a NULL skb. If clip_devs is NULL, clip_push() then crashes when reading skb->truesize. Fixes: 93a2014afbac ("atm: fix a UAF in lec_arp_clear_vccs()") Reported-by: syzbot+1316233c4c6803382a8b@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/68556f59.a00a0220.137b3.004e.GAE@google.com/T/#u Signed-off-by: Eric Dumazet Cc: Cong Wang Cc: Gengming Liu Reviewed-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/atm/clip.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/net/atm/clip.c b/net/atm/clip.c index 294cb9efe3d38..511467bb7fe40 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c @@ -193,12 +193,6 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb) pr_debug("\n"); - if (!clip_devs) { - atm_return(vcc, skb->truesize); - kfree_skb(skb); - return; - } - if (!skb) { pr_debug("removing VCC %p\n", clip_vcc); if (clip_vcc->entry) @@ -208,6 +202,11 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb) return; } atm_return(vcc, skb->truesize); + if (!clip_devs) { + kfree_skb(skb); + return; + } + skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs; /* clip_vcc->entry == NULL if we don't have an IP address yet */ if (!skb->dev) { -- 2.39.5