No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Waiman Long abdc85d630 locking/lockdep: Avoid potential access of invalid memory in lock_class
commit 61cc4534b6550997c97a03759ab46b29d44c0017 upstream.

It was found that reading /proc/lockdep after a lockdep splat may
potentially cause an access to freed memory if lockdep_unregister_key()
is called after the splat but before access to /proc/lockdep [1]. This
is due to the fact that graph_lock() call in lockdep_unregister_key()
fails after the clearing of debug_locks by the splat process.

After lockdep_unregister_key() is called, the lock_name may be freed
but the corresponding lock_class structure still have a reference to
it. That invalid memory pointer will then be accessed when /proc/lockdep
is read by a user and a use-after-free (UAF) error will be reported if
KASAN is enabled.

To fix this problem, lockdep_unregister_key() is now modified to always
search for a matching key irrespective of the debug_locks state and
zap the corresponding lock class if a matching one is found.

[1] https://lore.kernel.org/lkml/77f05c15-81b6-bddd-9650-80d5f23fe330@i-love.sakura.ne.jp/

Fixes: 8b39adbee8 ("locking/lockdep: Make lockdep_unregister_key() honor 'debug_locks' again")
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lkml.kernel.org/r/20220103023558.1377055-1-longman@redhat.com
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-08 16:20:46 +01:00
arch s390/cpum_sf: Remove WARN_ON_ONCE statements 2024-11-08 16:20:44 +01:00
block block, bfq: don't break merge chain in bfq_split_bfqq() 2024-11-08 16:20:28 +01:00
certs
crypto crypto: aead,cipher - zeroize key buffer after use 2024-11-08 16:20:33 +01:00
Documentation arm64: errata: Expand speculative SSBS workaround once more 2024-11-08 16:20:42 +01:00
drivers slip: make slhc_remember() more robust against malicious packets 2024-11-08 16:20:46 +01:00
fs SUNRPC: Fix integer overflow in decode_rc_list() 2024-11-08 16:20:45 +01:00
include net: annotate lockless accesses to sk->sk_max_ack_backlog 2024-11-08 16:20:46 +01:00
init init: open /initrd.image with O_LARGEFILE 2024-04-13 12:51:36 +02:00
ipc ipc: replace costly bailout check in sysvipc_find_ipc() 2024-09-04 13:15:02 +02:00
kernel locking/lockdep: Avoid potential access of invalid memory in lock_class 2024-11-08 16:20:46 +01:00
lib debugobjects: Fix conditions in fill_pool() 2024-11-08 16:20:34 +01:00
LICENSES
mm mm: krealloc: consider spare memory for __GFP_ZERO 2024-11-08 16:20:40 +01:00
net sctp: ensure sk_state is set to CLOSED if hashing fails in sctp_listen_start 2024-11-08 16:20:46 +01:00
samples
scripts scripts: kconfig: merge_config: config files: add a trailing newline 2024-11-08 16:20:24 +01:00
security tomoyo: fallback to realpath if symlink's pathname does not exist 2024-11-08 16:20:41 +01:00
sound ALSA: core: add isascii() check to card ID generator 2024-11-08 16:20:40 +01:00
tools tools/iio: Add memory allocation failure check for trigger_name 2024-11-08 16:20:45 +01:00
usr
virt KVM: async_pf: Cleanup kvm_setup_async_pf() 2024-05-02 16:18:32 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore Remove *.orig pattern from .gitignore 2024-11-08 16:20:33 +01:00
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.284 2024-09-12 11:03:57 +02: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.