6.12.13-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 546/590 selftests/rseq: Fix handling of glibc without rseq support
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathieu Desnoyers <[email protected]>
commit 336d02bc4c6bec5c3d933e5d470a94970f830957 upstream.
When porting librseq commit:
commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection")
from librseq to the kernel selftests, the following line was missed at the end of rseq_init():
rseq_size = get_rseq_kernel_feature_size();
which effectively leaves rseq_size initialized to -1U when glibc does not have rseq support. glibc supports rseq from version 2.35 onwards.
In a following librseq commit
commit c67d198627c2 ("Only set 'rseq_size' on first thread registration")
to mimic the libc behavior, a new approach is taken: don't set the feature size in 'rseq_size' until at least one thread has successfully registered. This allows using 'rseq_size' in fast-paths to test for both registration status and available features. The caveat is that on libc either all threads are registered or none are, while with bare librseq it is the responsability of the user to register all threads using rseq.
This combines the changes from the following librseq git commits:
commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") commit c67d198627c2 ("Only set 'rseq_size' on first thread registration")
--- tools/testing/selftests/rseq/rseq.c | 32 +++++++++++++++++++++++++------- tools/testing/selftests/rseq/rseq.h | 9 ++++++++- 2 files changed, 33 insertions(+), 8 deletions(-)
tools/testing/selftests/rseq/rseq.c +25 -7
@@ -61,7 +61,6 @@ unsigned int rseq_size = -1U;unsigned int rseq_flags;static int rseq_ownership; -static int rseq_reg_success;/* At least one rseq registration has succeded. */ /* Allocate a large area for the TLS. */ #define RSEQ_THREAD_AREA_ALLOC_SIZE 1024
@@ -152,14 +151,27 @@ int rseq_register_current_thread(void) } rc =sys_rseq (&__rseq_abi,get_rseq_min_alloc_size (),0 ,RSEQ_SIG );if (rc) { -if (RSEQ_READ_ONCE (rseq_reg_success)) { +/* +* After at least one thread has registered successfully +* (rseq_size > 0), the registration of other threads should +* never fail. +*/ +if (RSEQ_READ_ONCE (rseq_size) >0 ) {/* Incoherent success/failure within process. */ abort (); }return -1 ; }assert (rseq_current_cpu_raw () >=0 ); -RSEQ_WRITE_ONCE (rseq_reg_success,1 ); + +/* +* The first thread to register sets the rseq_size to mimic the libc +* behavior. +*/ +if (RSEQ_READ_ONCE (rseq_size) ==0 ) { +RSEQ_WRITE_ONCE (rseq_size,get_rseq_kernel_feature_size ()); + } +return 0 ; }
@@ -235,12 +247,18 @@ void rseq_init(void)return ; } rseq_ownership =1 ; -if (!rseq_available ()) { - rseq_size =0 ; -return ; - } + +/* Calculate the offset of the rseq area from the thread pointer. */ rseq_offset = (void *)&__rseq_abi -rseq_thread_pointer (); + +/* rseq flags are deprecated, always set to 0. */ rseq_flags =0 ; + +/* +* Set the size to 0 until at least one thread registers to mimic the +* libc behavior. +*/ + rseq_size =0 ; } static __attribute__((destructor))
tools/testing/selftests/rseq/rseq.h +8 -1
@@ -60,7 +60,14 @@extern ptrdiff_t rseq_offset;/* -* Size of the registered rseq area. 0 if the registration was +* The rseq ABI is composed of extensible feature fields. The extensions +* are done by appending additional fields at the end of the structure. +* The rseq_size defines the size of the active feature set which can be +* used by the application for the current rseq registration. Features +* starting at offset >= rseq_size are inactive and should not be used. +* +* The rseq_size is the intersection between the available allocation +* size for the rseq area and the feature size supported by the kernel. * unsuccessful. */ extern unsigned int rseq_size;
Greg Kroah-Hartman
maintainerPATCH 547/590 selftests/ftrace: Fix to use remount when testing mount GID option
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
commit 159ca65c42d90d5ab98fc31b708b12c0be2c26e0 upstream.
Fix mount_options.tc to use remount option to mount the tracefs. Since the current implementation does not umount the tracefs, this test always fails because of -EBUSY error.
Using remount option will allow us to change the mount option.
--- .../selftests/ftrace/test.d/00basic/mount_options.tc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/ftrace/test.d/00basic/mount_options.tc +4 -4
@@ -15,11 +15,11 @@ find_alternate_gid() { tac /etc/group | grep -v ":$original_gid:" | head -1 | cut -d: -f3 } -mount_tracefs_with_options() { +remount_tracefs_with_options() { local mount_point="$1" local options="$2" - mount -t tracefs -o "$options" nodev "$mount_point" + mount -t tracefs -o "remount,$options" nodev "$mount_point" setup }
@@ -81,7 +81,7 @@ test_gid_mount_option() { # Unmount existing tracefs instance and mount with new GID unmount_tracefs "$mount_point" - mount_tracefs_with_options "$mount_point" "$new_options" + remount_tracefs_with_options "$mount_point" "$new_options" check_gid "$mount_point" "$other_group"
@@ -92,7 +92,7 @@ test_gid_mount_option() { # Unmount and remount with the original GID unmount_tracefs "$mount_point" - mount_tracefs_with_options "$mount_point" "$mount_options" + remount_tracefs_with_options "$mount_point" "$mount_options" check_gid "$mount_point" "$original_group" }
Signature · 1 line
2.48.1
Greg Kroah-Hartman
maintainerPATCH 548/590 ktest.pl: Check kernelrelease return in get_version
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo B. Marliere <[email protected]>
commit a4e17a8f239a545c463f8ec27db4ed6e74b31841 upstream.
In the case of a test that uses the special option ${KERNEL_VERSION} in one of its settings but has no configuration available in ${OUTPUT_DIR}, for example if it's a new empty directory, then the make kernelrelease call will fail and the subroutine will chomp an empty string, silently. Fix that by adding an empty configuration and retrying.
--- tools/testing/ktest/ktest.pl | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/ktest/ktest.pl +5 -0
@@ -2419,6 +2419,11 @@ sub get_version { return if ($have_version); doprint "$make kernelrelease ... "; $version = `$make -s kernelrelease | tail -1`; + if (!length($version)) { + run_command "$make allnoconfig" or return 0; + doprint "$make kernelrelease ... "; + $version = `$make -s kernelrelease | tail -1`; + } chomp($version); doprint "$version\n"; $have_version = 1;
Greg Kroah-Hartman
maintainerPATCH 549/590 xfs: check for dead buffers in xfs_buf_find_insert
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
commit 07eae0fa67ca4bbb199ad85645e0f9dfaef931cd upstream.
Commit 32dd4f9c506b ("xfs: remove a superflous hash lookup when inserting new buffers") converted xfs_buf_find_insert to use rhashtable_lookup_get_insert_fast and thus an operation that returns the existing buffer when an insert would duplicate the hash key. But this code path misses the check for a buffer with a reference count of zero, which could lead to reusing an about to be freed buffer. Fix this by using the same atomic_inc_not_zero pattern as xfs_buf_insert.
--- fs/xfs/xfs_buf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/xfs_buf.c +1 -2
@@ -663,9 +663,8 @@ xfs_buf_find_insert(spin_unlock (&bch->bc_lock); goto out_free_buf; } -if (bp) { +if (bp &&atomic_inc_not_zero (&bp->b_hold)) {/* found an existing buffer */ -atomic_inc (&bp->b_hold);spin_unlock (&bch->bc_lock); error =xfs_buf_find_lock (bp, flags);if (error)
Greg Kroah-Hartman
maintainerPATCH 550/590 xfs: dont shut down the filesystem for media failures beyond end of log
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit f4ed93037966aea07ae6b10ab208976783d24e2e upstream.
If the filesystem has an external log device on pmem and the pmem reports a media error beyond the end of the log area, don't shut down the filesystem because we don't use that space.
--- fs/xfs/xfs_notify_failure.c | 121 +++++++++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 39 deletions(-)
fs/xfs/xfs_notify_failure.c +82 -39
@@ -154,6 +154,79 @@ xfs_dax_notify_failure_thaw( }static int +xfs_dax_translate_range ( +struct xfs_buftarg *btp, +u64 offset, +u64 len, +xfs_daddr_t *daddr, +uint64_t *bblen) +{ +u64 dev_start = btp->bt_dax_part_off; +u64 dev_len =bdev_nr_bytes (btp->bt_bdev); +u64 dev_end = dev_start + dev_len -1 ; + +/* Notify failure on the whole device. */ +if (offset ==0 && len ==U64_MAX ) { + offset = dev_start; + len = dev_len; + } + +/* Ignore the range out of filesystem area */ +if (offset + len -1 < dev_start) +return -ENXIO ; +if (offset > dev_end) +return -ENXIO ; + +/* Calculate the real range when it touches the boundary */ +if (offset > dev_start) + offset -= dev_start; +else { + len -= dev_start - offset; + offset =0 ; + } +if (offset + len -1 > dev_end) + len = dev_end - offset +1 ; + + *daddr =BTOBB (offset); + *bblen =BTOBB (len); +return 0 ; +} + +static int +xfs_dax_notify_logdev_failure ( +struct xfs_mount *mp, +u64 offset, +u64 len, +int mf_flags) +{ +xfs_daddr_t daddr; +uint64_t bblen; +int error; + +/* +* Return ENXIO instead of shutting down the filesystem if the failed +* region is beyond the end of the log. +*/ + error =xfs_dax_translate_range (mp->m_logdev_targp, + offset, len, &daddr, &bblen); +if (error) +return error; + +/* +* In the pre-remove case the failure notification is attempting to +* trigger a force unmount. The expectation is that the device is +* still present, but its removal is in progress and can not be +* cancelled, proceed with accessing the log device. +*/ +if (mf_flags &MF_MEM_PRE_REMOVE ) +return 0 ; + +xfs_err (mp,"ondisk log corrupt, shutting down fs!" ); +xfs_force_shutdown (mp,SHUTDOWN_CORRUPT_ONDISK ); +return -EFSCORRUPTED ; +} + +static int xfs_dax_notify_ddev_failure( struct xfs_mount *mp, xfs_daddr_t daddr,
@@ -263,8 +336,9 @@ xfs_dax_notify_failure( int mf_flags) {struct xfs_mount *mp =dax_holder (dax_dev); -u64 ddev_start; -u64 ddev_end; +xfs_daddr_t daddr; +uint64_t bblen; +int error;if (!(mp->m_super->s_flags &SB_BORN )) {xfs_warn (mp,"filesystem is not ready for notify_failure()!" );
@@ -279,17 +353,7 @@ xfs_dax_notify_failure(if (mp->m_logdev_targp && mp->m_logdev_targp->bt_daxdev == dax_dev && mp->m_logdev_targp != mp->m_ddev_targp) { -/* -* In the pre-remove case the failure notification is attempting -* to trigger a force unmount. The expectation is that the -* device is still present, but its removal is in progress and -* can not be cancelled, proceed with accessing the log device. -*/ -if (mf_flags &MF_MEM_PRE_REMOVE ) -return 0 ; -xfs_err (mp,"ondisk log corrupt, shutting down fs!" ); -xfs_force_shutdown (mp,SHUTDOWN_CORRUPT_ONDISK ); -return -EFSCORRUPTED ; +return xfs_dax_notify_logdev_failure (mp, offset, len, mf_flags); }if (!xfs_has_rmapbt (mp)) {
@@ -297,33 +361,12 @@ xfs_dax_notify_failure(return -EOPNOTSUPP ; } - ddev_start = mp->m_ddev_targp->bt_dax_part_off; - ddev_end = ddev_start +bdev_nr_bytes (mp->m_ddev_targp->bt_bdev) -1 ; - -/* Notify failure on the whole device. */ -if (offset ==0 && len ==U64_MAX ) { - offset = ddev_start; - len =bdev_nr_bytes (mp->m_ddev_targp->bt_bdev); - } - -/* Ignore the range out of filesystem area */ -if (offset + len -1 < ddev_start) -return -ENXIO ; -if (offset > ddev_end) -return -ENXIO ; - -/* Calculate the real range when it touches the boundary */ -if (offset > ddev_start) - offset -= ddev_start; -else { - len -= ddev_start - offset; - offset =0 ; - } -if (offset + len -1 > ddev_end) - len = ddev_end - offset +1 ; + error =xfs_dax_translate_range (mp->m_ddev_targp, offset, len, &daddr, + &bblen); +if (error) +return error; -return xfs_dax_notify_ddev_failure (mp,BTOBB (offset),BTOBB (len), - mf_flags); +return xfs_dax_notify_ddev_failure (mp, daddr, bblen, mf_flags); }const struct dax_holder_operations xfs_dax_holder_operations = {
Greg Kroah-Hartman
maintainerPATCH 551/590 ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lianqin Hu <[email protected]>
commit d85fc52cbb9a719c8335d93a28d6a79d7acd419f upstream.
Audio control requests that sets sampling frequency sometimes fail on this card. Adding delay between control messages eliminates that problem.
usb 1-1: New USB device found, idVendor=2fc6, idProduct=f0b7 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: iBasso DC07 Pro
usb 1-1: Manufacturer: iBasso
usb 1-1: SerialNumber: CTUA171130B
--- sound/usb/quirks.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/quirks.c +2 -0
@@ -2343,6 +2343,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_CTL_MSG_DELAY_1M),DEVICE_FLG (0x2d95 ,0x8021 ,/* VIVO USB-C-XE710 HEADSET */ QUIRK_FLAG_CTL_MSG_DELAY_1M ), +DEVICE_FLG (0x2fc6 ,0xf0b7 ,/* iBasso DC07 Pro */ +QUIRK_FLAG_CTL_MSG_DELAY_1M ),DEVICE_FLG (0x30be ,0x0101 ,/* Schiit Hel */ QUIRK_FLAG_IGNORE_CTL_ERROR ), DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
Greg Kroah-Hartman
maintainerPATCH 552/590 net: usb: rtl8150: enable basic endpoint checking
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
commit 90b7f2961798793275b4844348619b622f983907 upstream.
Syzkaller reports [1] encountering a common issue of utilizing a wrong usb endpoint type during URB submitting stage. This, in turn, triggers a warning shown below.
For now, enable simple endpoint checking (specifically, bulk and interrupt eps, testing control one is not essential) to mitigate the issue with a view to do other related cosmetic changes later, if they are necessary.
[1] Syzkaller report:
usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: CPU: 1 PID: 2586 at drivers/usb/core/urb.c:503 usb_submit_urb+0xe4b/0x1730 driv> Modules linked in: CPU: 1 UID: 0 PID: 2586 Comm: dhcpcd Not tainted 6.11.0-rc4-syzkaller-00069-gfc88bb11617> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:usb_submit_urb+0xe4b/0x1730 drivers/usb/core/urb.c:503 Code: 84 3c 02 00 00 e8 05 e4 fc fc 4c 89 ef e8 fd 25 d7 fe 45 89 e0 89 e9 4c 89 f2 48 8> RSP: 0018:ffffc9000441f740 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff888112487a00 RCX: ffffffff811a99a9 RDX: ffff88810df6ba80 RSI: ffffffff811a99b6 RDI: 0000000000000001 RBP: 0000000000000003 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: ffff8881023bf0a8 R14: ffff888112452a20 R15: ffff888112487a7c FS: 00007fc04eea5740(0000) GS:ffff8881f6300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0a1de9f870 CR3: 000000010dbd0000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> rtl8150_open+0x300/0xe30 drivers/net/usb/rtl8150.c:733 __dev_open+0x2d4/0x4e0 net/core/dev.c:1474 __dev_change_flags+0x561/0x720 net/core/dev.c:8838 dev_change_flags+0x8f/0x160 net/core/dev.c:8910 devinet_ioctl+0x127a/0x1f10 net/ipv4/devinet.c:1177 inet_ioctl+0x3aa/0x3f0 net/ipv4/af_inet.c:1003 sock_do_ioctl+0x116/0x280 net/socket.c:1222 sock_ioctl+0x22e/0x6c0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc04ef73d49
...
This change has not been tested on real hardware.
--- drivers/net/usb/rtl8150.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/net/usb/rtl8150.c +22 -0
@@ -71,6 +71,14 @@#define MSR_SPEED (1<<3)#define MSR_LINK (1<<2) +/* USB endpoints */ +enum rtl8150_usb_ep { +RTL8150_USB_EP_CONTROL =0 , +RTL8150_USB_EP_BULK_IN =1 , +RTL8150_USB_EP_BULK_OUT =2 , +RTL8150_USB_EP_INT_IN =3 , +}; +/* Interrupt pipe data */ #define INT_TSR 0x00#define INT_RSR 0x01
@@ -867,6 +875,13 @@ static int rtl8150_probe(struct usb_intestruct usb_device *udev =interface_to_usbdev (intf);rtl8150_t *dev;struct net_device *netdev; +static const u8 bulk_ep_addr[] = { +RTL8150_USB_EP_BULK_IN |USB_DIR_IN , +RTL8150_USB_EP_BULK_OUT |USB_DIR_OUT , +0 }; +static const u8 int_ep_addr[] = { +RTL8150_USB_EP_INT_IN |USB_DIR_IN , +0 }; netdev =alloc_etherdev (sizeof (rtl8150_t));if (!netdev)
@@ -880,6 +895,13 @@ static int rtl8150_probe(struct usb_intereturn -ENOMEM ; } +/* Verify that all required endpoints are present */ +if (!usb_check_bulk_endpoints (intf, bulk_ep_addr) || + !usb_check_int_endpoints (intf, int_ep_addr)) { +dev_err (&intf->dev,"couldn't find required endpoints\n" ); + goto out; + } +tasklet_setup (&dev->tl, rx_fixup);spin_lock_init (&dev->rx_pool_lock);
Greg Kroah-Hartman
maintainerPATCH 553/590 usb: xhci: Fix NULL pointer dereference on certain command aborts
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Pecio <[email protected]>
commit 1e0a19912adb68a4b2b74fd77001c96cd83eb073 upstream.
If a command is queued to the final usable TRB of a ring segment, the enqueue pointer is advanced to the subsequent link TRB and no further. If the command is later aborted, when the abort completion is handled the dequeue pointer is advanced to the first TRB of the next segment.
If no further commands are queued, xhci_handle_stopped_cmd_ring() sees the ring pointers unequal and assumes that there is a pending command, so it calls xhci_mod_cmd_timer() which crashes if cur_cmd was NULL.
Don't attempt timer setup if cur_cmd is NULL. The subsequent doorbell ring likely is unnecessary too, but it's harmless. Leave it alone.
This is probably Bug 219532, but no confirmation has been received.
The issue has been independently reproduced and confirmed fixed using a USB MCU programmed to NAK the Status stage of SET_ADDRESS forever. Everything continued working normally after several prevented crashes.
--- drivers/usb/host/xhci-ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-ring.c +2 -1
@@ -422,7 +422,8 @@ static void xhci_handle_stopped_cmd_ringif ((xhci->cmd_ring->dequeue != xhci->cmd_ring->enqueue) && !(xhci->xhc_state &XHCI_STATE_DYING )) { xhci->current_cmd = cur_cmd; -xhci_mod_cmd_timer (xhci); +if (cur_cmd) +xhci_mod_cmd_timer (xhci);xhci_ring_cmd_db (xhci); } }
Greg Kroah-Hartman
maintainerPATCH 554/590 drivers/card_reader/rtsx_usb: Restore interrupt based detection
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Rhodes <[email protected]>
commit 235b630eda072d7e7b102ab346d6b8a2c028a772 upstream.
This commit reintroduces interrupt-based card detection previously used in the rts5139 driver. This functionality was removed in commit 00d8521dcd23 ("staging: remove rts5139 driver code").
Reintroducing this mechanism fixes presence detection for certain card readers, which with the current driver, will taken approximately 20 seconds to enter S3 as mmc_rescan has to be frozen.
--- drivers/misc/cardreader/rtsx_usb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/misc/cardreader/rtsx_usb.c +15 -0
@@ -286,6 +286,7 @@ static int rtsx_usb_get_status_with_bulkint rtsx_usb_get_card_status (struct rtsx_ucr *ucr,u16 *status) {int ret; +u8 interrupt_val =0 ;u16 *buf;if (!status)
@@ -308,6 +309,20 @@ int rtsx_usb_get_card_status(struct rtsx ret =rtsx_usb_get_status_with_bulk (ucr, status); } +rtsx_usb_read_register (ucr,CARD_INT_PEND , &interrupt_val); +/* Cross check presence with interrupts */ +if (*status &XD_CD ) +if (!(interrupt_val &XD_INT )) + *status &= ~XD_CD ; + +if (*status &SD_CD ) +if (!(interrupt_val &SD_INT )) + *status &= ~SD_CD ; + +if (*status &MS_CD ) +if (!(interrupt_val &MS_INT )) + *status &= ~MS_CD ; +/* usb_control_msg may return positive when success */ if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 555/590 usb: gadget: f_tcm: Fix Get/SetInterface return value
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit 3b997089903b909684114aca6f79d683e5c64a0e upstream.
Check to make sure that the GetInterface and SetInterface are for valid interface. Return proper alternate setting number on GetInterface.
--- drivers/usb/gadget/function/f_tcm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_tcm.c +10 -2
@@ -2051,9 +2051,14 @@ static void tcm_delayed_set_alt(struct wstatic int tcm_get_alt (struct usb_function *f,unsigned intf) { -if (intf == bot_intf_desc.bInterfaceNumber) +struct f_uas *fu =to_f_uas (f); + +if (fu->iface != intf) +return -EOPNOTSUPP ; + +if (fu->flags &USBG_IS_BOT )return USB_G_ALT_INT_BBB ; -if (intf == uasp_intf_desc.bInterfaceNumber) +else if (fu->flags &USBG_IS_UAS )return USB_G_ALT_INT_UAS ;return -EOPNOTSUPP ;
@@ -2063,6 +2068,9 @@ static int tcm_set_alt(struct usb_functi {struct f_uas *fu =to_f_uas (f); +if (fu->iface != intf) +return -EOPNOTSUPP ; +if ((alt ==USB_G_ALT_INT_BBB ) || (alt ==USB_G_ALT_INT_UAS )) {struct guas_setup_wq *work;
Greg Kroah-Hartman
maintainerPATCH 556/590 usb: dwc3-am62: Fix an OF node leak in phy_syscon_pll_refclk()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
commit a266462b937beba065e934a563efe13dd246a164 upstream.
phy_syscon_pll_refclk() leaks an OF node obtained by of_parse_phandle_with_fixed_args(), thus add an of_node_put() call.
--- drivers/usb/dwc3/dwc3-am62.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-am62.c +1 -0
@@ -166,6 +166,7 @@ static int phy_syscon_pll_refclk(structif (ret)return ret; +of_node_put (args.np); am62->offset = args.args[0 ];/* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */
Greg Kroah-Hartman
maintainerPATCH 557/590 usb: dwc3: core: Defer the probe until USB power supply ready
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Tso <[email protected]>
commit 66e0ea341a2a78d14336117f19763bd9be26d45d upstream.
Currently, DWC3 driver attempts to acquire the USB power supply only once during the probe. If the USB power supply is not ready at that time, the driver simply ignores the failure and continues the probe, leading to permanent non-functioning of the gadget vbus_draw callback.
Address this problem by delaying the dwc3 driver initialization until the USB power supply is registered.
--- drivers/usb/dwc3/core.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-)
drivers/usb/dwc3/core.c +21 -9
@@ -1660,8 +1660,6 @@ static void dwc3_get_properties(struct du8 tx_thr_num_pkt_prd =0 ;u8 tx_max_burst_prd =0 ;u8 tx_fifo_resize_max_num; -const char *usb_psy_name; -int ret;/* default to highest possible threshold */ lpm_nyet_threshold =0xf ;
@@ -1696,13 +1694,6 @@ static void dwc3_get_properties(struct d dwc->sys_wakeup =device_may_wakeup (dwc->sysdev); - ret =device_property_read_string (dev,"usb-psy-name" , &usb_psy_name); -if (ret >=0 ) { - dwc->usb_psy =power_supply_get_by_name (usb_psy_name); -if (!dwc->usb_psy) -dev_err (dev,"couldn't get usb power supply\n" ); - } - dwc->has_lpm_erratum =device_property_read_bool (dev,"snps,has-lpm-erratum" ); device_property_read_u8(dev, "snps,lpm-nyet-threshold",
@@ -2105,6 +2096,23 @@ static int dwc3_get_num_ports(struct dwcreturn 0 ; } +static struct power_supply *dwc3_get_usb_power_supply (struct dwc3 *dwc) +{ +struct power_supply *usb_psy; +const char *usb_psy_name; +int ret; + + ret =device_property_read_string (dwc->dev,"usb-psy-name" , &usb_psy_name); +if (ret <0 ) +return NULL ; + + usb_psy =power_supply_get_by_name (usb_psy_name); +if (!usb_psy) +return ERR_PTR (-EPROBE_DEFER ); + +return usb_psy; +} +static int dwc3_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
@@ -2161,6 +2169,10 @@ static int dwc3_probe(struct platform_dedwc3_get_software_properties (dwc); + dwc->usb_psy =dwc3_get_usb_power_supply (dwc); +if (IS_ERR (dwc->usb_psy)) +return dev_err_probe (dev,PTR_ERR (dwc->usb_psy),"couldn't get usb power supply\n" ); + dwc->reset =devm_reset_control_array_get_optional_shared (dev);if (IS_ERR (dwc->reset)) { ret =PTR_ERR (dwc->reset);
Greg Kroah-Hartman
maintainerPATCH 558/590 usb: dwc3: Skip resume if pm_runtime_set_active() fails
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ray Chi <[email protected]>
commit e3a9bd247cddfb6fa0c29c2361f70b76c359eaa0 upstream.
When the system begins to enter suspend mode, dwc3_suspend() is called by PM suspend. There is a problem that if someone interrupt the system suspend process between dwc3_suspend() and pm_suspend() of its parent device, PM suspend will be canceled and attempt to resume suspended devices so that dwc3_resume() will be called. However, dwc3 and its parent device (like the power domain or glue driver) may already be suspended by runtime PM in fact. If this sutiation happened, the pm_runtime_set_active() in dwc3_resume() will return an error since parent device was suspended. This can lead to unexpected behavior if DWC3 proceeds to execute dwc3_resume_common().
EX.
RPM suspend: ... -> dwc3_runtime_suspend()
-> rpm_suspend() of parent device
...
PM suspend: ... -> dwc3_suspend() -> pm_suspend of parent device
^ interrupt, so resume suspended device
... <- dwc3_resume() <-/
^ pm_runtime_set_active() returns error
To prevent the problem, this commit will skip dwc3_resume_common() and return the error if pm_runtime_set_active() fails.
--- drivers/usb/dwc3/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +4 -1
@@ -2597,12 +2597,15 @@ static int dwc3_resume(struct device *depinctrl_pm_select_default_state (dev);pm_runtime_disable (dev); -pm_runtime_set_active (dev); + ret =pm_runtime_set_active (dev); +if (ret) + goto out; ret =dwc3_resume_common (dwc,PMSG_RESUME );if (ret)pm_runtime_set_suspended (dev); +out:pm_runtime_enable (dev);return ret;
Greg Kroah-Hartman
maintainerPATCH 559/590 usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jos Wang <[email protected]>
commit 2eb3da037c2c20fa30bc502bc092479b2a1aaae2 upstream.
As PD2.0 spec ("8.3.3.2.3 PE_SRC_Send_Capabilities state"), after the Source receives the GoodCRC Message from the Sink in response to the Source_Capabilities message, it should start the SenderResponseTimer, after the timer times out, the state machine transitions to the HARD_RESET state.
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
@@ -4757,7 +4757,7 @@ static void run_state_machine(struct tcp port->caps_count =0 ; port->pd_capable = true;tcpm_set_state_cond (port,SRC_SEND_CAPABILITIES_TIMEOUT , -PD_T_SEND_SOURCE_CAP ); +PD_T_SENDER_RESPONSE ); }break ;case SRC_SEND_CAPABILITIES_TIMEOUT :
Greg Kroah-Hartman
maintainerPATCH 560/590 usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Tso <[email protected]>
commit 4d27afbf256028a1f54363367f30efc8854433c3 upstream.
The Source can drop its output voltage to the minimum of the requested PPS APDO voltage range when it is in Current Limit Mode. If this voltage falls within the range of vPpsShutdown, the Source initiates a Hard Reset and discharges Vbus. However, currently the Sink may disconnect before the voltage reaches vPpsShutdown, leading to unexpected behavior.
Prevent premature disconnection by setting the Sink's disconnect threshold to the minimum vPpsShutdown value. Additionally, consider the voltage drop due to IR drop when calculating the appropriate threshold. This ensures a robust and reliable interaction between the Source and Sink during SPR PPS Current Limit Mode operation.
--- drivers/usb/typec/tcpm/tcpci.c | 13 +++++++++---- drivers/usb/typec/tcpm/tcpm.c | 8 +++++--- include/linux/usb/tcpm.h | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-)
drivers/usb/typec/tcpm/tcpci.c +9 -4
@@ -27,6 +27,7 @@#define VPPS_NEW_MIN_PERCENT 95#define VPPS_VALID_MIN_MV 100#define VSINKDISCONNECT_PD_MIN_PERCENT 90 +#define VPPS_SHUTDOWN_MIN_PERCENT 85struct tcpci {struct device *dev;
@@ -366,7 +367,8 @@ static int tcpci_enable_auto_vbus_discha }static int tcpci_set_auto_vbus_discharge_threshold (struct tcpc_dev *dev,enum typec_pwr_opmode mode, -bool pps_active,u32 requested_vbus_voltage_mv) +bool pps_active,u32 requested_vbus_voltage_mv, +u32 apdo_min_voltage_mv) {struct tcpci *tcpci =tcpc_to_tcpci (dev);unsigned int pwr_ctrl, threshold =0 ;
@@ -388,9 +390,12 @@ static int tcpci_set_auto_vbus_discharge threshold =AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV ; }else if (mode ==TYPEC_PWR_MODE_PD ) {if (pps_active) - threshold = ((VPPS_NEW_MIN_PERCENT * requested_vbus_voltage_mv /100 ) - -VSINKPD_MIN_IR_DROP_MV -VPPS_VALID_MIN_MV ) * -VSINKDISCONNECT_PD_MIN_PERCENT /100 ; +/* +* To prevent disconnect when the source is in Current Limit Mode. +* Set the threshold to the lowest possible voltage vPpsShutdown (min) +*/ + threshold =VPPS_SHUTDOWN_MIN_PERCENT * apdo_min_voltage_mv /100 - +VSINKPD_MIN_IR_DROP_MV ;else threshold = ((VSRC_NEW_MIN_PERCENT * requested_vbus_voltage_mv /100 ) - VSINKPD_MIN_IR_DROP_MV - VSRC_VALID_MIN_MV) *
drivers/usb/typec/tcpm/tcpm.c +5 -3
@@ -2928,10 +2928,12 @@ static int tcpm_set_auto_vbus_discharge_return 0 ; ret = port->tcpc->set_auto_vbus_discharge_threshold (port->tcpc, mode, pps_active, - requested_vbus_voltage); + requested_vbus_voltage, + port->pps_data.min_volt);tcpm_log_force (port, -"set_auto_vbus_discharge_threshold mode:%d pps_active:%c vbus:%u ret:%d" , - mode, pps_active ?'y' :'n' , requested_vbus_voltage, ret); +"set_auto_vbus_discharge_threshold mode:%d pps_active:%c vbus:%u pps_apdo_min_volt:%u ret:%d" , + mode, pps_active ?'y' :'n' , requested_vbus_voltage, + port->pps_data.min_volt, ret);return ret; }
include/linux/usb/tcpm.h +2 -1
@@ -163,7 +163,8 @@ struct tcpc_dev {void (*frs_sourcing_vbus)(struct tcpc_dev *dev);int (*enable_auto_vbus_discharge)(struct tcpc_dev *dev,bool enable);int (*set_auto_vbus_discharge_threshold)(struct tcpc_dev *dev,enum typec_pwr_opmode mode, -bool pps_active,u32 requested_vbus_voltage); +bool pps_active,u32 requested_vbus_voltage, +u32 pps_apdo_min_voltage);bool (*is_vbus_vsafe0v)(struct tcpc_dev *dev);void (*set_partner_usb_comm_capable)(struct tcpc_dev *dev,bool enable);void (*check_contaminant)(struct tcpc_dev *dev);
Greg Kroah-Hartman
maintainerPATCH 561/590 clk: qcom: gcc-x1e80100: Do not turn off usb_2 controller GDSC
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <[email protected]>
commit d26c4ad3fa53e76a602a9974ade171c8399f2a29 upstream.
Allowing the usb_2 controller GDSC to be turned off during system suspend renders the controller unable to resume.
So use PWRSTS_RET_ON instead in order to make sure this the GDSC doesn't go down.
--- drivers/clk/qcom/gcc-x1e80100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/gcc-x1e80100.c +1 -1
@@ -6083,7 +6083,7 @@ static struct gdsc gcc_usb20_prim_gdsc = .pd = { .name = "gcc_usb20_prim_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
Greg Kroah-Hartman
maintainerPATCH 562/590 mptcp: consolidate suboption status
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
commit c86b000782daba926c627d2fa00c3f60a75e7472 upstream.
MPTCP maintains the received sub-options status is the bitmask carrying the received suboptions and in several bitfields carrying per suboption additional info.
Zeroing the bitmask before parsing is not enough to ensure a consistent status, and the MPTCP code has to additionally clear some bitfiled depending on the actually parsed suboption.
The above schema is fragile, and syzbot managed to trigger a path where a relevant bitfield is not cleared/initialized:
BUG: KMSAN: uninit-value in __mptcp_expand_seq net/mptcp/options.c:1030 [inline] BUG: KMSAN: uninit-value in mptcp_expand_seq net/mptcp/protocol.h:864 [inline] BUG: KMSAN: uninit-value in ack_update_msk net/mptcp/options.c:1060 [inline] BUG: KMSAN: uninit-value in mptcp_incoming_options+0x2036/0x3d30 net/mptcp/options.c:1209 __mptcp_expand_seq net/mptcp/options.c:1030 [inline] mptcp_expand_seq net/mptcp/protocol.h:864 [inline] ack_update_msk net/mptcp/options.c:1060 [inline] mptcp_incoming_options+0x2036/0x3d30 net/mptcp/options.c:1209 tcp_data_queue+0xb4/0x7be0 net/ipv4/tcp_input.c:5233 tcp_rcv_established+0x1061/0x2510 net/ipv4/tcp_input.c:6264 tcp_v4_do_rcv+0x7f3/0x11a0 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x51df/0x5750 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x2a3/0x13d0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x336/0x500 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_rcv_finish+0x4a2/0x520 net/ipv4/ip_input.c:447 NF_HOOK include/linux/netfilter.h:314 [inline] ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:567 __netif_receive_skb_one_core net/core/dev.c:5704 [inline] __netif_receive_skb+0x319/0xa00 net/core/dev.c:5817 process_backlog+0x4ad/0xa50 net/core/dev.c:6149 __napi_poll+0xe7/0x980 net/core/dev.c:6902 napi_poll net/core/dev.c:6971 [inline] net_rx_action+0xa5a/0x19b0 net/core/dev.c:7093 handle_softirqs+0x1a0/0x7c0 kernel/softirq.c:561 __do_softirq+0x14/0x1a kernel/softirq.c:595 do_softirq+0x9a/0x100 kernel/softirq.c:462 __local_bh_enable_ip+0x9f/0xb0 kernel/softirq.c:389 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:919 [inline] __dev_queue_xmit+0x2758/0x57d0 net/core/dev.c:4493 dev_queue_xmit include/linux/netdevice.h:3168 [inline] neigh_hh_output include/net/neighbour.h:523 [inline] neigh_output include/net/neighbour.h:537 [inline] ip_finish_output2+0x187c/0x1b70 net/ipv4/ip_output.c:236 __ip_finish_output+0x287/0x810 ip_finish_output+0x4b/0x600 net/ipv4/ip_output.c:324 NF_HOOK_COND include/linux/netfilter.h:303 [inline] ip_output+0x15f/0x3f0 net/ipv4/ip_output.c:434 dst_output include/net/dst.h:450 [inline] ip_local_out net/ipv4/ip_output.c:130 [inline] __ip_queue_xmit+0x1f2a/0x20d0 net/ipv4/ip_output.c:536 ip_queue_xmit+0x60/0x80 net/ipv4/ip_output.c:550 __tcp_transmit_skb+0x3cea/0x4900 net/ipv4/tcp_output.c:1468 tcp_transmit_skb net/ipv4/tcp_output.c:1486 [inline] tcp_write_xmit+0x3b90/0x9070 net/ipv4/tcp_output.c:2829 __tcp_push_pending_frames+0xc4/0x380 net/ipv4/tcp_output.c:3012 tcp_send_fin+0x9f6/0xf50 net/ipv4/tcp_output.c:3618 __tcp_close+0x140c/0x1550 net/ipv4/tcp.c:3130 __mptcp_close_ssk+0x74e/0x16f0 net/mptcp/protocol.c:2496 mptcp_close_ssk+0x26b/0x2c0 net/mptcp/protocol.c:2550 mptcp_pm_nl_rm_addr_or_subflow+0x635/0xd10 net/mptcp/pm_netlink.c:889 mptcp_pm_nl_rm_subflow_received net/mptcp/pm_netlink.c:924 [inline] mptcp_pm_flush_addrs_and_subflows net/mptcp/pm_netlink.c:1688 [inline] mptcp_nl_flush_addrs_list net/mptcp/pm_netlink.c:1709 [inline] mptcp_pm_nl_flush_addrs_doit+0xe10/0x1630 net/mptcp/pm_netlink.c:1750 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x1214/0x12c0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2542 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1347 netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x30f/0x380 net/socket.c:726 ____sys_sendmsg+0x877/0xb60 net/socket.c:2583 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2637 __sys_sendmsg net/socket.c:2669 [inline] __do_sys_sendmsg net/socket.c:2674 [inline] __se_sys_sendmsg net/socket.c:2672 [inline] __x64_sys_sendmsg+0x212/0x3c0 net/socket.c:2672 x64_sys_call+0x2ed6/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:47 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was stored to memory at:
mptcp_get_options+0x2c0f/0x2f20 net/mptcp/options.c:397 mptcp_incoming_options+0x19a/0x3d30 net/mptcp/options.c:1150 tcp_data_queue+0xb4/0x7be0 net/ipv4/tcp_input.c:5233 tcp_rcv_established+0x1061/0x2510 net/ipv4/tcp_input.c:6264 tcp_v4_do_rcv+0x7f3/0x11a0 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x51df/0x5750 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x2a3/0x13d0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x336/0x500 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_rcv_finish+0x4a2/0x520 net/ipv4/ip_input.c:447 NF_HOOK include/linux/netfilter.h:314 [inline] ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:567 __netif_receive_skb_one_core net/core/dev.c:5704 [inline] __netif_receive_skb+0x319/0xa00 net/core/dev.c:5817 process_backlog+0x4ad/0xa50 net/core/dev.c:6149 __napi_poll+0xe7/0x980 net/core/dev.c:6902 napi_poll net/core/dev.c:6971 [inline] net_rx_action+0xa5a/0x19b0 net/core/dev.c:7093 handle_softirqs+0x1a0/0x7c0 kernel/softirq.c:561 __do_softirq+0x14/0x1a kernel/softirq.c:595
Uninit was stored to memory at:
put_unaligned_be32 include/linux/unaligned.h:68 [inline] mptcp_write_options+0x17f9/0x3100 net/mptcp/options.c:1417 mptcp_options_write net/ipv4/tcp_output.c:465 [inline] tcp_options_write+0x6d9/0xe90 net/ipv4/tcp_output.c:759 __tcp_transmit_skb+0x294b/0x4900 net/ipv4/tcp_output.c:1414 tcp_transmit_skb net/ipv4/tcp_output.c:1486 [inline] tcp_write_xmit+0x3b90/0x9070 net/ipv4/tcp_output.c:2829 __tcp_push_pending_frames+0xc4/0x380 net/ipv4/tcp_output.c:3012 tcp_send_fin+0x9f6/0xf50 net/ipv4/tcp_output.c:3618 __tcp_close+0x140c/0x1550 net/ipv4/tcp.c:3130 __mptcp_close_ssk+0x74e/0x16f0 net/mptcp/protocol.c:2496 mptcp_close_ssk+0x26b/0x2c0 net/mptcp/protocol.c:2550 mptcp_pm_nl_rm_addr_or_subflow+0x635/0xd10 net/mptcp/pm_netlink.c:889 mptcp_pm_nl_rm_subflow_received net/mptcp/pm_netlink.c:924 [inline] mptcp_pm_flush_addrs_and_subflows net/mptcp/pm_netlink.c:1688 [inline] mptcp_nl_flush_addrs_list net/mptcp/pm_netlink.c:1709 [inline] mptcp_pm_nl_flush_addrs_doit+0xe10/0x1630 net/mptcp/pm_netlink.c:1750 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x1214/0x12c0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2542 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1347 netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x30f/0x380 net/socket.c:726 ____sys_sendmsg+0x877/0xb60 net/socket.c:2583 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2637 __sys_sendmsg net/socket.c:2669 [inline] __do_sys_sendmsg net/socket.c:2674 [inline] __se_sys_sendmsg net/socket.c:2672 [inline] __x64_sys_sendmsg+0x212/0x3c0 net/socket.c:2672 x64_sys_call+0x2ed6/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:47 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was stored to memory at:
mptcp_pm_add_addr_signal+0x3d7/0x4c0 mptcp_established_options_add_addr net/mptcp/options.c:666 [inline] mptcp_established_options+0x1b9b/0x3a00 net/mptcp/options.c:884 tcp_established_options+0x2c4/0x7d0 net/ipv4/tcp_output.c:1012 __tcp_transmit_skb+0x5b7/0x4900 net/ipv4/tcp_output.c:1333 tcp_transmit_skb net/ipv4/tcp_output.c:1486 [inline] tcp_write_xmit+0x3b90/0x9070 net/ipv4/tcp_output.c:2829 __tcp_push_pending_frames+0xc4/0x380 net/ipv4/tcp_output.c:3012 tcp_send_fin+0x9f6/0xf50 net/ipv4/tcp_output.c:3618 __tcp_close+0x140c/0x1550 net/ipv4/tcp.c:3130 __mptcp_close_ssk+0x74e/0x16f0 net/mptcp/protocol.c:2496 mptcp_close_ssk+0x26b/0x2c0 net/mptcp/protocol.c:2550 mptcp_pm_nl_rm_addr_or_subflow+0x635/0xd10 net/mptcp/pm_netlink.c:889 mptcp_pm_nl_rm_subflow_received net/mptcp/pm_netlink.c:924 [inline] mptcp_pm_flush_addrs_and_subflows net/mptcp/pm_netlink.c:1688 [inline] mptcp_nl_flush_addrs_list net/mptcp/pm_netlink.c:1709 [inline] mptcp_pm_nl_flush_addrs_doit+0xe10/0x1630 net/mptcp/pm_netlink.c:1750 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x1214/0x12c0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2542 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1347 netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x30f/0x380 net/socket.c:726 ____sys_sendmsg+0x877/0xb60 net/socket.c:2583 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2637 __sys_sendmsg net/socket.c:2669 [inline] __do_sys_sendmsg net/socket.c:2674 [inline] __se_sys_sendmsg net/socket.c:2672 [inline] __x64_sys_sendmsg+0x212/0x3c0 net/socket.c:2672 x64_sys_call+0x2ed6/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:47 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was stored to memory at:
mptcp_pm_add_addr_received+0x95f/0xdd0 net/mptcp/pm.c:235 mptcp_incoming_options+0x2983/0x3d30 net/mptcp/options.c:1169 tcp_data_queue+0xb4/0x7be0 net/ipv4/tcp_input.c:5233 tcp_rcv_state_process+0x2a38/0x49d0 net/ipv4/tcp_input.c:6972 tcp_v4_do_rcv+0xbf9/0x11a0 net/ipv4/tcp_ipv4.c:1939 tcp_v4_rcv+0x51df/0x5750 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x2a3/0x13d0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x336/0x500 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_rcv_finish+0x4a2/0x520 net/ipv4/ip_input.c:447 NF_HOOK include/linux/netfilter.h:314 [inline] ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:567 __netif_receive_skb_one_core net/core/dev.c:5704 [inline] __netif_receive_skb+0x319/0xa00 net/core/dev.c:5817 process_backlog+0x4ad/0xa50 net/core/dev.c:6149 __napi_poll+0xe7/0x980 net/core/dev.c:6902 napi_poll net/core/dev.c:6971 [inline] net_rx_action+0xa5a/0x19b0 net/core/dev.c:7093 handle_softirqs+0x1a0/0x7c0 kernel/softirq.c:561 __do_softirq+0x14/0x1a kernel/softirq.c:595
Local variable mp_opt created at:
mptcp_incoming_options+0x119/0x3d30 net/mptcp/options.c:1127 tcp_data_queue+0xb4/0x7be0 net/ipv4/tcp_input.c:5233
The current schema is too fragile; address the issue grouping all the state-related data together and clearing the whole group instead of just the bitmask. This also cleans-up the code a bit, as there is no need to individually clear "random" bitfield in a couple of places any more.
--- net/mptcp/options.c | 13 +++++-------- net/mptcp/protocol.h | 30 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-)
net/mptcp/options.c +5 -8
@@ -108,7 +108,6 @@ static void mptcp_parse_option(const str mp_opt->suboptions |=OPTION_MPTCP_DSS ; mp_opt->use_map =1 ; mp_opt->mpc_map =1 ; - mp_opt->use_ack =0 ; mp_opt->data_len =get_unaligned_be16 (ptr); ptr +=2 ; }
@@ -157,11 +156,6 @@ static void mptcp_parse_option(const strpr_debug ("DSS\n" ); ptr++; -/* we must clear 'mpc_map' be able to detect MP_CAPABLE -* map vs DSS map in mptcp_incoming_options(), and reconstruct -* map info accordingly -*/ - mp_opt->mpc_map =0 ; flags = (*ptr++) &MPTCP_DSS_FLAG_MASK ; mp_opt->data_fin = (flags &MPTCP_DSS_DATA_FIN ) !=0 ; mp_opt->dsn64 = (flags &MPTCP_DSS_DSN64 ) !=0 ;
@@ -369,8 +363,11 @@ void mptcp_get_options(const struct sk_bconst unsigned char *ptr;int length; -/* initialize option status */ - mp_opt->suboptions =0 ; +/* Ensure that casting the whole status to u32 is efficient and safe */ + BUILD_BUG_ON(sizeof_field(struct mptcp_options_received, status) != sizeof(u32)); +BUILD_BUG_ON (!IS_ALIGNED (offsetof(struct mptcp_options_received , status), +sizeof (u32))); + *(u32 *)&mp_opt->status =0 ; length = (th->doff *4 ) -sizeof (struct tcphdr ); ptr = (const unsigned char *)(th +1 );
net/mptcp/protocol.h +16 -14
@@ -149,22 +149,24 @@ struct mptcp_options_received {u32 subflow_seq;u16 data_len;__sum16 csum; -u16 suboptions; +struct_group (status, + u16 suboptions; + u16 use_map:1, + dsn64:1, + data_fin:1, + use_ack:1, + ack64:1, + mpc_map:1, + reset_reason:4, + reset_transient:1, + echo:1, + backup:1, + deny_join_id0:1, + __unused:2; + ); +u8 join_id;u32 token;u32 nonce; - u16 use_map:1, - dsn64:1, - data_fin:1, - use_ack:1, - ack64:1, - mpc_map:1, - reset_reason:4, - reset_transient:1, - echo:1, - backup:1, - deny_join_id0:1, - __unused:2; -u8 join_id;u64 thmac;u8 hmac[MPTCPOPT_HMAC_LEN ];struct mptcp_addr_info addr;
Greg Kroah-Hartman
maintainerPATCH 563/590 mptcp: pm: only set fullmesh for subflow endp
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit 1bb0d1348546ad059f55c93def34e67cb2a034a6 upstream.
With the in-kernel path-manager, it is possible to change the 'fullmesh' flag. The code in mptcp_pm_nl_fullmesh() expects to change it only on 'subflow' endpoints, to recreate more or less subflows using the linked address.
Unfortunately, the set_flags() hook was a bit more permissive, and allowed 'implicit' endpoints to get the 'fullmesh' flag while it is not allowed before.
That's what syzbot found, triggering the following warning:
WARNING: CPU: 0 PID: 6499 at net/mptcp/pm_netlink.c:1496 __mark_subflow_endp_available net/mptcp/pm_netlink.c:1496 [inline] WARNING: CPU: 0 PID: 6499 at net/mptcp/pm_netlink.c:1496 mptcp_pm_nl_fullmesh net/mptcp/pm_netlink.c:1980 [inline] WARNING: CPU: 0 PID: 6499 at net/mptcp/pm_netlink.c:1496 mptcp_nl_set_flags net/mptcp/pm_netlink.c:2003 [inline] WARNING: CPU: 0 PID: 6499 at net/mptcp/pm_netlink.c:1496 mptcp_pm_nl_set_flags+0x974/0xdc0 net/mptcp/pm_netlink.c:2064 Modules linked in: CPU: 0 UID: 0 PID: 6499 Comm: syz.1.413 Not tainted 6.13.0-rc5-syzkaller-00172-gd1bf27c4e176 #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:__mark_subflow_endp_available net/mptcp/pm_netlink.c:1496 [inline] RIP: 0010:mptcp_pm_nl_fullmesh net/mptcp/pm_netlink.c:1980 [inline] RIP: 0010:mptcp_nl_set_flags net/mptcp/pm_netlink.c:2003 [inline] RIP: 0010:mptcp_pm_nl_set_flags+0x974/0xdc0 net/mptcp/pm_netlink.c:2064 Code: 01 00 00 49 89 c5 e8 fb 45 e8 f5 e9 b8 fc ff ff e8 f1 45 e8 f5 4c 89 f7 be 03 00 00 00 e8 44 1d 0b f9 eb a0 e8 dd 45 e8 f5 90 <0f> 0b 90 e9 17 ff ff ff 89 d9 80 e1 07 38 c1 0f 8c c9 fc ff ff 48 RSP: 0018:ffffc9000d307240 EFLAGS: 00010293 RAX: ffffffff8bb72e03 RBX: 0000000000000000 RCX: ffff88807da88000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000d307430 R08: ffffffff8bb72cf0 R09: 1ffff1100b842a5e R10: dffffc0000000000 R11: ffffed100b842a5f R12: ffff88801e2e5ac0 R13: ffff88805c214800 R14: ffff88805c2152e8 R15: 1ffff1100b842a5d FS: 00005555619f6500(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020002840 CR3: 00000000247e6000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2542 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1347 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:726 ____sys_sendmsg+0x52a/0x7e0 net/socket.c:2583 ___sys_sendmsg net/socket.c:2637 [inline] __sys_sendmsg+0x269/0x350 net/socket.c:2669 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5fe8785d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff571f5558 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5fe8975fa0 RCX: 00007f5fe8785d29 RDX: 0000000000000000 RSI: 0000000020000480 RDI: 0000000000000007 RBP: 00007f5fe8801b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5fe8975fa0 R14: 00007f5fe8975fa0 R15: 00000000000011f4 </TASK>
Here, syzbot managed to set the 'fullmesh' flag on an 'implicit' and used -- according to 'id_avail_bitmap' -- endpoint, causing the PM to try decrement the local_addr_used counter which is only incremented for the 'subflow' endpoint.
Note that 'no type' endpoints -- not 'subflow', 'signal', 'implicit' -- are fine, because their ID will not be marked as used in the 'id_avail' bitmap, and setting 'fullmesh' can help forcing the creation of subflow when receiving an ADD_ADDR.
--- net/mptcp/pm_netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mptcp/pm_netlink.c +2 -1
@@ -2049,7 +2049,8 @@ int mptcp_pm_nl_set_flags(struct sk_buffreturn -EINVAL ; }if ((addr.flags &MPTCP_PM_ADDR_FLAG_FULLMESH ) && - (entry->flags &MPTCP_PM_ADDR_FLAG_SIGNAL )) { + (entry->flags & (MPTCP_PM_ADDR_FLAG_SIGNAL | +MPTCP_PM_ADDR_FLAG_IMPLICIT ))) {spin_unlock_bh (&pernet->lock);GENL_SET_ERR_MSG (info,"invalid addr flags" );return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 564/590 mptcp: handle fastopen disconnect correctly
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
commit 619af16b3b57a3a4ee50b9a30add9ff155541e71 upstream.
Syzbot was able to trigger a data stream corruption:
WARNING: CPU: 0 PID: 9846 at net/mptcp/protocol.c:1024 __mptcp_clean_una+0xddb/0xff0 net/mptcp/protocol.c:1024 Modules linked in: CPU: 0 UID: 0 PID: 9846 Comm: syz-executor351 Not tainted 6.13.0-rc2-syzkaller-00059-g00a5acdbf398 #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 RIP: 0010:__mptcp_clean_una+0xddb/0xff0 net/mptcp/protocol.c:1024 Code: fa ff ff 48 8b 4c 24 18 80 e1 07 fe c1 38 c1 0f 8c 8e fa ff ff 48 8b 7c 24 18 e8 e0 db 54 f6 e9 7f fa ff ff e8 e6 80 ee f5 90 <0f> 0b 90 4c 8b 6c 24 40 4d 89 f4 e9 04 f5 ff ff 44 89 f1 80 e1 07 RSP: 0018:ffffc9000c0cf400 EFLAGS: 00010293 RAX: ffffffff8bb0dd5a RBX: ffff888033f5d230 RCX: ffff888059ce8000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000c0cf518 R08: ffffffff8bb0d1dd R09: 1ffff110170c8928 R10: dffffc0000000000 R11: ffffed10170c8929 R12: 0000000000000000 R13: ffff888033f5d220 R14: dffffc0000000000 R15: ffff8880592b8000 FS: 00007f6e866496c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6e86f491a0 CR3: 00000000310e6000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> __mptcp_clean_una_wakeup+0x7f/0x2d0 net/mptcp/protocol.c:1074 mptcp_release_cb+0x7cb/0xb30 net/mptcp/protocol.c:3493 release_sock+0x1aa/0x1f0 net/core/sock.c:3640 inet_wait_for_connect net/ipv4/af_inet.c:609 [inline] __inet_stream_connect+0x8bd/0xf30 net/ipv4/af_inet.c:703 mptcp_sendmsg_fastopen+0x2a2/0x530 net/mptcp/protocol.c:1755 mptcp_sendmsg+0x1884/0x1b10 net/mptcp/protocol.c:1830 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:726 ____sys_sendmsg+0x52a/0x7e0 net/socket.c:2583 ___sys_sendmsg net/socket.c:2637 [inline] __sys_sendmsg+0x269/0x350 net/socket.c:2669 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6e86ebfe69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 1f 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6e86649168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f6e86f491b8 RCX: 00007f6e86ebfe69 RDX: 0000000030004001 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007f6e86f491b0 R08: 00007f6e866496c0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6e86f491bc R13: 000000000000006e R14: 00007ffe445d9420 R15: 00007ffe445d9508 </TASK>
The root cause is the bad handling of disconnect() generated internally by the MPTCP protocol in case of connect FASTOPEN errors.
Address the issue increasing the socket disconnect counter even on such a case, to allow other threads waiting on the same socket lock to properly error out.
--- net/mptcp/protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +3 -1
@@ -1766,8 +1766,10 @@ static int mptcp_sendmsg_fastopen(struct* see mptcp_disconnect(). * Attempt it again outside the problematic scope. */ -if (!mptcp_disconnect (sk,0 )) +if (!mptcp_disconnect (sk,0 )) { + sk->sk_disconnects++; sk->sk_socket->state =SS_UNCONNECTED ; + } }inet_clear_bit (DEFER_CONNECT , sk);
Greg Kroah-Hartman
maintainerPATCH 565/590 mptcp: blackhole only if 1st SYN retrans w/o MPC is accepted
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit e598d8981fd34470b78a1ae777dbf131b15d5bf2 upstream.
The Fixes commit mentioned this:
Quoted 2 lines
An MPTCP firewall blackhole can be detected if the following SYN retransmission after a fallback to "plain" TCP is accepted.
But in fact, this blackhole was detected if any following SYN retransmissions after a fallback to TCP was accepted.
That's because 'mptcp_subflow_early_fallback()' will set 'request_mptcp' to 0, and 'mpc_drop' will never be reset to 0 after.
This is an issue, because some not so unusual situations might cause the kernel to detect a false-positive blackhole, e.g. a client trying to connect to a server while the network is not ready yet, causing a few SYN retransmissions, before reaching the end server.
--- net/mptcp/ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mptcp/ctrl.c +2 -2
@@ -405,9 +405,9 @@ void mptcp_active_detect_blackhole(strucMPTCP_INC_STATS (sock_net (ssk),MPTCP_MIB_MPCAPABLEACTIVEDROP ); subflow->mpc_drop =1 ;mptcp_subflow_early_fallback (mptcp_sk (subflow->conn), subflow); - }else { - subflow->mpc_drop =0 ; } + }else if (ssk->sk_state ==TCP_SYN_SENT ) { + subflow->mpc_drop =0 ; } }
Greg Kroah-Hartman
maintainerPATCH 566/590 RDMA/mlx5: Fix implicit ODP use after free
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrisious Haddad <[email protected]>
commit d3d930411ce390e532470194296658a960887773 upstream.
Prevent double queueing of implicit ODP mr destroy work by using __xa_cmpxchg() to make sure this is the only time we are destroying this specific mr.
Without this change, we could try to invalidate this mr twice, which in turn could result in queuing a MR work destroy twice, and eventually the second work could execute after the MR was freed due to the first work, causing a user after free and trace below.
refcount_t: underflow; use-after-free.
WARNING: CPU: 2 PID: 12178 at lib/refcount.c:28 refcount_warn_saturate+0x12b/0x130
Modules linked in: bonding ib_ipoib vfio_pci ip_gre geneve nf_tables ip6_gre gre ip6_tunnel tunnel6 ipip tunnel4 ib_umad rdma_ucm mlx5_vfio_pci vfio_pci_core vfio_iommu_type1 mlx5_ib vfio ib_uverbs mlx5_core iptable_raw openvswitch nsh rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc fuse [last unloaded: ib_uverbs]
CPU: 2 PID: 12178 Comm: kworker/u20:5 Not tainted 6.5.0-rc1_net_next_mlx5_58c644e #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
Workqueue: events_unbound free_implicit_child_mr_work [mlx5_ib]
RIP: 0010:refcount_warn_saturate+0x12b/0x130
Code: 48 c7 c7 38 95 2a 82 c6 05 bc c6 fe 00 01 e8 0c 66 aa ff 0f 0b 5b c3 48 c7 c7 e0 94 2a 82 c6 05 a7 c6 fe 00 01 e8 f5 65 aa ff <0f> 0b 5b c3 90 8b 07 3d 00 00 00 c0 74 12 83 f8 01 74 13 8d 50 ff
RSP: 0018:ffff8881008e3e40 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
RDX: ffff88852c91b5c8 RSI: 0000000000000001 RDI: ffff88852c91b5c0
RBP: ffff8881dacd4e00 R08: 00000000ffffffff R09: 0000000000000019
R10: 000000000000072e R11: 0000000063666572 R12: ffff88812bfd9e00
R13: ffff8881c792d200 R14: ffff88810011c005 R15: ffff8881002099c0
FS: 0000000000000000(0000) GS:ffff88852c900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5694b5e000 CR3: 00000001153f6003 CR4: 0000000000370ea0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
? refcount_warn_saturate+0x12b/0x130
free_implicit_child_mr_work+0x180/0x1b0 [mlx5_ib]
process_one_work+0x1cc/0x3c0
worker_thread+0x218/0x3c0
kthread+0xc6/0xf0
ret_from_fork+0x1f/0x30
</TASK>--- drivers/infiniband/hw/mlx5/odp.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
drivers/infiniband/hw/mlx5/odp.c +22 -8
@@ -228,13 +228,27 @@ static void destroy_unused_implicit_chilunsigned long idx =ib_umem_start (odp) >>MLX5_IMR_MTT_SHIFT ;struct mlx5_ib_mr *imr = mr->parent; +/* +* If userspace is racing freeing the parent implicit ODP MR then we can +* loose the race with parent destruction. In this case +* mlx5_ib_free_odp_mr() will free everything in the implicit_children +* xarray so NOP is fine. This child MR cannot be destroyed here because +* we are under its umem_mutex. +*/ if (!refcount_inc_not_zero (&imr->mmkey.usecount))return ; -xa_erase (&imr->implicit_children, idx); +xa_lock (&imr->implicit_children); +if (__xa_cmpxchg (&imr->implicit_children, idx, mr,NULL ,GFP_KERNEL ) != + mr) { +xa_unlock (&imr->implicit_children); +return ; + } +if (MLX5_CAP_ODP (mr_to_mdev (mr)->mdev, mem_page_fault)) -xa_erase (&mr_to_mdev (mr)->odp_mkeys, -mlx5_base_mkey (mr->mmkey.key)); +__xa_erase (&mr_to_mdev (mr)->odp_mkeys, +mlx5_base_mkey (mr->mmkey.key)); +xa_unlock (&imr->implicit_children);/* Freeing a MR is a sleeping operation, so bounce to a work queue */ INIT_WORK (&mr->odp_destroy.work, free_implicit_child_mr_work);
@@ -500,18 +514,18 @@ static struct mlx5_ib_mr *implicit_get_crefcount_inc (&ret->mmkey.usecount); goto out_lock; } -xa_unlock (&imr->implicit_children);if (MLX5_CAP_ODP (dev->mdev, mem_page_fault)) { - ret =xa_store (&dev->odp_mkeys,mlx5_base_mkey (mr->mmkey.key), - &mr->mmkey,GFP_KERNEL ); + ret =__xa_store (&dev->odp_mkeys,mlx5_base_mkey (mr->mmkey.key), + &mr->mmkey,GFP_KERNEL );if (xa_is_err (ret)) { ret =ERR_PTR (xa_err (ret)); -xa_erase (&imr->implicit_children, idx); - goto out_mr; +__xa_erase (&imr->implicit_children, idx); + goto out_lock; } mr->mmkey.type =MLX5_MKEY_IMPLICIT_CHILD ; } +xa_unlock (&imr->implicit_children);mlx5_ib_dbg (mr_to_mdev (imr),"key %x mr %p\n" , mr->mmkey.key, mr);return mr;
Greg Kroah-Hartman
maintainerPATCH 567/590 remoteproc: core: Fix ida_free call while not allocated
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaud Pouliquen <[email protected]>
commit 7378aeb664e5ebc396950b36a1f2dedf5aabec20 upstream.
In the rproc_alloc() function, on error, put_device(&rproc->dev) is called, leading to the call of the rproc_type_release() function. An error can occurs before ida_alloc is called.
In such case in rproc_type_release(), the condition (rproc->index >= 0) is true as rproc->index has been initialized to 0.ida_free() is called reporting a warning:
[ 4.181906] WARNING: CPU: 1 PID: 24 at lib/idr.c:525 ida_free+0x100/0x164 [ 4.186378] stm32-display-dsi 5a000000.dsi: Fixed dependency cycle(s) with /soc/dsi@5a000000/panel@0 [ 4.188854] ida_free called for id=0 which is not allocated. [ 4.198256] mipi-dsi 5a000000.dsi.0: Fixed dependency cycle(s) with /soc/dsi@5a000000 [ 4.203556] Modules linked in: panel_orisetech_otm8009a dw_mipi_dsi_stm(+) gpu_sched dw_mipi_dsi stm32_rproc stm32_crc32 stm32_ipcc(+) optee(+) [ 4.224307] CPU: 1 UID: 0 PID: 24 Comm: kworker/u10:0 Not tainted 6.12.0 #442 [ 4.231481] Hardware name: STM32 (Device Tree Support) [ 4.236627] Workqueue: events_unbound deferred_probe_work_func [ 4.242504] Call trace: [ 4.242522] unwind_backtrace from show_stack+0x10/0x14 [ 4.250218] show_stack from dump_stack_lvl+0x50/0x64 [ 4.255274] dump_stack_lvl from __warn+0x80/0x12c [ 4.260134] __warn from warn_slowpath_fmt+0x114/0x188 [ 4.265199] warn_slowpath_fmt from ida_free+0x100/0x164 [ 4.270565] ida_free from rproc_type_release+0x38/0x60 [ 4.275832] rproc_type_release from device_release+0x30/0xa0 [ 4.281601] device_release from kobject_put+0xc4/0x294 [ 4.286762] kobject_put from rproc_alloc.part.0+0x208/0x28c [ 4.292430] rproc_alloc.part.0 from devm_rproc_alloc+0x80/0xc4 [ 4.298393] devm_rproc_alloc from stm32_rproc_probe+0xd0/0x844 [stm32_rproc] [ 4.305575] stm32_rproc_probe [stm32_rproc] from platform_probe+0x5c/0xbc
Calling ida_alloc earlier in rproc_alloc ensures that the rproc->index is properly set.
--- drivers/remoteproc/remoteproc_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/remoteproc/remoteproc_core.c +7 -7
@@ -2486,6 +2486,13 @@ struct rproc *rproc_alloc(struct device rproc->dev.driver_data = rproc;idr_init (&rproc->notifyids); +/* Assign a unique device index and name */ + rproc->index =ida_alloc (&rproc_dev_index,GFP_KERNEL ); +if (rproc->index <0 ) { +dev_err (dev,"ida_alloc failed: %d\n" , rproc->index); + goto put_device; + } + rproc->name =kstrdup_const (name,GFP_KERNEL );if (!rproc->name) goto put_device;
@@ -2496,13 +2503,6 @@ struct rproc *rproc_alloc(struct deviceif (rproc_alloc_ops (rproc, ops)) goto put_device; -/* Assign a unique device index and name */ - rproc->index =ida_alloc (&rproc_dev_index,GFP_KERNEL ); -if (rproc->index <0 ) { -dev_err (dev,"ida_alloc failed: %d\n" , rproc->index); - goto put_device; - } -dev_set_name (&rproc->dev,"remoteproc%d" , rproc->index);atomic_set (&rproc->power,0 );
Greg Kroah-Hartman
maintainerPATCH 568/590 media: uvcvideo: Fix double free in error path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
commit c6ef3a7fa97ec823a1e1af9085cf13db9f7b3bac upstream.
If the uvc_status_init() function fails to allocate the int_urb, it will free the dev->status pointer but doesn't reset the pointer to NULL. This results in the kfree() call in uvc_status_cleanup() trying to double-free the memory. Fix it by resetting the dev->status pointer to NULL after freeing it.
Reviewed by: Ricardo Ribalda <[email protected]>
--- drivers/media/usb/uvc/uvc_status.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/uvc/uvc_status.c +1 -0
@@ -269,6 +269,7 @@ int uvc_status_init(struct uvc_device *d dev->int_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!dev->int_urb) {kfree (dev->status); + dev->status =NULL ;return -ENOMEM ; }
Greg Kroah-Hartman
maintainerPATCH 569/590 pps: Fix a use-after-free
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Calvin Owens <[email protected]>
commit c79a39dc8d060b9e64e8b0fa9d245d44befeefbe upstream.
On a board running ntpd and gpsd, I'm seeing a consistent use-after-free in sys_exit() from gpsd when rebooting:
pps pps1: removed
------------[ cut here ]------------
kobject: '(null)' (00000000db4bec24): is not initialized, yet kobject_put() is being called.
WARNING: CPU: 2 PID: 440 at lib/kobject.c:734 kobject_put+0x120/0x150
CPU: 2 UID: 299 PID: 440 Comm: gpsd Not tainted 6.11.0-rc6-00308-gb31c44928842 #1
Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : kobject_put+0x120/0x150
lr : kobject_put+0x120/0x150
sp : ffffffc0803d3ae0
x29: ffffffc0803d3ae0 x28: ffffff8042dc9738 x27: 0000000000000001
x26: 0000000000000000 x25: ffffff8042dc9040 x24: ffffff8042dc9440
x23: ffffff80402a4620 x22: ffffff8042ef4bd0 x21: ffffff80405cb600
x20: 000000000008001b x19: ffffff8040b3b6e0 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 696e6920746f6e20
x14: 7369203a29343263 x13: 205d303434542020 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
kobject_put+0x120/0x150
cdev_put+0x20/0x3c
__fput+0x2c4/0x2d8
____fput+0x1c/0x38
task_work_run+0x70/0xfc
do_exit+0x2a0/0x924
do_group_exit+0x34/0x90
get_signal+0x7fc/0x8c0
do_signal+0x128/0x13b4
do_notify_resume+0xdc/0x160
el0_svc+0xd4/0xf8
el0t_64_sync_handler+0x140/0x14c
el0t_64_sync+0x190/0x194
---[ end trace 0000000000000000 ]---...followed by more symptoms of corruption, with similar stacks:
refcount_t: underflow; use-after-free.
kernel BUG at lib/list_debug.c:62!
Kernel panic - not syncing: Oops - BUG: Fatal exception
This happens because pps_device_destruct() frees the pps_device with the embedded cdev immediately after calling cdev_del(), but, as the comment above cdev_del() notes, fops for previously opened cdevs are still callable even after cdev_del() returns. I think this bug has always been there: I can't explain why it suddenly started happening every time I reboot this particular board.
In commit d953e0e837e6 ("pps: Fix a use-after free bug when unregistering a source."), George Spelvin suggested removing the embedded cdev. That seems like the simplest way to fix this, so I've implemented his suggestion, using __register_chrdev() with pps_idr becoming the source of truth for which minor corresponds to which device.
But now that pps_idr defines userspace visibility instead of cdev_add(), we need to be sure the pps->dev refcount can't reach zero while userspace can still find it again. So, the idr_remove() call moves to pps_unregister_cdev(), and pps_idr now holds a reference to pps->dev.
pps_core: source serial1 got cdev (251:1)
<...>
pps pps1: removed
pps_core: unregistering pps1
pps_core: deallocating pps1
--- drivers/pps/clients/pps-gpio.c | 4 - drivers/pps/clients/pps-ktimer.c | 4 - drivers/pps/clients/pps-ldisc.c | 6 - drivers/pps/clients/pps_parport.c | 4 - drivers/pps/kapi.c | 10 +- drivers/pps/kc.c | 10 +- drivers/pps/pps.c | 127 +++++++++++++++++++------------------- drivers/ptp/ptp_ocp.c | 2 include/linux/pps_kernel.h | 3 9 files changed, 87 insertions(+), 83 deletions(-)
drivers/pps/clients/pps-gpio.c +2 -2
@@ -214,8 +214,8 @@ static int pps_gpio_probe(struct platforreturn -EINVAL ; } -dev_info (data->pps->dev,"Registered IRQ %d as PPS source\n" , - data->irq); +dev_dbg (&data->pps->dev,"Registered IRQ %d as PPS source\n" , + data->irq);return 0 ; }
drivers/pps/clients/pps-ktimer.c +2 -2
@@ -56,7 +56,7 @@ static struct pps_source_info pps_ktimer static void __exit pps_ktimer_exit(void) { -dev_info (pps->dev,"ktimer PPS source unregistered\n" ); +dev_dbg (&pps->dev,"ktimer PPS source unregistered\n" );del_timer_sync (&ktimer);pps_unregister_source (pps);
@@ -74,7 +74,7 @@ static int __init pps_ktimer_init(void)timer_setup (&ktimer, pps_ktimer_event,0 );mod_timer (&ktimer, jiffies +HZ ); -dev_info (pps->dev,"ktimer PPS source registered\n" ); +dev_dbg (&pps->dev,"ktimer PPS source registered\n" );return 0 ; }
drivers/pps/clients/pps-ldisc.c +3 -3
@@ -32,7 +32,7 @@ static void pps_tty_dcd_change(struct ttpps_event (pps, &ts, active ?PPS_CAPTUREASSERT :PPS_CAPTURECLEAR ,NULL ); -dev_dbg (pps->dev,"PPS %s at %lu\n" , +dev_dbg (&pps->dev,"PPS %s at %lu\n" , active ?"assert" :"clear" , jiffies); }
@@ -69,7 +69,7 @@ static int pps_tty_open(struct tty_struc goto err_unregister; } -dev_info (pps->dev,"source \"%s\" added\n" , info.path); +dev_dbg (&pps->dev,"source \"%s\" added\n" , info.path);return 0 ;
@@ -89,7 +89,7 @@ static void pps_tty_close(struct tty_strif (WARN_ON (!pps))return ; -dev_info (pps->dev,"removed\n" ); +dev_info (&pps->dev,"removed\n" );pps_unregister_source (pps); }
drivers/pps/clients/pps_parport.c +2 -2
@@ -81,7 +81,7 @@ static void parport_irq(void *handle)/* check the signal (no signal means the pulse is lost this time) */ if (!signal_is_set (port)) {local_irq_restore (flags); -dev_err (dev->pps->dev,"lost the signal\n" ); +dev_err (&dev->pps->dev,"lost the signal\n" ); goto out_assert; }
@@ -98,7 +98,7 @@ static void parport_irq(void *handle)/* timeout */ dev->cw_err++;if (dev->cw_err >=CLEAR_WAIT_MAX_ERRORS ) { -dev_err (dev->pps->dev,"disabled clear edge capture after %d" +dev_err (&dev->pps->dev,"disabled clear edge capture after %d" " timeouts\n" , dev->cw_err); dev->cw =0 ; dev->cw_err =0 ;
drivers/pps/kapi.c +5 -5
@@ -41,7 +41,7 @@ static void pps_add_offset(struct pps_ktstatic void pps_echo_client_default (struct pps_device *pps,int event,void *data) { -dev_info (pps->dev,"echo %s %s\n" , +dev_info (&pps->dev,"echo %s %s\n" , event &PPS_CAPTUREASSERT ?"assert" :"" , event &PPS_CAPTURECLEAR ?"clear" :"" ); }
@@ -112,7 +112,7 @@ struct pps_device *pps_register_source(s goto kfree_pps; } -dev_info (pps->dev,"new PPS source %s\n" , info->name); +dev_dbg (&pps->dev,"new PPS source %s\n" , info->name);return pps;
@@ -166,7 +166,7 @@ void pps_event(struct pps_device *pps, s/* check event type */ BUG_ON ((event & (PPS_CAPTUREASSERT |PPS_CAPTURECLEAR )) ==0 ); -dev_dbg (pps->dev,"PPS event at %lld.%09ld\n" , +dev_dbg (&pps->dev,"PPS event at %lld.%09ld\n" , (s64 )ts->ts_real.tv_sec, ts->ts_real.tv_nsec);timespec_to_pps_ktime (&ts_real, ts->ts_real);
@@ -188,7 +188,7 @@ void pps_event(struct pps_device *pps, s/* Save the time stamp */ pps->assert_tu = ts_real; pps->assert_sequence++; -dev_dbg (pps->dev,"capture assert seq #%u\n" , +dev_dbg (&pps->dev,"capture assert seq #%u\n" , pps->assert_sequence); captured = ~0 ;
@@ -202,7 +202,7 @@ void pps_event(struct pps_device *pps, s/* Save the time stamp */ pps->clear_tu = ts_real; pps->clear_sequence++; -dev_dbg (pps->dev,"capture clear seq #%u\n" , +dev_dbg (&pps->dev,"capture clear seq #%u\n" , pps->clear_sequence); captured = ~0 ;
drivers/pps/kc.c +5 -5
@@ -43,11 +43,11 @@ int pps_kc_bind(struct pps_device *pps, pps_kc_hardpps_mode =0 ; pps_kc_hardpps_dev =NULL ;spin_unlock_irq (&pps_kc_hardpps_lock); -dev_info (pps->dev,"unbound kernel" +dev_info (&pps->dev,"unbound kernel" " consumer\n" ); }else {spin_unlock_irq (&pps_kc_hardpps_lock); -dev_err (pps->dev,"selected kernel consumer" +dev_err (&pps->dev,"selected kernel consumer" " is not bound\n" );return -EINVAL ; }
@@ -57,11 +57,11 @@ int pps_kc_bind(struct pps_device *pps, pps_kc_hardpps_mode = bind_args->edge; pps_kc_hardpps_dev = pps;spin_unlock_irq (&pps_kc_hardpps_lock); -dev_info (pps->dev,"bound kernel consumer: " +dev_info (&pps->dev,"bound kernel consumer: " "edge=0x%x\n" , bind_args->edge); }else {spin_unlock_irq (&pps_kc_hardpps_lock); -dev_err (pps->dev,"another kernel consumer" +dev_err (&pps->dev,"another kernel consumer" " is already bound\n" );return -EINVAL ; }
@@ -83,7 +83,7 @@ void pps_kc_remove(struct pps_device *pp pps_kc_hardpps_mode =0 ; pps_kc_hardpps_dev =NULL ;spin_unlock_irq (&pps_kc_hardpps_lock); -dev_info (pps->dev,"unbound kernel consumer" +dev_info (&pps->dev,"unbound kernel consumer" " on device removal\n" ); }else spin_unlock_irq (&pps_kc_hardpps_lock);
drivers/pps/pps.c +66 -61
288 lines not on this page · raw message
drivers/ptp/ptp_ocp.c +1 -1
@@ -4420,7 +4420,7 @@ ptp_ocp_complete(struct ptp_ocp *bp) pps =pps_lookup_dev (bp->ptp);if (pps) -ptp_ocp_symlink (bp, pps->dev,"pps" ); +ptp_ocp_symlink (bp, &pps->dev,"pps" );ptp_ocp_debugfs_add_device (bp);
include/linux/pps_kernel.h +1 -2
@@ -56,8 +56,7 @@ struct pps_device {unsigned int id;/* PPS source unique ID */ void const *lookup_cookie;/* For pps_lookup_dev() only */ -struct cdev cdev; -struct device *dev; +struct device dev;struct fasync_struct *async_queue;/* fasync method */ spinlock_t lock; };
Greg Kroah-Hartman
maintainerPATCH 570/590 usb: gadget: f_tcm: Dont free command immediately
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit c225d006a31949d673e646d585d9569bc28feeb9 upstream.
Don't prematurely free the command. Wait for the status completion of the sense status. It can be freed then. Otherwise we will double-free the command.
--- drivers/usb/gadget/function/f_tcm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/gadget/function/f_tcm.c +0 -2
@@ -1066,7 +1066,6 @@ static void usbg_cmd_work(struct work_st out:transport_send_check_condition_and_sense (se_cmd,TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); -transport_generic_free_cmd (&cmd->se_cmd,0 ); } static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1195,7 +1194,6 @@ static void bot_cmd_work(struct work_str out:transport_send_check_condition_and_sense (se_cmd,TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); -transport_generic_free_cmd (&cmd->se_cmd,0 ); } static int bot_submit_command(struct f_uas *fu,
Greg Kroah-Hartman
maintainerPATCH 571/590 staging: media: max96712: fix kernel oops when removing module
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurentiu Palcu <[email protected]>
commit ee1b5046d5cd892a0754ab982aeaaad3702083a5 upstream.
The following kernel oops is thrown when trying to remove the max96712 module:
Unable to handle kernel paging request at virtual address 00007375746174db
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000010af89000 [00007375746174db] pgd=0000000000000000, p4d=0000000000000000
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in: crct10dif_ce polyval_ce mxc_jpeg_encdec flexcan
snd_soc_fsl_sai snd_soc_fsl_asoc_card snd_soc_fsl_micfil dwc_mipi_csi2
imx_csi_formatter polyval_generic v4l2_jpeg imx_pcm_dma can_dev
snd_soc_imx_audmux snd_soc_wm8962 snd_soc_imx_card snd_soc_fsl_utils
max96712(C-) rpmsg_ctrl rpmsg_char pwm_fan fuse
[last unloaded: imx8_isi]
CPU: 0 UID: 0 PID: 754 Comm: rmmod
Tainted: G C 6.12.0-rc6-06364-g327fec852c31 #17
Tainted: [C]=CRAP
Hardware name: NXP i.MX95 19X19 board (DT)
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : led_put+0x1c/0x40
lr : v4l2_subdev_put_privacy_led+0x48/0x58sp : ffff80008699bbb0
x29: ffff80008699bbb0 x28: ffff00008ac233c0 x27: 0000000000000000
x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
x23: ffff000080cf1170 x22: ffff00008b53bd00 x21: ffff8000822ad1c8
x20: ffff000080ff5c00 x19: ffff00008b53be40 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000004 x13: ffff0000800f8010 x12: 0000000000000000
x11: ffff000082acf5c0 x10: ffff000082acf478 x9 : ffff0000800f8010 x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff6364626d x5 : 8080808000000000 x4 : 0000000000000020 x3 : 00000000553a3dc1 x2 : ffff00008ac233c0 x1 : ffff00008ac233c0 x0 : ff00737574617473
Call trace: led_put+0x1c/0x40 v4l2_subdev_put_privacy_led+0x48/0x58 v4l2_async_unregister_subdev+0x2c/0x1a4 max96712_remove+0x1c/0x38 [max96712] i2c_device_remove+0x2c/0x9c device_remove+0x4c/0x80 device_release_driver_internal+0x1cc/0x228 driver_detach+0x4c/0x98 bus_remove_driver+0x6c/0xbc driver_unregister+0x30/0x60 i2c_del_driver+0x54/0x64 max96712_i2c_driver_exit+0x18/0x1d0 [max96712] __arm64_sys_delete_module+0x1a4/0x290 invoke_syscall+0x48/0x10c el0_svc_common.constprop.0+0xc0/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x34/0xd8 el0t_64_sync_handler+0x120/0x12c el0t_64_sync+0x190/0x194 Code: f9000bf3 aa0003f3 f9402800 f9402000 (f9403400) ---[ end trace 0000000000000000 ]---
This happens because in v4l2_i2c_subdev_init(), the i2c_set_cliendata() is called again and the data is overwritten to point to sd, instead of priv. So, in remove(), the wrong pointer is passed to v4l2_async_unregister_subdev(), leading to a crash.
--- drivers/staging/media/max96712/max96712.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/max96712/max96712.c +2 -2
@@ -421,7 +421,6 @@ static int max96712_probe(struct i2c_clireturn -ENOMEM ; priv->client = client; -i2c_set_clientdata (client, priv); priv->regmap =devm_regmap_init_i2c (client, &max96712_i2c_regmap);if (IS_ERR (priv->regmap))
@@ -454,7 +453,8 @@ static int max96712_probe(struct i2c_clistatic void max96712_remove (struct i2c_client *client) { -struct max96712_priv *priv =i2c_get_clientdata (client); +struct v4l2_subdev *sd =i2c_get_clientdata (client); + struct max96712_priv *priv = container_of(sd, struct max96712_priv, sd);v4l2_async_unregister_subdev (&priv->sd);
Greg Kroah-Hartman
maintainerPATCH 572/590 media: imx-jpeg: Fix potential error pointer dereference in detach_pm()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 1378ffec30367233152b7dbf4fa6a25ee98585d1 upstream.
The proble is on the first line:
if (jpeg->pd_dev[i] && !pm_runtime_suspended(jpeg->pd_dev[i]))
If jpeg->pd_dev[i] is an error pointer, then passing it to pm_runtime_suspended() will lead to an Oops. The other conditions check for both error pointers and NULL, but it would be more clear to use the IS_ERR_OR_NULL() check for that.
--- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +4 -3
@@ -2679,11 +2679,12 @@ static void mxc_jpeg_detach_pm_domains(sint i;for (i =0 ; i < jpeg->num_domains; i++) { -if (jpeg->pd_dev[i] && !pm_runtime_suspended (jpeg->pd_dev[i])) +if (!IS_ERR_OR_NULL (jpeg->pd_dev[i]) && + !pm_runtime_suspended (jpeg->pd_dev[i]))pm_runtime_force_suspend (jpeg->pd_dev[i]); -if (jpeg->pd_link[i] && !IS_ERR (jpeg->pd_link[i])) +if (!IS_ERR_OR_NULL (jpeg->pd_link[i]))device_link_del (jpeg->pd_link[i]); -if (jpeg->pd_dev[i] && !IS_ERR (jpeg->pd_dev[i])) +if (!IS_ERR_OR_NULL (jpeg->pd_dev[i]))dev_pm_domain_detach (jpeg->pd_dev[i], true); jpeg->pd_dev[i] =NULL ; jpeg->pd_link[i] =NULL ;
Greg Kroah-Hartman
maintainerPATCH 573/590 powerpc/pseries/iommu: Dont unset window if it was never set
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivaprasad G Bhat <[email protected]>
commit 17391cb2613b82f8c405570fea605af3255ff8d2 upstream.
On pSeries, when user attempts to use the same vfio container used by different iommu group, the spapr_tce_set_window() returns -EPERM and the subsequent cleanup leads to the below crash.
Kernel attempted to read user page (308) - exploit attempt?
BUG: Kernel NULL pointer dereference on read at 0x00000308
Faulting instruction address: 0xc0000000001ce358
Oops: Kernel access of bad area, sig: 11 [#1]
NIP: c0000000001ce358 LR: c0000000001ce05c CTR: c00000000005add0
<snip>
NIP [c0000000001ce358] spapr_tce_unset_window+0x3b8/0x510
LR [c0000000001ce05c] spapr_tce_unset_window+0xbc/0x510
Call Trace:
spapr_tce_unset_window+0xbc/0x510 (unreliable)
tce_iommu_attach_group+0x24c/0x340 [vfio_iommu_spapr_tce]
vfio_container_attach_group+0xec/0x240 [vfio]
vfio_group_fops_unl_ioctl+0x548/0xb00 [vfio]
sys_ioctl+0x754/0x1580
system_call_exception+0x13c/0x330
system_call_vectored_common+0x15c/0x2ec
<snip>
--- interrupt: 3000Fix this by having null check for the tbl passed to the spapr_tce_unset_window().
--- arch/powerpc/platforms/pseries/iommu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/powerpc/platforms/pseries/iommu.c +3 -0
@@ -2208,6 +2208,9 @@ static long spapr_tce_unset_window(struct iommu_table_group *table_group, int nuconst char *win_name;int ret = -ENODEV ; +if (!tbl)/* The table was never created OR window was never opened */ +return 0 ; +mutex_lock (&dma_win_init_mutex);if ((num ==0 ) &&is_default_window_table (table_group, tbl))
Signature · 1 line
2.48.1
Greg Kroah-Hartman
maintainerPATCH 574/590 md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
commit 8d28d0ddb986f56920ac97ae704cc3340a699a30 upstream.
After commit ec6bb299c7c3 ("md/md-bitmap: add 'sync_size' into struct md_bitmap_stats"), following panic is reported:
Oops: general protection fault, probably for non-canonical address RIP: 0010:bitmap_get_stats+0x2b/0xa0 Call Trace: <TASK> md_seq_show+0x2d2/0x5b0 seq_read_iter+0x2b9/0x470 seq_read+0x12f/0x180 proc_reg_read+0x57/0xb0 vfs_read+0xf6/0x380 ksys_read+0x6c/0xf0 do_syscall_64+0x82/0x170 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Root cause is that bitmap_get_stats() can be called at anytime if mddev is still there, even if bitmap is destroyed, or not fully initialized. Deferenceing bitmap in this case can crash the kernel. Meanwhile, the above commit start to deferencing bitmap->storage, make the problem easier to trigger.
Fix the problem by protecting bitmap_get_stats() with bitmap_info.mutex.
--- drivers/md/md-bitmap.c | 5 ++++- drivers/md/md.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/md/md-bitmap.c +4 -1
@@ -2355,7 +2355,10 @@ static int bitmap_get_stats(void *data,if (!bitmap)return -ENOENT ; - +if (bitmap->mddev->bitmap_info.external) +return -ENOENT ; +if (!bitmap->storage.sb_page)/* no superblock */ +return -EINVAL ; sb =kmap_local_page (bitmap->storage.sb_page); stats->sync_size =le64_to_cpu (sb->sync_size);kunmap_local (sb);
drivers/md/md.c +5 -0
@@ -8376,6 +8376,10 @@ static int md_seq_show(struct seq_file *return 0 ;spin_unlock (&all_mddevs_lock); + +/* prevent bitmap to be freed after checking */ +mutex_lock (&mddev->bitmap_info.mutex); +spin_lock (&mddev->lock);if (mddev->pers || mddev->raid_disks || !list_empty (&mddev->disks)) {seq_printf (seq,"%s : " ,mdname (mddev));
@@ -8451,6 +8455,7 @@ static int md_seq_show(struct seq_file *seq_printf (seq,"\n" ); }spin_unlock (&mddev->lock); +mutex_unlock (&mddev->bitmap_info.mutex);spin_lock (&all_mddevs_lock); if (mddev == list_last_entry(&all_mddevs, struct mddev, all_mddevs))
Greg Kroah-Hartman
maintainerPATCH 575/590 btrfs: output the reason for open_ctree() failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit d0f038104fa37380e2a725e669508e43d0c503e9 upstream.
There is a recent ML report that mounting a large fs backed by hardware RAID56 controller (with one device missing) took too much time, and systemd seems to kill the mount attempt.
In that case, the only error message is:
BTRFS error (device sdj): open_ctree failed
There is no reason on why the failure happened, making it very hard to understand the reason.
At least output the error number (in the particular case it should be -EINTR) to provide some clue.
--- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/super.c +1 -1
@@ -972,7 +972,7 @@ static int btrfs_fill_super(struct super err =open_ctree (sb, fs_devices);if (err) { -btrfs_err (fs_info,"open_ctree failed" ); +btrfs_err (fs_info,"open_ctree failed: %d" , err);return err; }
Greg Kroah-Hartman
maintainerPATCH 576/590 of: reserved-memory: Warn for missing static reserved memory regions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit 81dfedd5234b42df11a473eefe7328ea4a0416ad upstream.
For child node of /reserved-memory, its property 'reg' may contain multiple regions, but fdt_scan_reserved_mem_reg_nodes() only takes into account the first region, and miss remaining regions.
But there are no simple approach to fix it, so give user warning message when miss remaining regions.
--- drivers/of/of_reserved_mem.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/of/of_reserved_mem.c +5 -0
@@ -214,6 +214,11 @@ void __init fdt_scan_reserved_mem_reg_no uname);continue ; } + +if (len > t_len) +pr_warn ("%s() ignores %d regions in node '%s'\n" , + __func__, len / t_len -1 , uname); + base =dt_mem_next_cell (dt_root_addr_cells, &prop); size =dt_mem_next_cell (dt_root_size_cells, &prop);
Greg Kroah-Hartman
maintainerPATCH 577/590 dma-mapping: save base/size instead of pointer to shared DMA pool
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 22293c33738c14bb84b9d3e771bc37150e7cf8e7 upstream.
On RZ/Five, which is non-coherent, and uses CONFIG_DMA_GLOBAL_POOL=y:
Oops - store (or AMO) access fault [#1]
CPU: 0 UID: 0 PID: 1 Comm: swapper Not tainted 6.12.0-rc1-00015-g8a6e02d0c00e #201
Hardware name: Renesas SMARC EVK based on r9a07g043f01 (DT)
epc : __memset+0x60/0x100
ra : __dma_alloc_from_coherent+0x150/0x17a
epc : ffffffff8062d2bc ra : ffffffff80053a94 sp : ffffffc60000ba20
gp : ffffffff812e9938 tp : ffffffd601920000 t0 : ffffffc6000d0000
t1 : 0000000000000000 t2 : ffffffffe9600000 s0 : ffffffc60000baa0
s1 : ffffffc6000d0000 a0 : ffffffc6000d0000 a1 : 0000000000000000
a2 : 0000000000001000 a3 : ffffffc6000d1000 a4 : 0000000000000000
a5 : 0000000000000000 a6 : ffffffd601adacc0 a7 : ffffffd601a841a8
s2 : ffffffd6018573c0 s3 : 0000000000001000 s4 : ffffffd6019541e0
s5 : 0000000200000022 s6 : ffffffd6018f8410 s7 : ffffffd6018573e8
s8 : 0000000000000001 s9 : 0000000000000001 s10: 0000000000000010
s11: 0000000000000000 t3 : 0000000000000000 t4 : ffffffffdefe62d1
t5 : 000000001cd6a3a9 t6 : ffffffd601b2aad6
status: 0000000200000120 badaddr: ffffffc6000d0000 cause: 0000000000000007
[<ffffffff8062d2bc>] __memset+0x60/0x100
[<ffffffff80053e1a>] dma_alloc_from_global_coherent+0x1c/0x28
[<ffffffff80053056>] dma_direct_alloc+0x98/0x112
[<ffffffff8005238c>] dma_alloc_attrs+0x78/0x86
[<ffffffff8035fdb4>] rz_dmac_probe+0x3f6/0x50a
[<ffffffff803a0694>] platform_probe+0x4c/0x8aIf CONFIG_DMA_GLOBAL_POOL=y, the reserved_mem structure passed to rmem_dma_setup() is saved for later use, by saving the passed pointer. However, when dma_init_reserved_memory() is called later, the pointer has become stale, causing a crash.
E.g. in the RZ/Five case, the referenced memory now contains the reserved_mem structure for the "mmode_resv0@30000" node (with base 0x30000 and size 0x10000), instead of the correct "pma_resv0@58000000" node (with base 0x58000000 and size 0x8000000).
Fix this by saving the needed reserved_mem structure's contents instead.
--- kernel/dma/coherent.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
kernel/dma/coherent.c +8 -6
@@ -330,7 +330,8 @@ int dma_init_global_coherent(phys_addr_t#include <linux/of_reserved_mem.h> #ifdef CONFIG_DMA_GLOBAL_POOL -static struct reserved_mem *dma_reserved_default_memory__initdata ; +static phys_addr_t dma_reserved_default_memory_base__initdata ; +static phys_addr_t dma_reserved_default_memory_size__initdata ;#endif static int rmem_dma_device_init (struct reserved_mem *rmem,struct device *dev)
@@ -376,9 +377,10 @@ static int __init rmem_dma_setup(struct#ifdef CONFIG_DMA_GLOBAL_POOL if (of_get_flat_dt_prop (node,"linux,dma-default" ,NULL )) { -WARN (dma_reserved_default_memory, +WARN (dma_reserved_default_memory_size,"Reserved memory: region for default DMA coherent area is redefined\n" ); - dma_reserved_default_memory = rmem; + dma_reserved_default_memory_base = rmem->base; + dma_reserved_default_memory_size = rmem->size; }#endif
@@ -391,10 +393,10 @@ static int __init rmem_dma_setup(struct#ifdef CONFIG_DMA_GLOBAL_POOL static int __init dma_init_reserved_memory (void ) { -if (!dma_reserved_default_memory) +if (!dma_reserved_default_memory_size)return -ENOMEM ; -return dma_init_global_coherent (dma_reserved_default_memory->base, - dma_reserved_default_memory->size); +return dma_init_global_coherent (dma_reserved_default_memory_base, + dma_reserved_default_memory_size); }core_initcall (dma_init_reserved_memory);#endif /* CONFIG_DMA_GLOBAL_POOL */
Greg Kroah-Hartman
maintainerPATCH 578/590 xfrm: Add error handling when nla_put_u32() returns an error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Everest K.C <[email protected]>
commit 9d287e70c51f1c141ac588add261ed2efdd6fc6b upstream.
Error handling is missing when call to nla_put_u32() fails. Handle the error when the call to nla_put_u32() returns an error.
The error was reported by Coverity Scan.
Report:
CID 1601525: (#1 of 1): Unused value (UNUSED_VALUE)returned_value: Assigning value from nla_put_u32(skb, XFRMA_SA_PCPU, x->pcpu_num) to err here, but that stored value is overwritten before it can be used
--- net/xfrm/xfrm_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/xfrm/xfrm_user.c +4 -1
@@ -2609,8 +2609,11 @@ static int build_aevent(struct sk_buff * err =xfrm_if_id_put (skb, x->if_id);if (err) goto out_cancel; -if (x->pcpu_num !=UINT_MAX ) +if (x->pcpu_num !=UINT_MAX ) { err =nla_put_u32 (skb,XFRMA_SA_PCPU , x->pcpu_num); +if (err) + goto out_cancel; + }if (x->dir) { err =nla_put_u8 (skb,XFRMA_SA_DIR , x->dir);
Greg Kroah-Hartman
maintainerPATCH 579/590 xfrm: Fix acquire state insertion.
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
commit a35672819f8d85e2ae38b80d40b923e3ef81e4ea upstream.
A recent commit jumped over the dst hash computation and left the symbol uninitialized. Fix this by explicitly computing the dst hash before it is used.
--- net/xfrm/xfrm_state.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_state.c +1 -0
@@ -1512,6 +1512,7 @@ found: x->km.state =XFRM_STATE_ACQ ; x->dir =XFRM_SA_DIR_OUT ;list_add (&x->km.all, &net->xfrm.state_all); + h =xfrm_dst_hash (net, daddr, saddr, tmpl->reqid, encap_family);XFRM_STATE_INSERT (bydst, &x->bydst, net->xfrm.state_bydst + h, x->xso.type);
Greg Kroah-Hartman
maintainerPATCH 580/590 ethtool: Fix access to uninitialized fields in set RXNFC command
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <[email protected]>
commit 94071909477677fc2a1abf3fb281f203f66cf3ca upstream.
The check for non-zero ring with RSS is only relevant for ETHTOOL_SRXCLSRLINS command, in other cases the check tries to access memory which was not initialized by the userspace tool. Only perform the check in case of ETHTOOL_SRXCLSRLINS.
Without this patch, filter deletion (for example) could statistically result in a false error:
# ethtool --config-ntuple eth3 delete 484 rmgr: Cannot delete RX class rule: Invalid argument Cannot delete classification rule
--- net/ethtool/ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ethtool/ioctl.c +2 -1
@@ -993,7 +993,8 @@ static noinline_for_stack int ethtool_sereturn rc;/* Nonzero ring with RSS only makes sense if NIC adds them together */ -if (info.flow_type &FLOW_RSS && !ops->cap_rss_rxnfc_adds && +if (cmd ==ETHTOOL_SRXCLSRLINS && info.flow_type &FLOW_RSS && + !ops->cap_rss_rxnfc_adds &ðtool_get_flow_spec_ring (info.fs.ring_cookie))return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 581/590 phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <[email protected]>
commit 739214dd1c209e34323814fb815fb17cccb9f95b upstream.
The Kernel test robot returns the following warning:
do_div() does a 64-by-32 division, please consider using div64_ul instead.
To prevent the 64-by-32 divsion, consolidate both the multiplication and the do_div into one line which explicitly uses u64 sizes.
--- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/phy/freescale/phy-fsl-samsung-hdmi.c +1 -2
@@ -471,8 +471,7 @@ static unsigned long fsl_samsung_hdmi_ph* Fvco = (M * f_ref) / P, * where f_ref is 24MHz. */ - tmp = (u64 )_m *24 *MHZ ; -do_div (tmp, _p); + tmp =div64_ul ((u64 )_m *24 *MHZ , _p);if (tmp <750 *MHZ || tmp >3000 *MHZ )continue ;
Greg Kroah-Hartman
maintainerPATCH 582/590 Revert "s390/mm: Allow large pages for KASAN shadow mapping"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Gorbik <[email protected]>
commit cc00550b2ae7ab1c7c56669fc004a13d880aaf0a upstream.
This reverts commit ff123eb7741638d55abf82fac090bb3a543c1e74.
Allowing large pages for KASAN shadow mappings isn't inherently wrong, but adding POPULATE_KASAN_MAP_SHADOW to large_allowed() exposes an issue in can_large_pud() and can_large_pmd().
Since commit d8073dc6bc04 ("s390/mm: Allow large pages only for aligned physical addresses"), both can_large_pud() and can_large_pmd() call _pa() to check if large page physical addresses are aligned. However, _pa() has a side effect: it allocates memory in POPULATE_KASAN_MAP_SHADOW mode. This results in massive memory leaks.
The proper fix would be to address both large_allowed() and _pa()'s side effects, but for now, revert this change to avoid the leaks.
--- arch/s390/boot/vmem.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
arch/s390/boot/vmem.c +1 -11
@@ -264,17 +264,7 @@ static unsigned long _pa(unsigned long astatic bool large_allowed (enum populate_mode mode) { -switch (mode) { -case POPULATE_DIRECT : -case POPULATE_IDENTITY : -case POPULATE_KERNEL : -#ifdef CONFIG_KASAN -case POPULATE_KASAN_MAP_SHADOW : -#endif -return true; -default : -return false; - } +return (mode ==POPULATE_DIRECT ) || (mode ==POPULATE_IDENTITY ) || (mode ==POPULATE_KERNEL ); } static bool can_large_pud(pud_t *pu_dir, unsigned long addr, unsigned long end,
Greg Kroah-Hartman
maintainerPATCH 583/590 selftests/bpf: Add test to verify tailcall and freplace restrictions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <[email protected]>
commit 021611d33e78694f4bd54573093c6fc70a812644 upstream.
Add a test case to ensure that attaching a tail callee program with an freplace program fails, and that updating an extended program to a prog_array map is also prohibited.
This test is designed to prevent the potential infinite loop issue caused by the combination of tail calls and freplace, ensuring the correct behavior and stability of the system.
Additionally, fix the broken tailcalls/tailcall_freplace selftest because an extension prog should not be tailcalled.
cd tools/testing/selftests/bpf; ./test_progs -t tailcalls
337/25 tailcalls/tailcall_freplace:OK 337/26 tailcalls/tailcall_bpf2bpf_freplace:OK 337 tailcalls:OK
Summary: 1/26 PASSED, 0 SKIPPED, 0 FAILED
[ Yifei: bpf freplace update is backported to linux-6.12 by commit 987aa730bad3
("bpf: Prevent tailcall infinite loop caused by freplace"). It will cause selftest #336/25 failed. ]
--- tools/testing/selftests/bpf/prog_tests/tailcalls.c | 120 ++++++++++++++++++--- tools/testing/selftests/bpf/progs/tc_bpf2bpf.c | 5 2 files changed, 109 insertions(+), 16 deletions(-)
tools/testing/selftests/bpf/prog_tests/tailcalls.c +106 -14
@@ -1496,8 +1496,8 @@ static void test_tailcall_bpf2bpf_hierarRUN_TESTS (tailcall_bpf2bpf_hierarchy3); } -/* test_tailcall_freplace checks that the attached freplace prog is OK to -* update the prog_array map. +/* test_tailcall_freplace checks that the freplace prog fails to update the +* prog_array map, no matter whether the freplace prog attaches to its target. */ static void test_tailcall_freplace (void ) {
@@ -1505,7 +1505,7 @@ static void test_tailcall_freplace(void)struct bpf_link *freplace_link =NULL ;struct bpf_program *freplace_prog;struct tc_bpf2bpf *tc_skel =NULL ; -int prog_fd, map_fd; +int prog_fd, tc_prog_fd, map_fd;char buff[128 ] = {};int err, key;
@@ -1523,9 +1523,10 @@ static void test_tailcall_freplace(void)if (!ASSERT_OK_PTR (tc_skel,"tc_bpf2bpf__open_and_load" )) goto out; - prog_fd =bpf_program__fd (tc_skel->progs.entry_tc); + tc_prog_fd =bpf_program__fd (tc_skel->progs.entry_tc); freplace_prog = freplace_skel->progs.entry_freplace; - err =bpf_program__set_attach_target (freplace_prog, prog_fd,"subprog" ); + err =bpf_program__set_attach_target (freplace_prog, tc_prog_fd, +"subprog_tc" );if (!ASSERT_OK (err,"set_attach_target" )) goto out;
@@ -1533,27 +1534,116 @@ static void test_tailcall_freplace(void)if (!ASSERT_OK (err,"tailcall_freplace__load" )) goto out; - freplace_link =bpf_program__attach_freplace (freplace_prog, prog_fd, -"subprog" ); + map_fd =bpf_map__fd (freplace_skel->maps.jmp_table); + prog_fd =bpf_program__fd (freplace_prog); + key =0 ; + err =bpf_map_update_elem (map_fd, &key, &prog_fd,BPF_ANY ); +ASSERT_ERR (err,"update jmp_table failure" ); + + freplace_link =bpf_program__attach_freplace (freplace_prog, tc_prog_fd, +"subprog_tc" );if (!ASSERT_OK_PTR (freplace_link,"attach_freplace" )) goto out; - map_fd =bpf_map__fd (freplace_skel->maps.jmp_table); - prog_fd =bpf_program__fd (freplace_prog); + err =bpf_map_update_elem (map_fd, &key, &prog_fd,BPF_ANY ); +ASSERT_ERR (err,"update jmp_table failure" ); + +out: +bpf_link__destroy (freplace_link); +tailcall_freplace__destroy (freplace_skel); +tc_bpf2bpf__destroy (tc_skel); +} + +/* test_tailcall_bpf2bpf_freplace checks the failure that fails to attach a tail +* callee prog with freplace prog or fails to update an extended prog to +* prog_array map. +*/ +static void test_tailcall_bpf2bpf_freplace (void ) +{ +struct tailcall_freplace *freplace_skel =NULL ; +struct bpf_link *freplace_link =NULL ; +struct tc_bpf2bpf *tc_skel =NULL ; +char buff[128 ] = {}; +int prog_fd, map_fd; +int err, key; + +LIBBPF_OPTS (bpf_test_run_opts, topts, + .data_in = buff, + .data_size_in = sizeof(buff), + .repeat = 1, + ); + + tc_skel =tc_bpf2bpf__open_and_load (); +if (!ASSERT_OK_PTR (tc_skel,"tc_bpf2bpf__open_and_load" )) + goto out; + + prog_fd =bpf_program__fd (tc_skel->progs.entry_tc); + freplace_skel =tailcall_freplace__open (); +if (!ASSERT_OK_PTR (freplace_skel,"tailcall_freplace__open" )) + goto out; + + err =bpf_program__set_attach_target (freplace_skel->progs.entry_freplace, + prog_fd,"subprog_tc" ); +if (!ASSERT_OK (err,"set_attach_target" )) + goto out; + + err =tailcall_freplace__load (freplace_skel); +if (!ASSERT_OK (err,"tailcall_freplace__load" )) + goto out; + +/* OK to attach then detach freplace prog. */ + + freplace_link =bpf_program__attach_freplace (freplace_skel->progs.entry_freplace, + prog_fd,"subprog_tc" ); +if (!ASSERT_OK_PTR (freplace_link,"attach_freplace" )) + goto out; + + err =bpf_link__destroy (freplace_link); +if (!ASSERT_OK (err,"destroy link" )) + goto out; + +/* OK to update prog_array map then delete element from the map. */ + key =0 ; + map_fd =bpf_map__fd (freplace_skel->maps.jmp_table); err =bpf_map_update_elem (map_fd, &key, &prog_fd,BPF_ANY );if (!ASSERT_OK (err,"update jmp_table" )) goto out; - prog_fd =bpf_program__fd (tc_skel->progs.entry_tc); - err =bpf_prog_test_run_opts (prog_fd, &topts); -ASSERT_OK (err,"test_run" ); -ASSERT_EQ (topts.retval,34 ,"test_run retval" ); + err =bpf_map_delete_elem (map_fd, &key); +if (!ASSERT_OK (err,"delete_elem from jmp_table" )) + goto out; + +/* Fail to attach a tail callee prog with freplace prog. */ + + err =bpf_map_update_elem (map_fd, &key, &prog_fd,BPF_ANY ); +if (!ASSERT_OK (err,"update jmp_table" )) + goto out; + + freplace_link =bpf_program__attach_freplace (freplace_skel->progs.entry_freplace, + prog_fd,"subprog_tc" ); +if (!ASSERT_ERR_PTR (freplace_link,"attach_freplace failure" )) + goto out; + + err =bpf_map_delete_elem (map_fd, &key); +if (!ASSERT_OK (err,"delete_elem from jmp_table" )) + goto out; + +/* Fail to update an extended prog to prog_array map. */ + + freplace_link =bpf_program__attach_freplace (freplace_skel->progs.entry_freplace, + prog_fd,"subprog_tc" ); +if (!ASSERT_OK_PTR (freplace_link,"attach_freplace" )) + goto out; + + err =bpf_map_update_elem (map_fd, &key, &prog_fd,BPF_ANY ); +if (!ASSERT_ERR (err,"update jmp_table failure" )) + goto out; out:bpf_link__destroy (freplace_link); -tc_bpf2bpf__destroy (tc_skel);tailcall_freplace__destroy (freplace_skel); +tc_bpf2bpf__destroy (tc_skel); }void test_tailcalls (void )
@@ -1606,4 +1696,6 @@ void test_tailcalls(void)test_tailcall_bpf2bpf_hierarchy_3 ();if (test__start_subtest ("tailcall_freplace" ))test_tailcall_freplace (); +if (test__start_subtest ("tailcall_bpf2bpf_freplace" )) +test_tailcall_bpf2bpf_freplace (); }
tools/testing/selftests/bpf/progs/tc_bpf2bpf.c +3 -2
@@ -5,10 +5,11 @@#include "bpf_misc.h" __noinline -int subprog(struct __sk_buff *skb) +int subprog_tc(struct __sk_buff *skb) {int ret =1 ; +__sink (skb);__sink (ret);/* let verifier know that 'subprog_tc' can change pointers to skb->data */ bpf_skb_change_proto (skb,0 ,0 );
@@ -18,7 +19,7 @@ int subprog(struct __sk_buff *skb) SEC("tc")int entry_tc (struct __sk_buff *skb) { -return subprog (skb); +return subprog_tc (skb); } char __license[] SEC("license") = "GPL";
Greg Kroah-Hartman
maintainerPATCH 584/590 ASoC: da7213: Initialize the mutex
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Beznea <[email protected]>
commit 4a32a38cb68f55ff9e100df348ddb3d4b3e50643 upstream.
Initialize the struct da7213_priv::ctrl_lock mutex. Without it the following stack trace is displayed when rebooting and lockdep is enabled:
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: CPU: 0 PID: 180 at kernel/locking/mutex.c:564 __mutex_lock+0x254/0x4e4 CPU: 0 UID: 0 PID: 180 Comm: alsactl Not tainted 6.13.0-next-20250123-arm64-renesas-00002-g132083a22d3d #30 Hardware name: Renesas SMARC EVK version 2 based on r9a08g045s33 (DT) pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __mutex_lock+0x254/0x4e4 lr : __mutex_lock+0x254/0x4e4
sp : ffff800082c13c00
x29: ffff800082c13c00 x28: ffff00001002b500 x27: 0000000000000000
x26: 0000000000000000 x25: ffff800080b30db4 x24: 0000000000000002
x23: ffff800082c13c70 x22: 0000ffffc2a68a70 x21: ffff000010348000
x20: 0000000000000000 x19: ffff00000be2e488 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 00000000000003c1 x13: 00000000000003c1 x12: 0000000000000000
x11: 0000000000000011 x10: 0000000000001420 x9 : ffff800082c13a70 x8 : 0000000000000001 x7 : ffff800082c13a50 x6 : ffff800082c139e0 x5 : ffff800082c14000 x4 : ffff800082c13a50 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00001002b500
Call trace: __mutex_lock+0x254/0x4e4 (P) mutex_lock_nested+0x20/0x28 da7213_volsw_locked_get+0x34/0x60 snd_ctl_elem_read+0xbc/0x114 snd_ctl_ioctl+0x878/0xa70 __arm64_sys_ioctl+0x94/0xc8 invoke_syscall+0x44/0x104 el0_svc_common.constprop.0+0xb4/0xd4 do_el0_svc+0x18/0x20 el0_svc+0x3c/0xf0 el0t_64_sync_handler+0xc0/0xc4 el0t_64_sync+0x154/0x158 irq event stamp: 7713 hardirqs last enabled at (7713): [<ffff800080170d94>] ktime_get_coarse_real_ts64+0xf0/0x10c hardirqs last disabled at (7712): [<ffff800080170d58>] ktime_get_coarse_real_ts64+0xb4/0x10c softirqs last enabled at (7550): [<ffff8000800179d4>] fpsimd_restore_current_state+0x30/0xb8 softirqs last disabled at (7548): [<ffff8000800179a8>] fpsimd_restore_current_state+0x4/0xb8 ---[ end trace 0000000000000000 ]---
--- sound/soc/codecs/da7213.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/da7213.c +2 -0
@@ -2191,6 +2191,8 @@ static int da7213_i2c_probe(struct i2c_creturn ret; } +mutex_init (&da7213->ctrl_lock); +pm_runtime_set_autosuspend_delay (&i2c->dev,100 );pm_runtime_use_autosuspend (&i2c->dev);pm_runtime_set_active (&i2c->dev);
Greg Kroah-Hartman
maintainerPATCH 585/590 s390: Add -std=gnu11 to decompressor and purgatory CFLAGS
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 upstream.
GCC changed the default C standard dialect from gnu17 to gnu23, which should not have impacted the kernel because it explicitly requests the gnu11 standard in the main Makefile. However, there are certain places in the s390 code that use their own CFLAGS without a '-std=' value, which break with this dialect change because of the kernel's own definitions of bool, false, and true conflicting with the C23 reserved keywords.
include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant
11 | false = 0,
| ^~~~~
include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards
include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef'
35 | typedef _Bool bool;
| ^~~~ include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards
Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate these errors and make the C standard version of these areas match the rest of the kernel.
--- arch/s390/Makefile | 2 +- arch/s390/purgatory/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FL ifndef CONFIG_AS_IS_LLVM KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) endif -KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack +KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack -std=gnu11 KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY KBUILD_CFLAGS_DECOMPRESSOR += -D__DECOMPRESSOR KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
arch/s390/purgatory/Makefile +1 -1
@@ -13,7 +13,7 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS - $(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE $(call if_changed_rule,as_o_S) -KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes +KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common
Greg Kroah-Hartman
maintainerPATCH 586/590 drm/amd/display: Add hubp cache reset when powergating
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aric Cyr <[email protected]>
commit 01130f5260e5868fb6b15ab8c00dbc894139f48e upstream.
[Why]
When HUBP is power gated, the SW state can get out of sync with the hardware state causing cursor to not be programmed correctly.
[How]
Similar to DPP, add a HUBP reset function which is called wherever HUBP is initialized or powergated. This function will clear the cursor position and attribute cache allowing for proper programming when the HUBP is brought back up.
--- drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c | 3 +++ drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c | 10 +++++++++- drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.h | 2 ++ drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/hubp/dcn201/dcn201_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/hubp/dcn21/dcn21_hubp.c | 3 +++ drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c | 3 +++ drivers/gpu/drm/amd/display/dc/hubp/dcn31/dcn31_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/hubp/dcn32/dcn32_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/hubp/dcn35/dcn35_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 3 ++- drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 ++ drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 ++ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 2 ++ 14 files changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c +3 -0
@@ -194,6 +194,9 @@ void dpp_reset(struct dpp *dpp_base) dpp->filter_h =NULL ; dpp->filter_v =NULL ; +memset (&dpp_base->pos,0 ,sizeof (dpp_base->pos)); +memset (&dpp_base->att,0 ,sizeof (dpp_base->att)); +memset (&dpp->scl_data,0 ,sizeof (dpp->scl_data));memset (&dpp->pwl_data,0 ,sizeof (dpp->pwl_data)); }
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c +9 -1
@@ -532,6 +532,12 @@ void hubp1_dcc_control(struct hubp *hubp SECONDARY_SURFACE_DCC_IND_64B_BLK, dcc_ind_64b_blk); } +void hubp_reset (struct hubp *hubp) +{ +memset (&hubp->pos,0 ,sizeof (hubp->pos)); +memset (&hubp->att,0 ,sizeof (hubp->att)); +} + void hubp1_program_surface_config( struct hubp *hubp, enum surface_pixel_format format,
@@ -1337,8 +1343,9 @@ static void hubp1_wait_pipe_read_start(svoid hubp1_init (struct hubp *hubp) { -//do nothing +hubp_reset (hubp); } +static const struct hubp_funcs dcn10_hubp_funcs = { .hubp_program_surface_flip_and_addr = hubp1_program_surface_flip_and_addr,
@@ -1351,6 +1358,7 @@ static const struct hubp_funcs dcn10_hub .hubp_set_vm_context0_settings = hubp1_set_vm_context0_settings, .set_blank = hubp1_set_blank, .dcc_control = hubp1_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_hubp_blank_en = hubp1_set_hubp_blank_en, .set_cursor_attributes = hubp1_cursor_set_attributes,
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.h +2 -0
@@ -746,6 +746,8 @@ void hubp1_dcc_control(struct hubp *hubpbool enable, enum hubp_ind_block_size independent_64b_blks); +void hubp_reset (struct hubp *hubp); + bool hubp1_program_surface_flip_and_addr( struct hubp *hubp, const struct dc_plane_address *address,
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c +1 -0
@@ -1660,6 +1660,7 @@ static struct hubp_funcs dcn20_hubp_func .set_blank = hubp2_set_blank, .set_blank_regs = hubp2_set_blank_regs, .dcc_control = hubp2_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_cursor_attributes = hubp2_cursor_set_attributes, .set_cursor_position = hubp2_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn201/dcn201_hubp.c +1 -0
@@ -121,6 +121,7 @@ static struct hubp_funcs dcn201_hubp_fun .set_cursor_position = hubp1_cursor_set_position, .set_blank = hubp1_set_blank, .dcc_control = hubp1_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .hubp_clk_cntl = hubp1_clk_cntl, .hubp_vtg_sel = hubp1_vtg_sel,
drivers/gpu/drm/amd/display/dc/hubp/dcn21/dcn21_hubp.c +3 -0
@@ -811,6 +811,8 @@ static void hubp21_init(struct hubp *hubstruct dcn21_hubp *hubp21 =TO_DCN21_HUBP (hubp);//hubp[i].HUBPREQ_DEBUG.HUBPREQ_DEBUG[26] = 1; REG_WRITE (HUBPREQ_DEBUG ,1 <<26 ); + +hubp_reset (hubp); }static struct hubp_funcs dcn21_hubp_funcs = { .hubp_enable_tripleBuffer = hubp2_enable_triplebuffer,
@@ -823,6 +825,7 @@ static struct hubp_funcs dcn21_hubp_func .hubp_set_vm_system_aperture_settings = hubp21_set_vm_system_aperture_settings, .set_blank = hubp1_set_blank, .dcc_control = hubp1_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = hubp21_set_viewport, .set_cursor_attributes = hubp2_cursor_set_attributes, .set_cursor_position = hubp1_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c +3 -0
@@ -483,6 +483,8 @@ void hubp3_init(struct hubp *hubp)struct dcn20_hubp *hubp2 =TO_DCN20_HUBP (hubp);//hubp[i].HUBPREQ_DEBUG.HUBPREQ_DEBUG[26] = 1; REG_WRITE (HUBPREQ_DEBUG ,1 <<26 ); + +hubp_reset (hubp); }static struct hubp_funcs dcn30_hubp_funcs = {
@@ -497,6 +499,7 @@ static struct hubp_funcs dcn30_hubp_func .set_blank = hubp2_set_blank, .set_blank_regs = hubp2_set_blank_regs, .dcc_control = hubp3_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_cursor_attributes = hubp2_cursor_set_attributes, .set_cursor_position = hubp2_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn31/dcn31_hubp.c +1 -0
@@ -79,6 +79,7 @@ static struct hubp_funcs dcn31_hubp_func .hubp_set_vm_system_aperture_settings = hubp3_set_vm_system_aperture_settings, .set_blank = hubp2_set_blank, .dcc_control = hubp3_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_cursor_attributes = hubp2_cursor_set_attributes, .set_cursor_position = hubp2_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn32/dcn32_hubp.c +1 -0
@@ -181,6 +181,7 @@ static struct hubp_funcs dcn32_hubp_func .set_blank = hubp2_set_blank, .set_blank_regs = hubp2_set_blank_regs, .dcc_control = hubp3_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_cursor_attributes = hubp32_cursor_set_attributes, .set_cursor_position = hubp2_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn35/dcn35_hubp.c +1 -0
@@ -199,6 +199,7 @@ static struct hubp_funcs dcn35_hubp_func .hubp_set_vm_system_aperture_settings = hubp3_set_vm_system_aperture_settings, .set_blank = hubp2_set_blank, .dcc_control = hubp3_dcc_control, + .hubp_reset = hubp_reset, .mem_program_viewport = min_set_viewport, .set_cursor_attributes = hubp2_cursor_set_attributes, .set_cursor_position = hubp2_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +2 -1
@@ -141,7 +141,7 @@ void hubp401_update_mall_sel(struct hubpvoid hubp401_init (struct hubp *hubp) { -//For now nothing to do, HUBPREQ_DEBUG_DB register is removed on DCN4x. +hubp_reset (hubp); } void hubp401_vready_at_or_After_vsync(struct hubp *hubp,
@@ -974,6 +974,7 @@ static struct hubp_funcs dcn401_hubp_fun .hubp_set_vm_system_aperture_settings = hubp3_set_vm_system_aperture_settings, .set_blank = hubp2_set_blank, .set_blank_regs = hubp2_set_blank_regs, + .hubp_reset = hubp_reset, .mem_program_viewport = hubp401_set_viewport, .set_cursor_attributes = hubp32_cursor_set_attributes, .set_cursor_position = hubp401_cursor_set_position,
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -0
@@ -1286,6 +1286,7 @@ void dcn10_plane_atomic_power_down(strucif (hws->funcs.hubp_pg_control) hws->funcs.hubp_pg_control (hws, hubp->inst, false); + hubp->funcs->hubp_reset (hubp); dpp->funcs->dpp_reset (dpp); REG_SET(DC_IP_REQUEST_CNTL, 0,
@@ -1447,6 +1448,7 @@ void dcn10_init_pipes(struct dc *dc, str/* Disable on the current state so the new one isn't cleared. */ pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i]; + hubp->funcs->hubp_reset (hubp); dpp->funcs->dpp_reset (dpp); pipe_ctx->stream_res.tg = tg;
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2 -0
@@ -787,6 +787,7 @@ void dcn35_init_pipes(struct dc *dc, str/* Disable on the current state so the new one isn't cleared. */ pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i]; + hubp->funcs->hubp_reset (hubp); dpp->funcs->dpp_reset (dpp); pipe_ctx->stream_res.tg = tg;
@@ -940,6 +941,7 @@ void dcn35_plane_atomic_disable(struct d/*to do, need to support both case*/ hubp->power_gated = true; + hubp->funcs->hubp_reset (hubp); dpp->funcs->dpp_reset (dpp); pipe_ctx->stream =NULL ;
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +2 -0
@@ -152,6 +152,8 @@ struct hubp_funcs {void (*dcc_control)(struct hubp *hubp,bool enable,enum hubp_ind_block_size blk_size); +void (*hubp_reset)(struct hubp *hubp); + void (*mem_program_viewport)( struct hubp *hubp, const struct rect *viewport,
Greg Kroah-Hartman
maintainerPATCH 587/590 KVM: x86: Plumb in the vCPU to kvm_x86_ops.hwapic_isr_update()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit 76bce9f10162cd4b36ac0b7889649b22baf70ebd upstream.
Pass the target vCPU to the hwapic_isr_update() vendor hook so that VMX can defer the update until after nested VM-Exit if an EOI for L1's vAPIC occurs while L2 is active.
Note, commit d39850f57d21 ("KVM: x86: Drop @vcpu parameter from kvm_x86_ops.hwapic_isr_update()") removed the parameter with the justification that doing so "allows for a decent amount of (future) cleanup in the APIC code", but it's not at all clear what cleanup was intended, or if it was ever realized.
No functional change intended.
--- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/lapic.c | 11 +++++------ arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/kvm/vmx/x86_ops.h | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -1
@@ -1735,7 +1735,7 @@ struct kvm_x86_ops {bool allow_apicv_in_x2apic_without_x2apic_virtualization;void (*refresh_apicv_exec_ctrl)(struct kvm_vcpu *vcpu);void (*hwapic_irr_update)(struct kvm_vcpu *vcpu,int max_irr); -void (*hwapic_isr_update)(int isr); +void (*hwapic_isr_update)(struct kvm_vcpu *vcpu,int isr);void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu,u64 *eoi_exit_bitmap);void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu);
arch/x86/kvm/lapic.c +5 -6
@@ -763,7 +763,7 @@ static inline void apic_set_isr(int vec,* just set SVI. */ if (unlikely (apic->apicv_active)) -kvm_x86_call (hwapic_isr_update)(vec); +kvm_x86_call (hwapic_isr_update)(apic->vcpu, vec);else { ++apic->isr_count;BUG_ON (apic->isr_count >MAX_APIC_VECTOR );
@@ -808,7 +808,7 @@ static inline void apic_clear_isr(int ve* and must be left alone. */ if (unlikely (apic->apicv_active)) -kvm_x86_call (hwapic_isr_update)(apic_find_highest_isr (apic)); +kvm_x86_call (hwapic_isr_update)(apic->vcpu,apic_find_highest_isr (apic));else { --apic->isr_count;BUG_ON (apic->isr_count <0 );
@@ -2786,7 +2786,7 @@ void kvm_lapic_reset(struct kvm_vcpu *vcif (apic->apicv_active) {kvm_x86_call (apicv_post_state_restore)(vcpu);kvm_x86_call (hwapic_irr_update)(vcpu,-1 ); -kvm_x86_call (hwapic_isr_update)(-1 ); +kvm_x86_call (hwapic_isr_update)(vcpu,-1 ); } vcpu->arch.apic_arb_prio =0 ;
@@ -3102,9 +3102,8 @@ int kvm_apic_set_state(struct kvm_vcpu *kvm_apic_update_apicv (vcpu);if (apic->apicv_active) {kvm_x86_call (apicv_post_state_restore)(vcpu); -kvm_x86_call (hwapic_irr_update)(vcpu, -apic_find_highest_irr (apic)); -kvm_x86_call (hwapic_isr_update)(apic_find_highest_isr (apic)); +kvm_x86_call (hwapic_irr_update)(vcpu,apic_find_highest_irr (apic)); +kvm_x86_call (hwapic_isr_update)(vcpu,apic_find_highest_isr (apic)); }kvm_make_request (KVM_REQ_EVENT , vcpu);if (ioapic_in_kernel (vcpu->kvm))
arch/x86/kvm/vmx/vmx.c +1 -1
@@ -6847,7 +6847,7 @@ out:kvm_release_pfn_clean (pfn); } -void vmx_hwapic_isr_update (int max_isr) +void vmx_hwapic_isr_update (struct kvm_vcpu *vcpu,int max_isr) {u16 status;u8 old;
arch/x86/kvm/vmx/x86_ops.h +1 -1
@@ -48,7 +48,7 @@ void vmx_migrate_timers(struct kvm_vcpuvoid vmx_set_virtual_apic_mode (struct kvm_vcpu *vcpu);void vmx_apicv_pre_state_restore (struct kvm_vcpu *vcpu);void vmx_hwapic_irr_update (struct kvm_vcpu *vcpu,int max_irr); -void vmx_hwapic_isr_update (int max_isr); +void vmx_hwapic_isr_update (struct kvm_vcpu *vcpu,int max_isr);int vmx_sync_pir_to_irr (struct kvm_vcpu *vcpu);void vmx_deliver_interrupt (struct kvm_lapic *apic,int delivery_mode,int trig_mode,int vector);
Greg Kroah-Hartman
maintainerPATCH 588/590 memcg: fix soft lockup in the OOM process
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <[email protected]>
commit ade81479c7dda1ce3eedb215c78bc615bbd04f06 upstream.
A soft lockup issue was found in the product with about 56,000 tasks were in the OOM cgroup, it was traversing them when the soft lockup was triggered.
watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [VM Thread:1503066] CPU: 2 PID: 1503066 Comm: VM Thread Kdump: loaded Tainted: G Hardware name: Huawei Cloud OpenStack Nova, BIOS RIP: 0010:console_unlock+0x343/0x540 RSP: 0000:ffffb751447db9a0 EFLAGS: 00000247 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 00000000ffffffff RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000247 RBP: ffffffffafc71f90 R08: 0000000000000000 R09: 0000000000000040 R10: 0000000000000080 R11: 0000000000000000 R12: ffffffffafc74bd0 R13: ffffffffaf60a220 R14: 0000000000000247 R15: 0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2fe6ad91f0 CR3: 00000004b2076003 CR4: 0000000000360ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: vprintk_emit+0x193/0x280 printk+0x52/0x6e dump_task+0x114/0x130 mem_cgroup_scan_tasks+0x76/0x100 dump_header+0x1fe/0x210 oom_kill_process+0xd1/0x100 out_of_memory+0x125/0x570 mem_cgroup_out_of_memory+0xb5/0xd0 try_charge+0x720/0x770 mem_cgroup_try_charge+0x86/0x180 mem_cgroup_try_charge_delay+0x1c/0x40 do_anonymous_page+0xb5/0x390 handle_mm_fault+0xc4/0x1f0
This is because thousands of processes are in the OOM cgroup, it takes a long time to traverse all of them. As a result, this lead to soft lockup in the OOM process.
To fix this issue, call 'cond_resched' in the 'mem_cgroup_scan_tasks' function per 1000 iterations. For global OOM, call 'touch_softlockup_watchdog' per 1000 iterations to avoid this issue.
--- mm/memcontrol.c | 7 ++++++- mm/oom_kill.c | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
mm/memcontrol.c +6 -1
@@ -1139,6 +1139,7 @@ void mem_cgroup_scan_tasks(struct mem_cg {struct mem_cgroup *iter;int ret =0 ; +int i =0 ;BUG_ON (mem_cgroup_is_root (memcg));
@@ -1147,8 +1148,12 @@ void mem_cgroup_scan_tasks(struct mem_cgstruct task_struct *task;css_task_iter_start (&iter->css,CSS_TASK_ITER_PROCS , &it); -while (!ret && (task =css_task_iter_next (&it))) +while (!ret && (task =css_task_iter_next (&it))) { +/* Avoid potential softlockup warning */ +if ((++i &1023 ) ==0 ) +cond_resched (); ret =fn (task, arg); + }css_task_iter_end (&it);if (ret) {mem_cgroup_iter_break (memcg, iter);
mm/oom_kill.c +7 -1
@@ -45,6 +45,7 @@#include <linux/init.h> #include <linux/mmu_notifier.h> #include <linux/cred.h> +#include <linux/nmi.h> #include <asm/tlb.h> #include "internal.h"
@@ -431,10 +432,15 @@ static void dump_tasks(struct oom_contromem_cgroup_scan_tasks (oc->memcg, dump_task, oc); else {struct task_struct *p; +int i =0 ;rcu_read_lock (); -for_each_process (p) +for_each_process (p) { +/* Avoid potential softlockup warning */ +if ((++i &1023 ) ==0 ) +touch_softlockup_watchdog ();dump_task (p, oc); + }rcu_read_unlock (); } }
Greg Kroah-Hartman
maintainerPATCH 589/590 LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP}
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <[email protected]>
commit f502ea618bf16d615d7dc6138c8988d3118fe750 upstream.
The maximum number of load/store watchpoints and fetch instruction watchpoints is 14 each according to LoongArch Reference Manual, so change 8 to 14 for the related code.
--- arch/loongarch/include/asm/hw_breakpoint.h | 4 - arch/loongarch/include/asm/loongarch.h | 60 +++++++++++++++++++++++++++++ arch/loongarch/kernel/hw_breakpoint.c | 16 ++++++- 3 files changed, 76 insertions(+), 4 deletions(-)
arch/loongarch/include/asm/hw_breakpoint.h +2 -2
@@ -38,8 +38,8 @@ struct arch_hw_breakpoint {* Limits. * Changing these will require modifications to the register accessors. */ -#define LOONGARCH_MAX_BRP 8 -#define LOONGARCH_MAX_WRP 8 +#define LOONGARCH_MAX_BRP 14 +#define LOONGARCH_MAX_WRP 14/* Virtual debug register bases. */ #define CSR_CFG_ADDR 0
arch/loongarch/include/asm/loongarch.h +60 -0
72 lines not on this page · raw message
arch/loongarch/kernel/hw_breakpoint.c +14 -2
@@ -51,7 +51,13 @@ int hw_breakpoint_slots(int type)READ_WB_REG_CASE (OFF ,4 ,REG ,T ,VAL ); \READ_WB_REG_CASE (OFF ,5 ,REG ,T ,VAL ); \READ_WB_REG_CASE (OFF ,6 ,REG ,T ,VAL ); \ -READ_WB_REG_CASE (OFF ,7 ,REG ,T ,VAL ); +READ_WB_REG_CASE (OFF ,7 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,8 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,9 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,10 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,11 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,12 ,REG ,T ,VAL ); \ +READ_WB_REG_CASE (OFF ,13 ,REG ,T ,VAL );#define GEN_WRITE_WB_REG_CASES (OFF ,REG ,T ,VAL ) \ WRITE_WB_REG_CASE(OFF, 0, REG, T, VAL); \
@@ -61,7 +67,13 @@ int hw_breakpoint_slots(int type)WRITE_WB_REG_CASE (OFF ,4 ,REG ,T ,VAL ); \WRITE_WB_REG_CASE (OFF ,5 ,REG ,T ,VAL ); \WRITE_WB_REG_CASE (OFF ,6 ,REG ,T ,VAL ); \ -WRITE_WB_REG_CASE (OFF ,7 ,REG ,T ,VAL ); +WRITE_WB_REG_CASE (OFF ,7 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,8 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,9 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,10 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,11 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,12 ,REG ,T ,VAL ); \ +WRITE_WB_REG_CASE (OFF ,13 ,REG ,T ,VAL );static u64 read_wb_reg (int reg,int n,int t) {
Greg Kroah-Hartman
maintainerPATCH 590/590 btrfs: do proper folio cleanup when run_delalloc_nocow() failed
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit c2b47df81c8e20a8e8cd94f0d7df211137ae94ed upstream.
[BUG]
With CONFIG_DEBUG_VM set, test case generic/476 has some chance to crash with the following VM_BUG_ON_FOLIO():
BTRFS error (device dm-3): cow_file_range failed, start 1146880 end 1253375 len 106496 ret -28 BTRFS error (device dm-3): run_delalloc_nocow failed, start 1146880 end 1253375 len 106496 ret -28
page: refcount:4 mapcount:0 mapping:00000000592787cc index:0x12 pfn:0x10664 aops:btrfs_aops [btrfs] ino:101 dentry name(?):"f1774" flags: 0x2fffff80004028(uptodate|lru|private|node=0|zone=2|lastcpupid=0xfffff) page dumped because: VM_BUG_ON_FOLIO(!folio_test_locked(folio)) ------------[ cut here ]------------ kernel BUG at mm/page-writeback.c:2992! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP CPU: 2 UID: 0 PID: 3943513 Comm: kworker/u24:15 Tainted: G OE 6.12.0-rc7-custom+ #87 Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Hardware name: QEMU KVM Virtual Machine, BIOS unknown 2/2/2022 Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs] pc : folio_clear_dirty_for_io+0x128/0x258 lr : folio_clear_dirty_for_io+0x128/0x258 Call trace: folio_clear_dirty_for_io+0x128/0x258 btrfs_folio_clamp_clear_dirty+0x80/0xd0 [btrfs] __process_folios_contig+0x154/0x268 [btrfs] extent_clear_unlock_delalloc+0x5c/0x80 [btrfs] run_delalloc_nocow+0x5f8/0x760 [btrfs] btrfs_run_delalloc_range+0xa8/0x220 [btrfs] writepage_delalloc+0x230/0x4c8 [btrfs] extent_writepage+0xb8/0x358 [btrfs] extent_write_cache_pages+0x21c/0x4e8 [btrfs] btrfs_writepages+0x94/0x150 [btrfs] do_writepages+0x74/0x190 filemap_fdatawrite_wbc+0x88/0xc8 start_delalloc_inodes+0x178/0x3a8 [btrfs] btrfs_start_delalloc_roots+0x174/0x280 [btrfs] shrink_delalloc+0x114/0x280 [btrfs] flush_space+0x250/0x2f8 [btrfs] btrfs_async_reclaim_data_space+0x180/0x228 [btrfs] process_one_work+0x164/0x408 worker_thread+0x25c/0x388 kthread+0x100/0x118 ret_from_fork+0x10/0x20 Code: 910a8021 a90363f7 a9046bf9 94012379 (d4210000) ---[ end trace 0000000000000000 ]---
[CAUSE]
The first two lines of extra debug messages show the problem is caused by the error handling of run_delalloc_nocow().
E.g. we have the following dirtied range (4K blocksize 4K page size):
0 16K 32K
|//////////////////////////////////////|
| Pre-allocated |
And the range [0, 16K) has a preallocated extent.
- Enter run_delalloc_nocow() for range [0, 16K)
Which found range [0, 16K) is preallocated, can do the proper NOCOW write.
- Enter fallback_to_fow() for range [16K, 32K)
Since the range [16K, 32K) is not backed by preallocated extent, we have to go COW.
- cow_file_range() failed for range [16K, 32K)
So cow_file_range() will do the clean up by clearing folio dirty, unlock the folios.
Now the folios in range [16K, 32K) is unlocked.
- Enter extent_clear_unlock_delalloc() from run_delalloc_nocow() Which is called with PAGE_START_WRITEBACK to start page writeback. But folios can only be marked writeback when it's properly locked, thus this triggered the VM_BUG_ON_FOLIO().
Furthermore there is another hidden but common bug that run_delalloc_nocow() is not clearing the folio dirty flags in its error handling path.
This is the common bug shared between run_delalloc_nocow() and cow_file_range().
[FIX]
- Clear folio dirty for range [@start, @cur_offset) Introduce a helper, cleanup_dirty_folios(), which
will find and lock the folio in the range, clear the dirty flag and start/end the writeback, with the extra handling for the @locked_folio.
- Introduce a helper to clear folio dirty, start and end writeback
- Introduce a helper to record the last failed COW range end This is to trace which range we should skip, to avoid double unlocking.
- Skip the failed COW range for the error handling
--- fs/btrfs/inode.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++---- fs/btrfs/subpage.h | 13 +++++++ 2 files changed, 102 insertions(+), 6 deletions(-)
fs/btrfs/inode.c +89 -6
@@ -2002,6 +2002,53 @@ static int can_nocow_file_extent(struct }/* +* Cleanup the dirty folios which will never be submitted due to error. +* +* When running a delalloc range, we may need to split the ranges (due to +* fragmentation or NOCOW). If we hit an error in the later part, we will error +* out and previously successfully executed range will never be submitted, thus +* we have to cleanup those folios by clearing their dirty flag, starting and +* finishing the writeback. +*/ +static void cleanup_dirty_folios (struct btrfs_inode *inode, +struct folio *locked_folio, +u64 start,u64 end,int error) +{ +struct btrfs_fs_info *fs_info = inode->root->fs_info; +struct address_space *mapping = inode->vfs_inode.i_mapping; +pgoff_t start_index = start >>PAGE_SHIFT ; +pgoff_t end_index = end >>PAGE_SHIFT ; +u32 len; + +ASSERT (end +1 - start <U32_MAX ); +ASSERT (IS_ALIGNED (start, fs_info->sectorsize) && +IS_ALIGNED (end +1 , fs_info->sectorsize)); + len = end +1 - start; + +/* +* Handle the locked folio first. +* The btrfs_folio_clamp_*() helpers can handle range out of the folio case. +*/ +btrfs_folio_clamp_finish_io (fs_info, locked_folio, start, len); + +for (pgoff_t index = start_index; index <= end_index; index++) { +struct folio *folio; + +/* Already handled at the beginning. */ +if (index == locked_folio->index) +continue ; + folio =__filemap_get_folio (mapping, index,FGP_LOCK ,GFP_NOFS ); +/* Cache already dropped, no need to do any cleanup. */ +if (IS_ERR (folio)) +continue ; +btrfs_folio_clamp_finish_io (fs_info, locked_folio, start, len); +folio_unlock (folio); +folio_put (folio); + } +mapping_set_error (mapping, error); +} + +/* * when nowcow writeback call back. This checks for snapshots or COW copies * of the extents that exist in the file, and COWs the file as required. *
@@ -2016,6 +2063,11 @@ static noinline int run_delalloc_nocow(sstruct btrfs_root *root = inode->root;struct btrfs_path *path;u64 cow_start = (u64)-1 ; +/* +* If not 0, represents the inclusive end of the last fallback_to_cow() +* range. Only for error handling. +*/ +u64 cow_end =0 ;u64 cur_offset = start;int ret;bool check_prev = true;
@@ -2176,6 +2228,7 @@ must_cow: found_key.offset - 1); cow_start = (u64)-1 ;if (ret) { + cow_end = found_key.offset -1 ;btrfs_dec_nocow_writers (nocow_bg); goto error; }
@@ -2249,11 +2302,12 @@ must_cow: cow_start = cur_offset;if (cow_start != (u64)-1 ) { - cur_offset = end; ret =fallback_to_cow (inode, locked_folio, cow_start, end); cow_start = (u64)-1 ; -if (ret) +if (ret) { + cow_end = end; goto error; + } }btrfs_free_path (path);
@@ -2261,12 +2315,41 @@ must_cow: error:/* +* There are several error cases: +* +* 1) Failed without falling back to COW +* start cur_offset end +* |/////////////| | +* +* For range [start, cur_offset) the folios are already unlocked (except +* @locked_folio), EXTENT_DELALLOC already removed. +* Only need to clear the dirty flag as they will never be submitted. +* Ordered extent and extent maps are handled by +* btrfs_mark_ordered_io_finished() inside run_delalloc_range(). +* +* 2) Failed with error from fallback_to_cow() +* start cur_offset cow_end end +* |/////////////|-----------| | +* +* For range [start, cur_offset) it's the same as case 1). +* But for range [cur_offset, cow_end), the folios have dirty flag +* cleared and unlocked, EXTENT_DEALLLOC cleared by cow_file_range(). +* +* Thus we should not call extent_clear_unlock_delalloc() on range +* [cur_offset, cow_end), as the folios are already unlocked. +* +* So clear the folio dirty flags for [start, cur_offset) first. +*/ +if (cur_offset > start) +cleanup_dirty_folios (inode, locked_folio, start, cur_offset -1 , ret); + +/* * If an error happened while a COW region is outstanding, cur_offset -* needs to be reset to cow_start to ensure the COW region is unlocked -* as well. +* needs to be reset to @cow_end + 1 to skip the COW range, as +* cow_file_range() will do the proper cleanup at error. */ -if (cow_start != (u64)-1 ) - cur_offset = cow_start; +if (cow_end) + cur_offset = cow_end +1 ;/* * We need to lock the extent here because we're clearing DELALLOC and
fs/btrfs/subpage.h +13 -0
@@ -152,6 +152,19 @@ DECLARE_BTRFS_SUBPAGE_OPS(writeback);DECLARE_BTRFS_SUBPAGE_OPS (ordered);DECLARE_BTRFS_SUBPAGE_OPS (checked); +/* +* Helper for error cleanup, where a folio will have its dirty flag cleared, +* with writeback started and finished. +*/ +static inline void btrfs_folio_clamp_finish_io (struct btrfs_fs_info *fs_info, +struct folio *locked_folio, +u64 start,u32 len) +{ +btrfs_folio_clamp_clear_dirty (fs_info, locked_folio, start, len); +btrfs_folio_clamp_set_writeback (fs_info, locked_folio, start, len); +btrfs_folio_clamp_clear_writeback (fs_info, locked_folio, start, len); +} +bool btrfs_subpage_clear_and_test_dirty (const struct btrfs_fs_info *fs_info,struct folio *folio,u64 start,u32 len);
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.
Am 05.02.2025 um 14:35 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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.
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
6.12.13-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 6.12.13-rc1rv
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 14.2.1 20250128, GNU ld (GNU Binutils) 2.43.1) #1 SMP PREEMPT_DYNAMIC Thu Feb 6 07:11:23 JST 2025
Thanks
The kernel, bpf tool, perf tool, and kselftest builds fine for v6.12.13-rc1 on x86 and arm64 Azure VM.
Kernel binary size for x86 build:
text data bss dec hex filename 27752542 17709406 6397952 51859900 31751bc vmlinux
Kernel binary size for arm64 build:
text data bss dec hex filename 36382423 14991749 1052816 52426988 31ff8ec vmlinux
Thanks,
Hardik
Hi Greg,
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Regressions on the arm64, builds failed with gcc-8 on Linux stable-rc 6.12.13-rc1. But the gcc-13 and clang builds pass.
This was also reported on Linus tree a few weeks back [1] and also seen on the stable-rc 6.13.2-rc1
Build regression: arm64, gcc-8 phy-fsl-samsung-hdmi.c __compiletime_assert_537
Good: v6.12.11
Bad: 6.12.13-rc1 (v6.12.11-634-g9ca4cdc5e984)
* arm64:
build:
* gcc-8-defconfig
* gcc-8-defconfig-40bc7ee5
* gcc-8-lkftconfig-hardening
## Build log
n function 'fsl_samsung_hdmi_phy_configure_pll_lock_det.isra.10',
inlined from 'fsl_samsung_hdmi_phy_configure' atdrivers/phy/freescale/phy-fsl-samsung-hdmi.c:523:2:include/linux/compiler_types.h:536:38: error: call to '__compiletime_assert_478' declared with attribute error: FIELD_PREP:
value too large for the field
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:517:4: note: in definition of macro
'__compiletime_assert'
prefix ## suffix(); \
^~~~~~include/linux/compiler_types.h:536:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~include/linux/bitfield.h:68:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
^~~~~~~~~~~~~~~~include/linux/bitfield.h:115:3: note: in expansion of macro '__BF_FIELD_CHECK'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~drivers/phy/freescale/phy-fsl-samsung-hdmi.c:401:9: note: in expansion of macro 'FIELD_PREP'
writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
^~~~~~~~~~make[6]: *** [scripts/Makefile.build:229:drivers/phy/freescale/phy-fsl-samsung-hdmi.o] Error 1
## Source
* kernel version: 6.12.13-rc1
* git tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git sha: 9ca4cdc5e9841a39adf2ea1fc8ae45d28b4c85ea
* git describe: v6.12.11-634-g9ca4cdc5e984
* project details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.11-634-g9ca4cdc5e984
## Build
* build log: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.11-634-g9ca4cdc5e984/testrun/27199296/suite/build/test/gcc-8-defconfig/
* build history:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.11-634-g9ca4cdc5e984/testrun/27199296/suite/build/test/gcc-8-defconfig/history/
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.11-634-g9ca4cdc5e984/testrun/27199296/suite/build/test/gcc-8-defconfig/
* kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2scp7S3yK4hl95VryTZn5t3cUVh/config
* architectures: arm64
* toolchain version: gcc-8
## Steps to reproduce
tuxmake --runtime podman --target-arch arm64 --toolchain gcc-8 --kconfig defconfig
## Links
[1] https://lore.kernel.org/all/CA+G9fYsHGrgZsEEVvP0XMcAhLyCYnrCPgZJ1puT6cfQBCGUB9g@mail.gmail.com/
--
Linaro LKFT
https://lkft.linaro.org
Jon Hunter
maintainerQuoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Failures detected for Tegra ...
Test results for stable-v6.12:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 115 pass, 1 failLinux version: 6.12.13-rc1-g9ca4cdc5e984
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Test failures: tegra194-p2972-0000: pm-system-suspend.sh
Jon
Jon Hunter
maintainerHi Greg,
Quoted 26 lines · Jon Hunter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.13-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Failures detected for Tegra ...
Test results for stable-v6.12:
10 builds: 10 pass, 0 fail 26 boots: 26 pass, 0 fail 116 tests: 115 pass, 1 fail
Quoted 7 lines
Linux version: 6.12.13-rc1-g9ca4cdc5e984
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000, tegra20-ventana, tegra210-p2371-2180, tegra210-p3450-0000, tegra30-cardhu-a04Test failures: tegra194-p2972-0000:
pm-system-suspend.sh
I am seeing a suspend regression on both 6.12.y and 6.13.y and bisect is pointing to the following commit ...
# first bad commit: [ca20473b60926b94fdf58f971ccda43e866c32d1] PM: sleep: core: Synchronize runtime PM status of parents and children
This is the crash log I am seeing ...
[ 216.035765] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 216.035982] Mem abort info: [ 216.036055] ESR = 0x0000000096000004 [ 216.036147] EC = 0x25: DABT (current EL), IL = 32 bits [ 216.036276] SET = 0, FnV = 0 [ 216.036349] EA = 0, S1PTW = 0 [ 216.036424] FSC = 0x04: level 0 translation fault [ 216.036544] Data abort info: [ 216.036612] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 216.036736] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 216.036848] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 216.036982] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001161af000 [ 216.037126] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000 [ 216.037340] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 216.037474] Modules linked in: snd_soc_tegra210_admaif snd_soc_tegra_pcm snd_soc_tegra186_asrc snd_soc_tegra210_mixer snd_soc_tegra210_ope snd_soc_tegra210_dmic snd_soc_tegra210_mvc snd_soc_tegra210_amx snd_soc_tegra210_adx snd_soc_tegra210_sfc snd_soc_tegra210_i2s tegra_drm drm_dp_aux_bus cec drm_display_helper drm_kms_helper tegra210_adma snd_soc_tegra210_ahub ucsi_ccg snd_soc_rt5659 typec_ucsi drm backlight crct10dif_ce snd_soc_rl6231 typec ina3221 snd_soc_tegra_audio_graph_card snd_soc_audio_graph_card snd_soc_simple_card_utils pwm_fan pwm_tegra snd_hda_codec_hdmi tegra_aconnect snd_hda_tegra phy_tegra194_p2u snd_hda_codec snd_hda_core tegra_xudc at24 lm90 pcie_tegra194 host1x tegra_bpmp_thermal ip_tables x_tables ipv6 [ 216.078599] CPU: 3 UID: 0 PID: 14542 Comm: rtcwake Tainted: G W 6.12.13-rc1-g9ca4cdc5e984 #1 [ 216.088830] Tainted: [W]=WARN [ 216.091978] Hardware name: NVIDIA Jetson AGX Xavier Developer Kit (DT) [ 216.098287] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 216.105628] pc : simple_pm_bus_runtime_suspend+0x14/0x48 [ 216.110883] lr : pm_generic_runtime_suspend+0x2c/0x44 [ 216.116132] sp : ffff80009180baf0 [ 216.119545] x29: ffff80009180baf0 x28: ffff0000873f9140 x27: 0000000000000000 [ 216.127152] x26: ffff800082b339b8 x25: ffff800082d09000 x24: ffff800080931f4c [ 216.134245] x23: 0000000000000000 x22: 0000000000000002 x21: ffff800082d09000 [ 216.141596] x20: ffff80008092d498 x19: ffff0000808ec410 x18: ffffffffffff4a00 [ 216.149116] x17: 2033303a35353a36 x16: 312031312d39302d x15: 000048df7f6eda30 [ 216.156378] x14: ffff0000873f91c0 x13: 0000000000000001 x12: 0000000000000001 [ 216.163552] x11: 000000320f13ac60 x10: 0000000000000a90 x9 : ffff80009180b8f0 [ 216.170645] x8 : ffff0000873f9c30 x7 : ffff0003fde5ca80 x6 : 0000000000000000 [ 216.177991] x5 : 0000000000000000 x4 : ffff800081f78680 x3 : ffff0000808ec410 [ 216.184908] x2 : ffff8000805bd4ec x1 : 0000000000000000 x0 : 0000000000000000 [ 216.192169] Call trace: [ 216.194619] simple_pm_bus_runtime_suspend+0x14/0x48 [ 216.199613] pm_generic_runtime_suspend+0x2c/0x44 [ 216.204159] pm_runtime_force_suspend+0x54/0x14c [ 216.208966] device_suspend_noirq+0x6c/0x278 [ 216.213169] dpm_suspend_noirq+0xc0/0x198 [ 216.217452] suspend_devices_and_enter+0x210/0x4c0 [ 216.222265] pm_suspend+0x164/0x1c8 [ 216.225682] state_store+0x8c/0xfc [ 216.229181] kobj_attr_store+0x18/0x2c [ 216.233116] sysfs_kf_write+0x44/0x54 [ 216.236616] kernfs_fop_write_iter+0x118/0x1a8 [ 216.240824] vfs_write+0x2b0/0x35c [ 216.244062] ksys_write+0x68/0xf4 [ 216.247727] __arm64_sys_write+0x1c/0x28 [ 216.251236] invoke_syscall+0x48/0x110 [ 216.255428] el0_svc_common.constprop.0+0x40/0xe8 [ 216.259981] do_el0_svc+0x20/0x2c [ 216.263215] el0_svc+0x30/0xd0 [ 216.266109] el0t_64_sync_handler+0x13c/0x158 [ 216.270572] el0t_64_sync+0x190/0x194 [ 216.274252] Code: a9be7bfd 910003fd a90153f3 f9403c00 (f9400014) [ 216.280303] ---[ end trace 0000000000000000 ]---
Thanks
Jon
Signature · 1 line
nvpublic
Jon Hunter
maintainerQuoted 35 lines · Jon Hunter
Hi Greg,
Quoted 32 lines · Jon Hunter
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/ patch-6.12.13-rc1.gz or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux- stable-rc.git linux-6.12.y and the diffstat can be found below.Quoted 3 lines
thanks,
greg k-h
Failures detected for Tegra ...
Test results for stable-v6.12:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 115 pass, 1 failLinux version: 6.12.13-rc1-g9ca4cdc5e984
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000, tegra20-ventana, tegra210-p2371-2180, tegra210-p3450-0000, tegra30-cardhu-a04
Quoted 7 lines
Quoted 1 line
Test failures: tegra194-p2972-0000:
pm-system-suspend.shI am seeing a suspend regression on both 6.12.y and 6.13.y and bisect is pointing to the following commit ...
# first bad commit: [ca20473b60926b94fdf58f971ccda43e866c32d1] PM: sleep: core: Synchronize runtime PM status of parents and children
And 6.6.y too!
Jon
Signature · 1 line
nvpublic
Greg Kroah-Hartman
maintainerQuoted 42 lines · Jon Hunter
Quoted 40 lines · Jon Hunter
Hi Greg,
Quoted 35 lines · Jon Hunter
Quoted 16 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.13 release. There are 590 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 Fri, 07 Feb 2025 13:43:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/
patch-6.12.13-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
stable-rc.git linux-6.12.y
and the diffstat can be found below.Quoted 3 lines
thanks,
greg k-h
Failures detected for Tegra ...
Test results for stable-v6.12:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 115 pass, 1 failLinux version: 6.12.13-rc1-g9ca4cdc5e984
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000, tegra20-ventana, tegra210-p2371-2180, tegra210-p3450-0000, tegra30-cardhu-a04Test failures: tegra194-p2972-0000:
pm-system-suspend.sh
Quoted 7 lines
Quoted 5 lines
I am seeing a suspend regression on both 6.12.y and 6.13.y and bisect is pointing to the following commit ...
# first bad commit: [ca20473b60926b94fdf58f971ccda43e866c32d1] PM: sleep: core: Synchronize runtime PM status of parents and childrenAnd 6.6.y too!
Thanks, let me drop it from all stable queues now and I'll push out some -rc2 releases.
greg k-h