lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()
Date

On Tue, 02 Jan 2024 21:37:30 +0800, Baokun Li wrote:
> In the following concurrency we will access the uninitialized rs->lock:
>
> ext4_fill_super
> ext4_register_sysfs
> // sysfs registered msg_ratelimit_interval_ms
> // Other processes modify rs->interval to
> // non-zero via msg_ratelimit_interval_ms
> ext4_orphan_cleanup
> ext4_msg(sb, KERN_INFO, "Errors on filesystem, "
> __ext4_msg
> ___ratelimit(&(EXT4_SB(sb)->s_msg_ratelimit_state)
> if (!rs->interval) // do nothing if interval is 0
> return 1;
> raw_spin_trylock_irqsave(&rs->lock, flags)
> raw_spin_trylock(lock)
> _raw_spin_trylock
> __raw_spin_trylock
> spin_acquire(&lock->dep_map, 0, 1, _RET_IP_)
> lock_acquire
> __lock_acquire
> register_lock_class
> assign_lock_key
> dump_stack();
> ratelimit_state_init(&sbi->s_msg_ratelimit_state, 5 * HZ, 10);
> raw_spin_lock_init(&rs->lock);
> // init rs->lock here
>
> [...]

Applied, thanks!

[1/1] ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()
commit: b4b4fda34e535756f9e774fb2d09c4537b7dfd1c

Best regards,
--
Theodore Ts'o <tytso@mit.edu>

\
 
 \ /
  Last update: 2024-05-09 16:43    [W:0.117 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site