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 D5C531E9B15; Thu, 30 Jan 2025 14:21:27 +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=1738246887; cv=none; b=EcnvtQsLZVV5JhPd4NMDfU+DWzL6YoOSJVt2u/Q/Bkvu9G7G5lzYOPC2SqQdkBIAYUG0/gjZhqO5ssbVhiXSEYW3A9nnkk5cL2KecONU4Pg21TPvrmo254PZUkSK2wUITbSCZQc4RAnWeSyO/1qfDa7R5xZjmbTHpSRVZAetrVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738246887; c=relaxed/simple; bh=VIx+FR5e7AFgJiU4Bxcj7NoPpYOt9dUezzSAX7y8Fcg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QXPu1gdCejiExQy0FMlWVSf2mJVj/J+J89NLN2LgoFnD5EL+uGhp4wLp5i+OHcO1pN/UzbQjSMt2LnTuqL8q2Xo4L6xQZdVHr7zx+tqqO6ocyvV0VG6Cq0+DqW5IrXY6GV7dKOSE77SuD3jg/ue3Z03YekAPiFSVp3EglSFtQrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pwnb7NYw; 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="pwnb7NYw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FB69C4CEE5; Thu, 30 Jan 2025 14:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738246887; bh=VIx+FR5e7AFgJiU4Bxcj7NoPpYOt9dUezzSAX7y8Fcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwnb7NYw0F76CYV0SkN+4oJXXkuTnSr3UW5DFgwKrGONfE22PtH27DvXb6qc5xC6z ZueyX2BJJltmeoKX6BWa3fsmh1Wj9B7I0MNs7bbVA5QbVLQnS7NUPqwixa/EiB6WyP mOHBWVZNlMKpfpYDPuOM71HgkQ4gC+4xyZrza+N0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Antonio Pastor , Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 010/133] net: 802: LLC+SNAP OID:PID lookup on start of skb data Date: Thu, 30 Jan 2025 14:59:59 +0100 Message-ID: <20250130140142.913299684@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250130140142.491490528@linuxfoundation.org> References: <20250130140142.491490528@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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Antonio Pastor [ Upstream commit 1e9b0e1c550c42c13c111d1a31e822057232abc4 ] 802.2+LLC+SNAP frames received by napi_complete_done() with GRO and DSA have skb->transport_header set two bytes short, or pointing 2 bytes before network_header & skb->data. This was an issue as snap_rcv() expected offset to point to SNAP header (OID:PID), causing packet to be dropped. A fix at llc_fixup_skb() (a024e377efed) resets transport_header for any LLC consumers that may care about it, and stops SNAP packets from being dropped, but doesn't fix the problem which is that LLC and SNAP should not use transport_header offset. Ths patch eliminates the use of transport_header offset for SNAP lookup of OID:PID so that SNAP does not rely on the offset at all. The offset is reset after pull for any SNAP packet consumers that may (but shouldn't) use it. Fixes: fda55eca5a33 ("net: introduce skb_transport_header_was_set()") Signed-off-by: Antonio Pastor Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20250103012303.746521-1-antonio.pastor@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/802/psnap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/802/psnap.c b/net/802/psnap.c index 4492e8d7ad20..ed6e17c8cce9 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -55,11 +55,11 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev, goto drop; rcu_read_lock(); - proto = find_snap_client(skb_transport_header(skb)); + proto = find_snap_client(skb->data); if (proto) { /* Pass the frame on. */ - skb->transport_header += 5; skb_pull_rcsum(skb, 5); + skb_reset_transport_header(skb); rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev); } rcu_read_unlock(); -- 2.39.5