No description
  • C 96.9%
  • Assembly 0.9%
  • Rust 0.6%
  • Shell 0.6%
  • Python 0.5%
  • Other 0.3%
Find a file
Fedor Pchelkin bcb9321b63 apparmor: free the allocated pdb objects
[ Upstream commit 1af5aa82c9 ]

policy_db objects are allocated with kzalloc() inside aa_alloc_pdb() and
are not cleared in the corresponding aa_free_pdb() function causing leak:

unreferenced object 0xffff88801f0a1400 (size 192):
  comm "apparmor_parser", pid 1247, jiffies 4295122827 (age 2306.399s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff81ddc612>] __kmem_cache_alloc_node+0x1e2/0x2d0
    [<ffffffff81c47c55>] kmalloc_trace+0x25/0xc0
    [<ffffffff83eb9a12>] aa_alloc_pdb+0x82/0x140
    [<ffffffff83ec4077>] unpack_pdb+0xc7/0x2700
    [<ffffffff83ec6b10>] unpack_profile+0x450/0x4960
    [<ffffffff83ecc129>] aa_unpack+0x309/0x15e0
    [<ffffffff83ebdb23>] aa_replace_profiles+0x213/0x33c0
    [<ffffffff83e8d341>] policy_update+0x261/0x370
    [<ffffffff83e8d66e>] profile_replace+0x20e/0x2a0
    [<ffffffff81eadfaf>] vfs_write+0x2af/0xe00
    [<ffffffff81eaf4c6>] ksys_write+0x126/0x250
    [<ffffffff890fa0b6>] do_syscall_64+0x46/0xf0
    [<ffffffff892000ea>] entry_SYSCALL_64_after_hwframe+0x6e/0x76

Free the pdbs inside aa_free_pdb(). While at it, rename the variable
representing an aa_policydb object to make the function more unified with
aa_pdb_free_kref() and aa_alloc_pdb().

Found by Linux Verification Center (linuxtesting.org).

Fixes: 98b824ff89 ("apparmor: refcount the pdb")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-01-25 15:45:24 -08:00
arch arm64: dts: qcom: qrb5165-rb5: use u16 for DP altmode svid 2024-01-25 15:45:23 -08:00
block block: Remove special-casing of compound pages 2024-01-25 15:45:14 -08:00
certs This update includes the following changes: 2023-11-02 16:15:30 -10:00
crypto crypto: scomp - fix req->dst buffer overflow 2024-01-25 15:44:43 -08:00
Documentation rcu: Restrict access to RCU CPU stall notifiers 2024-01-25 15:45:18 -08:00
drivers nvmet-tcp: fix a missing endianess conversion in nvmet_tcp_try_peek_pdu 2024-01-25 15:45:24 -08:00
fs ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION 2024-01-25 15:45:13 -08:00
include bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs 2024-01-25 15:45:22 -08:00
init rootfs: Fix support for rootfstype= when root= is given 2024-01-25 15:45:15 -08:00
io_uring io_uring: ensure local task_work is run on wait timeout 2024-01-25 15:45:13 -08:00
ipc Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
kernel rcu: Restrict access to RCU CPU stall notifiers 2024-01-25 15:45:18 -08:00
lib test_bpf: Rename second ALU64_SMOD_X to ALU64_SMOD_K 2024-01-25 15:44:50 -08:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval 2024-01-20 11:53:02 +01:00
net Revert "net: rtnetlink: Enslave device before bringing it up" 2024-01-25 15:45:16 -08:00
rust rust: Ignore preserve-most functions 2024-01-25 15:45:09 -08:00
samples Landlock updates for v6.7-rc1 2023-11-03 09:28:53 -10:00
scripts scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-01-20 11:53:02 +01:00
security apparmor: free the allocated pdb objects 2024-01-25 15:45:24 -08:00
sound ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 2024-01-25 15:45:12 -08:00
tools perf vendor events: Remove UTF-8 characters from cmn.json 2024-01-25 15:45:23 -08:00
usr arch: Remove Itanium (IA-64) architecture 2023-09-11 08:13:17 +00:00
virt KVM/arm64 fixes for 6.7, part #2 2023-12-22 18:03:54 -05:00
.clang-format iommu: Add for_each_group_device() 2023-05-23 08:15:51 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ 2023-10-03 20:49:09 +09:00
.mailmap 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -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 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -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 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
Makefile Linux 6.7.1 2024-01-20 11:53:02 +01: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.