6.18.50-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 537/552 wifi: mt76: mt7996: validate default EEPROM firmware size
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laxman Acharya Padhya <[email protected]>
commit 653c6e289b13cc6942f3e8f8e3c568e70fa42d1f upstream.
The default EEPROM firmware is parsed and copied as a full EEPROM without checking its length. A truncated file can make the driver read beyond the firmware buffer during variant validation or the fallback copy.
Reject files shorter than MT7996_EEPROM_SIZE before parsing or copying the firmware.
--- drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c +6 -0
@@ -148,6 +148,12 @@ mt7996_eeprom_check_or_use_default(struc goto out; } +if (fw->size <MT7996_EEPROM_SIZE ) { +dev_err (dev->mt76.dev,"Invalid default bin size\n" ); + ret = -EINVAL ; + goto out; + } +if (!use_default &&mt7996_eeprom_variant_valid (dev, fw->data)) goto out;
Greg Kroah-Hartman
maintainerPATCH 538/552 vsock/virtio: flush works in dependency order
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <[email protected]>
commit 728836ebca239810f164262b10211ef59182f811 upstream.
virtio_vsock_remove() stops the virtqueues and then flushes each work item before freeing the enclosing virtio_vsock. The current order does not account for dependencies between those items: tx_work may queue send_pkt_work, and send_pkt_work may queue rx_work.
In particular, send_pkt_work can set restart_rx and release tx_lock. The remove path can then stop the queues and flush rx_work before send_pkt_work queues it. Although the later send_pkt_work flush waits for that producer to finish, nothing waits for the newly queued rx_work, so kfree(vsock) can race with it.
KASAN reported:
BUG: KASAN: slab-use-after-free in virtio_transport_rx_work+0x487/0x4b0 Read of size 8 at addr ffff888114c2b008 by task kworker/1:1/47 Workqueue: virtio_vsock virtio_transport_rx_work Call Trace: virtio_transport_rx_work+0x487/0x4b0 process_one_work+0x688/0x1120 worker_thread+0x45b/0xd10 Allocated by task 1: virtio_vsock_probe+0xef/0x6b0 Freed by task 84: kfree+0x131/0x3c0 virtio_vsock_remove+0xd1/0x100
Flush the works in producer-to-consumer order. virtio_vsock_vqs_del() has already disabled the queue callbacks and cleared the run flags, so after tx_work and send_pkt_work are drained, no source remains that can queue rx_work after its flush.
--- net/vmw_vsock/virtio_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/virtio_transport.c +1 -1
@@ -848,10 +848,10 @@ static void virtio_vsock_remove(struct v/* Other works can be queued before 'config->del_vqs()', so we flush * all works before to free the vsock object to avoid use after free. */ -flush_work (&vsock->rx_work);flush_work (&vsock->tx_work);flush_work (&vsock->event_work);flush_work (&vsock->send_pkt_work); +flush_work (&vsock->rx_work);mutex_unlock (&the_virtio_vsock_mutex);
Greg Kroah-Hartman
maintainerPATCH 539/552 w1: ds28e17: reject an oversize length on an I2C block read
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maoyi Xie <[email protected]>
commit 169ae5e65e5aaf213b6a578f6478a9fd2e523606 upstream.
w1_f19_i2c_master_transfer() is the master_xfer for the DS28E17 1-Wire to I2C bridge. On an I2C_M_RECV_LEN read, it takes the length from the device. The downstream slave puts a length byte in buf[0]. The driver then reads that many bytes into buf[1] with w1_f19_i2c_read().
buf[0] is controlled by the device and can be 0 to 255. w1_f19_i2c_read() only rejects a zero count. The caller buffer is I2C_SMBUS_BLOCK_MAX + 2, so 34 bytes. A length above 32 makes the read run past it, up to about 222 bytes out of bounds.
The SMBus core does check buf[0] against I2C_SMBUS_BLOCK_MAX. That check runs after master_xfer returns. By then the write is already done. i2c-algo-bit rejects an oversize length before it copies, and returns -EPROTO.
Reject a length above I2C_SMBUS_BLOCK_MAX at both RECV_LEN sites, the same way i2c-algo-bit does.
--- drivers/w1/slaves/w1_ds28e17.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/w1/slaves/w1_ds28e17.c +8 -0
@@ -389,6 +389,10 @@ static int w1_f19_i2c_master_transfer(st* another simple read in that case. */ if (msgs[i+1 ].flags &I2C_M_RECV_LEN ) { +if (msgs[i+1 ].buf[0 ] >I2C_SMBUS_BLOCK_MAX ) { + i = -EPROTO ; + goto error; + } result =w1_f19_i2c_read (sl, msgs[i+1 ].addr, &(msgs[i+1 ].buf[1 ]), msgs[i+1 ].buf[0 ]);if (result <0 ) {
@@ -415,6 +419,10 @@ static int w1_f19_i2c_master_transfer(st* another simple read in that case. */ if (msgs[i].flags &I2C_M_RECV_LEN ) { +if (msgs[i].buf[0 ] >I2C_SMBUS_BLOCK_MAX ) { + i = -EPROTO ; + goto error; + } result = w1_f19_i2c_read(sl, msgs[i].addr, &(msgs[i].buf[1]),
Greg Kroah-Hartman
maintainerPATCH 540/552 xarray: honor XA_FLAGS_ACCOUNT in xas_split_alloc()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zi Yan <[email protected]>
commit 789763523fb43cdc328de5cb5dcd19240ccf90d8 upstream.
XArray operations that allocate xa_nodes, such as xas_nomem() and xas_alloc(), add __GFP_ACCOUNT when the array has XA_FLAGS_ACCOUNT set. This charges the allocated memory and avoids the workingset convergence issue described by commit 7b785645e8f13 ("mm: fix page cache convergence regression").
xas_split_alloc() does not add _GFP_ACCOUNT when XA_FLAGS_ACCOUNT is present. Fix it.
--- lib/xarray.c | 3 +++ 1 file changed, 3 insertions(+)
lib/xarray.c +3 -0
@@ -1053,6 +1053,9 @@ void xas_split_alloc(struct xa_state *xaif (xas->xa_shift +XA_CHUNK_SHIFT > order)return ; +if (xas->xa->xa_flags &XA_FLAGS_ACCOUNT ) + gfp |= __GFP_ACCOUNT; + do { struct xa_node *node;
Greg Kroah-Hartman
maintainerPATCH 541/552 zloop: truncate finished zones to zone capacity
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xu Rao <[email protected]>
commit 72e67c118642634c25465db0c8bcfa54c4ce086c upstream.
The size of a sequential zone backing file records the amount of data written and is used to restore the zone state. A backing file whose size is equal to the zone capacity is restored as a full zone, while a file larger than the zone capacity is rejected as invalid.
However, zloop_finish_zone() currently truncates the backing file to the zone size. For devices with a reduced zone capacity, finishing a zone therefore creates a backing file larger than the zone capacity. After the device is removed and later re-added, that zone file is rejected instead of being restored as a full zone.
Truncate finished sequential zones to the zone capacity, matching the persistent representation accepted by zloop_update_seq_zone() for a full zone.
--- Documentation/admin-guide/blockdev/zoned_loop.rst | 9 ++++----- drivers/block/zloop.c | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-)
Documentation/admin-guide/blockdev/zoned_loop.rst +4 -5
@@ -30,11 +30,10 @@ indicates the position of the write poin When resetting a sequential zone, its backing file size is truncated to zero. Conversely, for a zone finish operation, the backing file is truncated to the -zone size. With this, the maximum capacity of a zloop zoned block device created -can be larger configured to be larger than the storage space available on the -backing file system. Of course, for such configuration, writing more data than -the storage space available on the backing file system will result in write -errors. +zone capacity. With this, a zloop zoned block device can be configured with a +larger capacity than the storage space available on the backing file system. Of +course, for such configuration, writing more data than the storage space +available on the backing file system will result in write errors. The zoned loop block device driver implements a complete zone transition state machine. That is, zones can be empty, implicitly opened, explicitly opened,
drivers/block/zloop.c +2 -1
@@ -319,7 +319,8 @@ static int zloop_finish_zone(struct zloo zone->cond == BLK_ZONE_COND_FULL) goto unlock; -if (vfs_truncate (&zone->file->f_path, zlo->zone_size <<SECTOR_SHIFT )) { +if (vfs_truncate (&zone->file->f_path, + zlo->zone_capacity <<SECTOR_SHIFT )) {set_bit (ZLOOP_ZONE_SEQ_ERROR , &zone->flags); ret = -EIO ; goto unlock;
Greg Kroah-Hartman
maintainerPATCH 542/552 tpm: tpm_i2c_nuvoton: disable IRQ on wait timeout
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <[email protected]>
commit 705c4ed0643366963547b2616d53165f2519c81f upstream.
i2c_nuvoton_wait_for_stat() enables the IRQ before waiting for the interrupt handler to report a status change. If the wait times out, or is interrupted before the handler runs, the function returns without balancing the enable_irq() call.
Disable the IRQ before leaving the failed wait path. Also preserve an interrupted wait's original error code instead of converting it to -ETIMEDOUT inside the helper.
--- drivers/char/tpm/tpm_i2c_nuvoton.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_i2c_nuvoton.c +4 -2
@@ -182,8 +182,10 @@ static int i2c_nuvoton_wait_for_stat(str timeout);if (rc >0 )return 0 ; -/* At this point we know that the SINT pin is asserted, so we -* do not need to do i2c_nuvoton_check_status */ + +disable_irq (priv->irq); +if (rc <0 ) +return rc; }else {unsigned long ten_msec, stop;bool status_valid;
Greg Kroah-Hartman
maintainerPATCH 543/552 sysctl: move the "cad_pid" entry from pid_table[] to kern_reboot_table[]
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 7170ca01623b399c97f2ae9d3e228badc1f25ea3 upstream.
cad_pid is global, and kill_cad_pid() is only used in the root namespace.
However, due to pid_table_root_permissions(), a non-root user can unshare pid/user namespaces and modify it from the child namespace. This makes no sense and is simply wrong.
Move it to kern_reboot_table[] where it logically belongs; this ensures that only GLOBAL_ROOT_UID can read/modify this sysctl.
Note that this patch doesn't preserve "#ifdef CONFIG_PROC_SYSCTL" around the "cad_pid"; CONFIG_PROC_SYSCTL selects CONFIG_SYSCTL, so it is always set when kern_reboot_table[] is compiled.
--- kernel/pid.c | 31 ------------------------------- kernel/reboot.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 31 deletions(-)
kernel/pid.c +0 -31
@@ -715,29 +715,6 @@ static struct ctl_table_root pid_table_r .set_ownership = pid_table_root_set_ownership, }; -static int proc_do_cad_pid (const struct ctl_table *table,int write,void *buffer, -size_t *lenp,loff_t *ppos) -{ -struct pid *new_pid; -pid_t tmp_pid; -int r; -struct ctl_table tmp_table = *table; - - tmp_pid =pid_vnr (cad_pid); - tmp_table.data = &tmp_pid; - - r =proc_dointvec (&tmp_table, write, buffer, lenp, ppos); -if (r || !write) -return r; - - new_pid =find_get_pid (tmp_pid); -if (!new_pid) -return -ESRCH ; - -put_pid (xchg (&cad_pid, new_pid)); -return 0 ; -} -static const struct ctl_table pid_table[] = { { .procname ="pid_max" ,
@@ -748,14 +725,6 @@ static const struct ctl_table pid_table[ .extra1 = &pid_max_min, .extra2 = &pid_max_max, }, -#ifdef CONFIG_PROC_SYSCTL - { - .procname = "cad_pid", - .maxlen = sizeof(int), - .mode = 0600, - .proc_handler = proc_do_cad_pid, - }, -#endif };#endif
kernel/reboot.c +29 -0
@@ -1366,6 +1366,29 @@ static struct attribute *reboot_attrs[] }; #ifdef CONFIG_SYSCTL +static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer, + size_t *lenp, loff_t *ppos) +{ + struct ctl_table tmp_table = *table; + struct pid *new_pid; + pid_t tmp_pid; + int r; + + tmp_pid = pid_vnr(cad_pid); + tmp_table.data = &tmp_pid; + + r = proc_dointvec(&tmp_table, write, buffer, lenp, ppos); + if (r || !write) + return r; + + new_pid = find_get_pid(tmp_pid); + if (!new_pid) + return -ESRCH; + + put_pid(xchg(&cad_pid, new_pid)); + return 0; +} + static const struct ctl_table kern_reboot_table[] = { { .procname = "poweroff_cmd",
@@ -1381,6 +1404,12 @@ static const struct ctl_table kern_reboo .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "cad_pid", + .maxlen = sizeof(int), + .mode = 0600, + .proc_handler = proc_do_cad_pid, + }, };static void __init kernel_reboot_sysctls_init (void )
Greg Kroah-Hartman
maintainerPATCH 544/552 sticon/parisc: Detect default STI graphics card for console output
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit de508ece1d37cdbbbfa52f074954310f9b066b13 upstream.
If a machine has multiple graphic cards, detect the graphic card which is used to display firmware messages and use that one as the default graphic card for sticon and fbcon.
On parisc machines the default graphic card used for BCH (boot console handler, aka BIOS menu) is stored in the stable storage (equivalent to CMOS storage on x86) or in the console path in page zero. Extract that path and store it as default STI path for later comparism. Take care that the graphic card can be a GSC or a PCI card which use different path strings.
Increase max string size for default_sti_path to 32 chars as the print_pa_hwpath() function formats a hardware path using unbounded sprintf calls for up to 6 bus converter components and 1 module component (e.g., 255/255/...), which can produce a string up to 28 bytes long.
--- drivers/video/sticore.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/video/sticore.c +21 -1
@@ -325,7 +325,7 @@ static void sti_rom_copy(unsigned long b -static char default_sti_path[21 ]__read_mostly ; +static char default_sti_path[32 ]__read_mostly ;#ifndef MODULE static int __init sti_setup (char *str)
@@ -1148,6 +1148,26 @@ static void sti_init_roms(void)pr_info ("STI GSC/PCI core graphics driver " STI_DRIVERVERSION "\n" ); +/* +* Find default console by hardware path which is either stored in +* console entry in stable storage or alternatively from console path +* in PAGE0 used by BCH and PDC. +*/ +if (!default_sti_path[0 ]) { +struct pdc_module_path conspath; +struct device *dev =NULL ; + +if (pdc_stable_read (0x60 , &conspath,sizeof (conspath)) ==PDC_OK ) + dev =hwpath_to_device (&conspath.path); +if (!dev) + dev =hwpath_to_device (&PAGE0 ->mem_cons.dp.path); +if (dev &&dev_is_pci (dev)) +print_pci_hwpath (to_pci_dev (dev), default_sti_path); +else if (dev && !dev_is_pci (dev)) +print_pa_hwpath (to_parisc_device (dev), default_sti_path); +pr_debug ("default graphic card: %s\n" , default_sti_path); + } +/* Register drivers for native & PCI cards */ register_parisc_driver (&pa_sti_driver);WARN_ON (pci_register_driver (&pci_sti_driver));
Greg Kroah-Hartman
maintainerPATCH 545/552 signal: avoid shared siginfo namespace rewrites
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bradley Morgan <[email protected]>
commit d19cdc167e696714509e87d3f7ae765b6e164589 upstream.
send_signal_locked() rewrites sender ids for the target namespace. Group sends reuse the same siginfo, so one recipient can affect the next.
Copy the siginfo before changing it.
--- kernel/signal.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/signal.c +4 -0
@@ -1183,6 +1183,7 @@ static inline bool has_si_pid_and_uid(stint send_signal_locked (int sig,struct kernel_siginfo *info,struct task_struct *t,enum pid_type type) { +struct kernel_siginfo rewritten;/* Should SIGKILL or SIGSTOP be received by a pid namespace init? */ bool force = false;
@@ -1196,6 +1197,9 @@ int send_signal_locked(int sig, struct k/* SIGKILL and SIGSTOP is special or has ids */ struct user_namespace *t_user_ns; + rewritten = *info; + info = &rewritten; +rcu_read_lock (); t_user_ns =task_cred_xxx (t, user_ns);if (current_user_ns () != t_user_ns) {
Greg Kroah-Hartman
maintainerPATCH 546/552 smack: fix cred UAF in smack_file_send_sigiotask()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit fedc88e38ce979a720cd2de042578cb5df3dc8de upstream.
When inspecting the credentials of another task, objective credentials (->real_cred, accessed with __task_cred()) must always be used.
Accessing ->cred on a non-current task is forbidden unless that task is being created or destroyed; a task is allowed to change its own ->cred pointer with no synchronization, and changing ->cred should only affect the current syscall.
smack_file_send_sigiotask() was accessing both sets of credentials: First tsk->cred, then __task_cred(tsk).
Fix it, always access the objective credentials here.
I have tested that this bug can lead to a KASAN-reported UAF of struct cred in smack_file_send_sigiotask(), and that this fix prevents the race.
--- security/smack/smack_lsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/smack/smack_lsm.c +1 -1
@@ -1969,7 +1969,7 @@ static int smack_file_send_sigiotask(str {struct smack_known **blob;struct smack_known *skp; -struct smack_known *tkp =smk_of_task (smack_cred (tsk->cred)); +struct smack_known *tkp =smk_of_task_struct_obj (tsk);const struct cred *tcred;struct file *file;int rc;
Greg Kroah-Hartman
maintainerPATCH 547/552 taskstats: fix cpumask parsing cutting off the last character
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bradley Morgan <[email protected]>
commit 1f58a5335cdd14b3fb5f2a5d3763dee1f5cba1d3 upstream.
parse() hands nla_strscpy() len as dstsize, and nla_strscpy() copies at most dstsize - 1 bytes. When the attr payload comes in without a trailing NUL, srclen == len >= dstsize and the last character of the cpumask string gets cut off. Register "0-15" and you are silently listening on "0-1", exit data for the rest never shows up.
The bug only bites when the sender doesn't NUL terminate the payload; senders that include the NUL were always fine (srclen gets decremented for the trailing NUL, so srclen < dstsize). Thats probably why this survived 20 years. And the policy is NLA_STRING, not NLA_NUL_STRING, so a payload without the trailing NUL is legit input here.
Skip the kmalloc/nla_strscpy dance entirely and use nla_strdup(), which already allocates srclen + 1 and terminates. The nla_len() bounds checks stay as they were.
--- kernel/taskstats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/taskstats.c +1 -2
@@ -368,10 +368,9 @@ static int parse(struct nlattr *na, strureturn -E2BIG ;if (len <1 )return -EINVAL ; - data =kmalloc (len,GFP_KERNEL ); + data =nla_strdup (na,GFP_KERNEL );if (!data)return -ENOMEM ; -nla_strscpy (data, na, len); ret =cpulist_parse (data, mask);kfree (data);return ret;
Greg Kroah-Hartman
maintainerPATCH 548/552 timekeeping: Check the return value of tk_get_aux_ts64 in __do_adjtimex()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh (Schneider Electric) <[email protected]>
commit 4b61084b11bcecce86d03804ff30f8d7b465593c upstream.
If the auxiliary clock is disabled during tk_get_aux_ts64() but is enabled before tks->clock_valid is checked, then uninitialized stackdata will be used in the calculations and indirectly leaked to userspace.
The same race window also exists after this change and also for the core timekeeper. But in these cases the only effect would be incorrect adjustments and this is userspace's responsibility to avoid this.
--- kernel/time/timekeeping.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/time/timekeeping.c +5 -3
@@ -2693,10 +2693,12 @@ static int __do_adjtimex(struct tk_datareturn ret;add_device_randomness (txc,sizeof (*txc)); -if (!aux_clock) +if (!aux_clock) {ktime_get_real_ts64 (&ts); -else -tk_get_aux_ts64 (tkd->timekeeper.id, &ts); + }else { +if (!tk_get_aux_ts64 (tkd->timekeeper.id, &ts)) +return -ENODEV ; + }add_device_randomness (&ts,sizeof (ts));
Greg Kroah-Hartman
maintainerPATCH 549/552 timer: Keep debugobjects state consistent in migrate_timer_list()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit c793bbfc4a0a9f5a66978fc91559e9681748dbeb upstream.
When timers are migrated away from an offline CPU the debugobjects state gets corrupted. The timer is accounted as inactive on deletion, but the enqueue on the alive CPU lacks the activation call.
That used to work, but got broken when the trace point and the debug objects call got separated. That change missed to fixup migrate_timer_list().
Add the missing debug_timer_activate() invocation to fix it.
--- kernel/time/timer.c | 1 + 1 file changed, 1 insertion(+)
kernel/time/timer.c +1 -0
@@ -2491,6 +2491,7 @@ static void migrate_timer_list(struct ti timer = hlist_entry(head->first, struct timer_list, entry);detach_timer (timer, false); timer->flags = (timer->flags & ~TIMER_BASEMASK ) | cpu; +debug_timer_activate (timer);internal_add_timer (new_base, timer); } }
Greg Kroah-Hartman
maintainerPATCH 550/552 udf: Fix i_lenExtents truncation on 32-bit kernels
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhan Xusheng <[email protected]>
commit a5a5ed23b1340ff0f32a14a7ca8585f7c4e9b2e2 upstream.
In udf_do_extend_file() the total extent length is rounded up to a block boundary with:
iinfo->i_lenExtents = (iinfo->i_lenExtents + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1);
i_lenExtents is a __u64, but sb->s_blocksize is unsigned long. On 32-bit kernels unsigned long is 32-bit, so ~(sb->s_blocksize - 1) is a 32-bit value (e.g. 0xfffff800 for a 2 KiB block) that is zero-extended in the AND, clearing the upper 32 bits of i_lenExtents. For UDF files whose total extent length exceeds 4 GiB this truncates i_lenExtents when the file is extended, corrupting the tracked extent length.
Cast the block size to 64-bit before forming the mask. 64-bit kernels are unaffected.
--- fs/udf/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/udf/inode.c +1 -1
@@ -532,7 +532,7 @@ static int udf_do_extend_file(struct ino sb->s_blocksize - 1) & ~(sb->s_blocksize - 1)); iinfo->i_lenExtents = (iinfo->i_lenExtents + sb->s_blocksize -1 ) & - ~(sb->s_blocksize -1 ); + ~((u64 )sb->s_blocksize -1 ); } add =0 ;
Greg Kroah-Hartman
maintainerPATCH 551/552 selftests/mm: fix on-fault-limit false failure under sudo-rs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Injae Ryou <[email protected]>
commit 98df164036bed307a16e7c124ad023c2c13c4b76 upstream.
run_vmtests.sh runs on-fault-limit as the nobody user via "sudo -u nobody ./on-fault-limit", guarded by a check that nobody can access the binary ("sudo -u nobody ls ./on-fault-limit").
The guard resolves the relative path from the inherited working directory, which only requires search permission on the test directory itself. Classic sudo passes the relative path through to execve() the same way, so the two agree. However, sudo-rs (the default sudo implementation since Ubuntu 25.10) canonicalizes the command to an absolute path before executing it, which requires search permission on every ancestor directory. When the kernel tree lives under a private home directory (mode 0750, the Ubuntu default for new users since 21.04), the guard passes but the execution fails with "command not found", and the test is reported as a false FAIL:
# running sudo -u nobody ./on-fault-limit sudo: './on-fault-limit': command not found # [FAIL]
Wrap the command in "sh -c" so that sudo only resolves the shell binary, and the relative path is resolved by nobody's shell from the inherited working directory, matching what the guard checks. This is the only "sudo -u nobody" invocation in the script; uid, cwd, rlimits (including RLIMIT_MEMLOCK, which this test exercises) and the exit status are unchanged through sh.
Verified on Ubuntu 26.04 (sudo-rs 0.2.13): the test now runs and passes instead of failing. Verified on Ubuntu 24.04 (sudo 1.9.15p5): behavior is unchanged.
--- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +1 -1
@@ -370,7 +370,7 @@ CATEGORY="compaction" run_test ./compact if command -v sudo &> /dev/null && sudo -u nobody ls ./on-fault-limit >/dev/null; then - CATEGORY="mlock" run_test sudo -u nobody ./on-fault-limit + CATEGORY="mlock" run_test sudo -u nobody sh -c ./on-fault-limit else echo "# SKIP ./on-fault-limit" fi
Greg Kroah-Hartman
maintainerPATCH 552/552 platform/chrome: sensorhub: Fix dropped timestamp events and log spam
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tzung-Bi Shih <[email protected]>
commit 9a3f43b30373c61477d0d3ab52946c05f9492bf9 upstream.
Commit 833740a2333c ("platform/chrome: sensorhub: Bound the EC-reported sensor number") evaluated the sensor_num against the bounds limit even for timestamp events. A timestamp event typically has a sensor_num of 0xff [1], causing the driver to flag it as invalid and skip to the next event.
As a result, we'd see a flooding of "Invalid sensor number 255 from EC" warning logs and these timestamp events were being dropped.
Move the bounds-check into cros_ec_sensor_ring_process_event() and evaluate it only after standalone timestamp events have already been processed and returned early.
[1] https://crrev.com/219ca6ef82ba266da788b673ee4ad50bd3ea1285/common/motion_sense_fifo.c#427
--- drivers/platform/chrome/cros_ec_sensorhub_ring.c | 27 ++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/platform/chrome/cros_ec_sensorhub_ring.c +15 -12
@@ -464,6 +464,21 @@ cros_ec_sensor_ring_process_event(struct fifo_timestamp, *current_timestamp, now); + +/* +* A standalone timestamp event typically has a sensor_num of +* 0xff. Return early here to prevent it from hitting the +* bounds check below and spamming the logs. +*/ +return false; + } + +/* Skip event if sensor_num from EC is out of bounds. */ +if (in->sensor_num >= sensorhub->sensor_num) { +dev_warn_ratelimited (sensorhub->dev, +"Invalid sensor number %u from EC\n" , + in->sensor_num); +return false; }if (in->flags &MOTIONSENSE_SENSOR_FLAG_ODR ) {
@@ -491,10 +506,6 @@ cros_ec_sensor_ring_process_event(structreturn true; } -if (in->flags &MOTIONSENSE_SENSOR_FLAG_TIMESTAMP ) -/* If we just have a timestamp, skip this entry. */ -return false; -/* Regular sample */ out->sensor_id = in->sensor_num; trace_cros_ec_sensorhub_data(in->sensor_num,
@@ -879,14 +890,6 @@ static void cros_ec_sensorhub_ring_handlfor (in = sensorhub->resp->fifo_read.data, j =0 ; j < number_data; j++, in++) { -/* Skip event if sensor_num from EC is out of bounds. */ -if (in->sensor_num >= sensorhub->sensor_num) { -dev_warn_ratelimited (sensorhub->dev, -"Invalid sensor number %u from EC\n" , - in->sensor_num); -continue ; - } - if (cros_ec_sensor_ring_process_event( sensorhub, fifo_info, fifo_timestamp,
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.18.50-rc1-g96ff57c9007f #1 SMP PREEMPT_DYNAMIC Fri Sep 4 12:46:51 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.18.50 release. There are 552 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
We see similar problems to 6.12:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2819268635
for example
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/jobs/16299963277
07:10:16mm/page_vma_mapped.c: In function 'check_pte':
1479
07:10:16mm/page_vma_mapped.c:110:25: error: implicit declaration of function 'huge_ptep_get' [-Werror=implicit-function-declaration] 1480
07:10:16
110 | ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
1481
07:10:16
| ^~~~~~~~~~~~~
1482
07:10:16
AR drivers/pinctrl/nomadik/built-in.a
1483
07:10:16
cc1: some warnings being treated as errors
I assume bisection from 6.12 applies here, too.
Best regards,
Pavel
Build tested in our x86,arm64,loongarch,riscv config successfully without error.
Best Regards
Wentao Guan
Log:
Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #2 SMP PREEMPT_DYNAMIC Sat Sep 5 02:03:27 CST 2026 Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #3 SMP PREEMPT_DYNAMIC Sat Sep 5 02:18:48 CST 2026 Linux version 6.18.50-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT
Linux version 6.18.50-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #4 SMP PREEMPT Sat Sep 5 02:34:29 CST 2026 Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin18) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC
Linux version 6.18.50-rc1-g96ff57c9007f (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin18) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #1 SMP PREEMPT_DYNAMIC Sat Sep 5 01:40:19 CST 2026
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.50 release. There are 552 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2026 04:56:59 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.50-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · On Fri, 04 Sep 2026 06:52:37 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.18.50 release. There are 552 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2026 04:56:59 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64 and arm32:
I see the same arm32 build issue:
mm/page_vma_mapped.c:110:11: error: call to undeclared function 'huge_ptep_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
110 | ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
| ^
In addition, in UML (x86_64) there is also nearby:
mm/page_vma_mapped.c:110:9: error: assigning to 'pte_t' from incompatible type 'int'
110 | ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111 | pvmw->pte);
| ~~~~~~~~~~Thanks!
Cheers,
Miguel
Miguel Ojeda wrote on Sat, Sep 05, 2026 at 01:41:11PM +0200:
Quoted 6 lines
I see the same arm32 build issue:
mm/page_vma_mapped.c:110:11: error: call to undeclared function 'huge_ptep_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
110 | ptent = huge_ptep_get(pvmw->vma->vm_mm,pvmw->address,
| ^
Quoted 7 lines
In addition, in UML (
x86_64) there is also nearby:mm/page_vma_mapped.c:110:9: error: assigning to 'pte_t' from incompatible type 'int' 110 | ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | pvmw->pte); | ~~~~~~~~~~
See this 6.12 thread[1] for this build failure (I didn't check but assume it is the same, that missing commit only made it 7.3-rc1 but was also backported to the 7.2 tree, which also explains 7.2 didn't build fail)
---
This builds on master because this commit:f5407e9b697c ("mm/rmap: use huge_ptep_get() in try_to_unmap_one()") added a function declaration in linux/hugetlb.h !CONFIG_HUGETLB_PAGE code:
```
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 817b8b4223fa..95b1b6ee1f96 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1270,6 +1270,8 @@ static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
{
}
+pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
+
static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
{
```The rest of that commit isn't applicable, so we either need to roll that change in 'mm/migrate: use huge_ptep_get() in remove_migration_pte()' or add it separately (or drop that commit)
---
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Dominique
Greg KH
maintainerQuoted 15 lines · Dominique Martinet
Miguel Ojeda wrote on Sat, Sep 05, 2026 at 01:41:11PM +0200:
Quoted 6 lines
I see the same arm32 build issue:
mm/page_vma_mapped.c:110:11: error: call to undeclared function 'huge_ptep_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
110 | ptent = huge_ptep_get(pvmw->vma->vm_mm,pvmw->address,
| ^Quoted 7 lines
In addition, in UML (
x86_64) there is also nearby:mm/page_vma_mapped.c:110:9: error: assigning to 'pte_t' from incompatible type 'int' 110 | ptent = huge_ptep_get(pvmw->vma->vm_mm, pvmw->address, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | pvmw->pte); | ~~~~~~~~~~
Quoted 4 lines
See this 6.12 thread[1] for this build failure (I didn't check but assume it is the same, that missing commit only made it 7.3-rc1 but was also backported to the 7.2 tree, which also explains 7.2 didn't build fail)
I should have this fixed up now, will push out a -rc2 so that you all can test it as I'm away from my big build box at the moment :(
thanks,
greg k-h