Linux/linux db2ddb8. Makefile

Linux 7.2-rc7
DeltaFile
+1-1Makefile
+1-11 files

Linux/linux b9b3e33fs/tracefs internal.h event_inode.c, kernel/trace trace.c ring_buffer.c

Merge tag 'trace-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix use-after-free in eventfs_remove_rec()

   The freeing of the eventfs_inode children used list_for_each_entry()
   where the child is freed via srcu, but there's still a chance that it
   gets freed. It should be using list_for_each_entry_safe().

 - Fix eventfs_inode SRCU use of list in freeing

   The iterator uses an SRCU protected list walk on the eventfs inodes.
   The eventfs inode uses its "list" field in a union with the RCU list
   head. When the inode gets added to the SRCU list it immediately
   corrupts the list pointer and can cause an issue with the iterator.
   Move the RCU list head to be shared with the children list head which
   allows the iterator to check the parent inode if is freed before
   referencing the child. Have the iterator check the parent "is_freed"

    [70 lines not shown]
DeltaFile
+23-10kernel/trace/ftrace.c
+26-2fs/tracefs/event_inode.c
+9-6kernel/trace/ring_buffer.c
+2-2fs/tracefs/internal.h
+1-1kernel/trace/trace.c
+61-215 files

Linux/linux b643e49drivers/s390/crypto zcrypt_ep11misc.c zcrypt_ccamisc.c

Merge tag 's390-7.2-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

 - Fix potential uninitialized memory reads and buffer overflows from
   malformed zcrypt CCA and EP11 requests by properly validating lengths
   and payloads

 - Fix possible out of bounds accesses in zcrypt EP11 domain handling by
   replacing fixed payload layout assumptions with parsing ASN.1 fields
   with bounds checks

 - Fix zcrypt CCA and EP11 request and reply buffer allocations missing
   required 4-byte padding, and scrub the full allocation on release

 - Fix zcrypt CCA and EP11 messages leaking up to 3 uninitialized bytes
   of memory by zeroing trailing alignment padding

* tag 's390-7.2-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:

    [5 lines not shown]
DeltaFile
+252-112drivers/s390/crypto/zcrypt_msgtype6.c
+14-6drivers/s390/crypto/zcrypt_ccamisc.c
+11-5drivers/s390/crypto/zcrypt_ep11misc.c
+277-1233 files

Linux/linux 9154286kernel/trace ring_buffer.c

ring-buffer: Fix crash passing ERR_PTR to kthread_stop()

In test_ringbuffer()'s out_free cleanup loop, the check
`!rb_threads[cpu]` only catches NULL entries and misses entries that
hold an ERR_PTR.

rb_threads[] is static, so unassigned slots are NULL. But when
kthread_run_on_cpu() fails for a cpu, it stores ERR_PTR(-ENOMEM) (or
-EINTR) in rb_threads[cpu] before the creation loop jumps to out_free.
That entry is non-NULL, so the old `!ptr` check does not break, and the
cleanup proceeds to call kthread_stop() on the ERR_PTR. kthread_stop()
then dereferences the bogus pointer, crashing the kernel during the
late_initcall self-test.

crash logs:
  BUG: kernel NULL pointer dereference, address: 000000000000001c
  Oops: 0002 [#1] SMP NOPTI
  CPU: 1 PID: 1 Comm: swapper/0 Not tainted 7.2.0-rc6-dirty #7 PREEMPT(lazy)
  RIP: 0010:kthread_stop+0x2e/0x220

    [19 lines not shown]
DeltaFile
+1-1kernel/trace/ring_buffer.c
+1-11 files

Linux/linux 6d014e4kernel/trace ring_buffer.c

ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()

In rb_allocate_cpu_buffer(), bpage->order was omitted, leaving it as 0.
This is an issue for a ring-buffer with subbufs bigger than PAGE_SIZE if
when freed: free_buffer_page() relies on this value. Align the value
with the actual allocation size (buffer::subbuf_order).

Cc: stable at vger.kernel.org
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Link: https://patch.msgid.link/20260806211306.3704194-4-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+1-0kernel/trace/ring_buffer.c
+1-01 files

Linux/linux bf98d7bkernel/trace ring_buffer.c

ring-buffer: Prevent subbuf order change when resizing is disabled

Because ring_buffer_subbuf_order_set() frees buffer pages, we can't
allow it when resizing is disabled. A non-consuming reader is at risk of
use-after-free (rb_advance_iter()).

Return -EBUSY on resize_disabled, matching ring_buffer_resize()
behaviour.

Cc: stable at vger.kernel.org
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Link: https://patch.msgid.link/20260806211306.3704194-3-vdonnefort@google.com
Reported-by: syzbot+e0cc44465d6bae735679 at syzkaller.appspotmail.com
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+1-1kernel/trace/ring_buffer.c
+1-11 files

Linux/linux 7c727dfkernel/trace ring_buffer.c

ring-buffer: Prevent resizing of persistent ring buffer

Dynamically resizing a persistent ring buffer is not possible. Disable
the feature.

Cc: stable at vger.kernel.org
Fixes: be68d63a139b ("ring-buffer: Add ring_buffer_alloc_range()")
Link: https://patch.msgid.link/20260806211306.3704194-2-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+2-0kernel/trace/ring_buffer.c
+2-01 files

Linux/linux 8b8292dkernel/trace ftrace.c

ftrace: Fix off-by-one fentry site disable in ftrace_free_mem()

When a module's init text is freed, do_init_module() calls
ftrace_free_mem() with a half-open [start, end) range.  However the
ftrace_cmp_recs() comparator treats the upper bound as inclusive, as all
its other users do, passing 'ip + size - 1'.  So ftrace_free_mem() can
delete a record sitting exactly at 'end', which is outside the freed
range.

For a kernel without CFI or IBT, the first record of a function is at
the function start, which for the first function in a module is also the
base of its text allocation.  As the module allocator packs its regions,
that address is often the 'end' passed by a neighboring module's
do_init_module(), causing the first function's ftrace location to get
disabled, preventing an attempt to livepatch it:

  livepatch: failed to find location for function 'pcspkr_probe'

Convert the exclusive end to the inclusive 'end - 1' the comparator

    [9 lines not shown]
DeltaFile
+5-1kernel/trace/ftrace.c
+5-11 files

Linux/linux f27bdc4kernel/trace ring_buffer.c

ring-buffer: Use current_context for safe per-CPU buffer swap

The ring_buffer_swap_cpu() function currently checks the per-CPU
committing counter to determine if a buffer is actively being written to
before performing the swap. However, there exists a race window where
this check can be bypassed:

    ring_buffer_lock_reserve
        cpu_buffer = buffer->buffers[cpu];       // cpu_buffer_a
        rb_reserve_next_event
            rb_start_commit // inc committing
            if (unlikely(READ_ONCE(cpu_buffer->buffer) != buffer)) {...}
            __rb_reserve_next
                rb_move_tail
                    rb_end_commit(cpu_buffer);   // dec committing => 0
                    /* interrupt hits here, successfully swaps! */
                    local_inc(&cpu_buffer->committing);

    ring_buffer_unlock_commit

    [21 lines not shown]
DeltaFile
+4-4kernel/trace/ring_buffer.c
+4-41 files

Linux/linux 06cf618arch/x86/kernel/cpu/mce core.c

Merge tag 'x86-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Ingo Molnar:

 - Fix MCE CMCI discovery initialization ordering bug (Breno Leitao)

* tag 'x86-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/mce: Set up the polling timer before CMCI discovery
DeltaFile
+1-1arch/x86/kernel/cpu/mce/core.c
+1-11 files

Linux/linux d4eee3bkernel/futex core.c

Merge tag 'locking-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull futex fix from Ingo Molnar:

 - Fix race in futex_pivot_pending() during private hash resize
   that can cause stuck tasks (Yao Kai)

* tag 'locking-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Fix race in futex_pivot_pending() during private hash resize
DeltaFile
+4-3kernel/futex/core.c
+4-31 files

Linux/linux 91a73dbDocumentation/admin-guide kernel-parameters.txt, drivers/thunderbolt eeprom.c

Merge tag 'usb-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt fixes from Greg KH:
 "Here are some small USB and Thunderbolt driver fixes for 7.2-rc7 that
  resolve some reported issues. Included in here are:

   - new quirk for some broken USB devices

   - thunderbolt device fixes for reported issues

   - usb gadget driver fix

   - usb atm driver fix

   - xhci driver fixes.

   - other minor USB driver fixes

  All of these have been in linux-next this week with no reported

    [16 lines not shown]
DeltaFile
+24-8drivers/usb/core/config.c
+12-4drivers/usb/core/hub.c
+6-6drivers/usb/host/xhci.h
+8-1drivers/thunderbolt/eeprom.c
+7-0drivers/usb/core/quirks.c
+5-0Documentation/admin-guide/kernel-parameters.txt
+62-199 files not shown
+76-2815 files

Linux/linux e4836b6drivers/tty/serial sc16is7xx.c qcom_geni_serial.c, drivers/tty/serial/8250 8250_dma.c 8250_of.c

Merge tag 'tty-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty / serial / vt driver fixes from Greg KH:
 "Here are some small serial and vt tty driver fixes for 7.2-rc7 that
  resolve some reported problems. Included in here are:

   - two vt core fixes

   - amba-pl011 serial driver fixes

   - 8250_of and 8250_dma driver fixes

   - qcom-geni serial driver fix

   - sc16is7xx serial driver fix

  All of these have been in linux-next this week with no reported
  issues"


    [10 lines not shown]
DeltaFile
+54-32drivers/tty/serial/amba-pl011.c
+22-21drivers/tty/serial/qcom_geni_serial.c
+38-0drivers/tty/serial/8250/8250_of.c
+7-5drivers/tty/serial/8250/8250_dma.c
+4-1drivers/tty/vt/keyboard.c
+3-0drivers/tty/serial/sc16is7xx.c
+128-591 files not shown
+130-597 files

Linux/linux e663f6ddrivers/staging/rtl8723bs/core rtw_mlme_ext.c rtw_wlan_util.c, drivers/staging/rtl8723bs/os_dep ioctl_cfg80211.c

Merge tag 'staging-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some more small staging driver fixes, just for the rtl8723bs
  driver, for some reported problems found with it now that people are
  starting to actually test the thing with "bad" networks.

  Nothing major, but good to have in the -final release. All of these
  have been in linux-next for over a week with no reported problems"

* tag 'staging-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: rtl8723bs: validate monitor transmit frame lengths
  staging: rtl8723bs: fix missing shared-key auth challenge length check
  staging: rtl8723bs: fix OOB read in WMM_param_handler()
  staging: rtl8723bs: fix OOB read in rtw_get_wpa_ie()
DeltaFile
+4-0drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+3-0drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+3-0drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+1-1drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+11-14 files

Linux/linux 5668ba2Documentation/process security-bugs.rst coding-assistants.rst, drivers/misc fastrpc.c

Merge tag 'char-misc-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc and documentation fixes from Greg KH:
 "Here are some small char/misc and nvmem and documentation fixes for
  7.2-rc7 to resolve some reported issues.  Included in here are:

   - updates to the documentation for the kernel threat model and
     security bugs to get the LLMs to actually follow what we have been
     asking them to do (i.e. not claim security issues for things we do
     not consider security issues.)

   - nvmem driver fixes which required a tiny "layout" driver to be
     added.

   - fastrpc driver fixes

   - mei driver fix

   - counter driver fix

    [22 lines not shown]
DeltaFile
+58-0drivers/nvmem/layouts/fixed-layout.c
+22-17Documentation/process/threat-model.rst
+37-0Documentation/process/coding-assistants.rst
+18-9drivers/misc/fastrpc.c
+26-0Documentation/process/security-bugs.rst
+15-10drivers/misc/mei/client.c
+176-369 files not shown
+220-7715 files

Linux/linux 48f2fd0kernel/trace trace.c

ftrace: Drop extra comma in trace_buffered_event_enable

Drop the extra comma in "scoped_guard()" to cleanup the code.

Link: https://patch.msgid.link/20260730150411.88667-5-leon.hwang@linux.dev
Acked-by: Jiri Olsa <jolsa at kernel.org>
Signed-off-by: Leon Hwang <leon.hwang at linux.dev>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+1-1kernel/trace/trace.c
+1-11 files

Linux/linux 092f8eckernel/trace ftrace.c

ftrace: Protect direct_functions in update_ftrace_direct_mod

Fix accessing the __rcu pointer direct_functions with RCU protection.

Cc: stable at vger.kernel.org
Link: https://patch.msgid.link/20260730150411.88667-4-leon.hwang@linux.dev
Fixes: e93672f770d7 ("ftrace: Add update_ftrace_direct_mod function")
Acked-by: Jiri Olsa <jolsa at kernel.org>
Signed-off-by: Leon Hwang <leon.hwang at linux.dev>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+8-3kernel/trace/ftrace.c
+8-31 files

Linux/linux f26e5fakernel/trace ftrace.c

ftrace: Protect direct_functions in update_ftrace_direct_del

Fix accessing the __rcu pointer direct_functions with RCU protection.

Cc: stable at vger.kernel.org
Link: https://patch.msgid.link/20260730150411.88667-3-leon.hwang@linux.dev
Fixes: 8d2c1233f371 ("ftrace: Add update_ftrace_direct_del function")
Acked-by: Jiri Olsa <jolsa at kernel.org>
Signed-off-by: Leon Hwang <leon.hwang at linux.dev>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+8-5kernel/trace/ftrace.c
+8-51 files

Linux/linux 63444b7kernel/trace ftrace.c

ftrace: Protect direct_functions in ftrace_find_rec_direct

Fix accessing the __rcu pointer direct_functions with RCU protection.

Cc: stable at vger.kernel.org
Link: https://patch.msgid.link/20260730150411.88667-2-leon.hwang@linux.dev
Fixes: d05cb470663a ("ftrace: Fix modification of direct_function hash while in use")
Acked-by: Jiri Olsa <jolsa at kernel.org>
Suggested-by: Steven Rostedt <rostedt at goodmis.org>
Signed-off-by: Leon Hwang <leon.hwang at linux.dev>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+2-1kernel/trace/ftrace.c
+2-11 files

Linux/linux a7c7074drivers/video/fbdev/core fbmem.c fb_io_fops.c

Merge tag 'fbdev-for-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:
 "A few patches for the core fbdev layer which stabilize or fix
  potential issues with text font rendering after screen rotation or
  after user initiated font changes and locking fixes for sysfb during
  modifications of the graphics mode database"

* tag 'fbdev-for-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: bitblit: bound-check glyph index in bit_cursor()
  fbdev: Fix out-of-bounds access when rotating console after font resize
  fbdev: core: Fix pointer desynchronization in fb_io_read()
  fbdev: serialize mode sysfs access with lock_fb_info()
  fbdev: clear fb_info->mode before deleting a videomode
  fbdev: bound mode sysfs output to the sysfs buffer
DeltaFile
+47-12drivers/video/fbdev/core/fbsysfs.c
+25-0drivers/video/fbdev/core/fbcon.c
+7-2drivers/video/fbdev/core/bitblit.c
+8-0drivers/video/fbdev/core/fb_io_fops.c
+4-1drivers/video/fbdev/core/fbmem.c
+91-155 files

Linux/linux f0ece16fs/tracefs internal.h event_inode.c

eventfs: Use children field for rcu head and add memory barriers

When an eventfs inode is freed, it sets ei->is_freed and then uses its
ei->list to add it to the srcu link list as the list field is a union with
the rcu list head. As the ei->list is used to iterate over an SRCU
protected list without taking the eventfs_mutex, there's nothing stopping
the iteration over that list to see the ei->rcu instead of the ei->list
and it will read a corrupt target.

To fix this, change the union of the rcu list head with the children list.
On freeing the eventfs inode, set the is_free and execute a smp_wmb()
before adding the eventfs inode to the SRCU list.

On iteration of the ei->children list, at the start, execute a smp_rmb()
and then read the is_freed of the ei to see if the children list is still
valid. If is_freed is set, then the ei_child read is not valid and the
loop should exit immediately.

Cc: stable at vger.kernel.org

    [6 lines not shown]
DeltaFile
+24-0fs/tracefs/event_inode.c
+2-2fs/tracefs/internal.h
+26-22 files

Linux/linux fd73b69fs/tracefs event_inode.c

eventfs: Fix use-after-free in eventfs_remove_rec()

eventfs_remove_rec() recursively removes the child at the current loop
position. After the recursive call returns, list_for_each_entry() advances
by reading list.next from the removed child.

If free_ei() drops the final reference, release_ei() reuses the list/rcu
union to queue an SRCU callback. The child may be freed before that read.
The eventfs_mutex serializes list updates, but it does not keep the removed
child alive or prevent the SRCU callback from running.

Use list_for_each_entry_safe() to save the next sibling before recursively
removing the current child.

Cc: stable at vger.kernel.org
Fixes: 43aa6f97c2d0 ("eventfs: Get rid of dentry pointers without refcounts")
Link: https://patch.msgid.link/20260806022719.375354-1-shuangpeng.kernel@gmail.com
Signed-off-by: Shuangpeng Bai <shuangpeng.kernel at gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat at kernel.org>
Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
DeltaFile
+2-2fs/tracefs/event_inode.c
+2-21 files

Linux/linux 361efacinclude/linux device.h, rust/helpers io.c

Merge tag 'driver-core-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core fixes from Danilo Krummrich:

 - Fix Rust build failure on s390 by gating ioremap() / iounmap()
   helpers and the io::mem module on CONFIG_HAS_IOMEM; gate affected
   doctests as well.

 - Add missing kernel-doc for show_const / store_const union members in
   struct device_attribute.

* tag 'driver-core-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
  rust: io: gate ioremap doctests on CONFIG_HAS_IOMEM
  rust: io: gate ioremap/iounmap on CONFIG_HAS_IOMEM
  driver core: add missing kernel-doc for union members
DeltaFile
+5-4rust/kernel/platform.rs
+2-0rust/kernel/io.rs
+2-0rust/helpers/io.c
+2-0include/linux/device.h
+1-0rust/kernel/devres.rs
+12-45 files

Linux/linux 7d8c681drivers/input evdev.c, drivers/input/joystick/iforce iforce-packets.c

Merge tag 'input-for-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

 - Fixes for information leaks and OOB accesses across several drivers,
   including evdev, focaltech, edt-ft5x06, iforce, and cs40l50-vibra

 - Improvements to the synaptics-rmi4 driver to properly handle F54
   worker errors and prevent buffer overflows

 - Input validation fixes in the hynitron_cstxxx touchscreen driver to
   prevent issues with invalid finger IDs and touch counts

 - Fixes for use-after-free and initialization bugs in the byd mouse and
   psxpad-spi drivers

 - New quirks for the atkbd driver to make keyboard work on HONOR and
   Xiaomi laptops


    [21 lines not shown]
DeltaFile
+32-11drivers/input/rmi4/rmi_f54.c
+16-11drivers/input/evdev.c
+18-2drivers/input/keyboard/atkbd.c
+10-3drivers/input/touchscreen/hynitron_cstxxx.c
+10-1drivers/input/joystick/iforce/iforce-packets.c
+8-2drivers/input/misc/cs40l50-vibra.c
+94-308 files not shown
+108-3614 files

Linux/linux afe80aearch/powerpc/platforms/pseries pci.c lparcfg.c

Merge tag 'powerpc-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Madhavan Srinivasan:

 - A couple of fixes for a memory leak and a underflow case

Thanks to George Wilson and R Nageswara Sastry

* tag 'powerpc-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/pseries: lparcfg - fix kbuf[] underflow
  powerpc/pseries: pci - logic bug
  powerpc/pseries: papr-phy-attest - validate cmd.length, plug mem leak
DeltaFile
+11-1arch/powerpc/platforms/pseries/papr-phy-attest.c
+1-1arch/powerpc/platforms/pseries/pci.c
+1-1arch/powerpc/platforms/pseries/lparcfg.c
+13-33 files

Linux/linux ef7656edrivers/video/fbdev/core fbcon.c

fbdev: Fix out-of-bounds access when rotating console after font resize

[BUG]
Recently, we encountered a KASAN warning as follows:

BUG: KASAN: slab-out-of-bounds in ccw_putcs+0x8bd/0xa80
Read of size 1 at addr ff11000110067100 by task bash/1209
CPU: 10 UID: 0 PID: 1209 Comm: bash Not tainted 7.2.0-rc3 #69 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-4.fc41 04/01/2014
 Call Trace:
  <TASK>
  ...
  kasan_report+0xf0/0x120
  ? ccw_putcs+0x8bd/0xa80
  ccw_putcs+0x8bd/0xa80
  ? __pfx_ccw_putcs+0x10/0x10
  fbcon_putcs+0x338/0x410
  ? __pfx_ccw_putcs+0x10/0x10
  do_update_region+0x21d/0x450

    [97 lines not shown]
DeltaFile
+25-0drivers/video/fbdev/core/fbcon.c
+25-01 files

Linux/linux 81cc73bdrivers/video/fbdev/core fb_io_fops.c

fbdev: core: Fix pointer desynchronization in fb_io_read()

In fb_io_read(), if copy_to_user() performs a partial copy (e.g., due to
a faulty user buffer), the loop adjusts the chunk size 'c' and updates
the remaining 'count'. However, the hardware 'src' pointer has already
been eagerly advanced by the original chunk size.

If the loop is allowed to continue, the read will resume from an
incorrect, over-advanced offset. Since the remaining 'count' was only
decremented by the successful bytes, this desynchronization causes the
next iterations to execute more hardware reads than originally bounded,
eventually leading to out-of-bounds I/O reads.

Fix this by breaking out of the loop immediately upon a partial
copy_to_user(). A partial copy indicates a faulty user buffer, making
subsequent read attempts futile. Breaking out ensures we return the
number of successfully read bytes without risking out-of-bounds hardware
accesses in subsequent mismatched iterations.


    [4 lines not shown]
DeltaFile
+8-0drivers/video/fbdev/core/fb_io_fops.c
+8-01 files

Linux/linux d15d51fdrivers/video/fbdev/core fbsysfs.c

fbdev: bound mode sysfs output to the sysfs buffer

mode_string() uses snprintf() which can return a value larger than the
remaining buffer space. show_modes() accumulates the return value into i
without checking whether i has reached PAGE_SIZE, causing the offset to
advance past the sysfs buffer if the modelist is long enough.

Add a size parameter to mode_string() and use scnprintf() to return
only the bytes actually written. Add an early return when offset
already exceeds the buffer. In show_modes(), stop accumulating once
the buffer is full.

Cc: stable at vger.kernel.org # v7.1+
Signed-off-by: Melbin K Mathew <mlbnkm1 at gmail.com>
Signed-off-by: Helge Deller <deller at gmx.de>
DeltaFile
+10-5drivers/video/fbdev/core/fbsysfs.c
+10-51 files

Linux/linux e033cbfdrivers/video/fbdev/core bitblit.c

fbdev: bitblit: bound-check glyph index in bit_cursor()

bit_cursor() fetches the glyph under the cursor with

        c = scr_readw(vc_pos);
        src = vc_font.data + ((c & charmask) * w * height);

where charmask is 0x1ff when vc_hi_font_mask is set. The screen buffer
value comes directly from scr_readw() and may be larger than the current
font's glyph count.

Syzkaller triggers this via vcs_write(). The Call Trace shows
vcs_write() in vc_screen.c writing an arbitrary 16-bit value with
writev() to /dev/vcsa, which vcs_write_buf() in vc_screen.c stores via
vcs_scr_writew() without checking charcount. The stored value is later
read in bit_cursor() in bitblit.c.

When the font is changed from a font with 512 glyphs to a font with
256 glyphs, the screen buffer can retain characters with the high

    [38 lines not shown]
DeltaFile
+7-2drivers/video/fbdev/core/bitblit.c
+7-21 files

Linux/linux 061db6bdrivers/video/fbdev/core fbsysfs.c

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 at vger.kernel.org # v7.1+
Signed-off-by: Melbin K Mathew <mlbnkm1 at gmail.com>
Signed-off-by: Helge Deller <deller at gmx.de>
DeltaFile
+38-8drivers/video/fbdev/core/fbsysfs.c
+38-81 files