From: Jan Kara <jack@suse.cz>
To: chill <maximkabox13@gmail.com>
Cc: jack@suse.com, linux-ext4@vger.kernel.org
Subject: Re: Use-After-Free Write in jbd2_journal_wait_updates in mainline Linux kernel 5.17
Date: Fri, 1 Apr 2022 11:19:50 +0200 [thread overview]
Message-ID: <20220401091950.eszmhrgjhd4j4745@quack3.lan> (raw)
In-Reply-To: <CANpfEhMi-9bFLCof9QODZgc8A31QWst8X5BAiQw4Mp=PhvWF=Q@mail.gmail.com>
On Thu 31-03-22 16:51:59, chill wrote:
> Hello, I found a similar vulnerability in the kernel like this:
> https://groups.google.com/g/syzkaller-bugs/c/AHp-BfwUM50/m/Jas1oKfmAAAJ in
> the kernel: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.17.tar.xz
> REPORT:
> ==================================================================
> BUG: KASAN: use-after-free in instrument_atomic_read_write
> include/linux/instrumented.h:101 [inline]
> BUG: KASAN: use-after-free in atomic_try_cmpxchg_acquire
> include/linux/atomic/atomic-instrumented.h:541 [inline]
> BUG: KASAN: use-after-free in queued_spin_lock
> include/asm-generic/qspinlock.h:82 [inline]
> BUG: KASAN: use-after-free in do_raw_spin_lock include/linux/spinlock.h:185
> [inline]
> BUG: KASAN: use-after-free in __raw_spin_lock
> include/linux/spinlock_api_smp.h:134 [inline]
> BUG: KASAN: use-after-free in _raw_spin_lock+0x73/0xd0
> kernel/locking/spinlock.c:154
> Write of size 4 at addr ffff8880236f11a0 by task syz-executor.2/9557
>
> CPU: 0 PID: 9557 Comm: syz-executor.2 Not tainted 5.17.0-rc6 #1
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2
> 04/01/2014
> Call Trace:
> <TASK>
> __dump_stack lib/dump_stack.c:88 [inline]
> dump_stack_lvl+0x4d/0x66 lib/dump_stack.c:106
> print_address_description.constprop.0+0x1f/0x150 mm/kasan/report.c:255
> __kasan_report mm/kasan/report.c:442 [inline]
> kasan_report.cold+0x7f/0x11b mm/kasan/report.c:459
> check_region_inline mm/kasan/generic.c:183 [inline]
> kasan_check_range+0xf9/0x1e0 mm/kasan/generic.c:189
> instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
> atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541
> [inline]
> queued_spin_lock include/asm-generic/qspinlock.h:82 [inline]
> do_raw_spin_lock include/linux/spinlock.h:185 [inline]
> __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline]
> _raw_spin_lock+0x73/0xd0 kernel/locking/spinlock.c:154
> spin_lock include/linux/spinlock.h:349 [inline]
> jbd2_journal_wait_updates+0x1f1/0x280 fs/jbd2/transaction.c:861
> jbd2_journal_lock_updates+0x13a/0x2e0 fs/jbd2/transaction.c:896
> ext4_ioctl_checkpoint fs/ext4/ioctl.c:1085 [inline]
> __ext4_ioctl+0xb5b/0x44f0 fs/ext4/ioctl.c:1562
> vfs_ioctl fs/ioctl.c:51 [inline]
> __do_sys_ioctl fs/ioctl.c:874 [inline]
> __se_sys_ioctl fs/ioctl.c:860 [inline]
> __x64_sys_ioctl+0x170/0x1d0 fs/ioctl.c:860
> do_syscall_x64 arch/x86/entry/common.c:50 [inline]
> do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
> entry_SYSCALL_64_after_hwframe+0x44/0xae
Thanks for report. This should be fixed by commit f7f497cb702 ("jbd2: kill
t_handle_lock transaction spinlock") which got just merged into 5.18-rc1.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next parent reply other threads:[~2022-04-01 9:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANpfEhMi-9bFLCof9QODZgc8A31QWst8X5BAiQw4Mp=PhvWF=Q@mail.gmail.com>
2022-04-01 9:19 ` Jan Kara [this message]
2022-04-01 10:11 ` Use-After-Free Write in jbd2_journal_wait_updates in mainline Linux kernel 5.17 Ritesh Harjani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220401091950.eszmhrgjhd4j4745@quack3.lan \
--to=jack@suse.cz \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=maximkabox13@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox