Go to file
Hangyu Hua 3f80c7374e xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup()
ANBZ: #2007

commit f85daf0e72 upstream.

xfrm_policy_lookup() will call xfrm_pol_hold_rcu() to get a refcount of
pols[0]. This refcount can be dropped in xfrm_expand_policies() when
xfrm_expand_policies() return error. pols[0]'s refcount is balanced in
here. But xfrm_bundle_lookup() will also call xfrm_pols_put() with
num_pols == 1 to drop this refcount when xfrm_expand_policies() return
error.

This patch also fix an illegal address access. pols[0] will save a error
point when xfrm_policy_lookup fails. This lead to xfrm_pols_put to resolve
an illegal address in xfrm_bundle_lookup's error path.

Fix these by setting num_pols = 0 in xfrm_expand_policies()'s error path.

Fixes: 80c802f307 ("xfrm: cache bundles instead of policies for outgoing flows")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/678
2022-11-01 03:09:35 +00:00
Documentation mm/vmstat: add events for THP migration without split 2022-09-26 02:02:14 +00:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
arch anolis: configs: enable CONFIG_NF_CT_NETLINK_HELPER for x86 2022-11-01 01:39:32 +00:00
block block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern 2022-10-27 15:22:52 +08: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: mm: initialize ZONE_DEVICE page struct on demand in guest kernel 2022-10-31 06:53:30 +00:00
firmware .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
fs anolis: mm: add module parameters for virtiofs dax on demand 2022-10-31 06:53:30 +00:00
include anolis: mm: initialize ZONE_DEVICE page struct on demand in guest kernel 2022-10-31 06:53:30 +00:00
init anolis: Kconfig: Enable group identity 2022-09-05 13:51:59 +00:00
ipc ipc/mqueue.c: only perform resource calculation if user valid 2019-08-06 19:06:52 +02:00
kernel anolis: mm: initialize ZONE_DEVICE page struct on demand in guest kernel 2022-10-31 06:53:30 +00:00
lib nfsd: escape high characters in binary data 2022-08-12 08:21:36 +00:00
mm anolis: mm: initialize ZONE_DEVICE page struct on demand in guest kernel 2022-10-31 06:53:30 +00:00
net xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup() 2022-11-01 03:09:35 +00:00
samples livepatch: Simplify API by removing registration step 2021-11-22 20:26:16 +08:00
scripts ftrace: modify the scope of sorting mcount at compile 2022-02-10 02:30:37 +00:00
security selinux: fix regression introduced by move_mount(2) syscall 2022-07-12 05:53:54 +00:00
sound ALSA: pcm: Fix races among concurrent hw_params and hw_free calls 2022-06-30 07:59:50 +00:00
tools selftests/bpf: Fix test_align verifier log patterns 2022-10-08 14:58:49 +08:00
usr .gitignore: add SPDX License Identifier 2020-09-02 17:52:15 +08:00
virt anolis: mm: gup: allow to follow _PAGE_DEVMAP && !ZONE_DEVICE pages optionally 2022-10-29 06:33:38 +00:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.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 net: txgbe: Add build support for txgbe 2022-09-21 06:08:51 +00:00
Makefile anolis: kbuild: move elflib check out of KBUILD_EXTMOD 2022-10-28 08:47:16 +00: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.