ACK/Cmnt: [UBUNTU OEM-5.14, Jammy, HWE-5.17, Kinetic, OEM-6.0, Lunar, OEM-6.1, Unstable 1/1] netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
Tim Gardner
tim.gardner at canonical.com
Fri Jan 20 14:01:04 UTC 2023
- Previous message (by thread): [UBUNTU OEM-5.14, Jammy, HWE-5.17, Kinetic, OEM-6.0, Lunar, OEM-6.1, Unstable 1/1] netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
- Next message (by thread): ACK/Cmnt: [UBUNTU OEM-5.14, Jammy, HWE-5.17, Kinetic, OEM-6.0, Lunar, OEM-6.1, Unstable 1/1] netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
On 1/18/23 11:58 AM, Thadeu Lima de Souza Cascardo wrote:
> From: Pablo Neira Ayuso <pablo at netfilter.org>
>
> If the offset + length goes over the ethernet + vlan header, then the
> length is adjusted to copy the bytes that are within the boundaries of
> the vlan_ethhdr scratchpad area. The remaining bytes beyond ethernet +
> vlan header are copied directly from the skbuff data area.
>
> Fix incorrect arithmetic operator: subtract, not add, the size of the
> vlan header in case of double-tagged packets to adjust the length
> accordingly to address CVE-2023-0179.
>
> Reported-by: Davide Ornaghi <d.ornaghi97 at gmail.com>
> Fixes: f6ae9f120dad ("netfilter: nft_payload: add C-VLAN support")
> Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
> (cherry picked from commit 696e1a48b1a1b01edad542a1ef293665864a4dd0 net.git)
> CVE-2023-0179
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
> ---
> net/netfilter/nft_payload.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
> index 4edd899aeb9b..d7de2ecb287e 100644
> --- a/net/netfilter/nft_payload.c
> +++ b/net/netfilter/nft_payload.c
> @@ -62,7 +62,7 @@ nft_payload_copy_vlan(u32 *d, const struct sk_buff *skb, u8 offset, u8 len)
> return false;
>
> if (offset + len > VLAN_ETH_HLEN + vlan_hlen)
> - ethlen -= offset + len - VLAN_ETH_HLEN + vlan_hlen;
> + ethlen -= offset + len - VLAN_ETH_HLEN - vlan_hlen;
>
> memcpy(dst_u8, vlanh + offset - vlan_hlen, ethlen);
>
Acked-by: Tim Gardner <tim.gardner at canonical.com>
This is commit a8acfe2c6fb99f9375a9325807a179cd8c32e6e3 in linux-5.15.y.txt
Oddly enough, that commit references an upstream commit that only exists
in linux-next (so far).
--
-----------
Tim Gardner
Canonical, Inc
- Previous message (by thread): [UBUNTU OEM-5.14, Jammy, HWE-5.17, Kinetic, OEM-6.0, Lunar, OEM-6.1, Unstable 1/1] netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
- Next message (by thread): ACK/Cmnt: [UBUNTU OEM-5.14, Jammy, HWE-5.17, Kinetic, OEM-6.0, Lunar, OEM-6.1, Unstable 1/1] netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the kernel-team
mailing list