The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Перейти к файлу
NeilBrown 3d2fc4c082 x86: fix seq_file iteration for pat/memtype.c
The memtype seq_file iterator allocates a buffer in the ->start and ->next
functions and frees it in the ->show function.  The preferred handling for
such resources is to free them in the subsequent ->next or ->stop function
call.

Since Commit 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration
code and interface") there is no guarantee that ->show will be called
after ->next, so this function can now leak memory.

So move the freeing of the buffer to ->next and ->stop.

Link: https://lkml.kernel.org/r/161248539022.21478.13874455485854739066.stgit@noble1
Fixes: 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration code and interface")
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Xin Long <lucien.xin@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-02-26 09:41:05 -08:00
Documentation seq_file: document how per-entry resources are managed. 2021-02-26 09:41:05 -08:00
LICENSES
arch x86: fix seq_file iteration for pat/memtype.c 2021-02-26 09:41:05 -08:00
block
certs
crypto
drivers treewide: Miguel has moved 2021-02-26 09:41:03 -08:00
fs fs/coredump: use kmap_local_page() 2021-02-26 09:41:05 -08:00
include init: clean up early_param_on_off() macro 2021-02-26 09:41:05 -08:00
init init/Kconfig: fix a typo in CC_VERSION_TEXT help text 2021-02-26 09:41:05 -08:00
ipc
kernel kernel: delete repeated words in comments 2021-02-26 09:41:03 -08:00
lib lib/cmdline: remove an unneeded local variable in next_arg() 2021-02-26 09:41:04 -08:00
mm kasan: clarify that only first bug is reported in HW_TAGS 2021-02-26 09:41:03 -08:00
net
samples treewide: Miguel has moved 2021-02-26 09:41:03 -08:00
scripts checkpatch: do not apply "initialise globals to 0" check to BPF progs 2021-02-26 09:41:04 -08:00
security
sound
tools
usr Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap treewide: Miguel has moved 2021-02-26 09:41:03 -08:00
COPYING
CREDITS treewide: Miguel has moved 2021-02-26 09:41:03 -08:00
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: add uapi directories to API/ABI section 2021-02-26 09:41:04 -08:00
Makefile Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
README

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.

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.