Go to file
Mårten Lindahl 7e264f67b7 ubifs: Fix memory leak in do_rename
commit 3a36d20e01 upstream.

If renaming a file in an encrypted directory, function
fscrypt_setup_filename allocates memory for a file name. This name is
never used, and before returning to the caller the memory for it is not
freed.

When running kmemleak on it we see that it is registered as a leak. The
report below is triggered by a simple program 'rename' that renames a
file in an encrypted directory:

  unreferenced object 0xffff888101502840 (size 32):
    comm "rename", pid 9404, jiffies 4302582475 (age 435.735s)
    backtrace:
      __kmem_cache_alloc_node
      __kmalloc
      fscrypt_setup_filename
      do_rename
      ubifs_rename
      vfs_rename
      do_renameat2

To fix this we can remove the call to fscrypt_setup_filename as it's not
needed.

Fixes: 278d9a2436 ("ubifs: Rename whiteout atomically")
Reported-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:10:54 +09:00
Documentation riscv: Move early dtb mapping into the fixmap region 2023-05-01 08:29:23 +09:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
arch RISC-V: Align SBI probe implementation with spec 2023-05-11 23:10:54 +09:00
block blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:10:50 +09:00
certs certs: Fix build error when PKCS#11 URI contains semicolon 2023-01-31 17:53:01 +09:00
crypto crypto: testmgr - fix RNG performance in fuzz tests 2023-05-11 23:10:52 +09:00
drivers ubi: Fix return value overwrite issue in try_write_vid_and_data() 2023-05-11 23:10:54 +09:00
fs ubifs: Fix memory leak in do_rename 2023-05-11 23:10:54 +09:00
include tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem 2023-05-11 23:10:51 +09:00
init gcc: disable '-Warray-bounds' for gcc-13 too 2023-04-26 14:30:08 +02:00
io_uring io_uring: complete request via task work in case of DEFER_TASKRUN 2023-04-20 12:36:52 +02:00
ipc Non-MM patches for 6.2-rc1. 2022-12-12 17:28:58 -08:00
kernel tracing: Fix permissions for the buffer_percent file 2023-05-11 23:10:54 +09:00
lib maple_tree: fix a potential memory leak, OOB access, or other unpredictable bug 2023-04-26 14:30:03 +02:00
mm mm/mempolicy: fix use-after-free of VMA iterator 2023-05-01 08:29:23 +09:00
net bluetooth: Perform careful capability checks in hci_sock_ioctl() 2023-05-01 08:29:23 +09:00
rust rust: kernel: Mark rust_fmt_argument as extern "C" 2023-04-26 14:30:02 +02:00
samples ftrace: Export ftrace_free_filter() to modules 2023-01-24 11:20:58 -05:00
scripts ASN.1: Fix check for strdup() success 2023-04-26 14:30:09 +02:00
security IMA: allow/fix UML builds 2023-05-11 23:10:49 +09:00
sound ASoC: amd: ps: update the acp clock source. 2023-05-11 23:10:48 +09:00
tools selftests mount: Fix mount_setattr_test builds failed 2023-05-11 23:10:47 +09:00
usr usr/gen_init_cpio.c: remove unnecessary -1 values from int file 2022-10-03 14:21:44 -07:00
virt KVM: Register /dev/kvm as the _very_ last thing during initialization 2023-03-10 09:29:33 +01:00
.clang-format iommufd for 6.2 2022-12-14 09:15:43 -08:00
.cocciconfig
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore *.rpm 2022-12-30 17:22:14 +09:00
.mailmap 12 hotfixes, mostly against mm/. Five of these fixes are cc:stable. 2023-02-13 14:09:20 -08:00
.rustfmt.toml rust: add `.rustfmt.toml` 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: update SCTP maintainers 2023-02-02 11:35:33 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS audit: update the mailing list in MAINTAINERS 2023-02-25 11:13:29 +01:00
Makefile Linux 6.2.14 2023-05-01 08:29:23 +09:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -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.

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.