diff options
| author | Melbin K Mathew <mlbnkm1@gmail.com> | 2026-07-02 01:42:48 +0200 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2026-08-08 08:08:58 +0200 |
| commit | 061db6b7a910b8378f3b2df64f8c0a3ddc6e85f2 (patch) | |
| tree | 769b4d9b2c4f9f0d94c3caeb1fb67b008538f29a /tools/perf/scripts/python/bin | |
| parent | 95e647d2a5304a8fd11f1ba3c8502de700650131 (diff) | |
fbdev: serialize mode sysfs access with lock_fb_info()
show_mode(), show_modes(), and store_mode() access fb_info->modelist
and fb_info->mode without holding lock_fb_info(). store_modes() takes
lock_fb_info() while replacing the modelist and freeing the old one.
A concurrent reader or writer can load a pointer to an old modelist
entry before store_modes() frees it, then dereference freed memory or
store a stale freed pointer in fb_info->mode.
Take lock_fb_info() in show_mode(), show_modes(), and store_mode() to
serialize with store_modes(). In show_mode(), copy the mode to the
stack and format after dropping the lock. In store_mode(), split
activate() into a _locked variant to avoid double-locking, and hold
the locks for the modelist walk, mode conversion, activation, and
fb_info->mode assignment together.
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Melbin K Mathew <mlbnkm1@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
