Go to file
Florian Westphal 5579010831 netfilter: nftables: exthdr: fix 4-byte stack OOB write
ANBZ: #9412

commit fd94d9dade upstream.

If priv->len is a multiple of 4, then dst[len / 4] can write past
the destination array which leads to stack corruption.

This construct is necessary to clean the remainder of the register
in case ->len is NOT a multiple of the register size, so make it
conditional just like nft_payload.c does.

The bug was added in 4.1 cycle and then copied/inherited when
tcp/sctp and ip option support was added.

Bug reported by Zero Day Initiative project (ZDI-CAN-21950,
ZDI-CAN-21951, ZDI-CAN-21961).

Fixes: 49499c3e6e ("netfilter: nf_tables: switch registers to 32 bit addressing")
Fixes: 935b7f6430 ("netfilter: nft_exthdr: add TCP option matching")
Fixes: 133dc203d7 ("netfilter: nft_exthdr: Support SCTP chunks")
Fixes: dbb5281a1f ("netfilter: nf_tables: add support for matching IPv4 options")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

[Fixes conflicts]
Fixes: CVE-2023-52628
Signed-off-by: Xiao Long <xiaolong@openanolis.org>
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/3416
2024-06-27 10:49:18 +00:00
Documentation anolis: net: txgbevf: Add build support for txgbevf 2024-05-27 07:30:09 +00:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
arch anolis: x86/amd_nb: Add support for Hygon family 18h model 10h 2024-06-26 02:42:00 -04:00
block anolis: blk-iocost: fix ABBA deadlock when writing blkio.cost.qos 2024-02-08 12:25:47 +00:00
certs .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
crypto X.509: Support parsing certificate using SM2 algorithm 2022-10-20 02:44:20 +00:00
drivers anolis: hwmon/k10temp: Add support for Hygon family 18h model 10h 2024-06-26 02:46:56 -04:00
firmware .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
fs erofs: avoid allocating DEFLATE streams before mounting 2024-06-05 03:09:49 +00:00
include anolis: x86/amd_nb: Add support for Hygon family 18h model 10h 2024-06-26 02:42:00 -04:00
init bpf, x86, arm64: Enable jit by default when not built as always-on 2024-02-29 20:47:29 +08:00
ipc memcg: enable accounting of ipc resources 2023-03-18 02:22:30 +00:00
kernel anolis: sched/fair: fix underclass unscheduled after ID_ABSOLUTE_EXPEL turned off 2024-04-29 02:31:42 +00:00
lib lib/xz, lib/decompress_unxz.c: Fix spelling in comments 2024-03-18 18:03:46 +08:00
mm anolis: check cgroup v1 for memcg_blkcg_tree operations 2024-05-09 15:54:37 +08:00
net netfilter: nftables: exthdr: fix 4-byte stack OOB write 2024-06-27 10:49:18 +00:00
samples anolis: add ./ to the executable file in test_cgrp2_sock.sh 2024-03-15 16:34:22 +08:00
scripts bpf: Support llvm-objcopy for vmlinux BTF 2024-03-25 03:47:25 +00:00
security tpm: use u32 instead of int for PCR index 2023-09-05 16:55:06 +08:00
sound anolis: ALSA: hda: Add support for Hygon family 18h model 10h HD-Audio 2024-06-26 02:47:04 -04:00
tools selftest/bpf: Verifier tests for var-off access 2024-03-25 03:47:25 +00:00
usr .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
virt KVM: x86: Fix APIC page invalidation race 2024-01-25 02:10:56 +00:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS open: introduce openat2(2) syscall 2020-05-28 14:39:52 +08:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS anolis: net: txgbevf: Add build support for txgbevf 2024-05-27 07:30:09 +00:00
Makefile kbuild: Unify options for BTF generation for vmlinux and modules 2024-02-01 16:16:31 +08:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.