No description
Find a file
Zhengchao Shao bf6d7a9fec test_firmware: fix memory leak in test_firmware_init()
[ Upstream commit 7610615e8c ]

When misc_register() failed in test_firmware_init(), the memory pointed
by test_fw_config->name is not released. The memory leak information is
as follows:
unreferenced object 0xffff88810a34cb00 (size 32):
  comm "insmod", pid 7952, jiffies 4294948236 (age 49.060s)
  hex dump (first 32 bytes):
    74 65 73 74 2d 66 69 72 6d 77 61 72 65 2e 62 69  test-firmware.bi
    6e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  n...............
  backtrace:
    [<ffffffff81b21fcb>] __kmalloc_node_track_caller+0x4b/0xc0
    [<ffffffff81affb96>] kstrndup+0x46/0xc0
    [<ffffffffa0403a49>] __test_firmware_config_init+0x29/0x380 [test_firmware]
    [<ffffffffa040f068>] 0xffffffffa040f068
    [<ffffffff81002c41>] do_one_initcall+0x141/0x780
    [<ffffffff816a72c3>] do_init_module+0x1c3/0x630
    [<ffffffff816adb9e>] load_module+0x623e/0x76a0
    [<ffffffff816af471>] __do_sys_finit_module+0x181/0x240
    [<ffffffff89978f99>] do_syscall_64+0x39/0xb0
    [<ffffffff89a0008b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

Fixes: c92316bf8e ("test_firmware: add batched firmware tests")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20221119035721.18268-1-shaozhengchao@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-19 17:57:44 +08:00
arch RISC-V: Align the shadow stack 2023-04-19 17:57:41 +08:00
block block: clear ->slave_dir when dropping the main slave_dir reference 2023-04-19 17:57:23 +08:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2023-04-19 17:50:34 +08:00
crypto crypto: tcrypt - Fix multibuffer skcipher speed test mem leak 2023-04-19 17:57:39 +08:00
Documentation dt-bindings: visconti-pcie: Fix interrupts array max constraints 2023-04-19 17:57:38 +08:00
drivers serial: sunsab: Fix error handling in sunsab_init() 2023-04-19 17:57:43 +08:00
fs orangefs: Fix sysfs not cleanup when dev init failed 2023-04-19 17:57:41 +08:00
include usb: typec: Factor out non-PD fwnode properties 2023-04-19 17:57:43 +08:00
init init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash 2023-04-19 17:56:40 +08:00
io_uring io_uring: Fix a null-ptr-deref in io_tctx_exit_cb() 2023-04-19 17:57:04 +08:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2023-04-19 17:56:54 +08:00
kernel padata: Fix list iterator in padata_do_serial() 2023-04-19 17:57:39 +08:00
lib test_firmware: fix memory leak in test_firmware_init() 2023-04-19 17:57:44 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm mm/gup: fix gup_pud_range() for dax 2023-04-19 17:56:58 +08:00
net net: dsa: tag_8021q: avoid leaking ctx on dsa_tag_8021q_register() error path 2023-04-19 17:57:35 +08:00
samples samples/landlock: Format with clang-format 2023-04-19 17:50:01 +08:00
scripts scripts/faddr2line: Fix regression in name resolution on ppc64le 2023-04-19 17:56:46 +08:00
security apparmor: Fix memleak in alloc_ns() 2023-04-19 17:57:36 +08:00
sound ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2023-04-19 17:57:29 +08:00
tools netfilter: conntrack: set icmpv6 redirects as RELATED 2023-04-19 17:57:27 +08:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2023-04-19 17:44:58 +08:00
virt kvm: Add support for arch compat vm ioctls 2023-04-19 17:55:40 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS futex: Move to kernel/futex/ 2023-04-19 17:57:16 +08:00
Makefile Linux 5.15.85 2023-04-19 17:57:07 +08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

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.