Blame SOURCES/CVE-2023-0179.patch

81ae6d
From 8552f3231628950fb3f2a8966ef78b14006aefb2 Mon Sep 17 00:00:00 2001
81ae6d
From: Ryan Sullivan <rysulliv@redhat.com>
81ae6d
Date: Tue, 31 Jan 2023 11:26:03 -0500
81ae6d
Subject: [KPATCH CVE-2023-0179] kpatch fixes for CVE-2023-0179
81ae6d
81ae6d
Kernels:
81ae6d
5.14.0-162.6.1.el9_1
81ae6d
5.14.0-162.12.1.el9_1
81ae6d
81ae6d
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-9/-/merge_requests/23
81ae6d
Approved-by: Yannick Cote (@ycote1)
81ae6d
Approved-by: Joe Lawrence (@joe.lawrence)
81ae6d
Changes since last build:
81ae6d
arches: x86_64 ppc64le
81ae6d
l2cap_core.o: changed function: l2cap_rx_state_recv
81ae6d
l2cap_core.o: changed function: l2cap_stream_rx
81ae6d
nfs4proc.o: changed function: nfsd4_copy
81ae6d
nfs4proc.o: changed function: nfsd4_do_async_copy
81ae6d
nft_payload.o: changed function: nft_payload_copy_vlan
81ae6d
sysctl.o: changed function: __do_proc_dointvec
81ae6d
sysctl.o: changed function: __do_proc_douintvec
81ae6d
sysctl.o: changed function: __do_proc_doulongvec_minmax
81ae6d
sysctl.o: changed function: proc_get_long.constprop.0
81ae6d
---------------------------
81ae6d
81ae6d
Modifications: none
81ae6d
81ae6d
commit d4b9787a8f8c75d0c37560d25e817183a700fbec
81ae6d
Author: Florian Westphal <fwestpha@redhat.com>
81ae6d
Date:   Tue Jan 17 19:28:09 2023 +0100
81ae6d
81ae6d
    netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
81ae6d
81ae6d
    Bugzilla: https://bugzilla.redhat.com/2161724
81ae6d
    CVE: CVE-2023-0179
81ae6d
    Y-Commit: c3747b9b25ff4bfdc9fa5c139126043fc8c0389c
81ae6d
81ae6d
    O-Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2161725
81ae6d
    Upstream Status: net commit 696e1a48b1a1b
81ae6d
    O-CVE: CVE-2023-0179
81ae6d
81ae6d
    commit 696e1a48b1a1b01edad542a1ef293665864a4dd0
81ae6d
    Author: Pablo Neira Ayuso <pablo@netfilter.org>
81ae6d
    Date:   Wed Jan 11 17:07:33 2023 +0100
81ae6d
81ae6d
        netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
81ae6d
81ae6d
        If the offset + length goes over the ethernet + vlan header, then the
81ae6d
        length is adjusted to copy the bytes that are within the boundaries of
81ae6d
        the vlan_ethhdr scratchpad area. The remaining bytes beyond ethernet +
81ae6d
        vlan header are copied directly from the skbuff data area.
81ae6d
81ae6d
        Fix incorrect arithmetic operator: subtract, not add, the size of the
81ae6d
        vlan header in case of double-tagged packets to adjust the length
81ae6d
        accordingly to address CVE-2023-0179.
81ae6d
81ae6d
        Reported-by: Davide Ornaghi <d.ornaghi97@gmail.com>
81ae6d
        Fixes: f6ae9f120dad ("netfilter: nft_payload: add C-VLAN support")
81ae6d
        Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
81ae6d
81ae6d
    Signed-off-by: Florian Westphal <fwestpha@redhat.com>
81ae6d
    Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
81ae6d
81ae6d
Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
81ae6d
---
81ae6d
 net/netfilter/nft_payload.c | 2 +-
81ae6d
 1 file changed, 1 insertion(+), 1 deletion(-)
81ae6d
81ae6d
diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
81ae6d
index 9af0d58a33f4..ee603dc05e81 100644
81ae6d
--- a/net/netfilter/nft_payload.c
81ae6d
+++ b/net/netfilter/nft_payload.c
81ae6d
@@ -62,7 +62,7 @@ nft_payload_copy_vlan(u32 *d, const struct sk_buff *skb, u8 offset, u8 len)
81ae6d
 			return false;
81ae6d
 
81ae6d
 		if (offset + len > VLAN_ETH_HLEN + vlan_hlen)
81ae6d
-			ethlen -= offset + len - VLAN_ETH_HLEN + vlan_hlen;
81ae6d
+			ethlen -= offset + len - VLAN_ETH_HLEN - vlan_hlen;
81ae6d
 
81ae6d
 		memcpy(dst_u8, vlanh + offset - vlan_hlen, ethlen);
81ae6d
 
81ae6d
-- 
81ae6d
2.39.1
81ae6d
81ae6d