Skip to contentSkip to conversation

6.12.97-rc1 review

PATCH In review Greg Kroah-Hartman 15 participants 1,324 messages Jul 21 – Aug 12 Page 10 of 10

Subsystems (12)
lore
Share & tools
lore
author maintainer
#1256 lore raw

PATCH 1216/1276 btrfs: remove folio parameter from ordered io related functions

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qu Wenruo <[email protected]>

[ Upstream commit a11d6912fdd9e57aff889ec97256b1d6b4e5bf06 ]

Both functions btrfs_finish_ordered_extent() and btrfs_mark_ordered_io_finished() are accepting an optional folio parameter.

That @folio is passed into can_finish_ordered_extent(), which later will test and clear the ordered flag for the involved range.

However I do not think there is any other call site that can clear ordered flags of an page cache folio and can affect can_finish_ordered_extent().

There are limited *_clear_ordered() callers out of can_finish_ordered_extent() function:

- btrfs_migrate_folio()
This is completely unrelated, it's just migrating the ordered flag to the new folio.

- btrfs_cleanup_ordered_extents()
We manually clean the ordered flags of all involved folios, then call btrfs_mark_ordered_io_finished() without a @folio parameter. So it doesn't need and didn't pass a @folio parameter in the first place.

- btrfs_writepage_fixup_worker()
This function is going to be removed soon, and we should not hit that function anymore.

- btrfs_invalidate_folio()
This is the real call site we need to bother with.

If we already have a bio running, btrfs_finish_ordered_extent() in end_bbio_data_write() will be executed first, as btrfs_invalidate_folio() will wait for the writeback to finish.

Thus if there is a running bio, it will not see the range has ordered flags, and just skip to the next range.

If there is no bio running, meaning the ordered extent is created but the folio is not yet submitted.

In that case btrfs_invalidate_folio() will manually clear the folio ordered range, but then manually finish the ordered extent with btrfs_dec_test_ordered_pending() without bothering the folio ordered flags.

Meaning if the OE range with folio ordered flags will be finished manually without the need to call can_finish_ordered_extent().

This means all can_finish_ordered_extent() call sites should get a range that has folio ordered flag set, thus the old "return false" branch should never be triggered.

Now we can:

- Remove the @folio parameter from involved functions
* btrfs_mark_ordered_io_finished()
* btrfs_finish_ordered_extent()

For call sites passing a @folio into those functions, let them manually clear the ordered flag of involved folios.

- Move btrfs_finish_ordered_extent() out of the loop in end_bbio_data_write()

We only need to call btrfs_finish_ordered_extent() once per bbio, not per folio.

- Add an ASSERT() to make sure all folio ranges have ordered flags It's only for end_bbio_data_write().

And we already have enough safe nets to catch over-accounting of ordered extents.

Stable-dep-of: 66ff4d366e7e ("btrfs: fix false IO failure after falling back to buffered write")

---
 fs/btrfs/compression.c  |    2 +-
 fs/btrfs/direct-io.c    |    9 ++++-----
 fs/btrfs/extent_io.c    |   23 ++++++++++++++---------
 fs/btrfs/inode.c        |    6 ++++--
 fs/btrfs/ordered-data.c |   29 +++++------------------------
 fs/btrfs/ordered-data.h |    6 ++----
 6 files changed, 30 insertions(+), 45 deletions(-)
fs/btrfs/compression.c +1 -1
@@ -316,7 +316,7 @@ static void btrfs_finish_compressed_writ
 	struct compressed_bio *cb =
 		container_of(work, struct compressed_bio, write_end_work);
 
-	btrfs_finish_ordered_extent(cb->bbio.ordered, NULL, cb->start, cb->len,
+	btrfs_finish_ordered_extent(cb->bbio.ordered, cb->start, cb->len,
 				    cb->bbio.bio.bi_status == BLK_STS_OK);
 
 	if (cb->writeback)
fs/btrfs/direct-io.c +4 -5
@@ -624,7 +624,7 @@ static int btrfs_dio_iomap_end(struct in
 		pos += submitted;
 		length -= submitted;
 		if (write)
-			btrfs_finish_ordered_extent(dio_data->ordered, NULL,
+			btrfs_finish_ordered_extent(dio_data->ordered,
 						    pos, length, false);
 		else
 			unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
@@ -656,9 +656,8 @@ static void btrfs_dio_end_io(struct btrf
 	}
 
 	if (btrfs_op(bio) == BTRFS_MAP_WRITE) {
-		btrfs_finish_ordered_extent(bbio->ordered, NULL,
-					    dip->file_offset, dip->bytes,
-					    !bio->bi_status);
+		btrfs_finish_ordered_extent(bbio->ordered, dip->file_offset,
+					    dip->bytes, !bio->bi_status);
 	} else {
 		unlock_dio_extent(&inode->io_tree, dip->file_offset,
 				  dip->file_offset + dip->bytes - 1, NULL);
@@ -736,7 +735,7 @@ static void btrfs_dio_submit_io(const st
 
 		ret = btrfs_extract_ordered_extent(bbio, dio_data->ordered);
 		if (ret) {
-			btrfs_finish_ordered_extent(dio_data->ordered, NULL,
+			btrfs_finish_ordered_extent(dio_data->ordered,
 						    file_offset, dip->bytes,
 						    !ret);
 			bio->bi_status = errno_to_blk_status(ret);
fs/btrfs/extent_io.c +14 -9
@@ -485,6 +485,7 @@ static void end_bbio_data_write(struct b
 	int error = blk_status_to_errno(bio->bi_status);
 	struct folio_iter fi;
 	const u32 sectorsize = fs_info->sectorsize;
+	u32 bio_size = 0;
 
 	ASSERT(!bio_flagged(bio, BIO_CLONED));
 	bio_for_each_folio_all(fi, bio) {
@@ -495,6 +496,7 @@ static void end_bbio_data_write(struct b
 		/* Only order 0 (single page) folios are allowed for data. */
 		ASSERT(folio_order(folio) == 0);
 
+		bio_size += len;
 		/* Our read/write should always be sector aligned. */
 		if (!IS_ALIGNED(fi.offset, sectorsize))
 			btrfs_err(fs_info,
@@ -505,13 +507,15 @@ static void end_bbio_data_write(struct b
 		"incomplete page write with offset %zu and length %zu",
 				   fi.offset, fi.length);
 
-		btrfs_finish_ordered_extent(bbio->ordered, folio, start, len,
-					    !error);
 		if (error)
 			mapping_set_error(folio->mapping, error);
+
+		ASSERT(btrfs_folio_test_ordered(fs_info, folio, start, len));
+		btrfs_folio_clear_ordered(fs_info, folio, start, len);
 		btrfs_folio_clear_writeback(fs_info, folio, start, len);
 	}
 
+	btrfs_finish_ordered_extent(bbio->ordered, bbio->file_offset, bio_size, !error);
 	bio_put(bio);
 }
 
@@ -1384,7 +1388,8 @@ static noinline_for_stack int writepage_
 			u64 start = page_start + (start_bit << fs_info->sectorsize_bits);
 			u32 len = (end_bit - start_bit) << fs_info->sectorsize_bits;
 
-			btrfs_mark_ordered_io_finished(inode, folio, start, len, false);
+			btrfs_folio_clear_ordered(fs_info, folio, start, len);
+			btrfs_mark_ordered_io_finished(inode, start, len, false);
 		}
 		return ret;
 	}
@@ -1460,6 +1465,7 @@ static int submit_one_sector(struct btrf
 		 * ordered extent.
 		 */
 		btrfs_folio_clear_dirty(fs_info, folio, filepos, sectorsize);
+		btrfs_folio_clear_ordered(fs_info, folio, filepos, sectorsize);
 		btrfs_folio_set_writeback(fs_info, folio, filepos, sectorsize);
 		btrfs_folio_clear_writeback(fs_info, folio, filepos, sectorsize);
 
@@ -1467,8 +1473,8 @@ static int submit_one_sector(struct btrf
 		 * Since there is no bio submitted to finish the ordered
 		 * extent, we have to manually finish this sector.
 		 */
-		btrfs_mark_ordered_io_finished(inode, folio, filepos,
-					       fs_info->sectorsize, false);
+		btrfs_mark_ordered_io_finished(inode, filepos, fs_info->sectorsize,
+					       false);
 		return PTR_ERR(em);
 	}
 
@@ -1573,8 +1579,8 @@ static noinline_for_stack int extent_wri
 			spin_unlock_irqrestore(&inode->ordered_tree_lock, flags);
 			btrfs_put_ordered_extent(ordered);
 
-			btrfs_mark_ordered_io_finished(inode, folio, cur,
-						       fs_info->sectorsize, true);
+			btrfs_folio_clear_ordered(fs_info, folio, cur, fs_info->sectorsize);
+			btrfs_mark_ordered_io_finished(inode, cur, fs_info->sectorsize, true);
 			/*
 			 * This range is beyond i_size, thus we don't need to
 			 * bother writing back.
@@ -2415,8 +2421,7 @@ void extent_write_locked_range(struct in
 		 * code is just in case, but shouldn't actually be run.
 		 */
 		if (IS_ERR(folio)) {
-			btrfs_mark_ordered_io_finished(BTRFS_I(inode), NULL,
-						       cur, cur_len, false);
+			btrfs_mark_ordered_io_finished(BTRFS_I(inode), cur, cur_len, false);
 			mapping_set_error(mapping, PTR_ERR(folio));
 			cur = cur_end + 1;
 			continue;
fs/btrfs/inode.c +4 -2
@@ -456,7 +456,7 @@ static inline void btrfs_cleanup_ordered
 		}
 	}
 
-	return btrfs_mark_ordered_io_finished(inode, NULL, offset, bytes, false);
+	return btrfs_mark_ordered_io_finished(inode, offset, bytes, false);
 }
 
 static int btrfs_dirty_inode(struct btrfs_inode *inode);
@@ -2937,7 +2937,9 @@ out_page:
 		 * to reflect the errors and clean the page.
 		 */
 		mapping_set_error(folio->mapping, ret);
-		btrfs_mark_ordered_io_finished(inode, folio, page_start,
+		btrfs_folio_clear_ordered(fs_info, folio, page_start,
+					  folio_size(folio));
+		btrfs_mark_ordered_io_finished(inode, page_start,
 					       folio_size(folio), !ret);
 		folio_clear_dirty_for_io(folio);
 	}
fs/btrfs/ordered-data.c +5 -24
@@ -338,30 +338,13 @@ static void finish_ordered_fn(struct btr
 }
 
 static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
-				      struct folio *folio, u64 file_offset,
-				      u64 len, bool uptodate)
+				      u64 file_offset, u64 len, bool uptodate)
 {
 	struct btrfs_inode *inode = ordered->inode;
 	struct btrfs_fs_info *fs_info = inode->root->fs_info;
 
 	lockdep_assert_held(&inode->ordered_tree_lock);
 
-	if (folio) {
-		ASSERT(folio->mapping);
-		ASSERT(folio_pos(folio) <= file_offset);
-		ASSERT(file_offset + len <= folio_pos(folio) + folio_size(folio));
-
-		/*
-		 * Ordered (Private2) bit indicates whether we still have
-		 * pending io unfinished for the ordered extent.
-		 *
-		 * If there's no such bit, we need to skip to next range.
-		 */
-		if (!btrfs_folio_test_ordered(fs_info, folio, file_offset, len))
-			return false;
-		btrfs_folio_clear_ordered(fs_info, folio, file_offset, len);
-	}
-
 	/* Now we're fine to update the accounting. */
 	if (WARN_ON_ONCE(len > ordered->bytes_left)) {
 		btrfs_crit(fs_info,
@@ -403,8 +386,7 @@ static void btrfs_queue_ordered_fn(struc
 }
 
 void btrfs_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
-				 struct folio *folio, u64 file_offset, u64 len,
-				 bool uptodate)
+				 u64 file_offset, u64 len, bool uptodate)
 {
 	struct btrfs_inode *inode = ordered->inode;
 	unsigned long flags;
@@ -413,7 +395,7 @@ void btrfs_finish_ordered_extent(struct
 	trace_btrfs_finish_ordered_extent(inode, file_offset, len, uptodate);
 
 	spin_lock_irqsave(&inode->ordered_tree_lock, flags);
-	ret = can_finish_ordered_extent(ordered, folio, file_offset, len,
+	ret = can_finish_ordered_extent(ordered, file_offset, len,
 					uptodate);
 	spin_unlock_irqrestore(&inode->ordered_tree_lock, flags);
 
@@ -466,8 +448,7 @@ void btrfs_finish_ordered_extent(struct
  * extent(s) covering it.
  */
 void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode,
-				    struct folio *folio, u64 file_offset,
-				    u64 num_bytes, bool uptodate)
+				    u64 file_offset, u64 num_bytes, bool uptodate)
 {
 	struct rb_node *node;
 	struct btrfs_ordered_extent *entry = NULL;
@@ -530,7 +511,7 @@ void btrfs_mark_ordered_io_finished(stru
 		ASSERT(end + 1 - cur < U32_MAX);
 		len = end + 1 - cur;
 
-		if (can_finish_ordered_extent(entry, folio, cur, len, uptodate)) {
+		if (can_finish_ordered_extent(entry, cur, len, uptodate)) {
 			spin_unlock_irqrestore(&inode->ordered_tree_lock, flags);
 			btrfs_queue_ordered_fn(entry);
 			spin_lock_irqsave(&inode->ordered_tree_lock, flags);
fs/btrfs/ordered-data.h +2 -4
@@ -163,11 +163,9 @@ void btrfs_put_ordered_extent(struct btr
 void btrfs_remove_ordered_extent(struct btrfs_inode *btrfs_inode,
 				struct btrfs_ordered_extent *entry);
 void btrfs_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
-				 struct folio *folio, u64 file_offset, u64 len,
-				 bool uptodate);
+				 u64 file_offset, u64 len, bool uptodate);
 void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode,
-				    struct folio *folio, u64 file_offset,
-				    u64 num_bytes, bool uptodate);
+				    u64 file_offset, u64 num_bytes, bool uptodate);
 bool btrfs_dec_test_ordered_pending(struct btrfs_inode *inode,
 				    struct btrfs_ordered_extent **cached,
 				    u64 file_offset, u64 io_size);
author maintainer
#1257 lore raw

PATCH 1217/1276 btrfs: remove the COW fixup mechanism

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qu Wenruo <[email protected]>

[ Upstream commit b2a9f217ad3fa8012940744059956b20a3971135 ]

[BACKGROUND]
Btrfs has a special mechanism called COW fixup, which detects dirty pages without an ordered extent (folio ordered flag).

Normally a dirty folio must go through delayed allocation (delalloc) before it can be submitted, and delalloc will create an ordered extent for it and mark the range with ordered flag.

However in older kernels, there are bugs related to get_user_pages() which can lead to some page marked dirty but without notifying the fs to properly prepare them for writeback.

In that case without an ordered extent btrfs is unable to properly submit such dirty folios, thus the COW fixup mechanism is introduced, which do the extra space reservation so that they can be written back properly.

[MODERN SOLUTIONS]
The MM layer has solved it properly now with the introduction of pin_user_pages*(), so we're handling cases that are no longer valid.

So commit 7ca3e84980ef ("btrfs: reject out-of-band dirty folios during writeback") is introduced to change the behavior from going through COW fixup to rejecting them directly for experimental builds.

So far it works fine, but when errors are injected into the IO path, we have random failures triggering the new warnings.

It looks like we have error path that cleared the ordered flag but leaves the folio dirty flag, which later triggers the warning.

[REMOVAL OF COW FIXUP]
Although I hope to fix all those known warnings cases, I just can not figure out the root cause yet.

But on the other hand, if we remove the ordered and checked flags in the future, and purely rely on the dirty flags and ordered extent search, we can get a much cleaner handling.

Considering it's no longer hitting the COW fixup for normal IO paths, I think it's finally the time to remove the COW fixup completely.

Furthermore, the function name "btrfs_writepage_cow_fixup()" is no longer meaningful, and since it's pretty small, only a folio flag check with error message, there is no need to put it as a dedicated helper, just open code it inside extent_writepage_io().

Stable-dep-of: 95ee2231896d ("btrfs: check and set EXTENT_DELALLOC_NEW before clearing EXTENT_DELALLOC")

---
 fs/btrfs/btrfs_inode.h |    1 
 fs/btrfs/disk-io.c     |   16 ----
 fs/btrfs/extent_io.c   |   17 ++--
 fs/btrfs/fs.h          |    7 -
 fs/btrfs/inode.c       |  187 -------------------------------------------------
 5 files changed, 12 insertions(+), 216 deletions(-)
fs/btrfs/btrfs_inode.h +0 -1
@@ -609,7 +609,6 @@ int btrfs_prealloc_file_range_trans(stru
 				    loff_t actual_len, u64 *alloc_hint);
 int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct folio *locked_folio,
 			     u64 start, u64 end, struct writeback_control *wbc);
-int btrfs_writepage_cow_fixup(struct folio *folio);
 int btrfs_encoded_io_compression_from_extent(struct btrfs_fs_info *fs_info,
 					     int compress_type);
 int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
fs/btrfs/disk-io.c +1 -15
@@ -1747,7 +1747,6 @@ static int read_backup_root(struct btrfs
 /* helper to cleanup workers */
 static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
 {
-	btrfs_destroy_workqueue(fs_info->fixup_workers);
 	btrfs_destroy_workqueue(fs_info->delalloc_workers);
 	btrfs_destroy_workqueue(fs_info->workers);
 	if (fs_info->endio_workers)
@@ -1954,9 +1953,6 @@ static int btrfs_init_workqueues(struct
 	fs_info->caching_workers =
 		btrfs_alloc_workqueue(fs_info, "cache", flags, max_active, 0);
 
-	fs_info->fixup_workers =
-		btrfs_alloc_ordered_workqueue(fs_info, "fixup", ordered_flags);
-
 	fs_info->endio_workers =
 		alloc_workqueue("btrfs-endio", flags, max_active);
 	fs_info->endio_meta_workers =
@@ -1985,7 +1981,7 @@ static int btrfs_init_workqueues(struct
 	      fs_info->compressed_write_workers &&
 	      fs_info->endio_write_workers &&
 	      fs_info->endio_freespace_worker && fs_info->rmw_workers &&
-	      fs_info->caching_workers && fs_info->fixup_workers &&
+	      fs_info->caching_workers &&
 	      fs_info->delayed_workers && fs_info->qgroup_rescan_workers &&
 	      fs_info->discard_ctl.discard_workers)) {
 		return -ENOMEM;
@@ -4246,16 +4242,6 @@ void __cold close_ctree(struct btrfs_fs_
 		btrfs_error_commit_super(fs_info);
 
 	/*
-	 * Wait for any fixup workers to complete.
-	 * If we don't wait for them here and they are still running by the time
-	 * we call kthread_stop() against the cleaner kthread further below, we
-	 * get an use-after-free on the cleaner because the fixup worker adds an
-	 * inode to the list of delayed iputs and then attempts to wakeup the
-	 * cleaner kthread, which was already stopped and destroyed. We parked
-	 * already the cleaner, but below we run all pending delayed iputs.
-	 */
-	btrfs_flush_workqueue(fs_info->fixup_workers);
-	/*
 	 * Similar case here, we have to wait for delalloc workers before we
 	 * proceed below and stop the cleaner kthread, otherwise we trigger a
 	 * use-after-tree on the cleaner kthread task_struct when a delalloc
fs/btrfs/extent_io.c +11 -6
@@ -1543,12 +1543,17 @@ static noinline_for_stack int extent_wri
 
 	ASSERT(start >= folio_start && end <= folio_end);
 
-	ret = btrfs_writepage_cow_fixup(folio);
-	if (ret) {
-		/* Fixup worker will requeue */
-		folio_redirty_for_writepage(bio_ctrl->wbc, folio);
-		folio_unlock(folio);
-		return 1;
+	if (unlikely(!folio_test_ordered(folio))) {
+		WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
+		btrfs_err_rl(fs_info,
+	"root %lld ino %llu folio %llu is marked dirty without notifying the fs",
+			     btrfs_root_id(inode->root),
+			     btrfs_ino(inode),
+			     folio_pos(folio));
+		btrfs_folio_clear_dirty(fs_info, folio, start, len);
+		btrfs_folio_set_writeback(fs_info, folio, start, len);
+		btrfs_folio_clear_writeback(fs_info, folio, start, len);
+		return -EUCLEAN;
 	}
 
 	bitmap_set(&range_bitmap, (start - folio_pos(folio)) >> fs_info->sectorsize_bits,
fs/btrfs/fs.h +0 -7
@@ -620,13 +620,6 @@ struct btrfs_fs_info {
 	struct btrfs_workqueue *endio_write_workers;
 	struct btrfs_workqueue *endio_freespace_worker;
 	struct btrfs_workqueue *caching_workers;
-
-	/*
-	 * Fixup workers take dirty pages that didn't properly go through the
-	 * cow mechanism and make them safe to write.  It happens for the
-	 * sys_munmap function call path.
-	 */
-	struct btrfs_workqueue *fixup_workers;
 	struct btrfs_workqueue *delayed_workers;
 
 	struct task_struct *transaction_kthread;
fs/btrfs/inode.c +0 -187

193 lines not on this page · raw message

author maintainer
#1258 lore raw

PATCH 1218/1276 btrfs: check and set EXTENT_DELALLOC_NEW before clearing EXTENT_DELALLOC

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qu Wenruo <[email protected]>

[ Upstream commit 95ee2231896d5f2a31760411429075a99d6045a7 ]

[WARNING]
When running test cases with injected errors or shutdown, e.g. generic/388 or generic/475, there is a chance that the following kernel warning is triggered:

BTRFS info (device dm-2): first mount of filesystem d8a19a28-3232-4809-b0df-38df83e71bff BTRFS info (device dm-2): using crc32c checksum algorithm
BTRFS info (device dm-2): checking UUID tree
BTRFS info (device dm-2): turning on async discard
BTRFS info (device dm-2): enabling free space tree
BTRFS critical (device dm-2 state E): emergency shutdown

  ------------[ cut here ]------------
  WARNING: extent_io.c:1742 at extent_writepage_io+0x437/0x520 [btrfs], CPU#2: kworker/u43:2/651591
  CPU: 2 UID: 0 PID: 651591 Comm: kworker/u43:2 Tainted: G        W  OE       7.0.0-rc6-custom+ #365 PREEMPT(full)  5804053f02137e627472d94b5128cc9fcb110e88
  RIP: 0010:extent_writepage_io+0x437/0x520 [btrfs]
  Call Trace:
   <TASK>
   extent_write_cache_pages+0x2a5/0x820 [btrfs 70299925d0856939e93b17d480651713b3cbba58]
   btrfs_writepages+0x74/0x130 [btrfs 70299925d0856939e93b17d480651713b3cbba58]
   do_writepages+0xd0/0x160
   __writeback_single_inode+0x42/0x340
   writeback_sb_inodes+0x22d/0x580
   wb_writeback+0xc6/0x360
   wb_workfn+0xbd/0x470
   process_one_work+0x198/0x3b0
   worker_thread+0x1c8/0x330
   kthread+0xee/0x120
   ret_from_fork+0x2a6/0x330
   ret_from_fork_asm+0x11/0x20
   </TASK>
  ---[ end trace 0000000000000000 ]---
  BTRFS error (device dm-2 state E): root 5 ino 259 folio 1323008 is marked dirty without notifying the fs
  BTRFS error (device dm-2 state E): failed to submit blocks, root=5 inode=259 folio=1323008 submit_bitmap=0: -117
  BTRFS info (device dm-2 state E): last unmount of filesystem d8a19a28-3232-4809-b0df-38df83e71bff

[CAUSE]
Inside btrfs we have the following pattern in several locations, for example inside btrfs_dirty_folio():

	btrfs_clear_extent_bit(&inode->io_tree, start_pos, end_of_last_block,
			       EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG,
			       cached);

	ret = btrfs_set_extent_delalloc(inode, start_pos, end_of_last_block,
					extra_bits, cached);
	if (ret)
		return ret;

However btrfs_set_extent_delalloc() can return IO errors other than -ENOMEM through the following callchain:

btrfs_set_extent_delalloc()
\- btrfs_find_new_delalloc_bytes()

    \- btrfs_get_extent()
       \- btrfs_lookup_file_extent()
          \- btrfs_search_slot()

When such IO error happened, the previous btrfs_clear_extent_bit() has cleared the EXTENT_DELALLOC for the range, and we're expecting btrfs_set_extent_delalloc() to re-set EXTENT_DELALLOC.

But since btrfs_set_extent_delalloc() failed before btrfs_set_extent_bit(), EXTENT_DELALLOC flag is no longer present.

And if the folio range is dirty before entering btrfs_set_extent_delalloc(), we got a dirty folio but no EXTENT_DELALLOC flag now.

Then we hit the folio writeback:

extent_writepage()

  |- writepage_delalloc()
  |  No ordered extent is created, as there is no EXTENT_DELALLOC set
  |  for the folio range.
  |  This also means the folio has no ordered flag set.
  |
  |- extent_writepage_io()

\- if (unlikely(!folio_test_ordered(folio))
Now we hit the warning.

[FIX]
Introduce a new helper, btrfs_reset_extent_delalloc() to replace the currently open-coded btrfs_clear_extent_bit() + btrfs_set_extent_delalloc() combination.

Instead of calling btrfs_clear_extent_bit() first, update EXTENT_DELALLOC_NEW first, as that part can fail due to metadata IO, meanwhile btrfs_clear_extent_bit() and btrfs_set_extent_bit() won't return any error but retry memory allocation until succeeded.

This allows us to fail early without clearing EXTENT_DELALLOC bit, so even if that new btrfs_reset_extent_delalloc() failed before touching EXTENT_DELALLOC, the existing dirty range will still have their old EXTENT_DELALLOC flag present, thus avoid the warning.

---
 fs/btrfs/btrfs_inode.h |    2 +
 fs/btrfs/file.c        |   27 +++--------------------
 fs/btrfs/inode.c       |   57 ++++++++++++++++++++++++++++++++++++++++++-------
 fs/btrfs/reflink.c     |    5 ----
 4 files changed, 57 insertions(+), 34 deletions(-)
fs/btrfs/btrfs_inode.h +2 -0
@@ -547,6 +547,8 @@ int btrfs_start_delalloc_roots(struct bt
 int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
 			      unsigned int extra_bits,
 			      struct extent_state **cached_state);
+int btrfs_reset_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
+				unsigned int extra_bits, struct extent_state **cached_state);
 
 struct btrfs_new_inode_args {
 	/* Input */
fs/btrfs/file.c +4 -23
@@ -150,16 +150,8 @@ int btrfs_dirty_pages(struct btrfs_inode
 
 	end_of_last_block = start_pos + num_bytes - 1;
 
-	/*
-	 * The pages may have already been dirty, clear out old accounting so
-	 * we can set things up properly
-	 */
-	clear_extent_bit(&inode->io_tree, start_pos, end_of_last_block,
-			 EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG,
-			 cached);
-
-	ret = btrfs_set_extent_delalloc(inode, start_pos, end_of_last_block,
-					extra_bits, cached);
+	ret = btrfs_reset_extent_delalloc(inode, start_pos, end_of_last_block,
+					  extra_bits, cached);
 	if (ret)
 		return ret;
 
@@ -1997,19 +1989,8 @@ again:
 		}
 	}
 
-	/*
-	 * page_mkwrite gets called when the page is firstly dirtied after it's
-	 * faulted in, but write(2) could also dirty a page and set delalloc
-	 * bits, thus in this case for space account reason, we still need to
-	 * clear any delalloc bits within this page range since we have to
-	 * reserve data&meta space before lock_page() (see above comments).
-	 */
-	clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end,
-			  EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING |
-			  EXTENT_DEFRAG, &cached_state);
-
-	ret2 = btrfs_set_extent_delalloc(BTRFS_I(inode), page_start, end, 0,
-					&cached_state);
+	ret2 = btrfs_reset_extent_delalloc(BTRFS_I(inode), page_start, end, 0,
+					   &cached_state);
 	if (ret2) {
 		unlock_extent(io_tree, page_start, page_end, &cached_state);
 		ret = VM_FAULT_SIGBUS;
fs/btrfs/inode.c +50 -7

75 lines not on this page · raw message

fs/btrfs/reflink.c +1 -4
@@ -95,10 +95,7 @@ static int copy_inline_to_page(struct bt
 	if (ret < 0)
 		goto out_unlock;
 
-	clear_extent_bit(&inode->io_tree, file_offset, range_end,
-			 EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG,
-			 NULL);
-	ret = btrfs_set_extent_delalloc(inode, file_offset, range_end, 0, NULL);
+	ret = btrfs_reset_extent_delalloc(inode, file_offset, range_end, 0, NULL);
 	if (ret)
 		goto out_unlock;
 
author maintainer
#1259 lore raw

PATCH 1219/1276 crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

[ Upstream commit 9770b428b1a28360663f1f5e524ee458b4cf454b ]

Move dev_info and dev_err messages related to SEV/SNP initialization and shutdown into __sev_platform_init_locked(), __sev_snp_init_locked() and __sev_platform_shutdown_locked(), __sev_snp_shutdown_locked() so that they don't need to be issued from callers.

This allows both _sev_platform_init_locked() and various SEV/SNP ioctls to call __sev_platform_init_locked(), __sev_snp_init_locked() and __sev_platform_shutdown_locked(), __sev_snp_shutdown_locked() for implicit SEV/SNP initialization and shutdown without additionally printing any errors/success messages.

Stable-dep-of: 08f0e65e784c ("crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)")

---
 drivers/crypto/ccp/sev-dev.c |   44 +++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)
drivers/crypto/ccp/sev-dev.c +32 -12
@@ -1174,21 +1174,31 @@ static int __sev_snp_init_locked(int *er
 	wbinvd_on_all_cpus();
 
 	rc = __sev_do_cmd_locked(cmd, arg, error);
-	if (rc)
+	if (rc) {
+		dev_err(sev->dev, "SEV-SNP: %s failed rc %d, error %#x\n",
+			cmd == SEV_CMD_SNP_INIT_EX ? "SNP_INIT_EX" : "SNP_INIT",
+			rc, *error);
 		return rc;
+	}
 
 	/* Prepare for first SNP guest launch after INIT. */
 	wbinvd_on_all_cpus();
 	rc = __sev_do_cmd_locked(SEV_CMD_SNP_DF_FLUSH, NULL, error);
-	if (rc)
+	if (rc) {
+		dev_err(sev->dev, "SEV-SNP: SNP_DF_FLUSH failed rc %d, error %#x\n",
+			rc, *error);
 		return rc;
+	}
 
 	sev->snp_initialized = true;
 	dev_dbg(sev->dev, "SEV-SNP firmware initialized\n");
 
+	dev_info(sev->dev, "SEV-SNP API:%d.%d build:%d\n", sev->api_major,
+		 sev->api_minor, sev->build);
+
 	sev_es_tmr_size = SNP_TMR_SIZE;
 
-	return rc;
+	return 0;
 }
 
 static void __sev_platform_init_handle_tmr(struct sev_device *sev)
@@ -1285,16 +1295,22 @@ static int __sev_platform_init_locked(in
 	if (error)
 		*error = psp_ret;
 
-	if (rc)
+	if (rc) {
+		dev_err(sev->dev, "SEV: %s failed %#x, rc %d\n",
+			sev_init_ex_buffer ? "INIT_EX" : "INIT", psp_ret, rc);
 		return rc;
+	}
 
 	sev->state = SEV_STATE_INIT;
 
 	/* Prepare for first SEV guest launch after INIT */
 	wbinvd_on_all_cpus();
 	rc = __sev_do_cmd_locked(SEV_CMD_DF_FLUSH, NULL, error);
-	if (rc)
+	if (rc) {
+		dev_err(sev->dev, "SEV: DF_FLUSH failed %#x, rc %d\n",
+			*error, rc);
 		return rc;
+	}
 
 	dev_dbg(sev->dev, "SEV firmware initialized\n");
 
@@ -1374,8 +1390,11 @@ static int __sev_platform_shutdown_locke
 		return 0;
 
 	ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, NULL, error);
-	if (ret)
+	if (ret) {
+		dev_err(sev->dev, "SEV: failed to SHUTDOWN error %#x, rc %d\n",
+			*error, ret);
 		return ret;
+	}
 
 	sev->state = SEV_STATE_UNINIT;
 	dev_dbg(sev->dev, "SEV firmware shutdown\n");
@@ -1733,9 +1752,12 @@ static int __sev_snp_shutdown_locked(int
 	ret = __sev_do_cmd_locked(SEV_CMD_SNP_SHUTDOWN_EX, &data, error);
 	/* SHUTDOWN may require DF_FLUSH */
 	if (*error == SEV_RET_DFFLUSH_REQUIRED) {
-		ret = __sev_do_cmd_locked(SEV_CMD_SNP_DF_FLUSH, NULL, NULL);
+		int dfflush_error;
+
+		ret = __sev_do_cmd_locked(SEV_CMD_SNP_DF_FLUSH, NULL, &dfflush_error);
 		if (ret) {
-			dev_err(sev->dev, "SEV-SNP DF_FLUSH failed\n");
+			dev_err(sev->dev, "SEV-SNP DF_FLUSH failed, ret = %d, error = %#x\n",
+				ret, dfflush_error);
 			return ret;
 		}
 		/* reissue the shutdown command */
@@ -1743,7 +1765,8 @@ static int __sev_snp_shutdown_locked(int
 					  error);
 	}
 	if (ret) {
-		dev_err(sev->dev, "SEV-SNP firmware shutdown failed\n");
+		dev_err(sev->dev, "SEV-SNP firmware shutdown failed, rc %d, error %#x\n",
+			ret, *error);
 		return ret;
 	}
 
@@ -2511,9 +2534,6 @@ void sev_pci_init(void)
 		dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n",
 			args.error, rc);
 
-	dev_info(sev->dev, "SEV%s API:%d.%d build:%d\n", sev->snp_initialized ?
-		"-SNP" : "", sev->api_major, sev->api_minor, sev->build);
-
 	atomic_notifier_chain_register(&panic_notifier_list,
 				       &snp_panic_notifier);
 	return;
author maintainer
#1260 lore raw

PATCH 1220/1276 crypto: ccp - Reset TMR size at SNP Shutdown

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

[ Upstream commit 65a895a44e641fe47f3419b064288d1d713024a5 ]

Implicit SNP initialization as part of some SNP ioctls modify TMR size to be SNP compliant which followed by SNP shutdown will leave the TMR size modified and then subsequently cause SEV only initialization to fail, hence, reset TMR size to default at SNP Shutdown.

Stable-dep-of: 08f0e65e784c ("crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)")

---
 drivers/crypto/ccp/sev-dev.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/ccp/sev-dev.c +3 -0
@@ -1792,6 +1792,9 @@ static int __sev_snp_shutdown_locked(int
 	sev->snp_initialized = false;
 	dev_dbg(sev->dev, "SEV-SNP firmware shutdown\n");
 
+	/* Reset TMR size back to default */
+	sev_es_tmr_size = SEV_TMR_SIZE;
+
 	return ret;
 }
 
author maintainer
#1261 lore raw

PATCH 1221/1276 crypto: ccp - Register SNP panic notifier only if SNP is enabled

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

[ Upstream commit 19860c3274fb209e36ebcba562dc5da301a53cb3 ]

Currently, the SNP panic notifier is registered on module initialization regardless of whether SNP is being enabled or initialized.

Instead, register the SNP panic notifier only when SNP is actually initialized and unregister the notifier when SNP is shutdown.

Stable-dep-of: 08f0e65e784c ("crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)")

---
 drivers/crypto/ccp/sev-dev.c |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/crypto/ccp/sev-dev.c +13 -9
@@ -105,6 +105,13 @@ static void *sev_init_ex_buffer;
 
 static void __sev_firmware_shutdown(struct sev_device *sev, bool panic);
 
+static int snp_shutdown_on_panic(struct notifier_block *nb,
+				 unsigned long reason, void *arg);
+
+static struct notifier_block snp_panic_notifier = {
+	.notifier_call = snp_shutdown_on_panic,
+};
+
 static inline bool sev_version_greater_or_equal(u8 maj, u8 min)
 {
 	struct sev_device *sev = psp_master->sev_data;
@@ -1196,6 +1203,9 @@ static int __sev_snp_init_locked(int *er
 	dev_info(sev->dev, "SEV-SNP API:%d.%d build:%d\n", sev->api_major,
 		 sev->api_minor, sev->build);
 
+	atomic_notifier_chain_register(&panic_notifier_list,
+				       &snp_panic_notifier);
+
 	sev_es_tmr_size = SNP_TMR_SIZE;
 
 	return 0;
@@ -1792,6 +1802,9 @@ static int __sev_snp_shutdown_locked(int
 	sev->snp_initialized = false;
 	dev_dbg(sev->dev, "SEV-SNP firmware shutdown\n");
 
+	atomic_notifier_chain_unregister(&panic_notifier_list,
+					 &snp_panic_notifier);
+
 	/* Reset TMR size back to default */
 	sev_es_tmr_size = SEV_TMR_SIZE;
 
@@ -2488,10 +2501,6 @@ static int snp_shutdown_on_panic(struct
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block snp_panic_notifier = {
-	.notifier_call = snp_shutdown_on_panic,
-};
-
 int sev_issue_cmd_external_user(struct file *filep, unsigned int cmd,
 				void *data, int *error)
 {
@@ -2537,8 +2546,6 @@ void sev_pci_init(void)
 		dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n",
 			args.error, rc);
 
-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &snp_panic_notifier);
 	return;
 
 err:
@@ -2555,7 +2562,4 @@ void sev_pci_exit(void)
 		return;
 
 	sev_firmware_shutdown(sev);
-
-	atomic_notifier_chain_unregister(&panic_notifier_list,
-					 &snp_panic_notifier);
 }
author maintainer
#1262 lore raw

PATCH 1222/1276 crypto: ccp - Move SEV/SNP Platform initialization to KVM

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

[ Upstream commit 3f8f0133a5fc9b32d0c308530320c3f2430ba5ab ]

SNP initialization is forced during PSP driver probe purely because SNP can't be initialized if VMs are running. But the only in-tree user of SEV/SNP functionality is KVM, and KVM depends on PSP driver for the same. Forcing SEV/SNP initialization because a hypervisor could be running legacy non-confidential VMs make no sense.

This patch removes SEV/SNP initialization from the PSP driver probe time and moves the requirement to initialize SEV/SNP functionality to KVM if it wants to use SEV/SNP.

Stable-dep-of: 08f0e65e784c ("crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)")

---
 drivers/crypto/ccp/sev-dev.c |   13 -------------
 1 file changed, 13 deletions(-)
drivers/crypto/ccp/sev-dev.c +0 -13
@@ -1352,10 +1352,6 @@ static int _sev_platform_init_locked(str
 	if (sev->state == SEV_STATE_INIT)
 		return 0;
 
-	/*
-	 * Legacy guests cannot be running while SNP_INIT(_EX) is executing,
-	 * so perform SEV-SNP initialization at probe time.
-	 */
 	rc = __sev_snp_init_locked(&args->error);
 	if (rc && rc != -ENODEV) {
 		/*
@@ -2514,9 +2510,7 @@ EXPORT_SYMBOL_GPL(sev_issue_cmd_external
 void sev_pci_init(void)
 {
 	struct sev_device *sev = psp_master->sev_data;
-	struct sev_platform_init_args args = {0};
 	u8 api_major, api_minor, build;
-	int rc;
 
 	if (!sev)
 		return;
@@ -2539,13 +2533,6 @@ void sev_pci_init(void)
 			 api_major, api_minor, build,
 			 sev->api_major, sev->api_minor, sev->build);
 
-	/* Initialize the platform */
-	args.probe = true;
-	rc = sev_platform_init(&args);
-	if (rc)
-		dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n",
-			args.error, rc);
-
 	return;
 
 err:
author maintainer
#1263 lore raw

PATCH 1223/1276 crypto: ccp - Fix a case where SNP_SHUTDOWN is missed

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Tom Lendacky <[email protected]>

[ Upstream commit 551120148b67e04527b405c5ec33a31593846ba4 ]

If page reclaim fails in sev_ioctl_do_snp_platform_status() and SNP was moved from UNINIT to INIT for the function, SNP is not moved back to UNINIT state. Additionally, SNP is not required to be initialized in order to execute the SNP_PLATFORM_STATUS command, so don't attempt to move to INIT state and let SNP_PLATFORM_STATUS report the status as is.

Fixes ceac7fb89e8d ("crypto: ccp - Ensure implicit SEV/SNP init and shutdown in ioctls")

Stable-dep-of: 08f0e65e784c ("crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)")

---
 drivers/crypto/ccp/sev-dev.c |   46 +++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/ccp/sev-dev.c +23 -23
@@ -2071,11 +2071,10 @@ e_free_pdh:
 static int sev_ioctl_do_snp_platform_status(struct sev_issue_cmd *argp)
 {
 	struct sev_device *sev = psp_master->sev_data;
-	bool shutdown_required = false;
 	struct sev_data_snp_addr buf;
 	struct page *status_page;
-	int ret, error;
 	void *data;
+	int ret;
 
 	if (!argp->data)
 		return -EINVAL;
@@ -2086,31 +2085,35 @@ static int sev_ioctl_do_snp_platform_sta
 
 	data = page_address(status_page);
 
-	if (!sev->snp_initialized) {
-		ret = snp_move_to_init_state(argp, &shutdown_required);
-		if (ret)
-			goto cleanup;
-	}
-
 	/*
-	 * Firmware expects status page to be in firmware-owned state, otherwise
-	 * it will report firmware error code INVALID_PAGE_STATE (0x1A).
+	 * SNP_PLATFORM_STATUS can be executed in any SNP state. But if executed
+	 * when SNP has been initialized, the status page must be firmware-owned.
 	 */
-	if (rmp_mark_pages_firmware(__pa(data), 1, true)) {
-		ret = -EFAULT;
-		goto cleanup;
+	if (sev->snp_initialized) {
+		/*
+		 * Firmware expects the status page to be in Firmware state,
+		 * otherwise it will report an error INVALID_PAGE_STATE.
+		 */
+		if (rmp_mark_pages_firmware(__pa(data), 1, true)) {
+			ret = -EFAULT;
+			goto cleanup;
+		}
 	}
 
 	buf.address = __psp_pa(data);
 	ret = __sev_do_cmd_locked(SEV_CMD_SNP_PLATFORM_STATUS, &buf, &argp->error);
 
-	/*
-	 * Status page will be transitioned to Reclaim state upon success, or
-	 * left in Firmware state in failure. Use snp_reclaim_pages() to
-	 * transition either case back to Hypervisor-owned state.
-	 */
-	if (snp_reclaim_pages(__pa(data), 1, true))
-		return -EFAULT;
+	if (sev->snp_initialized) {
+		/*
+		 * The status page will be in Reclaim state on success, or left
+		 * in Firmware state on failure. Use snp_reclaim_pages() to
+		 * transition either case back to Hypervisor-owned state.
+		 */
+		if (snp_reclaim_pages(__pa(data), 1, true)) {
+			snp_leak_pages(__page_to_pfn(status_page), 1);
+			return -EFAULT;
+		}
+	}
 
 	if (ret)
 		goto cleanup;
@@ -2120,9 +2123,6 @@ static int sev_ioctl_do_snp_platform_sta
 		ret = -EFAULT;
 
 cleanup:
-	if (shutdown_required)
-		__sev_snp_shutdown_locked(&error, false);
-
 	__free_pages(status_page, 0);
 	return ret;
 }
author maintainer
#1264 lore raw

PATCH 1224/1276 crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Tycho Andersen (AMD)" <[email protected]>

[ Upstream commit 08f0e65e784c4b20e6e620dd4f68d8636073a3d2 ]

Sashiko notes:

Quoted 5 lines

if SEV initialization fails and KVM is actively running normal VMs, could a userspace process trigger this code path via /dev/sev ioctls (e.g., SEV_PDH_GEN) and zero out MSR_VM_HSAVE_PA globally? Would the next VMRUN execution for an active VM trigger a general protection fault and crash the host?

Refuse to re-try initialization if SNP is not already initialized for SNP_CONFIG.

This is technically an ABI break: before if SNP initialization failed it could be transparently retriggered by this ioctl, and if no VMs were running, everything worked fine. Hopefully this is enough of a corner case that nobody will notice, but someone does, there are a few options:

* do something like symbol_get() for kvm and refuse to initialize if KVM is loaded
* check each cpu's HSAVE_PA for non-zero data before re-initializing
* once initialization has failed, continue to refuse to initialize until the ccp module is unloaded

Fixes ceac7fb89e8d ("crypto: ccp - Ensure implicit SEV/SNP init and shutdown in ioctls")
Reported-by Sashiko
Assisted-by Gemini:gemini-3.1-pro-preview
---
 drivers/crypto/ccp/sev-dev.c |   33 ++++-----------------------------
 1 file changed, 4 insertions(+), 29 deletions(-)
drivers/crypto/ccp/sev-dev.c +4 -29
@@ -1434,21 +1434,6 @@ static int sev_move_to_init_state(struct
 	return 0;
 }
 
-static int snp_move_to_init_state(struct sev_issue_cmd *argp, bool *shutdown_required)
-{
-	int error, rc;
-
-	rc = __sev_snp_init_locked(&error);
-	if (rc) {
-		argp->error = SEV_RET_INVALID_PLATFORM_STATE;
-		return rc;
-	}
-
-	*shutdown_required = true;
-
-	return 0;
-}
-
 static int sev_ioctl_do_reset(struct sev_issue_cmd *argp, bool writable)
 {
 	int state, rc;
@@ -2143,8 +2128,6 @@ static int sev_ioctl_do_snp_set_config(s
 {
 	struct sev_device *sev = psp_master->sev_data;
 	struct sev_user_data_snp_config config;
-	bool shutdown_required = false;
-	int ret, error;
 
 	if (!argp->data)
 		return -EINVAL;
@@ -2152,21 +2135,13 @@ static int sev_ioctl_do_snp_set_config(s
 	if (!writable)
 		return -EPERM;
 
+	if (!sev->snp_initialized)
+		return -ENODEV;
+
 	if (copy_from_user(&config, (void __user *)argp->data, sizeof(config)))
 		return -EFAULT;
 
-	if (!sev->snp_initialized) {
-		ret = snp_move_to_init_state(argp, &shutdown_required);
-		if (ret)
-			return ret;
-	}
-
-	ret = __sev_do_cmd_locked(SEV_CMD_SNP_CONFIG, &config, &argp->error);
-
-	if (shutdown_required)
-		__sev_snp_shutdown_locked(&error, false);
-
-	return ret;
+	return __sev_do_cmd_locked(SEV_CMD_SNP_CONFIG, &config, &argp->error);
 }
 
 static int sev_ioctl_do_snp_vlek_load(struct sev_issue_cmd *argp, bool writable)
author maintainer
#1265 lore raw

PATCH 1225/1276 crypto: qat - fix restarting state leak on allocation failure

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ahsan Atta <[email protected]>

[ Upstream commit 7d3ed20f7e46b3e991936fedd7a28f3ff4aec8d2 ]

In adf_dev_aer_schedule_reset(), ADF_STATUS_RESTARTING is set before allocating reset_data. If the allocation fails, the function returns -ENOMEM without queuing reset work, so nothing ever clears the bit. This leaves the device permanently stuck in the restarting state, causing all subsequent reset attempts to be silently skipped.

Fix this by using test_and_set_bit() to atomically claim the RESTARTING state, preventing duplicate reset scheduling races under concurrent fatal error reporting. If the subsequent allocation fails, clear the bit to restore clean state so future reset attempts can proceed.

---
 drivers/crypto/intel/qat/qat_common/adf_aer.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/crypto/intel/qat/qat_common/adf_aer.c +4 -3
@@ -157,13 +157,14 @@ static int adf_dev_aer_schedule_reset(st
 	struct adf_reset_dev_data *reset_data;
 
 	if (!adf_dev_started(accel_dev) ||
-	    test_bit(ADF_STATUS_RESTARTING, &accel_dev->status))
+	    test_and_set_bit(ADF_STATUS_RESTARTING, &accel_dev->status))
 		return 0;
 
-	set_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
 	reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL);
-	if (!reset_data)
+	if (!reset_data) {
+		clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
 		return -ENOMEM;
+	}
 	reset_data->accel_dev = accel_dev;
 	init_completion(&reset_data->compl);
 	reset_data->mode = mode;
author maintainer
#1266 lore raw

PATCH 1226/1276 exfat: remove unnecessary read entry in __exfat_rename()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yuezhang Mo <[email protected]>

[ Upstream commit 30ef0e0d7ff5b6dceda19d18a85d9d72a4909784 ]

To determine whether it is a directory, there is no need to read its directory entry, just use S_ISDIR(inode->i_mode).

Stable-dep-of: 942296784b2a ("exfat: preserve benign secondary entries during rename and move")

---
 fs/exfat/namei.c |   20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
fs/exfat/namei.c +4 -16
@@ -1145,17 +1145,12 @@ static int __exfat_rename(struct inode *
 	int ret;
 	int dentry;
 	struct exfat_chain olddir, newdir;
-	struct exfat_chain *p_dir = NULL;
 	struct exfat_uni_name uni_name;
-	struct exfat_dentry *ep;
 	struct super_block *sb = old_parent_inode->i_sb;
 	struct exfat_sb_info *sbi = EXFAT_SB(sb);
 	const unsigned char *new_path = new_dentry->d_name.name;
 	struct inode *new_inode = new_dentry->d_inode;
 	struct exfat_inode_info *new_ei = NULL;
-	unsigned int new_entry_type = TYPE_UNUSED;
-	int new_entry = 0;
-	struct buffer_head *new_bh = NULL;
 
 	/* check the validity of pointer parameters */
 	if (new_path == NULL || strlen(new_path) == 0)
@@ -1181,17 +1176,8 @@ static int __exfat_rename(struct inode *
 			goto out;
 		}
 
-		p_dir = &(new_ei->dir);
-		new_entry = new_ei->entry;
-		ep = exfat_get_dentry(sb, p_dir, new_entry, &new_bh);
-		if (!ep)
-			goto out;
-
-		new_entry_type = exfat_get_entry_type(ep);
-		brelse(new_bh);
-
 		/* if new_inode exists, update ei */
-		if (new_entry_type == TYPE_DIR) {
+		if (S_ISDIR(new_inode->i_mode)) {
 			struct exfat_chain new_clu;
 
 			new_clu.dir = new_ei->start_clu;
@@ -1223,6 +1209,8 @@ static int __exfat_rename(struct inode *
 
 	if (!ret && new_inode) {
 		struct exfat_entry_set_cache es;
+		struct exfat_chain *p_dir = &(new_ei->dir);
+		int new_entry = new_ei->entry;
 
 		/* delete entries of new_dir */
 		ret = exfat_get_dentry_set(&es, sb, p_dir, new_entry,
@@ -1239,7 +1227,7 @@ static int __exfat_rename(struct inode *
 			goto del_out;
 
 		/* Free the clusters if new_inode is a dir(as if exfat_rmdir) */
-		if (new_entry_type == TYPE_DIR &&
+		if (S_ISDIR(new_inode->i_mode) &&
 		    new_ei->start_clu != EXFAT_EOF_CLUSTER) {
 			/* new_ei, new_clu_to_free */
 			struct exfat_chain new_clu_to_free;
author maintainer
#1267 lore raw

PATCH 1227/1276 exfat: rename argument name for exfat_move_file and exfat_rename_file

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yuezhang Mo <[email protected]>

[ Upstream commit 06a2b0b3b490a6103376652c01c3ac6e8e22e654 ]

In this exfat implementation, the relationship between inode and ei is ei=EXFAT_I(inode). However, in the arguments of exfat_move_file() and exfat_rename_file(), argument 'inode' indicates the parent directory, but argument 'ei' indicates the target file to be renamed. They do not have the above relationship, which is not friendly to code readers.

So this commit renames 'inode' to 'parent_inode', making the argument name match its role.

Stable-dep-of: 942296784b2a ("exfat: preserve benign secondary entries during rename and move")

---
 fs/exfat/namei.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
fs/exfat/namei.c +12 -12
@@ -1009,15 +1009,15 @@ unlock:
 	return err;
 }
 
-static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
+static int exfat_rename_file(struct inode *parent_inode, struct exfat_chain *p_dir,
 		int oldentry, struct exfat_uni_name *p_uniname,
 		struct exfat_inode_info *ei)
 {
 	int ret, num_new_entries;
 	struct exfat_dentry *epold, *epnew;
-	struct super_block *sb = inode->i_sb;
+	struct super_block *sb = parent_inode->i_sb;
 	struct exfat_entry_set_cache old_es, new_es;
-	int sync = IS_DIRSYNC(inode);
+	int sync = IS_DIRSYNC(parent_inode);
 
 	if (unlikely(exfat_forced_shutdown(sb)))
 		return -EIO;
@@ -1037,7 +1037,7 @@ static int exfat_rename_file(struct inod
 	if (old_es.num_entries < num_new_entries) {
 		int newentry;
 
-		newentry = exfat_find_empty_entry(inode, p_dir, num_new_entries,
+		newentry = exfat_find_empty_entry(parent_inode, p_dir, num_new_entries,
 				&new_es);
 		if (newentry < 0) {
 			ret = newentry; /* -EIO or -ENOSPC */
@@ -1061,7 +1061,7 @@ static int exfat_rename_file(struct inod
 		if (ret)
 			goto put_old_es;
 
-		exfat_remove_entries(inode, &old_es, ES_IDX_FILE);
+		exfat_remove_entries(parent_inode, &old_es, ES_IDX_FILE);
 		ei->dir = *p_dir;
 		ei->entry = newentry;
 	} else {
@@ -1070,7 +1070,7 @@ static int exfat_rename_file(struct inod
 			ei->attr |= EXFAT_ATTR_ARCHIVE;
 		}
 
-		exfat_remove_entries(inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
+		exfat_remove_entries(parent_inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
 		exfat_init_ext_entry(&old_es, num_new_entries, p_uniname);
 	}
 	return exfat_put_dentry_set(&old_es, sync);
@@ -1080,13 +1080,13 @@ put_old_es:
 	return ret;
 }
 
-static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
+static int exfat_move_file(struct inode *parent_inode, struct exfat_chain *p_olddir,
 		int oldentry, struct exfat_chain *p_newdir,
 		struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
 {
 	int ret, newentry, num_new_entries;
 	struct exfat_dentry *epmov, *epnew;
-	struct super_block *sb = inode->i_sb;
+	struct super_block *sb = parent_inode->i_sb;
 	struct exfat_entry_set_cache mov_es, new_es;
 
 	num_new_entries = exfat_calc_num_entries(p_uniname);
@@ -1098,7 +1098,7 @@ static int exfat_move_file(struct inode
 	if (ret)
 		return -EIO;
 
-	newentry = exfat_find_empty_entry(inode, p_newdir, num_new_entries,
+	newentry = exfat_find_empty_entry(parent_inode, p_newdir, num_new_entries,
 			&new_es);
 	if (newentry < 0) {
 		ret = newentry; /* -EIO or -ENOSPC */
@@ -1118,18 +1118,18 @@ static int exfat_move_file(struct inode
 	*epnew = *epmov;
 
 	exfat_init_ext_entry(&new_es, num_new_entries, p_uniname);
-	exfat_remove_entries(inode, &mov_es, ES_IDX_FILE);
+	exfat_remove_entries(parent_inode, &mov_es, ES_IDX_FILE);
 
 	exfat_chain_set(&ei->dir, p_newdir->dir, p_newdir->size,
 		p_newdir->flags);
 
 	ei->entry = newentry;
 
-	ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(inode));
+	ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(parent_inode));
 	if (ret)
 		goto put_mov_es;
 
-	return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(inode));
+	return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(parent_inode));
 
 put_mov_es:
 	exfat_put_dentry_set(&mov_es, false);
author maintainer
#1268 lore raw

PATCH 1228/1276 exfat: add exfat_get_dentry_set_by_ei() helper

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yuezhang Mo <[email protected]>

[ Upstream commit ac844e91364a03c35838fd488437605fbe56f8c3 ]

This helper gets the directory entry set of the file for the exfat inode which has been created.

It's used to remove all the instances of the pattern it replaces making the code cleaner, it's also a preparation for changing ->dir to record the cluster where the directory entry set is located and changing ->entry to record the index of the directory entry within the cluster.

Stable-dep-of: 942296784b2a ("exfat: preserve benign secondary entries during rename and move")

---
 fs/exfat/exfat_fs.h |    2 +
 fs/exfat/inode.c    |    2 -
 fs/exfat/namei.c    |   53 +++++++++++++++++-----------------------------------
 3 files changed, 21 insertions(+), 36 deletions(-)
fs/exfat/exfat_fs.h +2 -0
@@ -508,6 +508,8 @@ struct exfat_dentry *exfat_get_dentry_ca
 int exfat_get_dentry_set(struct exfat_entry_set_cache *es,
 		struct super_block *sb, struct exfat_chain *p_dir, int entry,
 		unsigned int num_entries);
+#define exfat_get_dentry_set_by_ei(es, sb, ei)		\
+	exfat_get_dentry_set(es, sb, &(ei)->dir, (ei)->entry, ES_ALL_ENTRIES)
 int exfat_get_empty_dentry_set(struct exfat_entry_set_cache *es,
 		struct super_block *sb, struct exfat_chain *p_dir, int entry,
 		unsigned int num_entries);
fs/exfat/inode.c +1 -1
@@ -43,7 +43,7 @@ int __exfat_write_inode(struct inode *in
 	exfat_set_volume_dirty(sb);
 
 	/* get the directory entry of given file or directory */
-	if (exfat_get_dentry_set(&es, sb, &(ei->dir), ei->entry, ES_ALL_ENTRIES))
+	if (exfat_get_dentry_set_by_ei(&es, sb, ei))
 		return -EIO;
 	ep = exfat_get_dentry_cached(&es, ES_IDX_FILE);
 	ep2 = exfat_get_dentry_cached(&es, ES_IDX_STREAM);
fs/exfat/namei.c +18 -35

148 lines not on this page · raw message

author maintainer
#1269 lore raw

PATCH 1229/1276 exfat: move exfat_chain_set() out of __exfat_resolve_path()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yuezhang Mo <[email protected]>

[ Upstream commit 0891c7313d87a1b6baf7162bc2f0d755ce70383f ]

__exfat_resolve_path() mixes two functions. The first one is to resolve and check if the path is valid. The second one is to output the cluster assigned to the directory.

The second one is only needed when need to traverse the directory entries, and calling exfat_chain_set() so early causes p_dir to be passed as an argument multiple times, increasing the complexity of the code.

This commit moves the call to exfat_chain_set() before traversing directory entries.

Stable-dep-of: 942296784b2a ("exfat: preserve benign secondary entries during rename and move")

---
 fs/exfat/namei.c |   60 +++++++++++++++++++++++--------------------------------
 1 file changed, 26 insertions(+), 34 deletions(-)
fs/exfat/namei.c +26 -34
@@ -311,6 +311,9 @@ static int exfat_find_empty_entry(struct
 		ei->hint_femp.eidx = EXFAT_HINT_NONE;
 	}
 
+	exfat_chain_set(p_dir, ei->start_clu,
+			EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags);
+
 	while ((dentry = exfat_search_empty_slot(sb, &hint_femp, p_dir,
 					num_entries, es)) < 0) {
 		if (dentry == -EIO)
@@ -386,14 +389,11 @@ static int exfat_find_empty_entry(struct
  * Zero if it was successful; otherwise nonzero.
  */
 static int __exfat_resolve_path(struct inode *inode, const unsigned char *path,
-		struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
-		int lookup)
+		struct exfat_uni_name *p_uniname, int lookup)
 {
 	int namelen;
 	int lossy = NLS_NAME_NO_LOSSY;
 	struct super_block *sb = inode->i_sb;
-	struct exfat_sb_info *sbi = EXFAT_SB(sb);
-	struct exfat_inode_info *ei = EXFAT_I(inode);
 	int pathlen = strlen(path);
 
 	/*
@@ -432,24 +432,19 @@ static int __exfat_resolve_path(struct i
 	if ((lossy && !lookup) || !namelen)
 		return (lossy & NLS_NAME_OVERLEN) ? -ENAMETOOLONG : -EINVAL;
 
-	exfat_chain_set(p_dir, ei->start_clu,
-		EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags);
-
 	return 0;
 }
 
 static inline int exfat_resolve_path(struct inode *inode,
-		const unsigned char *path, struct exfat_chain *dir,
-		struct exfat_uni_name *uni)
+		const unsigned char *path, struct exfat_uni_name *uni)
 {
-	return __exfat_resolve_path(inode, path, dir, uni, 0);
+	return __exfat_resolve_path(inode, path, uni, 0);
 }
 
 static inline int exfat_resolve_path_for_lookup(struct inode *inode,
-		const unsigned char *path, struct exfat_chain *dir,
-		struct exfat_uni_name *uni)
+		const unsigned char *path, struct exfat_uni_name *uni)
 {
-	return __exfat_resolve_path(inode, path, dir, uni, 1);
+	return __exfat_resolve_path(inode, path, uni, 1);
 }
 
 static inline loff_t exfat_make_i_pos(struct exfat_dir_entry *info)
@@ -471,7 +466,7 @@ static int exfat_add_entry(struct inode
 	int clu_size = 0;
 	unsigned int start_clu = EXFAT_FREE_CLUSTER;
 
-	ret = exfat_resolve_path(inode, path, p_dir, &uniname);
+	ret = exfat_resolve_path(inode, path, &uniname);
 	if (ret)
 		goto out;
 
@@ -602,10 +597,13 @@ static int exfat_find(struct inode *dir,
 		return -ENOENT;
 
 	/* check the validity of directory name in the given pathname */
-	ret = exfat_resolve_path_for_lookup(dir, qname->name, &cdir, &uni_name);
+	ret = exfat_resolve_path_for_lookup(dir, qname->name, &uni_name);
 	if (ret)
 		return ret;
 
+	exfat_chain_set(&cdir, ei->start_clu,
+		EXFAT_B_TO_CLU(i_size_read(dir), sbi), ei->flags);
+
 	/* check the validation of hint_stat and initialize it if required */
 	if (ei->version != (inode_peek_iversion_raw(dir) & 0xffffffff)) {
 		ei->hint_stat.clu = cdir.dir;
@@ -1004,8 +1002,7 @@ unlock:
 }
 
 static int exfat_rename_file(struct inode *parent_inode,
-		struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
-		struct exfat_inode_info *ei)
+		struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
 {
 	int ret, num_new_entries;
 	struct exfat_dentry *epold, *epnew;
@@ -1030,9 +1027,10 @@ static int exfat_rename_file(struct inod
 
 	if (old_es.num_entries < num_new_entries) {
 		int newentry;
+		struct exfat_chain dir;
 
-		newentry = exfat_find_empty_entry(parent_inode, p_dir, num_new_entries,
-				&new_es);
+		newentry = exfat_find_empty_entry(parent_inode, &dir,
+				num_new_entries, &new_es);
 		if (newentry < 0) {
 			ret = newentry; /* -EIO or -ENOSPC */
 			goto put_old_es;
@@ -1056,7 +1054,7 @@ static int exfat_rename_file(struct inod
 			goto put_old_es;
 
 		exfat_remove_entries(parent_inode, &old_es, ES_IDX_FILE);
-		ei->dir = *p_dir;
+		ei->dir = dir;
 		ei->entry = newentry;
 	} else {
 		if (exfat_get_entry_type(epold) == TYPE_FILE) {
@@ -1075,12 +1073,12 @@ put_old_es:
 }
 
 static int exfat_move_file(struct inode *parent_inode,
-		struct exfat_chain *p_newdir, struct exfat_uni_name *p_uniname,
-		struct exfat_inode_info *ei)
+		struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
 {
 	int ret, newentry, num_new_entries;
 	struct exfat_dentry *epmov, *epnew;
 	struct exfat_entry_set_cache mov_es, new_es;
+	struct exfat_chain newdir;
 
 	num_new_entries = exfat_calc_num_entries(p_uniname);
 	if (num_new_entries < 0)
@@ -1090,8 +1088,8 @@ static int exfat_move_file(struct inode
 	if (ret)
 		return -EIO;
 
-	newentry = exfat_find_empty_entry(parent_inode, p_newdir, num_new_entries,
-			&new_es);
+	newentry = exfat_find_empty_entry(parent_inode, &newdir,
+			num_new_entries, &new_es);
 	if (newentry < 0) {
 		ret = newentry; /* -EIO or -ENOSPC */
 		goto put_mov_es;
@@ -1112,9 +1110,7 @@ static int exfat_move_file(struct inode
 	exfat_init_ext_entry(&new_es, num_new_entries, p_uniname);
 	exfat_remove_entries(parent_inode, &mov_es, ES_IDX_FILE);
 
-	exfat_chain_set(&ei->dir, p_newdir->dir, p_newdir->size,
-		p_newdir->flags);
-
+	ei->dir = newdir;
 	ei->entry = newentry;
 
 	ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(parent_inode));
@@ -1135,7 +1131,6 @@ static int __exfat_rename(struct inode *
 		struct dentry *new_dentry)
 {
 	int ret;
-	struct exfat_chain newdir;
 	struct exfat_uni_name uni_name;
 	struct super_block *sb = old_parent_inode->i_sb;
 	struct exfat_sb_info *sbi = EXFAT_SB(sb);
@@ -1179,19 +1174,16 @@ static int __exfat_rename(struct inode *
 	}
 
 	/* check the validity of directory name in the given new pathname */
-	ret = exfat_resolve_path(new_parent_inode, new_path, &newdir,
-			&uni_name);
+	ret = exfat_resolve_path(new_parent_inode, new_path, &uni_name);
 	if (ret)
 		goto out;
 
 	exfat_set_volume_dirty(sb);
 
 	if (new_parent_inode == old_parent_inode)
-		ret = exfat_rename_file(new_parent_inode, &newdir,
-				&uni_name, ei);
+		ret = exfat_rename_file(new_parent_inode, &uni_name, ei);
 	else
-		ret = exfat_move_file(new_parent_inode, &newdir,
-				&uni_name, ei);
+		ret = exfat_move_file(new_parent_inode, &uni_name, ei);
 
 	if (!ret && new_inode) {
 		struct exfat_entry_set_cache es;
author maintainer
#1270 lore raw

PATCH 1230/1276 exfat: fix incorrect directory checksum after rename to shorter name

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chi Zhiling <[email protected]>

[ Upstream commit ff37797badd831797b8a27830fe5046d7e23fdc3 ]

When renaming a file in-place to a shorter name, exfat_remove_entries marks excess entries as DELETED, but es->num_entries is not updated accordingly. As a result, exfat_update_dir_chksum iterates over the deleted entries and computes an incorrect checksum.

This does not lead to persistent corruption because mark_inode_dirty() is called afterward, and __exfat_write_inode later recomputes the checksum using the correct num_entries value.

Fix by setting es->num_entries = num_entries in exfat_init_ext_entry.

Stable-dep-of: 942296784b2a ("exfat: preserve benign secondary entries during rename and move")

---
 fs/exfat/dir.c |    1 +
 1 file changed, 1 insertion(+)
fs/exfat/dir.c +1 -0
@@ -507,6 +507,7 @@ void exfat_init_ext_entry(struct exfat_e
 	unsigned short *uniname = p_uniname->name;
 	struct exfat_dentry *ep;
 
+	es->num_entries = num_entries;
 	ep = exfat_get_dentry_cached(es, ES_IDX_FILE);
 	ep->dentry.file.num_ext = (unsigned char)(num_entries - 1);
 
author maintainer
#1271 lore raw

PATCH 1231/1276 exfat: preserve benign secondary entries during rename and move

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rochan Avlur <[email protected]>

[ Upstream commit 942296784b2a9439651750c42f540bf2579b330f ]

Commit 8258ef28001a ("exfat: handle unreconized benign secondary entries") added cluster freeing for benign secondary entries inside exfat_remove_entries(). However, exfat_remove_entries() is also called from the rename and move paths (exfat_rename_file and exfat_move_file), where the old entry set is being relocated rather than deleted. This causes benign secondary entries such as vendor extension entries to be silently destroyed on rename or cross-directory move, violating the exFAT spec requirement (section 8.2) that implementations preserve unrecognized benign secondary entries.

Fix this by adding a free_benign parameter to exfat_remove_entries() so callers can suppress cluster freeing during relocation, and extending exfat_init_ext_entry() to copy trailing benign secondary entries from the old entry set into the new one internally. Also clean up the error paths to delete newly allocated entries on failure.

---
 fs/exfat/dir.c      |   50 +++++++++++++++++++++++++----
 fs/exfat/exfat_fs.h |    5 +-
 fs/exfat/namei.c    |   89 ++++++++++++++++++++++++++++++++++++++++------------
 3 files changed, 116 insertions(+), 28 deletions(-)
fs/exfat/dir.c +44 -6
@@ -500,32 +500,70 @@ static void exfat_free_benign_secondary_
 	exfat_free_cluster(inode, &dir);
 }
 
+/*
+ * exfat_init_ext_entry - initialize extension entries in a directory entry set
+ * @es:          target entry set
+ * @num_entries: number of entries excluding benign secondary entries
+ * @p_uniname:   filename to store
+ * @old_es:      optional source entry set with benign secondary entries, or NULL
+ * @num_extra:   number of benign secondary entries to copy from @old_es
+ *
+ * Set up the file, stream extension, and filename entries in @es, optionally
+ * preserving @num_extra benign secondary entries from @old_es.  @es and @old_es
+ * may refer to the same entry set; excess entries are marked as deleted.
+ */
 void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries,
-		struct exfat_uni_name *p_uniname)
+		struct exfat_uni_name *p_uniname,
+		struct exfat_entry_set_cache *old_es, int num_extra)
 {
-	int i;
+	int i, src_start = 0, old_num;
 	unsigned short *uniname = p_uniname->name;
 	struct exfat_dentry *ep;
 
-	es->num_entries = num_entries;
+	if (WARN_ON(num_extra < 0 || (num_extra && (!old_es ||
+		    old_es->num_entries < ES_IDX_FIRST_FILENAME + num_extra))))
+		num_extra = 0;
+
+	/*
+	 * Save old entry count and source position before modifying
+	 * es->num_entries, since old_es and es may point to the same
+	 * entry set.
+	 */
+	old_num = es->num_entries;
+	if (old_es && num_extra > 0)
+		src_start = old_es->num_entries - num_extra;
+
+	es->num_entries = num_entries + num_extra;
 	ep = exfat_get_dentry_cached(es, ES_IDX_FILE);
-	ep->dentry.file.num_ext = (unsigned char)(num_entries - 1);
+	ep->dentry.file.num_ext = (unsigned char)(num_entries - 1 + num_extra);
 
 	ep = exfat_get_dentry_cached(es, ES_IDX_STREAM);
 	ep->dentry.stream.name_len = p_uniname->name_len;
 	ep->dentry.stream.name_hash = cpu_to_le16(p_uniname->name_hash);
 
+	if (old_es && num_extra > 0) {
+		for (i = 0; i < num_extra; i++)
+			*exfat_get_dentry_cached(es, num_entries + i) =
+				*exfat_get_dentry_cached(old_es, src_start + i);
+	}
+
 	for (i = ES_IDX_FIRST_FILENAME; i < num_entries; i++) {
 		ep = exfat_get_dentry_cached(es, i);
 		exfat_init_name_entry(ep, uniname);
 		uniname += EXFAT_FILE_NAME_LEN;
 	}
 
+	/* Mark excess old entries as deleted (in-place shrink) */
+	for (i = num_entries + num_extra; i < old_num; i++) {
+		ep = exfat_get_dentry_cached(es, i);
+		exfat_set_entry_type(ep, TYPE_DELETED);
+	}
+
 	exfat_update_dir_chksum(es);
 }
 
 void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es,
-		int order)
+		int order, bool free_benign)
 {
 	int i;
 	struct exfat_dentry *ep;
@@ -533,7 +571,7 @@ void exfat_remove_entries(struct inode *
 	for (i = order; i < es->num_entries; i++) {
 		ep = exfat_get_dentry_cached(es, i);
 
-		if (exfat_get_entry_type(ep) & TYPE_BENIGN_SEC)
+		if (free_benign && (exfat_get_entry_type(ep) & TYPE_BENIGN_SEC))
 			exfat_free_benign_secondary_clusters(inode, ep);
 
 		exfat_set_entry_type(ep, TYPE_DELETED);
fs/exfat/exfat_fs.h +3 -2
@@ -492,9 +492,10 @@ void exfat_init_dir_entry(struct exfat_e
 		unsigned int type, unsigned int start_clu,
 		unsigned long long size, struct timespec64 *ts);
 void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries,
-		struct exfat_uni_name *p_uniname);
+		struct exfat_uni_name *p_uniname,
+		struct exfat_entry_set_cache *old_es, int num_extra);
 void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es,
-		int order);
+		int order, bool free_benign);
 void exfat_update_dir_chksum(struct exfat_entry_set_cache *es);
 int exfat_calc_num_entries(struct exfat_uni_name *p_uniname);
 int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
fs/exfat/namei.c +69 -20

184 lines not on this page · raw message

author maintainer
#1272 lore raw

PATCH 1232/1276 btrfs: fix false IO failure after falling back to buffered write

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qu Wenruo <[email protected]>

[ Upstream commit 66ff4d366e7eb4d31813d2acabf3af512ce03aa5 ]

[BUG]
The test case generic/362 will fail with "nodatasum" mount option (*):

MOUNT_OPTIONS -- -o nodatasum /dev/mapper/test-scratch1 /mnt/scratch

# generic/362  0s ... - output mismatch (see /home/adam/xfstests/results//generic/362.out.bad)
#    --- tests/generic/362.out	2024-08-24 15:31:37.200000000 +0930
#    +++ /home/adam/xfstests/results//generic/362.out.bad	2026-05-27 10:21:17.574771567 +0930
#    @@ -1,2 +1,3 @@
#     QA output created by 362
#    +First write failed: Input/output error
#     Silence is golden
#    ...

*: If the test case has been executed before with default data checksum, the failure will not reproduce. Need the following fix to make it reliably reproducible:
https://lore.kernel.org/linux-btrfs/[email protected]/

[CAUSE]
Inside __iomap_dio_rw(), the -EFAULT/-ENOTBLK error is not directly returned. Thus we never got an error pointer from __iomap_dio_rw().

The call chain looks like this:

btrfs_direct_write()

 |- btrfs_dio_write()
 |-  __iomap_dio_rw()
 |  |- iomap_iter()
 |  |  |- btrfs_dio_iomap_begin()
 |  |     Now an ordered extent is allocated for the 4K write.
 |  |
 |  |- iomi.status = iomap_dio_iter()
 |  |  Where iomap_dio_iter() returned -EFAULT.
 |  |
 |  |- ret = iomap_iter()
 |  |  |- btrfs_dio_iomap_end()
 |  |  |  |- btrfs_finish_ordered_extent(uptodate = false)
 |  |  |  |  |- can_finish_ordered_extent()
 |  |  |  |     |- btrfs_mark_ordered_extent_error()
 |  |  |  |        |- mapping_set_error()
 |  |  |  |           Now the address space is marked error.
 |  |  |  | return -ENOTBLK
 |  |  |- return -ENOTBLK
 |  |- if (ret == -ENOTBLK) { ret = 0; }
 |     Now the return value is reset to 0.
 |     Thus no error pointer will be returned.
 |
 |- ret = iomap_dio_complete()
 |  Since no byte is submitted, @ret is 0.
 |
 |- Fallback to buffered IO
 |  And the buffered write finished without error
 |
 |- filemap_fdatawait_range()

|- filemap_check_errors()
The previous error is recorded, thus an error is returned

However the buffered write is properly submitted and finished, the error is from the btrfs_finish_ordered_extent() call with @uptodate = false.

[FIX]
When a short dio write happened, any range that is submitted will have btrfs_extract_ordered_extent() to be called, thus the submitted range will always have an OE just covering the submitted range.

The remaining OE range is never submitted, thus they should be treated as truncated, not an error. So that we can properly reclaim and not insert an unnecessary file extent item, without marking the mapping as error.

Extract a helper, btrfs_mark_ordered_extent_truncated(), and utilize that helper to mark the direct IO ordered extent as truncated, so it won't cause failure for the later buffered fallback.

[REASON FOR NO FIXES TAG]
The bug itself is pretty old, at commit f85781fb505e ("btrfs: switch to iomap for direct IO") we're already passing @uptodate=false finishing the OE.
But at that time OE with IOERR won't call mapping_set_error(), so it's not exposed.
Later commit d61bec08b904 ("btrfs: mark ordered extent and inode with error if we fail to finish") finally exposed the bug, but that commit is doing a correct job, not the root cause.

Anyway the bug is very old, dating back to 5.1x days, thus only CC to stable.

---
 fs/btrfs/direct-io.c    |   17 ++++++++++++++---
 fs/btrfs/inode.c        |    6 +-----
 fs/btrfs/ordered-data.c |   12 ++++++++++++
 fs/btrfs/ordered-data.h |    2 ++
 4 files changed, 29 insertions(+), 8 deletions(-)
fs/btrfs/direct-io.c +14 -3
@@ -623,12 +623,23 @@ static int btrfs_dio_iomap_end(struct in
 	if (submitted < length) {
 		pos += submitted;
 		length -= submitted;
-		if (write)
+		if (write) {
+			/*
+			 * We have a short write, if there is any range
+			 * that is submitted properly, that part will have
+			 * its own OE split from the original one.
+			 *
+			 * So for the OE at dio_data->ordered, it's the part
+			 * that is not submitted, and should be marked
+			 * as fully truncated.
+			 */
+			btrfs_mark_ordered_extent_truncated(dio_data->ordered, 0);
 			btrfs_finish_ordered_extent(dio_data->ordered,
-						    pos, length, false);
-		else
+						    pos, length, true);
+		} else {
 			unlock_dio_extent(&BTRFS_I(inode)->io_tree, pos,
 					  pos + length - 1, NULL);
+		}
 		ret = -ENOTBLK;
 	}
 	if (write) {
fs/btrfs/inode.c +1 -5
@@ -7388,11 +7388,7 @@ static void btrfs_invalidate_folio(struc
 					 EXTENT_LOCKED | EXTENT_DO_ACCOUNTING |
 					 EXTENT_DEFRAG, &cached_state);
 
-		spin_lock_irq(&inode->ordered_tree_lock);
-		set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags);
-		ordered->truncated_len = min(ordered->truncated_len,
-					     cur - ordered->file_offset);
-		spin_unlock_irq(&inode->ordered_tree_lock);
+		btrfs_mark_ordered_extent_truncated(ordered, cur - ordered->file_offset);
 
 		/*
 		 * If the ordered extent has finished, we're safe to delete all
fs/btrfs/ordered-data.c +12 -0
@@ -329,6 +329,18 @@ void btrfs_mark_ordered_extent_error(str
 		mapping_set_error(ordered->inode->vfs_inode.i_mapping, -EIO);
 }
 
+void btrfs_mark_ordered_extent_truncated(struct btrfs_ordered_extent *ordered,
+					 u64 truncate_len)
+{
+	struct btrfs_inode *inode = ordered->inode;
+
+	ASSERT(truncate_len <= ordered->num_bytes);
+	spin_lock_irq(&inode->ordered_tree_lock);
+	set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags);
+	ordered->truncated_len = min(ordered->truncated_len, truncate_len);
+	spin_unlock_irq(&inode->ordered_tree_lock);
+}
+
 static void finish_ordered_fn(struct btrfs_work *work)
 {
 	struct btrfs_ordered_extent *ordered_extent;
fs/btrfs/ordered-data.h +2 -0
@@ -213,6 +213,8 @@ bool btrfs_try_lock_ordered_range(struct
 struct btrfs_ordered_extent *btrfs_split_ordered_extent(
 			struct btrfs_ordered_extent *ordered, u64 len);
 void btrfs_mark_ordered_extent_error(struct btrfs_ordered_extent *ordered);
+void btrfs_mark_ordered_extent_truncated(struct btrfs_ordered_extent *ordered,
+					 u64 truncate_len);
 int __init ordered_data_init(void);
 void __cold ordered_data_exit(void);
 
author maintainer
#1273 lore raw

PATCH 1233/1276 btrfs: fix incorrect buffered IO fallback for append direct writes

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qu Wenruo <[email protected]>

[ Upstream commit ff66fe6662330226b3f486014c375538d91c44aa ]

[BUG]
With the previous bug of short direct writes fixed, test case generic/362 (*) still fails with the following error with nodatasum mount option:

# generic/362  0s ... - output mismatch (see /home/adam/xfstests/results//generic/362.out.bad)
# - output mismatch (see /home/adam/xfstests/results//generic/362.out.bad)
#    --- tests/generic/362.out	2024-08-24 15:31:37.200000000 +0930
#    +++ /home/adam/xfstests/results//generic/362.out.bad	2026-05-27 10:13:09.072485767 +0930
#    @@ -1,2 +1,3 @@
#     QA output created by 362
#    +Wrong file size after first write, got 8192 expected 4096
#     Silence is golden
#    ...

*: If the test case has been executed before with default data checksum, the failure will not reproduce. Need the following fix to make it reliably reproducible:
https://lore.kernel.org/linux-btrfs/[email protected]/

[CAUSE]
Inside btrfs_dio_iomap_begin() for a direct write, we increase the isize if it's beyond the current isize.

But if the direct io finished short, we do not revert the isize to the previous value nor to the short write end.

Then if we need to fall back to buffered writes, and the write has IOCB_APPEND flag, then the buffered write will be positioned at the incorrect isize.

The call chain looks like this:

btrfs_direct_write(pos=0, length=4K)

 |- __iomap_dio_rw()
 |  |- iomap_iter()
 |  |  |- btrfs_dio_iomap_begin()
 |  |     |- btrfs_get_blocks_direct_write()
 |  |        |- i_size_write()
 |  |           Which updates the isize to the write end (4K).
 |  |
 |  |- iomap_dio_iter()
 |  |  Failed with -EFAULT on the first page.
 |  |
 |  |- iomap_iter()
 |  |  |- btrfs_dio_iomap_end()
 |  |     Detects a short write, return -ENOTBLK
 |  |- if (ret == -ENOTBLK) { ret = 0;}
 |     Which resets the return value.
 |
 |- ret = iomap_dio_complet()
 |  Which returns 0.
 |
 |- btrfs_buffered_write(iocb, from);

|- generic_write_checks()
|- iocb->ki_pos = i_size_read()
Which is still the new size (4K), other than the original isize 0.

[FIX]
Introduce the following btrfs_dio_data members:

- old_isize

- updated_isize
If the direct write has enlarged the isize.

Then if we got a short write, and btrfs_dio_data::updated_isize is set, revert to the correct isize based on old_isize and current file position.

And here we call i_size_write() without holding an extent lock, which is a very special case that we're safe to do:

- Only a single writer can be enlarging isize Enlarging isize will take the exclusive inode lock.

- Buffered readers need to wait for the OE we're holding Buffered readers will lock extent and wait for OE of the folio range. Sometimes we can skip the OE wait, but since all page cache is invalidated, the OE wait can not be skipped.

But I do not think this is the most elegant solution, nor covers all cases. E.g. if the bio is submitted but IO failed, we are unable to do the revert.

I believe the more elegant one would be extend the EXTENT_DIO_LOCKED lifespan for direct writes, so that we can update the isize when a write beyond EOF finished successfully.

However that change is too huge for a small bug fix. So only implement the minimal partial fix for now.

[REASON FOR NO FIXES TAG]
The bug is again very old, before commit f85781fb505e ("btrfs: switch to iomap for direct IO") we are already increasing isize without a proper rollback for short writes.

Thus only a CC to stable.

---
 fs/btrfs/direct-io.c |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)
fs/btrfs/direct-io.c +42 -1
@@ -13,10 +13,12 @@
 
 struct btrfs_dio_data {
 	ssize_t submitted;
+	loff_t old_isize;
 	struct extent_changeset *data_reserved;
 	struct btrfs_ordered_extent *ordered;
 	bool data_space_reserved;
 	bool nocow_done;
+	bool updated_isize;
 };
 
 struct btrfs_dio_private {
@@ -227,6 +229,7 @@ static int btrfs_get_blocks_direct_write
 	bool space_reserved = false;
 	u64 len = *lenp;
 	u64 prev_len;
+	loff_t old_isize;
 	int ret = 0;
 
 	/*
@@ -340,8 +343,14 @@ static int btrfs_get_blocks_direct_write
 	 * Need to update the i_size under the extent lock so buffered
 	 * readers will get the updated i_size when we unlock.
 	 */
-	if (start + len > i_size_read(inode))
+	old_isize = i_size_read(inode);
+	if (start + len > old_isize) {
+		if (!dio_data->updated_isize) {
+			dio_data->old_isize = old_isize;
+			dio_data->updated_isize = true;
+		}
 		i_size_write(inode, start + len);
+	}
 out:
 	if (ret && space_reserved) {
 		btrfs_delalloc_release_extents(BTRFS_I(inode), len);
@@ -625,6 +634,38 @@ static int btrfs_dio_iomap_end(struct in
 		length -= submitted;
 		if (write) {
 			/*
+			 * Got a short write and have updated the isize, need to
+			 * revert the isize change.
+			 *
+			 * Normally we need to update isize with extent lock hold,
+			 * but we're safe due to the following factors:
+			 *
+			 * - Only a single writer can be enlarging isize
+			 *   Enlarging isize will take the exclusive inode lock.
+			 *
+			 * - Buffered readers need to wait for the OE we're holding
+			 *   Buffered readers will lock extent and wait for OE
+			 *   of the folio range, and since page cache is invalidated
+			 *   the OE wait can not be skipped.
+			 *
+			 * So here we are safe to revert the isize before
+			 * finishing the OE, and no reader of the remaining range
+			 * can see the enlarged size.
+			 *
+			 * TODO: Extend the DIO_LOCKED lifespan for direct writes,
+			 * and only enlarge isize after a successful write.
+			 */
+			if (dio_data->updated_isize) {
+				u64 new_isize;
+
+				if (submitted == 0)
+					new_isize = dio_data->old_isize;
+				else
+					new_isize = max(dio_data->old_isize, pos);
+				i_size_write(inode, new_isize);
+				dio_data->updated_isize = false;
+			}
+			/*
 			 * We have a short write, if there is any range
 			 * that is submitted properly, that part will have
 			 * its own OE split from the original one.
author maintainer
#1274 lore raw

PATCH 1234/1276 slab: Introduce kmalloc_obj() and family

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kees Cook <[email protected]>

commit 2932ba8d9c99875b98c951d9d3fd6d651d35df3a upstream.

Introduce type-aware kmalloc-family helpers to replace the common idioms for single object and arrays of objects allocation:

	ptr = kmalloc(sizeof(*ptr), gfp);
	ptr = kmalloc(sizeof(struct some_obj_name), gfp);
	ptr = kzalloc(sizeof(*ptr), gfp);
	ptr = kmalloc_array(count, sizeof(*ptr), gfp);
	ptr = kcalloc(count, sizeof(*ptr), gfp);

These become, respectively:

	ptr = kmalloc_obj(*ptr, gfp);
	ptr = kmalloc_obj(*ptr, gfp);
	ptr = kzalloc_obj(*ptr, gfp);
	ptr = kmalloc_objs(*ptr, count, gfp);
	ptr = kzalloc_objs(*ptr, count, gfp);

Beyond the other benefits outlined below, the primary ergonomic benefit is the elimination of needing "sizeof" nor the type name, and the enforcement of assignment types (they do not return "void *", but rather a pointer to the type of the first argument). The type name _can_ be used, though, in the case where an assignment is indirect (e.g. via "return"). This additionally allows[1] variables to be declared via __auto_type:

	__auto_type ptr = kmalloc_obj(struct foo, gfp);

Internal introspection of the allocated type now becomes possible, allowing for future alignment-aware choices to be made by the allocator and future hardening work that can be type sensitive. For example, adding __alignof(*ptr) as an argument to the internal allocators so that appropriate/efficient alignment choices can be made, or being able to correctly choose per-allocation offset randomization within a bucket that does not break alignment requirements.

---
 Documentation/process/deprecated.rst |   24 ++++++++++++++
 include/linux/slab.h                 |   58 +++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)
Documentation/process/deprecated.rst +24 -0
@@ -372,3 +372,27 @@ The helper must be used::
 			DECLARE_FLEX_ARRAY(struct type2, two);
 		};
 	};
+
+Open-coded kmalloc assignments for struct objects
+-------------------------------------------------
+Performing open-coded kmalloc()-family allocation assignments prevents
+the kernel (and compiler) from being able to examine the type of the
+variable being assigned, which limits any related introspection that
+may help with alignment, wrap-around, or additional hardening. The
+kmalloc_obj()-family of macros provide this introspection, which can be
+used for the common code patterns for single, array, and flexible object
+allocations. For example, these open coded assignments::
+
+	ptr = kmalloc(sizeof(*ptr), gfp);
+	ptr = kzalloc(sizeof(*ptr), gfp);
+	ptr = kmalloc_array(count, sizeof(*ptr), gfp);
+	ptr = kcalloc(count, sizeof(*ptr), gfp);
+	ptr = kmalloc(sizeof(struct foo, gfp);
+
+become, respectively::
+
+	ptr = kmalloc_obj(*ptr, gfp);
+	ptr = kzalloc_obj(*ptr, gfp);
+	ptr = kmalloc_objs(*ptr, count, gfp);
+	ptr = kzalloc_objs(*ptr, count, gfp);
+	__auto_type ptr = kmalloc_obj(struct foo, gfp);
include/linux/slab.h +58 -0

70 lines not on this page · raw message

author maintainer
#1275 lore raw

PATCH 1235/1276 slab: Introduce kmalloc_flex() and family

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kees Cook <[email protected]>

commit e4c8b46b924eb8de66c6f0accc9cdd0c2e8fa23b upstream.

As done for kmalloc_obj*(), introduce a type-aware allocator for flexible arrays, which may also have "counted_by" annotations:

	ptr = kmalloc(struct_size(ptr, flex_member, count), gfp);

becomes:

	ptr = kmalloc_flex(*ptr, flex_member, count, gfp);

The internal use of __flex_counter() allows for automatically setting the counter member of a struct's flexible array member when it has been annotated with __counted_by(), avoiding any missed early size initializations while __counted_by() annotations are added to the kernel. Additionally, this also checks for "too large" allocations based on the type size of the counter variable. For example:

	if (count > type_max(ptr->flex_counter))
		fail...;
	size = struct_size(ptr, flex_member, count);
	ptr = kmalloc(size, gfp);
	if (!ptr)
		fail...;
	ptr->flex_counter = count;

becomes (n.b. unchanged from earlier example):

	ptr = kmalloc_flex(*ptr, flex_member, count, gfp);
	if (!ptr)
		fail...;
	ptr->flex_counter = count;

Note that manual initialization of the flexible array counter is still required (at some point) after allocation as not all compiler versions support the __counted_by annotation yet. But doing it internally makes sure they cannot be missed when __counted_by _is_ available, meaning that the bounds checker will not trip due to the lack of "early enough" initializations that used to work before enabling the stricter bounds checking. For example:

	ptr = kmalloc_flex(*ptr, flex_member, count, gfp);
	fill(ptr->flex, count);
	ptr->flex_count = count;

This works correctly before adding a __counted_by annotation (since nothing is checking ptr->flex accesses against ptr->flex_count). After adding the annotation, the bounds sanitizer would trip during fill() because ptr->flex_count wasn't set yet. But with kmalloc_flex() setting ptr->flex_count internally at allocation time, the existing code works without needing to move the ptr->flex_count assignment before the call to fill(). (This has been a stumbling block for __counted_by adoption.)

[Backport-notes: Removed the actual flex counter handling. That's a new
feature, which isn't necessary for just adding the new allocation APIs to get backports to apply cleanly. Also, the allocation-time overflow check in the upstream commit was reverted upstream.]

---
 Documentation/process/deprecated.rst |    7 +++++
 include/linux/slab.h                 |   42 +++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
Documentation/process/deprecated.rst +7 -0
@@ -387,6 +387,7 @@ allocations. For example, these open cod
 	ptr = kzalloc(sizeof(*ptr), gfp);
 	ptr = kmalloc_array(count, sizeof(*ptr), gfp);
 	ptr = kcalloc(count, sizeof(*ptr), gfp);
+	ptr = kmalloc(struct_size(ptr, flex_member, count), gfp);
 	ptr = kmalloc(sizeof(struct foo, gfp);
 
 become, respectively::
@@ -395,4 +396,10 @@ become, respectively::
 	ptr = kzalloc_obj(*ptr, gfp);
 	ptr = kmalloc_objs(*ptr, count, gfp);
 	ptr = kzalloc_objs(*ptr, count, gfp);
+	ptr = kmalloc_flex(*ptr, flex_member, count, gfp);
 	__auto_type ptr = kmalloc_obj(struct foo, gfp);
+
+If `ptr->flex_member` is annotated with __counted_by(), the allocation
+will automatically fail if `count` is larger than the maximum
+representable value that can be stored in the counter member associated
+with `flex_member`.
include/linux/slab.h +42 -0

71 lines not on this page · raw message

author maintainer
#1276 lore raw

PATCH 1236/1276 add default_gfp() helper macro and use it in the new *alloc_obj() helpers

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Linus Torvalds <[email protected]>

commit e19e1b480ac73c3e62ffebbca1174f0f511f43e7 upstream.

Most simple allocations use GFP_KERNEL, and with the new allocation helpers being introduced, let's just take advantage of that to simplify that default case.

It's a numbers game:

git grep 'alloc_obj(' |
sed 's/.*\(GFP_[_A-Z]*\).*/\1/' |
sort | uniq -c | sort -n | tail

shows that about 90% of all those new allocator instances just use that standard GFP_KERNEL.

Those helpers are already macros, and we can easily just make it be the default case when the gfp argument is missing.

And yes, we could do that for all the legacy interfaces too, but let's keep it to just the new ones at least for now, since those all got converted recently anyway, so this is not any "extra" noise outside of that limited conversion.

And, in fact, I want to do this before doing the -rc1 release, exactly so that we don't get extra merge conflicts.

---
 include/linux/gfp.h  |    4 ++++
 include/linux/slab.h |   48 ++++++++++++++++++++++++------------------------
 2 files changed, 28 insertions(+), 24 deletions(-)
include/linux/gfp.h +4 -0
@@ -12,6 +12,10 @@
 struct vm_area_struct;
 struct mempolicy;
 
+/* Helper macro to avoid gfp flags if they are the default one */
+#define __default_gfp(a,...) a
+#define default_gfp(...) __default_gfp(__VA_ARGS__ __VA_OPT__(,) GFP_KERNEL)
+
 /* Convert GFP flags to their corresponding migrate type */
 #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
 #define GFP_MOVABLE_SHIFT 3
include/linux/slab.h +24 -24

72 lines not on this page · raw message

author maintainer
#1277 lore raw

PATCH 1237/1276 default_gfp(): avoid using the "newfangled" __VA_OPT__ trick

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Linus Torvalds <[email protected]>

commit 551d44200152cb26f75d2ef990aeb6185b7e37fd upstream.

The default_gfp() helper that I added is not wrong, but it turns out that it causes unnecessary headaches for 'sparse' which doesn't support the use of __VA_OPT__ (introduced in C++20 and C23, and supported by gcc and clang for a long time).

We do already use __VA_OPT__ in some other cases in the kernel (drm/xe and btrfs), but it has been fairly limited. Now it triggers for pretty much everything, and sparse ends up not working at all.

We can use the traditional gcc ',##__VA_ARGS__' syntax instead: it may not be the "C standard" way and is slightly less natural in this context, but it is the traditional model for this and avoids the sparse problem.

Fixes e19e1b480ac7 ("add default_gfp() helper macro and use it in the new *alloc_obj() helpers")
---
 include/linux/gfp.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/gfp.h +2 -2
@@ -13,8 +13,8 @@ struct vm_area_struct;
 struct mempolicy;
 
 /* Helper macro to avoid gfp flags if they are the default one */
-#define __default_gfp(a,...) a
-#define default_gfp(...) __default_gfp(__VA_ARGS__ __VA_OPT__(,) GFP_KERNEL)
+#define __default_gfp(a,b,...) b
+#define default_gfp(...) __default_gfp(,##__VA_ARGS__,GFP_KERNEL)
 
 /* Convert GFP flags to their corresponding migrate type */
 #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
author maintainer
#1278 lore raw

PATCH 1238/1276 slab: recognize @GFP parameter as optional in kernel-doc

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Randy Dunlap <[email protected]>

commit 7b5f5865fb11e60edd03c5e063e2d228b7062317 upstream.

Since the @GFP parameter in kmalloc_obj() etc. is now optional, change the kernel-doc to indicate that it is optional. This avoids kernel-doc warnings:

WARNING: include/linux/slab.h:1101 Excess function parameter 'GFP' description in 'kmalloc_obj'
WARNING: include/linux/slab.h:1113 Excess function parameter 'GFP' description in 'kmalloc_objs'
WARNING: include/linux/slab.h:1128 Excess function parameter 'GFP' description in 'kmalloc_flex'
Fixes e19e1b480ac7 ("add default_gfp() helper macro and use it in the new *alloc_obj() helpers")
---
 include/linux/slab.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/slab.h +3 -3
@@ -924,7 +924,7 @@ static __always_inline __alloc_size(1) v
 /**
  * kmalloc_obj - Allocate a single instance of the given type
  * @VAR_OR_TYPE: Variable or type to allocate.
- * @GFP: GFP flags for the allocation.
+ * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
  *
  * Returns: newly allocated pointer to a @VAR_OR_TYPE on success, or NULL
  * on failure.
@@ -936,7 +936,7 @@ static __always_inline __alloc_size(1) v
  * kmalloc_objs - Allocate an array of the given type
  * @VAR_OR_TYPE: Variable or type to allocate an array of.
  * @COUNT: How many elements in the array.
- * @GFP: GFP flags for the allocation.
+ * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
  *
  * Returns: newly allocated pointer to array of @VAR_OR_TYPE on success,
  * or NULL on failure.
@@ -949,7 +949,7 @@ static __always_inline __alloc_size(1) v
  * @VAR_OR_TYPE: Variable or type to allocate (with its flex array).
  * @FAM: The name of the flexible array member of the structure.
  * @COUNT: How many flexible array member elements are desired.
- * @GFP: GFP flags for the allocation.
+ * @...: optional GFP flags for the allocation (GFP_KERNEL when not specified).
  *
  * Returns: newly allocated pointer to @VAR_OR_TYPE on success, NULL on
  * failure. If @FAM has been annotated with __counted_by(), the allocation
author maintainer
#1279 lore raw

PATCH 1239/1276 fscrypt: Fix key setup in edge case with multiple data unit sizes

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Eric Biggers <[email protected]>

commit dd015b566d505d698386103e9c80b739c7336eb8 upstream.

The addition of support for customizable data unit sizes introduced an edge case where a file's contents can be en/decrypted with the wrong data unit size. It occurs when there are multiple v2 policies that:

- Have *different* data unit sizes, via the log2_data_unit_size field

- Share the same master_key_identifier, contents_encryption_mode, and either FSCRYPT_POLICY_FLAG_DIRECT_KEY, FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32, or FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64

- Are being used on the same filesystem, which also must be mounted with the "inlinecrypt" mount option.

Fortunately this edge case doesn't actually occur in practice. I just found it via code review. But it needs to be fixed regardless.

The bug is caused by the data unit size not being fully considered when blk_crypto_keys are cached in mk_direct_keys, mk_iv_ino_lblk_32_keys, and mk_iv_ino_lblk_64_keys. They're differentiated only by master key, encryption mode, and flag. However, each one actually has a data unit size too. Only the first data unit size that is cached is used.

To fix this, start using the data unit size to differentiate the cached keys. For several reasons, including avoiding increasing the size of struct fscrypt_master_key, just replace all three arrays with a single linked list instead of changing them into two-dimensional arrays. This works well when considering that in practice at most 2 entries are used across all three arrays, so it was already mostly wasted space.

For simplicity, make the list also take over the publish/subscribe of the prepared key itself. That is, create separate list nodes for blk_crypto_keys vs crypto_skciphers, and add nodes to the list only when their key is actually prepared. (Note that the legacy fscrypt_direct_keys table in fs/crypto/keysetup_v1.c already works this way.) This eliminates the need for the additional memory barriers when reading and writing the fields of struct fscrypt_prepared_key.

Note that I technically should have included the data unit size in the HKDF info string as well. But it's too late to change that.

Fixes 5b1188847180 ("fscrypt: support crypto data unit size less than filesystem block size")
---
 fs/crypto/fscrypt_private.h |   55 ++++++++++++--------
 fs/crypto/inline_crypt.c    |    8 --
 fs/crypto/keyring.c         |   23 +++++---
 fs/crypto/keysetup.c        |  121 ++++++++++++++++++++++++++++----------------
 4 files changed, 126 insertions(+), 81 deletions(-)
fs/crypto/fscrypt_private.h +34 -21
@@ -27,6 +27,9 @@
  */
 #define FSCRYPT_MIN_KEY_SIZE	16
 
+/* Maximum size of a raw fscrypt master key */
+#define FSCRYPT_MAX_RAW_KEY_SIZE	64
+
 /*
  * This mask is passed as the third argument to the crypto_alloc_*() functions
  * to prevent fscrypt from using the Crypto API drivers for non-inline crypto
@@ -217,7 +220,7 @@ struct fscrypt_symlink_data {
  * @tfm: crypto API transform object
  * @blk_key: key for blk-crypto
  *
- * Normally only one of the fields will be non-NULL.
+ * Only one of the fields is non-NULL.
  */
 struct fscrypt_prepared_key {
 	struct crypto_skcipher *tfm;
@@ -226,6 +229,15 @@ struct fscrypt_prepared_key {
 #endif
 };
 
+/* An entry in the linked list ->mk_mode_keys */
+struct fscrypt_mode_key {
+	struct fscrypt_prepared_key key;
+	struct list_head link;
+	u8 hkdf_context;
+	u8 mode_num;
+	u8 data_unit_bits;
+};
+
 /*
  * fscrypt_inode_info - the "encryption key" for an inode
  *
@@ -413,20 +425,12 @@ void fscrypt_destroy_inline_crypt_key(st
  * @prep_key, depending on which encryption implementation the file will use.
  */
 static inline bool
-fscrypt_is_key_prepared(struct fscrypt_prepared_key *prep_key,
+fscrypt_is_key_prepared(const struct fscrypt_prepared_key *prep_key,
 			const struct fscrypt_inode_info *ci)
 {
-	/*
-	 * The two smp_load_acquire()'s here pair with the smp_store_release()'s
-	 * in fscrypt_prepare_inline_crypt_key() and fscrypt_prepare_key().
-	 * I.e., in some cases (namely, if this prep_key is a per-mode
-	 * encryption key) another task can publish blk_key or tfm concurrently,
-	 * executing a RELEASE barrier.  We need to use smp_load_acquire() here
-	 * to safely ACQUIRE the memory the other task published.
-	 */
 	if (fscrypt_using_inline_encryption(ci))
-		return smp_load_acquire(&prep_key->blk_key) != NULL;
-	return smp_load_acquire(&prep_key->tfm) != NULL;
+		return prep_key->blk_key != NULL;
+	return prep_key->tfm != NULL;
 }
 
 #else /* CONFIG_FS_ENCRYPTION_INLINE_CRYPT */
@@ -458,10 +462,10 @@ fscrypt_destroy_inline_crypt_key(struct
 }
 
 static inline bool
-fscrypt_is_key_prepared(struct fscrypt_prepared_key *prep_key,
+fscrypt_is_key_prepared(const struct fscrypt_prepared_key *prep_key,
 			const struct fscrypt_inode_info *ci)
 {
-	return smp_load_acquire(&prep_key->tfm) != NULL;
+	return prep_key->tfm != NULL;
 }
 #endif /* !CONFIG_FS_ENCRYPTION_INLINE_CRYPT */
 
@@ -531,8 +535,8 @@ struct fscrypt_master_key {
 	/*
 	 * Active and structural reference counts.  An active ref guarantees
 	 * that the struct continues to exist, continues to be in the keyring
-	 * ->s_master_keys, and that any embedded subkeys (e.g.
-	 * ->mk_direct_keys) that have been prepared continue to exist.
+	 * ->s_master_keys, and that any non-file-scoped subkeys (e.g.
+	 * ->mk_mode_keys) that have been prepared continue to exist.
 	 * A structural ref only guarantees that the struct continues to exist.
 	 *
 	 * There is one active ref associated with ->mk_present being true, and
@@ -586,12 +590,21 @@ struct fscrypt_master_key {
 	spinlock_t		mk_decrypted_inodes_lock;
 
 	/*
-	 * Per-mode encryption keys for the various types of encryption policies
-	 * that use them.  Allocated and derived on-demand.
+	 * A list of 'struct fscrypt_mode_key' for the (hkdf_context, mode_num,
+	 * data_unit_bits, inlinecrypt) combinations that are in use for this
+	 * master key, for hkdf_context in [HKDF_CONTEXT_DIRECT_KEY,
+	 * HKDF_CONTEXT_IV_INO_LBLK_32_KEY, HKDF_CONTEXT_IV_INO_LBLK_64_KEY].
+	 *
+	 * This is a linked list and not a hash table because in practice
+	 * there's just a single encryption policy per master key, using
+	 * _at most_ 2 nodes in this list.  Per-file keys don't use this at all.
+	 *
+	 * This list is append-only until the master key is fully removed, at
+	 * which time the list is cleared.  Before then,
+	 * fscrypt_mode_key_setup_mutex synchronizes appends, and searches use
+	 * the RCU read lock together with ->mk_sem held for read.
 	 */
-	struct fscrypt_prepared_key mk_direct_keys[FSCRYPT_MODE_MAX + 1];
-	struct fscrypt_prepared_key mk_iv_ino_lblk_64_keys[FSCRYPT_MODE_MAX + 1];
-	struct fscrypt_prepared_key mk_iv_ino_lblk_32_keys[FSCRYPT_MODE_MAX + 1];
+	struct list_head	mk_mode_keys;
 
 	/* Hash key for inode numbers.  Initialized only when needed. */
 	siphash_key_t		mk_ino_hash_key;
fs/crypto/inline_crypt.c +1 -7
@@ -191,13 +191,7 @@ int fscrypt_prepare_inline_crypt_key(str
 		goto fail;
 	}
 
-	/*
-	 * Pairs with the smp_load_acquire() in fscrypt_is_key_prepared().
-	 * I.e., here we publish ->blk_key with a RELEASE barrier so that
-	 * concurrent tasks can ACQUIRE it.  Note that this concurrency is only
-	 * possible for per-mode keys, not for per-file keys.
-	 */
-	smp_store_release(&prep_key->blk_key, blk_key);
+	prep_key->blk_key = blk_key;
 	return 0;
 
 fail:
fs/crypto/keyring.c +14 -9
@@ -86,14 +86,14 @@ void fscrypt_put_master_key(struct fscry
 void fscrypt_put_master_key_activeref(struct super_block *sb,
 				      struct fscrypt_master_key *mk)
 {
-	size_t i;
+	struct fscrypt_mode_key *node, *tmp;
 
 	if (!refcount_dec_and_test(&mk->mk_active_refs))
 		return;
 	/*
 	 * No active references left, so complete the full removal of this
 	 * fscrypt_master_key struct by removing it from the keyring and
-	 * destroying any subkeys embedded in it.
+	 * destroying any non-file-scoped subkeys.
 	 */
 
 	if (WARN_ON_ONCE(!sb->s_master_keys))
@@ -109,13 +109,16 @@ void fscrypt_put_master_key_activeref(st
 	WARN_ON_ONCE(mk->mk_present);
 	WARN_ON_ONCE(!list_empty(&mk->mk_decrypted_inodes));
 
-	for (i = 0; i <= FSCRYPT_MODE_MAX; i++) {
-		fscrypt_destroy_prepared_key(
-				sb, &mk->mk_direct_keys[i]);
-		fscrypt_destroy_prepared_key(
-				sb, &mk->mk_iv_ino_lblk_64_keys[i]);
-		fscrypt_destroy_prepared_key(
-				sb, &mk->mk_iv_ino_lblk_32_keys[i]);
+	/*
+	 * Destroy any non-file-scoped subkeys.  Since ->mk_active_refs == 0,
+	 * they're no longer referenced by any inodes.  Nor can key setup run
+	 * and use them again.  So they're no longer needed.  (This implies no
+	 * concurrent readers, so we don't need list_del_rcu() for example.)
+	 */
+	list_for_each_entry_safe(node, tmp, &mk->mk_mode_keys, link) {
+		fscrypt_destroy_prepared_key(sb, &node->key);
+		list_del(&node->link);
+		kfree(node);
 	}
 	memzero_explicit(&mk->mk_ino_hash_key,
 			 sizeof(mk->mk_ino_hash_key));
@@ -444,6 +447,8 @@ static int add_new_master_key(struct sup
 	INIT_LIST_HEAD(&mk->mk_decrypted_inodes);
 	spin_lock_init(&mk->mk_decrypted_inodes_lock);
 
+	INIT_LIST_HEAD(&mk->mk_mode_keys);
+
 	if (mk_spec->type == FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER) {
 		err = allocate_master_key_users_keyring(mk);
 		if (err)
fs/crypto/keysetup.c +77 -44

172 lines not on this page · raw message

author maintainer
#1280 lore raw

PATCH 1240/1276 fscrypt: Replace mk_users keyring with simple list

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Eric Biggers <[email protected]>

commit 696c030e1e3438955aba443b308ee8b6faa3983e upstream.

Change mk_users (the set of user claims to an fscrypt master key) from a 'struct key' keyring to a simple linked list.

It's still a collection of 'struct key' for quota tracking. It was originally thought to be natural that a collection of 'struct key' should be held in a 'struct key' keyring. In reality, it's just been causing problems, similar to how using 'struct key' for the filesystem keyring caused problems and was removed in commit d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key").

Commit d3a7bd420076 ("fscrypt: clear keyring before calling key_put()") fixed mk_users cleanup to be synchronous. But that apparently wasn't
enough: the keyring subsystem's redundant locking is still generating lockdep false positives due to the interaction with filesystem reclaim.

With the simple list, the redundant locking and lockdep issue goes away.

Of course, searching a linked list is linear-time whereas the 'struct key' keyring used a fancy constant-time associative array. But that's fine here, since in practice there's just one entry in the list. In fact the new code is much faster in practice, since it's much smaller and doesn't have to convert the kuid_t into a string to search for it.

---
 fs/crypto/fscrypt_private.h |   36 ++++---
 fs/crypto/keyring.c         |  220 ++++++++++++++++++--------------------------
 2 files changed, 117 insertions(+), 139 deletions(-)
fs/crypto/fscrypt_private.h +24 -12
@@ -472,6 +472,19 @@ fscrypt_is_key_prepared(const struct fsc
 /* keyring.c */
 
 /*
+ * fscrypt_master_key_user - a user's claim to a master key
+ */
+struct fscrypt_master_key_user {
+	struct list_head link;
+	kuid_t uid;
+	/*
+	 * This 'struct key' contains no secret.  It exists solely to charge the
+	 * appropriate user's key quota.
+	 */
+	struct key *quota_key;
+};
+
+/*
  * fscrypt_master_key_secret - secret key material of an in-use master key
  */
 struct fscrypt_master_key_secret {
@@ -568,19 +581,18 @@ struct fscrypt_master_key {
 	struct fscrypt_key_specifier		mk_spec;
 
 	/*
-	 * Keyring which contains a key of type 'key_type_fscrypt_user' for each
-	 * user who has added this key.  Normally each key will be added by just
-	 * one user, but it's possible that multiple users share a key, and in
-	 * that case we need to keep track of those users so that one user can't
-	 * remove the key before the others want it removed too.
-	 *
-	 * This is NULL for v1 policy keys; those can only be added by root.
-	 *
-	 * Locking: protected by ->mk_sem.  (We don't just rely on the keyrings
-	 * subsystem semaphore ->mk_users->sem, as we need support for atomic
-	 * search+insert along with proper synchronization with other fields.)
+	 * List of user claims to this key (struct fscrypt_master_key_user).
+	 * Normally each key will be added by just one user, but it's possible
+	 * that multiple users share a key, and in that case we need to keep
+	 * track of those users so that one user can't remove the key before the
+	 * others want it removed too.
+	 *
+	 * Used only for v2 policy keys.  v1 policy keys can be added only by
+	 * root, so user tracking doesn't apply to them.
+	 *
+	 * Locking: protected by ->mk_sem.
 	 */
-	struct key		*mk_users;
+	struct list_head	mk_users;
 
 	/*
 	 * List of inodes that were unlocked using this key.  This allows the
fs/crypto/keyring.c +93 -127

339 lines not on this page · raw message

author maintainer
#1281 lore raw

PATCH 1241/1276 selftests/fs/statmount: build with tools include dir

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amir Goldstein <[email protected]>

commit b13fb4ee46472d7f7fc3e2172c08c06ed8b3f31c upstream.

Copy the required headers files (mount.h, nsfs.h) to the tools include dir and define the statmount/listmount syscall numbers to decouple dependency with headers_install for the common cases.

---
 tools/include/uapi/linux/mount.h                          |  235 ++++++++++++++
 tools/include/uapi/linux/nsfs.h                           |   45 ++
 tools/testing/selftests/filesystems/statmount/Makefile    |    3 
 tools/testing/selftests/filesystems/statmount/statmount.h |   36 ++
 4 files changed, 318 insertions(+), 1 deletion(-)
 create mode 100644 tools/include/uapi/linux/mount.h
 create mode 100644 tools/include/uapi/linux/nsfs.h
tools/include/uapi/linux/mount.h new file +235 -0
@@ -0,0 +1,235 @@
+#ifndef _UAPI_LINUX_MOUNT_H
+#define _UAPI_LINUX_MOUNT_H
+
+#include <linux/types.h>
+
+/*
+ * These are the fs-independent mount-flags: up to 32 flags are supported
+ *
+ * Usage of these is restricted within the kernel to core mount(2) code and
+ * callers of sys_mount() only.  Filesystems should be using the SB_*
+ * equivalent instead.
+ */
+#define MS_RDONLY	 1	/* Mount read-only */
+#define MS_NOSUID	 2	/* Ignore suid and sgid bits */
+#define MS_NODEV	 4	/* Disallow access to device special files */
+#define MS_NOEXEC	 8	/* Disallow program execution */
+#define MS_SYNCHRONOUS	16	/* Writes are synced at once */
+#define MS_REMOUNT	32	/* Alter flags of a mounted FS */
+#define MS_MANDLOCK	64	/* Allow mandatory locks on an FS */
+#define MS_DIRSYNC	128	/* Directory modifications are synchronous */
+#define MS_NOSYMFOLLOW	256	/* Do not follow symlinks */
+#define MS_NOATIME	1024	/* Do not update access times. */
+#define MS_NODIRATIME	2048	/* Do not update directory access times */
+#define MS_BIND		4096
+#define MS_MOVE		8192
+#define MS_REC		16384
+#define MS_VERBOSE	32768	/* War is peace. Verbosity is silence.
+				   MS_VERBOSE is deprecated. */
+#define MS_SILENT	32768
+#define MS_POSIXACL	(1<<16)	/* VFS does not apply the umask */
+#define MS_UNBINDABLE	(1<<17)	/* change to unbindable */
+#define MS_PRIVATE	(1<<18)	/* change to private */
+#define MS_SLAVE	(1<<19)	/* change to slave */
+#define MS_SHARED	(1<<20)	/* change to shared */
+#define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
+#define MS_KERNMOUNT	(1<<22) /* this is a kern_mount call */
+#define MS_I_VERSION	(1<<23) /* Update inode I_version field */
+#define MS_STRICTATIME	(1<<24) /* Always perform atime updates */
+#define MS_LAZYTIME	(1<<25) /* Update the on-disk [acm]times lazily */
+
+/* These sb flags are internal to the kernel */
+#define MS_SUBMOUNT     (1<<26)
+#define MS_NOREMOTELOCK	(1<<27)
+#define MS_NOSEC	(1<<28)
+#define MS_BORN		(1<<29)
+#define MS_ACTIVE	(1<<30)
+#define MS_NOUSER	(1<<31)
+
+/*
+ * Superblock flags that can be altered by MS_REMOUNT
+ */
+#define MS_RMT_MASK	(MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\
+			 MS_LAZYTIME)
+
+/*
+ * Old magic mount flag and mask
+ */
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+/*
+ * open_tree() flags.
+ */
+#define OPEN_TREE_CLONE		1		/* Clone the target tree and attach the clone */
+#define OPEN_TREE_CLOEXEC	O_CLOEXEC	/* Close the file on execve() */
+
+/*
+ * move_mount() flags.
+ */
+#define MOVE_MOUNT_F_SYMLINKS		0x00000001 /* Follow symlinks on from path */
+#define MOVE_MOUNT_F_AUTOMOUNTS		0x00000002 /* Follow automounts on from path */
+#define MOVE_MOUNT_F_EMPTY_PATH		0x00000004 /* Empty from path permitted */
+#define MOVE_MOUNT_T_SYMLINKS		0x00000010 /* Follow symlinks on to path */
+#define MOVE_MOUNT_T_AUTOMOUNTS		0x00000020 /* Follow automounts on to path */
+#define MOVE_MOUNT_T_EMPTY_PATH		0x00000040 /* Empty to path permitted */
+#define MOVE_MOUNT_SET_GROUP		0x00000100 /* Set sharing group instead */
+#define MOVE_MOUNT_BENEATH		0x00000200 /* Mount beneath top mount */
+#define MOVE_MOUNT__MASK		0x00000377
+
+/*
+ * fsopen() flags.
+ */
+#define FSOPEN_CLOEXEC		0x00000001
+
+/*
+ * fspick() flags.
+ */
+#define FSPICK_CLOEXEC		0x00000001
+#define FSPICK_SYMLINK_NOFOLLOW	0x00000002
+#define FSPICK_NO_AUTOMOUNT	0x00000004
+#define FSPICK_EMPTY_PATH	0x00000008
+
+/*
+ * The type of fsconfig() call made.
+ */
+enum fsconfig_command {
+	FSCONFIG_SET_FLAG	= 0,	/* Set parameter, supplying no value */
+	FSCONFIG_SET_STRING	= 1,	/* Set parameter, supplying a string value */
+	FSCONFIG_SET_BINARY	= 2,	/* Set parameter, supplying a binary blob value */
+	FSCONFIG_SET_PATH	= 3,	/* Set parameter, supplying an object by path */
+	FSCONFIG_SET_PATH_EMPTY	= 4,	/* Set parameter, supplying an object by (empty) path */
+	FSCONFIG_SET_FD		= 5,	/* Set parameter, supplying an object by fd */
+	FSCONFIG_CMD_CREATE	= 6,	/* Create new or reuse existing superblock */
+	FSCONFIG_CMD_RECONFIGURE = 7,	/* Invoke superblock reconfiguration */
+	FSCONFIG_CMD_CREATE_EXCL = 8,	/* Create new superblock, fail if reusing existing superblock */
+};
+
+/*
+ * fsmount() flags.
+ */
+#define FSMOUNT_CLOEXEC		0x00000001
+
+/*
+ * Mount attributes.
+ */
+#define MOUNT_ATTR_RDONLY	0x00000001 /* Mount read-only */
+#define MOUNT_ATTR_NOSUID	0x00000002 /* Ignore suid and sgid bits */
+#define MOUNT_ATTR_NODEV	0x00000004 /* Disallow access to device special files */
+#define MOUNT_ATTR_NOEXEC	0x00000008 /* Disallow program execution */
+#define MOUNT_ATTR__ATIME	0x00000070 /* Setting on how atime should be updated */
+#define MOUNT_ATTR_RELATIME	0x00000000 /* - Update atime relative to mtime/ctime. */
+#define MOUNT_ATTR_NOATIME	0x00000010 /* - Do not update access times. */
+#define MOUNT_ATTR_STRICTATIME	0x00000020 /* - Always perform atime updates */
+#define MOUNT_ATTR_NODIRATIME	0x00000080 /* Do not update directory access times */
+#define MOUNT_ATTR_IDMAP	0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */
+#define MOUNT_ATTR_NOSYMFOLLOW	0x00200000 /* Do not follow symlinks */
+
+/*
+ * mount_setattr()
+ */
+struct mount_attr {
+	__u64 attr_set;
+	__u64 attr_clr;
+	__u64 propagation;
+	__u64 userns_fd;
+};
+
+/* List of all mount_attr versions. */
+#define MOUNT_ATTR_SIZE_VER0	32 /* sizeof first published struct */
+
+
+/*
+ * Structure for getting mount/superblock/filesystem info with statmount(2).
+ *
+ * The interface is similar to statx(2): individual fields or groups can be
+ * selected with the @mask argument of statmount().  Kernel will set the @mask
+ * field according to the supported fields.
+ *
+ * If string fields are selected, then the caller needs to pass a buffer that
+ * has space after the fixed part of the structure.  Nul terminated strings are
+ * copied there and offsets relative to @str are stored in the relevant fields.
+ * If the buffer is too small, then EOVERFLOW is returned.  The actually used
+ * size is returned in @size.
+ */
+struct statmount {
+	__u32 size;		/* Total size, including strings */
+	__u32 mnt_opts;		/* [str] Options (comma separated, escaped) */
+	__u64 mask;		/* What results were written */
+	__u32 sb_dev_major;	/* Device ID */
+	__u32 sb_dev_minor;
+	__u64 sb_magic;		/* ..._SUPER_MAGIC */
+	__u32 sb_flags;		/* SB_{RDONLY,SYNCHRONOUS,DIRSYNC,LAZYTIME} */
+	__u32 fs_type;		/* [str] Filesystem type */
+	__u64 mnt_id;		/* Unique ID of mount */
+	__u64 mnt_parent_id;	/* Unique ID of parent (for root == mnt_id) */
+	__u32 mnt_id_old;	/* Reused IDs used in proc/.../mountinfo */
+	__u32 mnt_parent_id_old;
+	__u64 mnt_attr;		/* MOUNT_ATTR_... */
+	__u64 mnt_propagation;	/* MS_{SHARED,SLAVE,PRIVATE,UNBINDABLE} */
+	__u64 mnt_peer_group;	/* ID of shared peer group */
+	__u64 mnt_master;	/* Mount receives propagation from this ID */
+	__u64 propagate_from;	/* Propagation from in current namespace */
+	__u32 mnt_root;		/* [str] Root of mount relative to root of fs */
+	__u32 mnt_point;	/* [str] Mountpoint relative to current root */
+	__u64 mnt_ns_id;	/* ID of the mount namespace */
+	__u32 fs_subtype;	/* [str] Subtype of fs_type (if any) */
+	__u32 sb_source;	/* [str] Source string of the mount */
+	__u32 opt_num;		/* Number of fs options */
+	__u32 opt_array;	/* [str] Array of nul terminated fs options */
+	__u32 opt_sec_num;	/* Number of security options */
+	__u32 opt_sec_array;	/* [str] Array of nul terminated security options */
+	__u64 supported_mask;	/* Mask flags that this kernel supports */
+	__u32 mnt_uidmap_num;	/* Number of uid mappings */
+	__u32 mnt_uidmap;	/* [str] Array of uid mappings (as seen from callers namespace) */
+	__u32 mnt_gidmap_num;	/* Number of gid mappings */
+	__u32 mnt_gidmap;	/* [str] Array of gid mappings (as seen from callers namespace) */
+	__u64 __spare2[43];
+	char str[];		/* Variable size part containing strings */
+};
+
+/*
+ * Structure for passing mount ID and miscellaneous parameters to statmount(2)
+ * and listmount(2).
+ *
+ * For statmount(2) @param represents the request mask.
+ * For listmount(2) @param represents the last listed mount id (or zero).
+ */
+struct mnt_id_req {
+	__u32 size;
+	__u32 spare;
+	__u64 mnt_id;
+	__u64 param;
+	__u64 mnt_ns_id;
+};
+
+/* List of all mnt_id_req versions. */
+#define MNT_ID_REQ_SIZE_VER0	24 /* sizeof first published struct */
+#define MNT_ID_REQ_SIZE_VER1	32 /* sizeof second published struct */
+
+/*
+ * @mask bits for statmount(2)
+ */
+#define STATMOUNT_SB_BASIC		0x00000001U     /* Want/got sb_... */
+#define STATMOUNT_MNT_BASIC		0x00000002U	/* Want/got mnt_... */
+#define STATMOUNT_PROPAGATE_FROM	0x00000004U	/* Want/got propagate_from */
+#define STATMOUNT_MNT_ROOT		0x00000008U	/* Want/got mnt_root  */
+#define STATMOUNT_MNT_POINT		0x00000010U	/* Want/got mnt_point */
+#define STATMOUNT_FS_TYPE		0x00000020U	/* Want/got fs_type */
+#define STATMOUNT_MNT_NS_ID		0x00000040U	/* Want/got mnt_ns_id */
+#define STATMOUNT_MNT_OPTS		0x00000080U	/* Want/got mnt_opts */
+#define STATMOUNT_FS_SUBTYPE		0x00000100U	/* Want/got fs_subtype */
+#define STATMOUNT_SB_SOURCE		0x00000200U	/* Want/got sb_source */
+#define STATMOUNT_OPT_ARRAY		0x00000400U	/* Want/got opt_... */
+#define STATMOUNT_OPT_SEC_ARRAY		0x00000800U	/* Want/got opt_sec... */
+#define STATMOUNT_SUPPORTED_MASK	0x00001000U	/* Want/got supported mask flags */
+#define STATMOUNT_MNT_UIDMAP		0x00002000U	/* Want/got uidmap... */
+#define STATMOUNT_MNT_GIDMAP		0x00004000U	/* Want/got gidmap... */
+
+/*
+ * Special @mnt_id values that can be passed to listmount
+ */
+#define LSMT_ROOT		0xffffffffffffffff	/* root mount */
+#define LISTMOUNT_REVERSE	(1 << 0) /* List later mounts first */
+
+#endif /* _UAPI_LINUX_MOUNT_H */
tools/include/uapi/linux/nsfs.h new file +45 -0

45 lines not on this page · raw message

tools/testing/selftests/filesystems/statmount/Makefile +2 -1
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES)
+CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES) $(TOOLS_INCLUDES)
+
 TEST_GEN_PROGS := statmount_test statmount_test_ns
 
 include ../../lib.mk
tools/testing/selftests/filesystems/statmount/statmount.h +36 -0
@@ -7,6 +7,42 @@
 #include <linux/mount.h>
 #include <asm/unistd.h>
 
+#ifndef __NR_statmount
+	#if defined __alpha__
+		#define __NR_statmount 567
+	#elif defined _MIPS_SIM
+		#if _MIPS_SIM == _MIPS_SIM_ABI32	/* o32 */
+			#define __NR_statmount 4457
+		#endif
+		#if _MIPS_SIM == _MIPS_SIM_NABI32	/* n32 */
+			#define __NR_statmount 6457
+		#endif
+		#if _MIPS_SIM == _MIPS_SIM_ABI64	/* n64 */
+			#define __NR_statmount 5457
+		#endif
+	#else
+		#define __NR_statmount 457
+	#endif
+#endif
+
+#ifndef __NR_listmount
+	#if defined __alpha__
+		#define __NR_listmount 568
+	#elif defined _MIPS_SIM
+		#if _MIPS_SIM == _MIPS_SIM_ABI32	/* o32 */
+			#define __NR_listmount 4458
+		#endif
+		#if _MIPS_SIM == _MIPS_SIM_NABI32	/* n32 */
+			#define __NR_listmount 6458
+		#endif
+		#if _MIPS_SIM == _MIPS_SIM_ABI64	/* n64 */
+			#define __NR_listmount 5458
+		#endif
+	#else
+		#define __NR_listmount 458
+	#endif
+#endif
+
 static inline int statmount(uint64_t mnt_id, uint64_t mnt_ns_id, uint64_t mask,
 			    struct statmount *buf, size_t bufsize,
 			    unsigned int flags)
author maintainer
#1282 lore raw

PATCH 1242/1276 mm/damon/core: always put unsuccessfully committed target pids

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: SeongJae Park <[email protected]>

commit 6a66c557a2ab2609575bafd15e093669c05f9711 upstream.

damon_commit_target() puts and gets the destination and the source target pids. It puts the destination target pid because it will be overwritten by the source target pid. It gets the source pid because the caller is supposed to eventually put the pids. In more detail, the caller will call damon_destroy_ctx() after damon_commit_ctx() to destroy the entire source context. And in this case, [f]vaddr operation set's cleanup_target() callback will put the pids.

The commit operation is made at the context level. The operation can fail in multiple places including in the middle and after the targets commit operations. For any such failures, immediately the error is returned to the damon_commit_ctx() caller. If some or all of the source target pids were committed to the destination during the unsuccessful context commit attempt, those pids should be put twice.

The source context will do the put operations using the above explained routine. However, let's suppose the destination context was not originally using [f]vaddr operation set and the commit failed before the ops of the source context is committed. The destination does not have the cleanup_target() ops callback, so it cannot put the pids via the damon_destroy_ctx().

As a result, the pids are leaked. The issue in the real world would be not very common. The commit feature is for changing parameters of running DAMON context while inheriting internal status like the monitoring results. The monitoring results of a physical address range ain't have things that are beneficial to be inherited to a virtual address ranges monitoring. So the problem-causing DAMON control would be not very common in the real world. That said, it is a supported feature. And damon_commit_target() failure due to memory allocation is relatively realistic [1] if there are a huge number of target regions.

Fix by putting the pids in the commit operation in case of the failures.

The issue was discovered [2] by Sashiko.

---
 mm/damon/core.c |   49 +++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 6 deletions(-)
mm/damon/core.c +43 -6
@@ -938,10 +938,36 @@ static int damon_commit_target(
 	return 0;
 }
 
+/*
+ * damon_revert_target_commits() - revert unsuccessful target commits.
+ * @dst:	Commit destination context
+ * @failed:	Commit failed destination target
+ * @src:	Commit source context
+ *
+ * Revert target states that changed by damon_commit_target(), and cannot be
+ * cleaned up by the destination context's ops.cleanup_target().
+ */
+static void damon_revert_target_commits(struct damon_ctx *dst,
+		struct damon_target *failed, struct damon_ctx *src)
+{
+	struct damon_target *target;
+
+	if (!damon_target_has_pid(src))
+		return;
+	if (damon_target_has_pid(dst))
+		return;
+	damon_for_each_target(target, dst) {
+		if (target == failed)
+			return;
+		put_pid(target->pid);
+	}
+}
+
 static int damon_commit_targets(
 		struct damon_ctx *dst, struct damon_ctx *src)
 {
 	struct damon_target *dst_target, *next, *src_target, *new_target;
+	struct damon_target *failed;
 	int i = 0, j = 0, err;
 
 	damon_for_each_target_safe(dst_target, next, dst) {
@@ -950,8 +976,10 @@ static int damon_commit_targets(
 			err = damon_commit_target(
 					dst_target, damon_target_has_pid(dst),
 					src_target, damon_target_has_pid(src));
-			if (err)
-				return err;
+			if (err) {
+				failed = dst_target;
+				goto out;
+			}
 		} else {
 			if (damon_target_has_pid(dst))
 				put_pid(dst_target->pid);
@@ -959,21 +987,28 @@ static int damon_commit_targets(
 		}
 	}
 
+	failed = NULL;
 	damon_for_each_target_safe(src_target, next, src) {
 		if (j++ < i)
 			continue;
 		new_target = damon_new_target();
-		if (!new_target)
-			return -ENOMEM;
+		if (!new_target) {
+			err = -ENOMEM;
+			goto out;
+		}
 		err = damon_commit_target(new_target, false,
 				src_target, damon_target_has_pid(src));
 		if (err) {
 			damon_destroy_target(new_target);
-			return err;
+			goto out;
 		}
 		damon_add_target(dst, new_target);
 	}
 	return 0;
+
+out:
+	damon_revert_target_commits(dst, failed, src);
+	return err;
 }
 
 /**
@@ -1007,8 +1042,10 @@ int damon_commit_ctx(struct damon_ctx *d
 	 *    committing require putting pids).
 	 */
 	err = damon_set_attrs(dst, &src->attrs);
-	if (err)
+	if (err) {
+		damon_revert_target_commits(dst, NULL, src);
 		return err;
+	}
 	dst->ops = src->ops;
 
 	return 0;
author maintainer
#1283 lore raw

PATCH 1243/1276 KVM: Move kvm_io_bus_get_dev() locking responsibilities to callers

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Marc Zyngier <[email protected]>

commit 3a07249981629ace483ebbef81ef6b34c2d2afec upstream.

kvm_io_bus_get_dev() returns a device that is only matched by the address, and nothing else. This can cause a lifetime issue if the matched device is not the expected type, as by the time the caller can introspect the object, it might be gone (the srcu lock having been dropped).

Given that there is only a single user of this helper, the simplest option is to move the locking responsibility to the caller, which can keep the srcu lock held for as long as it wants.

Note that this aligns with other kvm_io_bus*() helpers, which already require the srcu lock to be held by the callers.

---
 arch/arm64/kvm/vgic/vgic-its.c |    2 ++
 virt/kvm/kvm_main.c            |   16 +++++-----------
 2 files changed, 7 insertions(+), 11 deletions(-)
arch/arm64/kvm/vgic/vgic-its.c +2 -0
@@ -510,6 +510,8 @@ static struct vgic_its *__vgic_doorbell_
 	struct kvm_io_device *kvm_io_dev;
 	struct vgic_io_device *iodev;
 
+	guard(srcu)(&kvm->srcu);
+
 	kvm_io_dev = kvm_io_bus_get_dev(kvm, KVM_MMIO_BUS, db);
 	if (!kvm_io_dev)
 		return ERR_PTR(-EINVAL);
virt/kvm/kvm_main.c +5 -11
@@ -6063,25 +6063,19 @@ struct kvm_io_device *kvm_io_bus_get_dev
 					 gpa_t addr)
 {
 	struct kvm_io_bus *bus;
-	int dev_idx, srcu_idx;
-	struct kvm_io_device *iodev = NULL;
+	int dev_idx;
 
-	srcu_idx = srcu_read_lock(&kvm->srcu);
+	lockdep_assert_held(&kvm->srcu);
 
 	bus = srcu_dereference(kvm->buses[bus_idx], &kvm->srcu);
 	if (!bus)
-		goto out_unlock;
+		return NULL;
 
 	dev_idx = kvm_io_bus_get_first_dev(bus, addr, 1);
 	if (dev_idx < 0)
-		goto out_unlock;
+		return NULL;
 
-	iodev = bus->range[dev_idx].dev;
-
-out_unlock:
-	srcu_read_unlock(&kvm->srcu, srcu_idx);
-
-	return iodev;
+	return bus->range[dev_idx].dev;
 }
 EXPORT_SYMBOL_GPL(kvm_io_bus_get_dev);
 
author maintainer
#1284 lore raw

PATCH 1244/1276 KVM: arm64: Ensure level is always initialized when relaxing perms

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Oliver Upton <[email protected]>

commit 100baf0184896f859290a684f864b8200d8ac872 upstream.

stage2_update_leaf_attrs() returns early before writing to @level if the table walker returned an error. At the same time, kvm_pgtable_stage2_relax_perms() uses the level as a TLBI TTL hint when the error was EAGAIN, indicating the vCPU raced with a table update and the TLB entry it hit is now stale.

Fall back to an unknown TTL if none was provided by the walk.

Fixes be097997a273 ("KVM: arm64: Always invalidate TLB for stage-2 permission faults")
---
 arch/arm64/kvm/hyp/pgtable.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/pgtable.c +1 -1
@@ -1314,7 +1314,7 @@ int kvm_pgtable_stage2_relax_perms(struc
 				   enum kvm_pgtable_prot prot)
 {
 	int ret;
-	s8 level;
+	s8 level = TLBI_TTL_UNKNOWN;
 	kvm_pte_t set = 0, clr = 0;
 
 	if (prot & KVM_PTE_LEAF_ATTR_HI_SW)
author maintainer
#1285 lore raw

PATCH 1245/1276 KVM: arm64: Fix propagation of TLBI level in kvm_pgtable_stage2_relax_perms()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Marc Zyngier <[email protected]>

commit 8d187d4b33c262c0f3e44842553521151d8629e8 upstream.

Assigning the invalidation level (an s8 value) with TLBI_TTL_UNKNOWN (a 32bit signed value) is not ideal, to say the least. Instead of this, only pass TLBI_TTL_UNKNOWN to __kvm_tlb_flush_vmid_ipa_nsh() when we know for sure that we don't have a provided level.

---
 arch/arm64/kvm/hyp/pgtable.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/kvm/hyp/pgtable.c +3 -2
@@ -1314,7 +1314,7 @@ int kvm_pgtable_stage2_relax_perms(struc
 				   enum kvm_pgtable_prot prot)
 {
 	int ret;
-	s8 level = TLBI_TTL_UNKNOWN;
+	s8 level;
 	kvm_pte_t set = 0, clr = 0;
 
 	if (prot & KVM_PTE_LEAF_ATTR_HI_SW)
@@ -1333,7 +1333,8 @@ int kvm_pgtable_stage2_relax_perms(struc
 				       KVM_PGTABLE_WALK_HANDLE_FAULT |
 				       KVM_PGTABLE_WALK_SHARED);
 	if (!ret || ret == -EAGAIN)
-		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr, level);
+		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr,
+			     (ret == -EAGAIN) ? TLBI_TTL_UNKNOWN : level);
 	return ret;
 }
 
author maintainer
#1286 lore raw

PATCH 1246/1276 bpf: Reject BPF_MAP_TYPE_INODE_STORAGE creation if BPF LSM is uninitialized

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Matt Bobrowski <[email protected]>

commit a6f0643e4f63cfaa0d5d4a69de4f132eac4b8fe4 upstream.

When CONFIG_BPF_LSM=y is set, BPF inode storage maps (BPF_MAP_TYPE_INODE_STORAGE) are compiled into the kernel. However, if the BPF LSM is not explicitly enabled at boot time (e.g. omitted from the "lsm=" boot parameter), lsm_prepare() is never executed for the BPF LSM.

Consequently, the BPF inode security blob offset (bpf_lsm_blob_sizes.lbs_inode) is never initialized and remains at its default compiled size of 8 bytes instead of being updated to a valid offset past the reserved struct rcu_head (typically 16 bytes or more).

When a privileged user creates and updates a BPF_MAP_TYPE_INODE_STORAGE map, bpf_inode() evaluates inode->i_security + 8. This erroneously aliases the struct rcu_head.func callback pointer at the beginning of the inode->i_security blob. During subsequent map element cleanup or inode destruction, writing NULL to owner_storage clears the queued RCU callback pointer. When rcu_do_batch() later executes the queued callback, it attempts an instruction fetch at address 0x0, triggering an immediate kernel panic.

Fix this by introducing a global bpf_lsm_initialized boolean flag marked with __ro_after_init. Set this flag to true inside bpf_lsm_init() when the LSM framework successfully registers the BPF LSM. Gate map allocation in inode_storage_map_alloc() on this flag, returning -EOPNOTSUPP if the BPF LSM is in turn uninitialized.

This fail-fast approach prevents userspace from allocating inode storage maps when the supporting BPF LSM infrastructure is absent, avoiding zombie map states.

---
 include/linux/bpf_lsm.h        |    4 ++++
 kernel/bpf/bpf_inode_storage.c |    9 +++++++++
 security/bpf/hooks.c           |    3 +++
 3 files changed, 16 insertions(+)
include/linux/bpf_lsm.h +4 -0
@@ -14,6 +14,8 @@
 
 #ifdef CONFIG_BPF_LSM
 
+extern bool bpf_lsm_initialized __ro_after_init;
+
 #define LSM_HOOK(RET, DEFAULT, NAME, ...) \
 	RET bpf_lsm_##NAME(__VA_ARGS__);
 #include <linux/lsm_hook_defs.h>
@@ -50,6 +52,8 @@ int bpf_lsm_get_retval_range(const struc
 			     struct bpf_retval_range *range);
 #else /* !CONFIG_BPF_LSM */
 
+#define bpf_lsm_initialized false
+
 static inline bool bpf_lsm_is_sleepable_hook(u32 btf_id)
 {
 	return false;
kernel/bpf/bpf_inode_storage.c +9 -0
@@ -182,6 +182,15 @@ static int notsupp_get_next_key(struct b
 
 static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr)
 {
+	/*
+	 * Do not allow allocation of BPF_MAP_TYPE_INODE_STORAGE if the BPF LSM
+	 * was not initialized by the LSM framework at boot. Without proper
+	 * initialization, the BPF inode security blob offset remains unprepared,
+	 * causing bpf_inode() to calculate an invalid memory offset and corrupt
+	 * inode->i_security.
+	 */
+	if (!bpf_lsm_initialized)
+		return ERR_PTR(-EOPNOTSUPP);
 	return bpf_local_storage_map_alloc(attr, &inode_cache, false);
 }
 
security/bpf/hooks.c +3 -0
@@ -7,6 +7,8 @@
 #include <linux/bpf_lsm.h>
 #include <uapi/linux/lsm.h>
 
+bool bpf_lsm_initialized __ro_after_init;
+
 static struct security_hook_list bpf_lsm_hooks[] __ro_after_init = {
 	#define LSM_HOOK(RET, DEFAULT, NAME, ...) \
 	LSM_HOOK_INIT(NAME, bpf_lsm_##NAME),
@@ -25,6 +27,7 @@ static int __init bpf_lsm_init(void)
 {
 	security_add_hooks(bpf_lsm_hooks, ARRAY_SIZE(bpf_lsm_hooks),
 			   &bpf_lsmid);
+	bpf_lsm_initialized = true;
 	pr_info("LSM support for eBPF active\n");
 	return 0;
 }
author maintainer
#1287 lore raw

PATCH 1247/1276 perf/x86/amd/brs: Fix kernel address leakage

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sandipan Das <[email protected]>

commit 47915e855fb38b42133e31ba917d99565f862154 upstream.

A user-only branch stack can contain branches that originate from the kernel. As a result, kernel addresses are exposed to user space even when PERF_SAMPLE_BRANCH_USER is requested. On AMD processors supporting X86_FEATURE_BRS (Zen 3 only), perf can still report entries such as SYSRET/interrupt returns for which the branch-from addresses are in the kernel.

E.g.

  $ perf record -j any,u -c 4000 -e branch-brs -o - -- \
        perf bench syscall basic --loop 1000 | \
        perf script -i - -F brstack|tr ' ' '\n'| \
        grep -E '0x[89a-f][0-9a-f]{15}'

...
0xffffffff810001c4/0x72e2e32955eb/-/-/-/0//-
0xffffffff810001c4/0x72e2d94a9821/-/-/-/0//-
0xffffffff810001c4/0x72e2d94ffa1b/-/-/-/0//-
...

BRS provides no hardware branch filtering, so privilege level filtering is performed entirely in software. However, amd_brs_match_plm() only validates the branch-to address against the requested privilege levels. For branches from the kernel to user space, the branch-from address is left unchecked and is leaked. Extend the software filter to also validate the branch-from address, so that any branch record whose branch-from address is in the kernel is dropped when PERF_SAMPLE_BRANCH_USER is requested.

---
 arch/x86/events/amd/brs.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/x86/events/amd/brs.c +5 -5
@@ -259,13 +259,13 @@ void amd_brs_disable_all(void)
 		amd_brs_disable();
 }
 
-static bool amd_brs_match_plm(struct perf_event *event, u64 to)
+static bool amd_brs_match_plm(struct perf_event *event, u64 from, u64 to)
 {
 	int type = event->attr.branch_sample_type;
 	int plm_k = PERF_SAMPLE_BRANCH_KERNEL | PERF_SAMPLE_BRANCH_HV;
 	int plm_u = PERF_SAMPLE_BRANCH_USER;
 
-	if (!(type & plm_k) && kernel_ip(to))
+	if (!(type & plm_k) && (kernel_ip(to) || kernel_ip(from)))
 		return 0;
 
 	if (!(type & plm_u) && !kernel_ip(to))
@@ -338,11 +338,11 @@ void amd_brs_drain(void)
 		 */
 		to = (u64)(((s64)to << shift) >> shift);
 
-		if (!amd_brs_match_plm(event, to))
-			continue;
-
 		rdmsrl(brs_from(brs_idx), from);
 
+		if (!amd_brs_match_plm(event, from, to))
+			continue;
+
 		perf_clear_branch_entry_bitfields(br+nr);
 
 		br[nr].from = from;
author maintainer
#1288 lore raw

PATCH 1248/1276 dibs: loopback: validate offset and size in move_data()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dust Li <[email protected]>

commit 78237e3c0720fcc6eb9b87e90fd70f63eeca886f upstream.

The loopback move_data() performs a memcpy into the registered DMB without checking whether offset + size exceeds the DMB length. Unlike real ISM hardware, which enforces memory region bounds natively, the software loopback has no such protection.

A peer-supplied out-of-bounds offset or oversized write would result in an OOB write past the allocated kernel buffer. Add an explicit bounds check before the memcpy to reject such requests with -EINVAL.

Fixes f7a22071dbf3 ("net/smc: implement DMB-related operations of loopback-ism")
[backport for smc_loopback instead of dibs_loopback]
---
 net/smc/smc_loopback.c |    5 +++++
 1 file changed, 5 insertions(+)
net/smc/smc_loopback.c +5 -0
@@ -245,6 +245,11 @@ static int smc_lo_move_data(struct smcd_
 		read_unlock_bh(&ldev->dmb_ht_lock);
 		return -EINVAL;
 	}
+	if ((u64)offset + size > rmb_node->len) {
+		read_unlock_bh(&ldev->dmb_ht_lock);
+		return -EINVAL;
+	}
+
 	memcpy((char *)rmb_node->cpu_addr + offset, data, size);
 	read_unlock_bh(&ldev->dmb_ht_lock);
 
author maintainer
#1289 lore raw

PATCH 1249/1276 perf inject: With --convert-callchain ignore the dummy event for dwarf stacks

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Rogers <[email protected]>

commit e786a04b4a5461dd7e2829422314a5a6d5a664d9 upstream.

On hybrid systems there is generally >1 event and a dummy event.

The perf inject --convert-callchain option is failing to convert perf.data files on such systems reporting "--convert-callchain requires DWARF call graph."

The failing event is the dummy event that doesn't need to be set up for samples.

As such ignore this event when checking the evsels.

Fixes 92ea788d2af4e65a ("perf inject: Add --convert-callchain option")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/builtin-inject.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-inject.c +1 -1
@@ -2739,7 +2739,7 @@ int cmd_inject(int argc, const char **ar
 		}
 
 		evlist__for_each_entry(inject.session->evlist, evsel) {
-			if (!evsel__has_dwarf_callchain(evsel)) {
+			if (!evsel__has_dwarf_callchain(evsel) && !evsel__is_dummy_event(evsel)) {
 				pr_err("--convert-callchain requires DWARF call graph.\n");
 				goto out_delete;
 			}
author maintainer
#1290 lore raw

PATCH 1250/1276 seqlock: fix scoped_seqlock_read kernel-doc

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Randy Dunlap <[email protected]>

commit f88a31308db6a856229150039b0f56d59696ed31 upstream.

Eliminate all kernel-doc warnings in seqlock.h:

- correct the macro to have "()" immediately following the macro name
- don't include the macro parameters in the short description (first line)
- make the parameter names in the comments match the actual macro parameter names.
- use "::" for the Example

WARNING: include/linux/seqlock.h:1341 This comment starts with '/**', but isn't a kernel-doc comment.
 * scoped_seqlock_read (lock, ss_state) - execute the read side critical

Documentation/locking/seqlock:242: include/linux/seqlock.h:1351: WARNING:
Definition list ends without a blank line; unexpected unindent. [docutils]
Warning: include/linux/seqlock.h:1357 function parameter '_seqlock' not described in 'scoped_seqlock_read'
Warning: include/linux/seqlock.h:1357 function parameter '_target' not described in 'scoped_seqlock_read'

---
 include/linux/seqlock.h |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
include/linux/seqlock.h +7 -8
@@ -1277,15 +1277,14 @@ __scoped_seqlock_next(struct ss_tmp *sst
 	     __scoped_seqlock_next(&_s, _seqlock, _target))
 
 /**
- * scoped_seqlock_read (lock, ss_state) - execute the read side critical
- *                                        section without manual sequence
- *                                        counter handling or calls to other
- *                                        helpers
- * @lock: pointer to seqlock_t protecting the data
- * @ss_state: one of {ss_lock, ss_lock_irqsave, ss_lockless} indicating
- *            the type of critical read section
+ * scoped_seqlock_read() - execute the read-side critical section
+ *                         without manual sequence counter handling
+ *                         or calls to other helpers
+ * @_seqlock: pointer to seqlock_t protecting the data
+ * @_target: an enum ss_state: one of {ss_lock, ss_lock_irqsave, ss_lockless}
+ *           indicating the type of critical read section
  *
- * Example:
+ * Example::
  *
  *     scoped_seqlock_read (&lock, ss_lock) {
  *         // read-side critical section
author maintainer
#1291 lore raw

PATCH 1251/1276 perf callchain: Handle multiple address spaces

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Thomas Richter <[email protected]>

commit ae15db3e9b639491007cc1e9e99638e4b6091781 upstream.

perf test 'perf inject to convert DWARF callchains to regular ones' fails on s390. It was introduced with commit 92ea788d2af4e65a ("perf
inject: Add --convert-callchain option")

The failure comes the difference in output. Without the inject script to convert DWARF the callchains is:

 # perf record -F 999 --call-graph dwarf -- perf test -w noploop
 # perf report -i perf.data --stdio --no-children -q \
					 --percent-limit=1 > /tmp/111
 # cat /tmp/111
    99.30%  perf-noploop  perf               [.] noploop
            |
            ---noploop
               run_workload (inlined)
               cmd_test
               run_builtin (inlined)
               handle_internal_command
               run_argv (inlined)
               main
               __libc_start_call_main
               __libc_start_main_impl (inlined)
               _start
 #

With the inject script step the output is:

 # perf inject -i perf.data --convert-callchain -o /tmp/perf-inject-1.out
 # perf report -i /tmp/perf-inject-1.out --stdio --no-children -q \
		--percent-limit=1 > /tmp/222
 # cat /tmp/222
    99.40%  perf-noploop  perf               [.] noploop
            |
            ---noploop
               run_workload (inlined)
               cmd_test
               run_builtin (inlined)
               handle_internal_command
               run_argv (inlined)
               main
               _start
 # diff /tmp/111 /tmp/222
 1c1
 <     99.30%  perf-noploop  perf               [.] noploop
 ---
Quoted 1 line

99.40% perf-noploop perf [.] noploop

10,11d9
< __libc_start_call_main
< __libc_start_main_impl (inlined)
#

The difference are the symbols __libc_start_call_main and __libc_start_main_impl.

On x86_64, kernel and user space share a single virtual address space, with the kernel mapped to the upper end of memory. The instruction pointer value alone is sufficient to distinguish between user space and kernel space addresses.

This is not true for s390, which uses separate address spaces for user and kernel.

The same virtual address can be valid in both address spaces, so the instruction pointer value alone cannot determine whether an address belongs to the kernel or user space.

Instead, perf must rely on the cpumode metadata derived from the processor status word (PSW) at sample time.

In function perf_event__convert_sample_callchain() the first part copies a kernel callchain and context entries, if any.

It then appends additional entries ignoring the address space architecture. Taking that into account, the symbols at addresses

0x3ff970348cb __libc_start_call_main
0x3ff970349c5 __libc_start_main_impl

(located after the kernel address space on s390) are now included.

Output before:

 # perf test 83
 83: perf inject to convert DWARF callchains to regular ones : FAILED!

Output after:

 # perf test 83
 83: perf inject to convert DWARF callchains to regular ones : Ok

Question to Namhyung:

In function perf_event__convert_sample_callchain() just before the for() loop this patch modifies, the kernel callchain is copied, see this comment and the next 5 lines:

/* copy kernel callchain and context entries */

Then why is machine__kernel_ip() needed in the for() loop, when the kernel entries have been copied just before the loop?

Note: This patch was tested on x86_64 virtual machine and succeeded.

Fixes 92ea788d2af4e65a ("perf inject: Add --convert-callchain option")
Cc Alexander Gordeev <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Jan Polensky <[email protected]>
Cc Sumanth Korikkar <[email protected]>
Cc Vasily Gorbik <[email protected]>
---
 tools/perf/arch/common.c    |    4 +++-
 tools/perf/builtin-inject.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
tools/perf/arch/common.c +3 -1
@@ -237,5 +237,7 @@ int perf_env__lookup_objdump(struct perf
  */
 bool perf_env__single_address_space(struct perf_env *env)
 {
-	return strcmp(perf_env__arch(env), "sparc");
+	const char *arch = perf_env__arch(env);
+
+	return strcmp(arch, "s390") && strcmp(arch, "sparc");
 }
tools/perf/builtin-inject.c +2 -1
@@ -452,7 +452,8 @@ static int perf_event__convert_sample_ca
 
 	node = cursor->first;
 	for (k = 0; k < cursor->nr && i < PERF_MAX_STACK_DEPTH; k++) {
-		if (machine__kernel_ip(machine, node->ip))
+		if (machine->single_address_space &&
+		    machine__kernel_ip(machine, node->ip))
 			/* kernel IPs were added already */;
 		else if (node->ms.sym && node->ms.sym->inlined)
 			/* we can't handle inlined callchains */;
author maintainer
#1292 lore raw

PATCH 1252/1276 ksmbd: fix durable reconnect double-bind race in ksmbd_reopen_durable_fd

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Gil Portnoy <[email protected]>

commit 7ce4fc40018de07f05f3035241122d992610dbfb upstream.

Two concurrent same-user DHnC reconnects can both observe fp->conn == NULL before either sets it. ksmbd_reopen_durable_fd() checks fp->conn to guard against a handle already being reconnected, but the check and the binding assignment are not atomic: both threads pass the guard, both call ksmbd_conn_get() on the same fp, and both eventually reach kfree(fp->owner.name) -- a double-free of the owner.name slab object. The double-bound ksmbd_file also causes a write-UAF on the 344-byte ksmbd_file_cache object when a concurrent smb2_close() spins on fp->f_lock after the object has been freed by the losing reconnect path.

KASAN on 7.1-rc5 (48-thread concurrent reconnect, 3000 cycles):

  BUG: KASAN: double-free in ksmbd_reopen_durable_fd+0x268/0x308
  BUG: KASAN: slab-use-after-free in _raw_spin_lock+0xac/0x150
    Write of size 4 at offset 24 into freed ksmbd_file_cache object

Five double-bind windows observed; 63 total KASAN reports triggered.

Fix: validate and claim fp->conn under write_lock(&global_ft.lock) so the check-and-claim is atomic. ksmbd_lookup_durable_fd() already treats fp->conn != NULL as "in use" and skips such an fp; setting fp->conn before dropping the lock closes the race. ksmbd_conn_get() is a non-sleeping refcount increment, safe under the rwlock. The rollback path on __open_id() failure also clears fp->conn/tcon under the lock so concurrent readers see a consistent state.

Fixes b1f1e80620de ("ksmbd: centralize ksmbd_conn final release to plug transport leak")
Assisted-by Henry (Claude):claude-opus-4
---
 fs/smb/server/vfs_cache.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/vfs_cache.c +9 -3
@@ -1185,19 +1185,19 @@ int ksmbd_reopen_durable_fd(struct ksmbd
 	struct ksmbd_lock *smb_lock;
 	unsigned int old_f_state;
 
+	write_lock(&global_ft.lock);
 	if (!fp->is_durable || fp->conn || fp->tcon) {
+		write_unlock(&global_ft.lock);
 		pr_err("Invalid durable fd [%p:%p]\n", fp->conn, fp->tcon);
 		return -EBADF;
 	}
 
 	if (has_file_id(fp->volatile_id)) {
+		write_unlock(&global_ft.lock);
 		pr_err("Still in use durable fd: %llu\n", fp->volatile_id);
 		return -EBADF;
 	}
 
-	old_f_state = fp->f_state;
-	fp->f_state = FP_NEW;
-
 	/*
 	 * Initialize fp's connection binding before publishing fp into the
 	 * session's file table.  If __open_id() is ordered first, a
@@ -1208,11 +1208,17 @@ int ksmbd_reopen_durable_fd(struct ksmbd
 	 */
 	fp->conn = ksmbd_conn_get(conn);
 	fp->tcon = work->tcon;
+	write_unlock(&global_ft.lock);
+
+	old_f_state = fp->f_state;
+	fp->f_state = FP_NEW;
 
 	__open_id(&work->sess->file_table, fp, OPEN_ID_TYPE_VOLATILE_ID);
 	if (!has_file_id(fp->volatile_id)) {
+		write_lock(&global_ft.lock);
 		fp->conn = NULL;
 		fp->tcon = NULL;
+		write_unlock(&global_ft.lock);
 		ksmbd_conn_put(conn);
 		fp->f_state = old_f_state;
 		return -EBADF;
author maintainer
#1293 lore raw

PATCH 1253/1276 rtnetlink: Make per-netns RTNL dereference helpers to macro.

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kuniyuki Iwashima <[email protected]>

commit 9cb7e40d388d6c0e4677809c6b2950bc67fd8830 upstream.

When CONFIG_DEBUG_NET_SMALL_RTNL is off, rtnl_net_dereference() is the static inline wrapper of rtnl_dereference() returning a plain (void *) pointer to make sure net is always evaluated as requested in [0].

But, it makes sparse complain [1] when the pointer has __rcu annotation:

net/ipv4/devinet.c:674:47: sparse: warning: incorrect type in argument 2 (different address spaces)
net/ipv4/devinet.c:674:47: sparse: expected void *p
net/ipv4/devinet.c:674:47: sparse: got struct in_ifaddr [noderef] __rcu *

Also, if we evaluate net as (void *) in a macro, then the compiler in turn fails to build due to -Werror=unused-value.

  #define rtnl_net_dereference(net, p)                  \
        ({                                              \
                (void *)net;                            \
                rtnl_dereference(p);                    \
        })

net/ipv4/devinet.c: In function ‘inet_rtm_deladdr’:
./include/linux/rtnetlink.h:154:17: error: statement with no effect [-Werror=unused-value]

    154 |                 (void *)net;                            \
  net/ipv4/devinet.c:674:21: note: in expansion of macro ‘rtnl_net_dereference’
    674 |              (ifa = rtnl_net_dereference(net, *ifap)) != NULL;
        |                     ^~~~~~~~~~~~~~~~~~~~

Let's go back to the original simplest macro.

Note that checkpatch complains about this approach, but it's one-shot and less noisy than the other two.

WARNING: Argument 'net' is not used in function-like macro #76: FILE: include/linux/rtnetlink.h:142:
+#define rtnl_net_dereference(net, p) \
+ rtnl_dereference(p)

---
 include/linux/rtnetlink.h |   21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
include/linux/rtnetlink.h +6 -15
@@ -146,21 +146,12 @@ static inline void ASSERT_RTNL_NET(struc
 	ASSERT_RTNL();
 }
 
-static inline void *rcu_dereference_rtnl_net(struct net *net, void *p)
-{
-	return rcu_dereference_rtnl(p);
-}
-
-static inline void *rtnl_net_dereference(struct net *net, void *p)
-{
-	return rtnl_dereference(p);
-}
-
-static inline void *rcu_replace_pointer_rtnl_net(struct net *net,
-						 void *rp, void *p)
-{
-	return rcu_replace_pointer_rtnl(rp, p);
-}
+#define rcu_dereference_rtnl_net(net, p)		\
+	rcu_dereference_rtnl(p)
+#define rtnl_net_dereference(net, p)			\
+	rtnl_dereference(p)
+#define rcu_replace_pointer_rtnl_net(net, rp, p)	\
+	rcu_replace_pointer_rtnl(rp, p)
 #endif
 
 static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev)
author maintainer
#1294 lore raw

PATCH 1254/1276 perf arm-spe: Use old behavior when opening old SPE files

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: James Clark <[email protected]>

commit ba993e5ada1ddce7a71140dc85ef65bc2cd981bc upstream.

Since the linked commit, we stopped interpreting data source if the perf.data file doesn't have the new metadata version. This means that perf c2c will show no samples in this case.

Keep the old behavior so old files can be opened, but also still show the new warning that updating might improve the decoding.

Also re-write the warning to be more concise and specific to a user.

Fixes ba5e7169e548 ("perf arm-spe: Use metadata to decide the data source feature")
Cc Will Deacon <[email protected]>
Cc Mike Leach <[email protected]>
Cc Besar Wicaksono <[email protected]>
Cc John Garry <[email protected]>
---
 tools/perf/util/arm-spe.c |   50 ++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 26 deletions(-)
tools/perf/util/arm-spe.c +24 -26
@@ -655,37 +655,35 @@ static bool arm_spe__is_common_ds_encodi
 	u64 *metadata = NULL;
 	u64 midr = 0;
 
-	/*
-	 * Metadata version 1 doesn't contain any info for MIDR.
-	 * Simply return false in this case.
-	 */
+	/* Metadata version 1 assumes all CPUs are the same (old behavior) */
 	if (spe->metadata_ver == 1) {
-		pr_warning_once("The data file contains metadata version 1, "
-				"which is absent the info for data source. "
-				"Please upgrade the tool to record data.\n");
-		return false;
-	}
-
-	/* CPU ID is -1 for per-thread mode */
-	if (speq->cpu < 0) {
-		/*
-		 * On the heterogeneous system, due to CPU ID is -1,
-		 * cannot confirm the data source packet is supported.
-		 */
-		if (!spe->is_homogeneous)
-			return false;
+		const char *cpuid;
 
-		/* In homogeneous system, simply use CPU0's metadata */
-		if (spe->metadata)
-			metadata = spe->metadata[0];
+		pr_warning_once("Old SPE metadata, re-record to improve decode accuracy\n");
+		cpuid = perf_env__cpuid(spe->session->evlist->env);
+		midr = strtol(cpuid, NULL, 16);
 	} else {
-		metadata = arm_spe__get_metadata_by_cpu(spe, speq->cpu);
-	}
+		/* CPU ID is -1 for per-thread mode */
+		if (speq->cpu < 0) {
+			/*
+			 * On the heterogeneous system, due to CPU ID is -1,
+			 * cannot confirm the data source packet is supported.
+			 */
+			if (!spe->is_homogeneous)
+				return false;
+
+			/* In homogeneous system, simply use CPU0's metadata */
+			if (spe->metadata)
+				metadata = spe->metadata[0];
+		} else {
+			metadata = arm_spe__get_metadata_by_cpu(spe, speq->cpu);
+		}
 
-	if (!metadata)
-		return false;
+		if (!metadata)
+			return false;
 
-	midr = metadata[ARM_SPE_CPU_MIDR];
+		midr = metadata[ARM_SPE_CPU_MIDR];
+	}
 
 	is_in_cpu_list = is_midr_in_range_list(midr, common_ds_encoding_cpus);
 	if (is_in_cpu_list)
author maintainer
#1295 lore raw

PATCH 1255/1276 net: airoha: Fix channel configuration for ETS Qdisc

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Lorenzo Bianconi <[email protected]>

commit 7d0da8f862340c5f42f0062b8560b8d0971a6ac4 upstream.

Limit ETS QoS channel to AIROHA_NUM_QOS_CHANNELS in airoha_tc_setup_qdisc_ets() in order to align the configured channel to the value set in airoha_dev_select_queue().

---
 drivers/net/ethernet/mediatek/airoha_eth.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/mediatek/airoha_eth.c +4 -1
@@ -2798,11 +2798,14 @@ static int airoha_qdma_get_tx_ets_stats(
 static int airoha_tc_setup_qdisc_ets(struct airoha_gdm_port *port,
 				     struct tc_ets_qopt_offload *opt)
 {
-	int channel = TC_H_MAJ(opt->handle) >> 16;
+	int channel;
 
 	if (opt->parent == TC_H_ROOT)
 		return -EINVAL;
 
+	channel = TC_H_MAJ(opt->handle) >> 16;
+	channel = channel % AIROHA_NUM_QOS_CHANNELS;
+
 	switch (opt->command) {
 	case TC_ETS_REPLACE:
 		return airoha_qdma_set_tx_ets_sched(port, channel, opt);
author maintainer
#1296 lore raw

PATCH 1256/1276 jiffies: Cast to unsigned long in secs_to_jiffies() conversion

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Easwar Hariharan <[email protected]>

commit bb2784d9ab49587ba4fbff37a319fff2924db289 upstream.

While converting users of msecs_to_jiffies(), lkp reported that some range checks would always be true because of the mismatch between the implied int value of secs_to_jiffies() vs the unsigned long return value of the msecs_to_jiffies() calls it was replacing.

Fix this by casting the secs_to_jiffies() input value to unsigned long.

---
 include/linux/jiffies.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/jiffies.h +1 -1
@@ -537,7 +537,7 @@ static __always_inline unsigned long mse
  *
  * Return: jiffies value
  */
-#define secs_to_jiffies(_secs) ((_secs) * HZ)
+#define secs_to_jiffies(_secs) (unsigned long)((_secs) * HZ)
 
 extern unsigned long __usecs_to_jiffies(const unsigned int u);
 #if !(USEC_PER_SEC % HZ)
author maintainer
#1297 lore raw

PATCH 1257/1276 afs: Fix afs_atcell_get_link() to check if ws_cell is unset first

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Howells <[email protected]>

commit 0307d16f3610eb29ad0b7529846de7d62fed60ca upstream.

Fix afs_atcell_get_link() to check if the workstation cell is unset before doing the RCU pathwalk bit where we dereference that.

---
 fs/afs/dynroot.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/afs/dynroot.c +3 -3
@@ -209,6 +209,9 @@ static const char *afs_atcell_get_link(s
 	const char *name;
 	bool dotted = vnode->fid.vnode == 3;
 
+	if (!rcu_access_pointer(net->ws_cell))
+		return ERR_PTR(-ENOENT);
+
 	if (!dentry) {
 		/* We're in RCU-pathwalk. */
 		cell = rcu_dereference(net->ws_cell);
@@ -220,9 +223,6 @@ static const char *afs_atcell_get_link(s
 		return name;
 	}
 
-	if (!rcu_access_pointer(net->ws_cell))
-		return ERR_PTR(-ENOENT);
-
 	down_read(&net->cells_lock);
 
 	cell = rcu_dereference_protected(net->ws_cell, lockdep_is_held(&net->cells_lock));
author maintainer
#1298 lore raw

PATCH 1258/1276 afs: Fix afs_dynroot_readdir() to not use the RCU read lock

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Howells <[email protected]>

commit a64e4d48a0b77e4ada19ac26ca3a08cd492f6362 upstream.

afs_dynroot_readdir() uses the RCU read lock to walk the cell list whilst emitting cell automount entries - but dir_emit() may write to a userspace buffer, thereby causing a fault to occur and waits to happen.

Fix afs_dynroot_readdir() to get a shared lock on net->cells_lock instead.

This can be triggered by enabling lockdep, preconfiguring a number of cells, doing "mount -t afs none /afs -o dyn" (or using the kafs-client package with afs.mount systemd unit enabled) and then doing "ls /afs".

---
 fs/afs/dynroot.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/dynroot.c +2 -2
@@ -347,9 +347,9 @@ static int afs_dynroot_readdir(struct fi
 	}
 
 	if ((unsigned long long)ctx->pos <= AFS_MAX_DYNROOT_CELL_INO) {
-		rcu_read_lock();
+		down_read(&net->cells_lock);
 		ret = afs_dynroot_readdir_cells(net, ctx);
-		rcu_read_unlock();
+		up_read(&net->cells_lock);
 	}
 	return ret;
 }
author maintainer
#1299 lore raw

PATCH 1259/1276 perf libunwind arm64: Fix missing close parens in an if statement

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Arnaldo Carvalho de Melo <[email protected]>

commit 1293dacbbd43ab9848ac4655f6f2ba1dcc5a96ad upstream.

While testing building with libunwind (using LIBUNWIND=1) in various arches I noticed a problem on arm64, on an rpi5 system, a missing close parens in a change related to dso__data_get_fd() usage, fix it.

Fixes 5ac22c35aa8519f1 ("perf dso: Use lock annotations to fix asan deadlock")
---
 tools/perf/util/unwind-libunwind-local.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/unwind-libunwind-local.c +1 -1
@@ -371,7 +371,7 @@ static int read_unwind_spec_debug_frame(
 	 *    has to be pointed by symsrc_filename
 	 */
 	if (ofs == 0) {
-		if (dso__data_get_fd(dso, machine, &fd) {
+		if (dso__data_get_fd(dso, machine, &fd)) {
 			ofs = elf_section_offset(fd, ".debug_frame");
 			dso__data_put_fd(dso);
 		}
author maintainer
#1300 lore raw

PATCH 1260/1276 crypto: ccp - Fix __sev_snp_shutdown_locked

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

commit 9af6339a65426b0b4850b07ff3b6959497bfcac5 upstream.

Fix smatch warning:

	drivers/crypto/ccp/sev-dev.c:1755 __sev_snp_shutdown_locked()
	error: uninitialized symbol 'dfflush_error'.
Fixes 9770b428b1a2 ("crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown")
---
 drivers/crypto/ccp/sev-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/sev-dev.c +1 -1
@@ -1743,7 +1743,7 @@ static int __sev_snp_shutdown_locked(int
 	ret = __sev_do_cmd_locked(SEV_CMD_SNP_SHUTDOWN_EX, &data, error);
 	/* SHUTDOWN may require DF_FLUSH */
 	if (*error == SEV_RET_DFFLUSH_REQUIRED) {
-		int dfflush_error;
+		int dfflush_error = SEV_RET_NO_FW_CALL;
 
 		ret = __sev_do_cmd_locked(SEV_CMD_SNP_DF_FLUSH, NULL, &dfflush_error);
 		if (ret) {
author maintainer
#1301 lore raw

PATCH 1261/1276 crypto: ccp - Fix dereferencing uninitialized error pointer

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

commit 0fa766726c091ff0ec7d26874f6e4724d23ecb0e upstream.

Fix below smatch warnings:
drivers/crypto/ccp/sev-dev.c:1312 __sev_platform_init_locked()
error: we previously assumed 'error' could be null

Fixes 9770b428b1a2 ("crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown")
---
 drivers/crypto/ccp/sev-dev.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/crypto/ccp/sev-dev.c +5 -3
@@ -1271,9 +1271,11 @@ static int __sev_platform_init_handle_in
 
 static int __sev_platform_init_locked(int *error)
 {
-	int rc, psp_ret = SEV_RET_NO_FW_CALL;
+	int rc, psp_ret, dfflush_error;
 	struct sev_device *sev;
 
+	psp_ret = dfflush_error = SEV_RET_NO_FW_CALL;
+
 	if (!psp_master || !psp_master->sev_data)
 		return -ENODEV;
 
@@ -1315,10 +1317,10 @@ static int __sev_platform_init_locked(in
 
 	/* Prepare for first SEV guest launch after INIT */
 	wbinvd_on_all_cpus();
-	rc = __sev_do_cmd_locked(SEV_CMD_DF_FLUSH, NULL, error);
+	rc = __sev_do_cmd_locked(SEV_CMD_DF_FLUSH, NULL, &dfflush_error);
 	if (rc) {
 		dev_err(sev->dev, "SEV: DF_FLUSH failed %#x, rc %d\n",
-			*error, rc);
+			dfflush_error, rc);
 		return rc;
 	}
 
author maintainer
#1302 lore raw

PATCH 1262/1276 crypto: ccp - Fix SNP panic notifier unregistration

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ashish Kalra <[email protected]>

commit ab8b9fd39c45b7760093528cbef93e7353359d82 upstream.

Panic notifiers are invoked with RCU read lock held and when the SNP panic notifier tries to unregister itself from the panic notifier callback itself it causes a deadlock as notifier unregistration does RCU synchronization.

Code flow for SNP panic notifier:
snp_shutdown_on_panic() -> __sev_firmware_shutdown() -> __sev_snp_shutdown_locked() -> atomic_notifier_chain_unregister(.., &snp_panic_notifier)

Fix SNP panic notifier to unregister itself during SNP shutdown only if panic is not in progress.

Fixes 19860c3274fb ("crypto: ccp - Register SNP panic notifier only if SNP is enabled")
---
 drivers/crypto/ccp/sev-dev.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/crypto/ccp/sev-dev.c +8 -2
@@ -1785,8 +1785,14 @@ static int __sev_snp_shutdown_locked(int
 	sev->snp_initialized = false;
 	dev_dbg(sev->dev, "SEV-SNP firmware shutdown\n");
 
-	atomic_notifier_chain_unregister(&panic_notifier_list,
-					 &snp_panic_notifier);
+	/*
+	 * __sev_snp_shutdown_locked() deadlocks when it tries to unregister
+	 * itself during panic as the panic notifier is called with RCU read
+	 * lock held and notifier unregistration does RCU synchronization.
+	 */
+	if (!panic)
+		atomic_notifier_chain_unregister(&panic_notifier_list,
+						 &snp_panic_notifier);
 
 	/* Reset TMR size back to default */
 	sev_es_tmr_size = SEV_TMR_SIZE;
author maintainer
#1303 lore raw

PATCH 1263/1276 udp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Paolo Abeni <[email protected]>

commit c9e78afa688afec528784b79bb02d513cdcd6527 upstream.

While configuring a vxlan tunnel in a system with a i40e NIC driver, I observe the following deadlock:

WARNING: possible recursive locking detected
6.16.0-rc2.net-next-6.16_92d87230d899+ #13 Tainted: G E
--------------------------------------------
kworker/u256:4/1125 is trying to acquire lock:
ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: i40e_udp_tunnel_set_port (/home/pabeni/net-next/include/net/udp_tunnel.h:343 /home/pabeni/net-next/drivers/net/ethernet/intel/i40e/i40e_main.c:13013) i40e

but task is already holding lock:
ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:739) udp_tunnel

other info that might help us debug this:

  Possible unsafe locking scenario:
        CPU0
        ----

lock(&utn->lock);
lock(&utn->lock);

*** DEADLOCK ***

May be due to missing lock nesting notation

4 locks held by kworker/u256:4/1125:
#0: ffff8892910ca158 ((wq_completion)udp_tunnel_nic){+.+.}-{0:0}, at: process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3213) #1: ffffc900244efd30 ((work_completion)(&utn->work)){+.+.}-{0:0}, at: process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3214) #2: ffffffff9a14e290 (rtnl_mutex){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:737) udp_tunnel #3: ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:739) udp_tunnel

 stack backtrace:
 Hardware name: Dell Inc. PowerEdge R7525/0YHMCJ, BIOS 2.2.5 04/08/2021
i
 Call Trace:
  <TASK>
 dump_stack_lvl (/home/pabeni/net-next/lib/dump_stack.c:123)
 print_deadlock_bug (/home/pabeni/net-next/kernel/locking/lockdep.c:3047)
 validate_chain (/home/pabeni/net-next/kernel/locking/lockdep.c:3901)
 __lock_acquire (/home/pabeni/net-next/kernel/locking/lockdep.c:5240)
 lock_acquire.part.0 (/home/pabeni/net-next/kernel/locking/lockdep.c:473 /home/pabeni/net-next/kernel/locking/lockdep.c:5873)
 __mutex_lock (/home/pabeni/net-next/kernel/locking/mutex.c:604 /home/pabeni/net-next/kernel/locking/mutex.c:747)
 i40e_udp_tunnel_set_port (/home/pabeni/net-next/include/net/udp_tunnel.h:343 /home/pabeni/net-next/drivers/net/ethernet/intel/i40e/i40e_main.c:13013) i40e
 udp_tunnel_nic_device_sync_by_port (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:230 /home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:249) udp_tunnel
 __udp_tunnel_nic_device_sync.part.0 (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:292) udp_tunnel
 udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:742) udp_tunnel
 process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3243)
 worker_thread (/home/pabeni/net-next/kernel/workqueue.c:3315 /home/pabeni/net-next/kernel/workqueue.c:3402)
 kthread (/home/pabeni/net-next/kernel/kthread.c:464)

AFAICS all the existing callsites of udp_tunnel_nic_set_port_priv() are already under the utn lock scope, avoid (re-)acquiring it in such a function.

---
 include/net/udp_tunnel.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/net/udp_tunnel.h +1 -2
@@ -323,9 +323,8 @@ udp_tunnel_nic_set_port_priv(struct net_
 			     unsigned int idx, u8 priv)
 {
 	if (udp_tunnel_nic_ops) {
-		udp_tunnel_nic_ops->lock(dev);
+		udp_tunnel_nic_ops->assert_locked(dev);
 		udp_tunnel_nic_ops->set_port_priv(dev, table, idx, priv);
-		udp_tunnel_nic_ops->unlock(dev);
 	}
 }
 
author maintainer
#1304 lore raw

PATCH 1264/1276 Bluetooth: hci_core: Remove check of BDADDR_ANY in hci_conn_hash_lookup_big_state

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Luiz Augusto von Dentz <[email protected]>

commit 59710a26a289ad4e7ef227d22063e964930928b0 upstream.

The check for destination to be BDADDR_ANY is no longer necessary with the introduction of BIS_LINK.

Fixes 23205562ffc8 ("Bluetooth: separate CIS_LINK and BIS_LINK link types")
---
 include/net/bluetooth/hci_core.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/net/bluetooth/hci_core.h +1 -2
@@ -1367,8 +1367,7 @@ hci_conn_hash_lookup_big_state(struct hc
 	rcu_read_lock();
 
 	list_for_each_entry_rcu(c, &h->list, list) {
-		if (c->type != BIS_LINK || bacmp(&c->dst, BDADDR_ANY) ||
-		    c->state != state)
+		if (c->type != BIS_LINK || c->state != state)
 			continue;
 
 		if (handle == c->iso_qos.bcast.big) {
author maintainer
#1305 lore raw

PATCH 1265/1276 Bluetooth: hci_sync: Fix attempting to send HCI_Disconnect to BIS handle

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Luiz Augusto von Dentz <[email protected]>

commit 314d30b1508682e27c8a324096262c66f23455d9 upstream.

BIS/PA connections do have their own cleanup proceedure which are performed by hci_conn_cleanup/bis_cleanup.

Fixes 23205562ffc8 ("Bluetooth: separate CIS_LINK and BIS_LINK link types")
---
 net/bluetooth/hci_sync.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_sync.c +1 -1
@@ -5543,7 +5543,7 @@ static int hci_disconnect_sync(struct hc
 {
 	struct hci_cp_disconnect cp;
 
-	if (test_bit(HCI_CONN_BIG_CREATED, &conn->flags)) {
+	if (conn->type == BIS_LINK) {
 		/* This is a BIS connection, hci_conn_del will
 		 * do the necessary cleanup.
 		 */
author maintainer
#1306 lore raw

PATCH 1266/1276 crypto: ccp - Always pass in an error pointer to __sev_platform_shutdown_locked()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Borislav Petkov (AMD) <[email protected]>

commit 46834d90a9a13549264b9581067d8f746b4b36cc upstream.

When

9770b428b1a2 ("crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown")

moved the error messages dumping so that they don't need to be issued by the callers, it missed the case where __sev_firmware_shutdown() calls __sev_platform_shutdown_locked() with a NULL argument which leads to a NULL ptr deref on the shutdown path, during suspend to disk:

#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0

  Oops: Oops: 0000 [#1] SMP NOPTI
  CPU: 0 UID: 0 PID: 983 Comm: hib.sh Not tainted 6.17.0-rc4+ #1 PREEMPT(voluntary)
  Hardware name: Supermicro Super Server/H12SSL-i, BIOS 2.5 09/08/2022
  RIP: 0010:__sev_platform_shutdown_locked.cold+0x0/0x21 [ccp]

That rIP is:

00000000000006fd <__sev_platform_shutdown_locked.cold>:

   6fd:   8b 13                   mov    (%rbx),%edx
   6ff:   48 8b 7d 00             mov    0x0(%rbp),%rdi
   703:   89 c1                   mov    %eax,%ecx
  Code: 74 05 31 ff 41 89 3f 49 8b 3e 89 ea 48 c7 c6 a0 8e 54 a0 41 bf 92 ff ff ff e8 e5 2e 09 e1 c6 05 2a d4 38 00 01 e9 26 af ff ff <8b> 13 48 8b 7d 00 89 c1 48 c7 c6 18 90 54 a0 89 44 24 04 e8 c1 2e
  RSP: 0018:ffffc90005467d00 EFLAGS: 00010282
  RAX: 00000000ffffff92 RBX: 0000000000000000 RCX: 0000000000000000
  			     ^^^^^^^^^^^^^^^^

and %rbx is nice and clean.

  Call Trace:
   <TASK>
   __sev_firmware_shutdown.isra.0
   sev_dev_destroy
   psp_dev_destroy
   sp_destroy
   pci_device_shutdown
   device_shutdown
   kernel_power_off
   hibernate.cold
   state_store
   kernfs_fop_write_iter
   vfs_write
   ksys_write
   do_syscall_64
   entry_SYSCALL_64_after_hwframe

Pass in a pointer to the function-local error var in the caller.

With that addressed, suspending the ccp shows the error properly at least:

ccp 0000:47:00.1: sev command 0x2 timed out, disabling PSP
ccp 0000:47:00.1: SEV: failed to SHUTDOWN error 0x0, rc -110
SEV-SNP: Leaking PFN range 0x146800-0x146a00
SEV-SNP: PFN 0x146800 unassigned, dumping non-zero entries in 2M PFN region: [0x146800 - 0x146a00]
...
ccp 0000:47:00.1: SEV-SNP firmware shutdown failed, rc -16, error 0x0
ACPI: PM: Preparing to enter system sleep state S5
kvm: exiting hardware virtualization
reboot: Power down

Btw, this driver is crying to be cleaned up to pass in a proper I/O struct which can be used to store information between the different functions, otherwise stuff like that will happen in the future again.

Fixes 9770b428b1a2 ("crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown")
---
 drivers/crypto/ccp/sev-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/sev-dev.c +1 -1
@@ -2408,7 +2408,7 @@ static void __sev_firmware_shutdown(stru
 {
 	int error;
 
-	__sev_platform_shutdown_locked(NULL);
+	__sev_platform_shutdown_locked(&error);
 
 	if (sev_es_tmr) {
 		/*
author maintainer
#1307 lore raw

PATCH 1267/1276 perf build-id: Ensure snprintf string is empty when size is 0

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Rogers <[email protected]>

commit 0dc96cae063cbf9ebf6631b33b08e9ba02324248 upstream.

The string result of build_id__snprintf() is unconditionally used in places like dsos__fprintf_buildid_cb(). If the build id has size 0 then this creates a use of uninitialized memory. Add null termination for the size 0 case.

A similar fix was written by Jiri Olsa in commit 6311951d4f8f28c4 ("perf
tools: Initialize output buffer in build_id__sprintf") but lost in the transition to snprintf.

Fixes fccaaf6fbbc59910 ("perf build-id: Change sprintf functions to snprintf")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/build-id.c |    7 +++++++
 1 file changed, 7 insertions(+)
tools/perf/util/build-id.c +7 -0
@@ -71,6 +71,13 @@ int build_id__snprintf(const struct buil
 {
 	size_t offs = 0;
 
+	if (build_id->size == 0) {
+		/* Ensure bf is always \0 terminated. */
+		if (bf_size > 0)
+			bf[0] = '\0';
+		return 0;
+	}
+
 	for (size_t i = 0; i < build_id->size && offs < bf_size; ++i)
 		offs += snprintf(bf + offs, bf_size - offs, "%02x", build_id->data[i]);
 
author maintainer
#1308 lore raw

PATCH 1268/1276 i40e: drop udp_tunnel_get_rx_info() call from i40e_open()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Mohammad Heib <[email protected]>

commit 40857194956dcaf3d2b66d6bd113d844c93bef54 upstream.

The i40e driver calls udp_tunnel_get_rx_info() during i40e_open(). This is redundant because UDP tunnel RX offload state is preserved across device down/up cycles. The udp_tunnel core handles synchronization automatically when required.

Furthermore, recent changes in the udp_tunnel infrastructure require querying RX info while holding the udp_tunnel lock. Calling it directly from the ndo_open path violates this requirement, triggering the following lockdep warning:

  Call Trace:
   <TASK>
   ? __udp_tunnel_nic_assert_locked+0x39/0x40 [udp_tunnel]
   i40e_open+0x135/0x14f [i40e]
   __dev_open+0x121/0x2e0
   __dev_change_flags+0x227/0x270
   dev_change_flags+0x3d/0xb0
   devinet_ioctl+0x56f/0x860
   sock_do_ioctl+0x7b/0x130
   __x64_sys_ioctl+0x91/0xd0
   do_syscall_64+0x90/0x170
   ...
   </TASK>

Remove the redundant and unsafe call to udp_tunnel_get_rx_info() from i40e_open() resolve the locking violation.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -1
@@ -9110,7 +9110,6 @@ int i40e_open(struct net_device *netdev)
 						       TCP_FLAG_FIN |
 						       TCP_FLAG_CWR) >> 16);
 	wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16);
-	udp_tunnel_get_rx_info(netdev);
 
 	return 0;
 }
author maintainer
#1309 lore raw

PATCH 1269/1276 ice: drop udp_tunnel_get_rx_info() call from ndo_open()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Mohammad Heib <[email protected]>

commit 234e615bfece9e3e91c50fe49ab9e68ee37c791a upstream.

The ice driver calls udp_tunnel_get_rx_info() during ice_open_internal(). This is redundant because UDP tunnel RX offload state is preserved across device down/up cycles. The udp_tunnel core handles synchronization automatically when required.

Furthermore, recent changes in the udp_tunnel infrastructure require querying RX info while holding the udp_tunnel lock. Calling it directly from the ndo_open path violates this requirement, triggering the following lockdep warning:

Call Trace:
  <TASK>
  ice_open_internal+0x253/0x350 [ice]
  __udp_tunnel_nic_assert_locked+0x86/0xb0 [udp_tunnel]
  __dev_open+0x2f5/0x880
  __dev_change_flags+0x44c/0x660
  netif_change_flags+0x80/0x160
  devinet_ioctl+0xd21/0x15f0
  inet_ioctl+0x311/0x350
  sock_ioctl+0x114/0x220
  __x64_sys_ioctl+0x131/0x1a0
  ...
  </TASK>

Remove the redundant and unsafe call to udp_tunnel_get_rx_info() from ice_open_internal() to resolve the locking violation

---
 drivers/net/ethernet/intel/ice/ice_main.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +0 -3
@@ -9574,9 +9574,6 @@ int ice_open_internal(struct net_device
 		netdev_err(netdev, "Failed to open VSI 0x%04X on switch 0x%04X\n",
 			   vsi->vsi_num, vsi->vsw->sw_id);
 
-	/* Update existing tunnels information */
-	udp_tunnel_get_rx_info(netdev);
-
 	return err;
 }
 
author maintainer
#1310 lore raw

PATCH 1270/1276 crypto: ccp - Fix leaking the same page twice

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guenter Roeck <[email protected]>

commit 5c52607c43c397b79a9852ce33fc61de58c3645c upstream.

Commit 551120148b67 ("crypto: ccp - Fix a case where SNP_SHUTDOWN is missed") fixed a case where SNP is left in INIT state if page reclaim fails. It removes the transition to the INIT state for this command and adjusts the page state management.

While doing this, it added a call to snp_leak_pages() after a call to snp_reclaim_pages() failed. Since snp_reclaim_pages() already calls snp_leak_pages() internally on the pages it fails to reclaim, calling it again leaks the exact same page twice.

Fix by removing the extra call to snp_leak_pages().

The problem was found by an experimental code review agent based on gemini-3.1-pro while reviewing backports into v6.18.y.

Assisted-by Gemini:gemini-3.1-pro
Fixes 551120148b67 ("crypto: ccp - Fix a case where SNP_SHUTDOWN is missed")
Cc Tycho Andersen (AMD) <[email protected]>
Cc Tom Lendacky <[email protected]>
---
 drivers/crypto/ccp/sev-dev.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/crypto/ccp/sev-dev.c +1 -3
@@ -2102,10 +2102,8 @@ static int sev_ioctl_do_snp_platform_sta
 		 * in Firmware state on failure. Use snp_reclaim_pages() to
 		 * transition either case back to Hypervisor-owned state.
 		 */
-		if (snp_reclaim_pages(__pa(data), 1, true)) {
-			snp_leak_pages(__page_to_pfn(status_page), 1);
+		if (snp_reclaim_pages(__pa(data), 1, true))
 			return -EFAULT;
-		}
 	}
 
 	if (ret)
author maintainer
#1311 lore raw

PATCH 1271/1276 perf synthetic-events: Fix stale build ID in module MMAP2 records

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chuck Lever <[email protected]>

commit 35b16a7a2c4fc458304447128b86514ce9f70f3c upstream.

perf_event__synthesize_modules() allocates a single union perf_event and reuses it across every kernel module callback.

After the first module is processed, perf_record_mmap2__read_build_id() sets PERF_RECORD_MISC_MMAP_BUILD_ID in header.misc and writes that module's build ID into the event.

On subsequent iterations the callback overwrites start, len, pid, and filename for the next module but never clears the stale build ID fields or the MMAP_BUILD_ID flag.

When perf_record_mmap2__read_build_id() runs for the second module it sees the flag, reads the stale build ID into a dso_id, and __dso__improve_id() permanently poisons the DSO with the wrong build ID.

Every module after the first therefore receives the first module's build ID in its MMAP2 record.

On a system with the sunrpc and nfsd modules loaded, this causes perf script and perf report to show [unknown] for all module symbols.

The latent bug has existed since commit d9f2ecbc5e47fca7 ("perf dso:
Move build_id to dso_id") introduced the PERF_RECORD_MISC_MMAP_BUILD_ID check in perf_record_mmap2__read_build_id().

Commit 53b00ff358dc75b1 ("perf record: Make --buildid-mmap the default") then exposed it to all users by making the MMAP2-with-build-ID path the default. Both commits were merged in the same series.

Clear the MMAP_BUILD_ID flag and zero the build_id union before each call to perf_record_mmap2__read_build_id() so that every module starts with a clean slate.

Fixes d9f2ecbc5e47fca7 ("perf dso: Move build_id to dso_id")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/synthetic-events.c |    5 +++++
 1 file changed, 5 insertions(+)
tools/perf/util/synthetic-events.c +5 -0
@@ -702,6 +702,11 @@ static int perf_event__synthesize_module
 
 		memcpy(event->mmap2.filename, dso__long_name(dso), dso__long_name_len(dso) + 1);
 
+		/* Clear stale build ID from previous module iteration */
+		event->mmap2.header.misc &= ~PERF_RECORD_MISC_MMAP_BUILD_ID;
+		memset(event->mmap2.build_id, 0, sizeof(event->mmap2.build_id));
+		event->mmap2.build_id_size = 0;
+
 		perf_record_mmap2__read_build_id(&event->mmap2, args->machine, false);
 	} else {
 		size = PERF_ALIGN(dso__long_name_len(dso) + 1, sizeof(u64));
author maintainer
#1312 lore raw

PATCH 1272/1276 Bluetooth: L2CAP: Fix regressions caused by reusing ident

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Luiz Augusto von Dentz <[email protected]>

commit 761fb8ec8778f0caf2bba5a41e3cff1ea86974f3 upstream.

This attempt to fix regressions caused by reusing ident which apparently is not handled well on certain stacks causing the stack to not respond to requests, so instead of simple returning the first unallocated id this stores the last used tx_ident and then attempt to use the next until all available ids are exausted and then cycle starting over to 1.

---
 include/net/bluetooth/l2cap.h |    1 +
 net/bluetooth/l2cap_core.c    |   29 ++++++++++++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
include/net/bluetooth/l2cap.h +1 -0
@@ -660,6 +660,7 @@ struct l2cap_conn {
 	struct sk_buff		*rx_skb;
 	__u32			rx_len;
 	struct ida		tx_ida;
+	__u8			tx_ident;
 
 	struct sk_buff_head	pending_rx;
 	struct work_struct	pending_rx_work;
net/bluetooth/l2cap_core.c +26 -3
@@ -958,16 +958,39 @@ int l2cap_chan_check_security(struct l2c
 
 static int l2cap_get_ident(struct l2cap_conn *conn)
 {
+	u8 max;
+	int ident;
+
 	/* LE link does not support tools like l2ping so use the full range */
 	if (conn->hcon->type == LE_LINK)
-		return ida_alloc_range(&conn->tx_ida, 1, 255, GFP_ATOMIC);
-
+		max = 255;
 	/* Get next available identificator.
 	 *    1 - 128 are used by kernel.
 	 *  129 - 199 are reserved.
 	 *  200 - 254 are used by utilities like l2ping, etc.
 	 */
-	return ida_alloc_range(&conn->tx_ida, 1, 128, GFP_ATOMIC);
+	else
+		max = 128;
+
+	/* Allocate ident using min as last used + 1 (cyclic) */
+	ident = ida_alloc_range(&conn->tx_ida, READ_ONCE(conn->tx_ident) + 1,
+				max, GFP_ATOMIC);
+	/* Force min 1 to start over */
+	if (ident <= 0) {
+		ident = ida_alloc_range(&conn->tx_ida, 1, max, GFP_ATOMIC);
+		if (ident <= 0) {
+			/* If all idents are in use, log an error, this is
+			 * extremely unlikely to happen and would indicate a bug
+			 * in the code that idents are not being freed properly.
+			 */
+			BT_ERR("Unable to allocate ident: %d", ident);
+			return 0;
+		}
+	}
+
+	WRITE_ONCE(conn->tx_ident, ident);
+
+	return ident;
 }
 
 static void l2cap_send_acl(struct l2cap_conn *conn, struct sk_buff *skb,
author maintainer
#1313 lore raw

PATCH 1273/1276 Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Luiz Augusto von Dentz <[email protected]>

commit d38eaf611839b85ade3dd3db309dbc8aaaaf0095 upstream.

b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref") don't reset the chan->conn to NULL anymore making the bt# netdev not be remove once the last l2cap_chan_del is removed.

Instead of restoring the original behavior this remove the logic of keeping the interface after the last channel is removed because it never worked as intended and the l2cap_chan_del always detach its l2cap_conn which results in always removing the channel anyway.

Fixes b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref")
---
 net/bluetooth/6lowpan.c |   18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)
net/bluetooth/6lowpan.c +3 -15
@@ -781,20 +781,10 @@ static void chan_close_cb(struct l2cap_c
 	struct lowpan_btle_dev *dev = NULL;
 	struct lowpan_peer *peer;
 	int err = -ENOENT;
-	bool last = false, remove = true;
+	bool last = false;
 
 	BT_DBG("chan %p conn %p", chan, chan->conn);
 
-	if (chan->conn && chan->conn->hcon) {
-		if (!is_bt_6lowpan(chan->conn->hcon))
-			return;
-
-		/* If conn is set, then the netdev is also there and we should
-		 * not remove it.
-		 */
-		remove = false;
-	}
-
 	spin_lock(&devices_lock);
 
 	list_for_each_entry_rcu(entry, &bt_6lowpan_devices, list) {
@@ -821,10 +811,8 @@ static void chan_close_cb(struct l2cap_c
 
 		ifdown(dev->netdev);
 
-		if (remove) {
-			INIT_WORK(&entry->delete_netdev, delete_netdev);
-			schedule_work(&entry->delete_netdev);
-		}
+		INIT_WORK(&entry->delete_netdev, delete_netdev);
+		schedule_work(&entry->delete_netdev);
 	} else {
 		spin_unlock(&devices_lock);
 	}
author maintainer
#1314 lore raw

PATCH 1274/1276 Bluetooth: L2CAP: fix tx ident leak for commands without a response

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Stig Hornang <[email protected]>

commit 6e1930ece855a4c256f1c7e6632d634cfb9888b5 upstream.

Commit 6c3ea155e5ee ("Bluetooth: L2CAP: Fix not tracking outstanding TX ident") changed ident allocation to use an IDA, releasing idents in l2cap_put_ident() when the matching response command is received.

But identifiers allocated for commands that have no response defined are never released. In particular L2CAP_LE_CREDITS is sent repeatedly for the lifetime of an LE CoC channel, so a peer streaming data to the host exhausts the 1-255 ident range after 254 credit packets. From then on l2cap_get_ident() fails:

kernel: Bluetooth: Unable to allocate ident: -28

and every subsequent L2CAP_LE_CREDITS packet is sent with ident 0, which is invalid (Core Spec, Vol 3, Part A, Section 4: "Signaling identifier 0x00 is an invalid identifier and shall never be used in any command"). Remote stacks that validate the ident drop these commands, never receive new credits, and the channel stalls permanently. With default socket buffers this happens after roughly 0.5 MB of received data (the exact amount depends on the socket receive buffer):

< ACL Data TX: Handle 2048 flags 0x00 dlen 12
LE L2CAP: LE Flow Control Credit (0x16) ident 0 len 4
Source CID: 64
Credits: 1

Release the ident immediately after sending L2CAP_LE_CREDITS since no response will ever release it. Use a local variable instead of chan->ident so that an ident that an EXT_FLOWCTL channel may be waiting on (e.g. a pending reconfigure) is not overwritten by a credit packet.

Also add the missing L2CAP_LE_CONN_RSP case to l2cap_put_ident() so idents allocated for outgoing L2CAP_LE_CONN_REQ commands are released when the response arrives.

Fixes 6c3ea155e5ee ("Bluetooth: L2CAP: Fix not tracking outstanding TX ident")
Assisted-by Claude:claude-opus-4.8
Assisted-by Fable:5
---
 net/bluetooth/l2cap_core.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
net/bluetooth/l2cap_core.c +13 -2
@@ -4857,6 +4857,7 @@ static void l2cap_put_ident(struct l2cap
 	case L2CAP_ECHO_RSP:
 	case L2CAP_INFO_RSP:
 	case L2CAP_CONN_PARAM_UPDATE_RSP:
+	case L2CAP_LE_CONN_RSP:
 	case L2CAP_ECRED_CONN_RSP:
 	case L2CAP_ECRED_RECONF_RSP:
 		/* The remote may send bogus ids that would make ida_free
@@ -6755,6 +6756,7 @@ static void l2cap_chan_le_send_credits(s
 	struct l2cap_conn *conn = chan->conn;
 	struct l2cap_le_credits pkt;
 	u16 return_credits = l2cap_le_rx_credits(chan);
+	int ident;
 
 	if (chan->mode != L2CAP_MODE_LE_FLOWCTL &&
 	    chan->mode != L2CAP_MODE_EXT_FLOWCTL)
@@ -6772,9 +6774,18 @@ static void l2cap_chan_le_send_credits(s
 	pkt.cid     = cpu_to_le16(chan->scid);
 	pkt.credits = cpu_to_le16(return_credits);
 
-	chan->ident = l2cap_get_ident(conn);
+	ident = l2cap_get_ident(conn);
+
+	l2cap_send_cmd(conn, ident, L2CAP_LE_CREDITS, sizeof(pkt), &pkt);
 
-	l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CREDITS, sizeof(pkt), &pkt);
+	/* L2CAP_LE_CREDITS has no response so the ident is never released by
+	 * l2cap_put_ident() - release it right away, otherwise the tx_ida
+	 * range is exhausted after 254 packets and from then on credits are
+	 * sent with the invalid ident 0, which some remote stacks ignore,
+	 * stalling the channel.
+	 */
+	if (ident > 0)
+		ida_free(&conn->tx_ida, ident);
 }
 
 void l2cap_chan_rx_avail(struct l2cap_chan *chan, ssize_t rx_avail)
author maintainer
#1315 lore raw

PATCH 1275/1276 dpll: fix NULL pointer dereference in dpll_msg_add_pin_ref_sync()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ivan Vecera <[email protected]>

commit d2e914a4a0d0f753dbae830264850d044026167c upstream.

When a dpll_pin is shared across multiple dpll_device instances and those devices are being unregistered (e.g. during driver module removal), a NULL pointer dereference can occur in dpll_msg_add_pin_ref_sync().

This happens under the following conditions:
- A pin is registered with two or more dpll devices (dpll_A, dpll_B)
- The pin has ref_sync pairs with other pins
- During unregistration of dpll_A's pins, a ref_sync partner pin is unregistered first, removing it from dpll_A->pin_refs
- But since the partner pin is still registered with dpll_B, its dpll_refs is not empty, so dpll_pin_ref_sync_pair_del() does NOT run and the partner stays in the pin's ref_sync_pins xarray
- When the pin itself is then unregistered from dpll_A, the delete notification calls dpll_msg_add_pin_ref_sync() which finds the partner in ref_sync_pins, passes dpll_pin_available() (partner is still registered with dpll_B), but dpll_pin_on_dpll_priv(dpll_A, partner) returns NULL because partner was already removed from dpll_A->pin_refs
- The NULL priv pointer is passed to the driver's ref_sync_get callback, which dereferences it

 BUG: kernel NULL pointer dereference, address: 0000000000000034
 Oops: Oops: 0000 [#1] SMP NOPTI
 RIP: 0010:zl3073x_dpll_input_pin_ref_sync_get+0x73/0x80 [zl3073x]
 Call Trace:
  dpll_msg_add_pin_ref_sync+0xb8/0x200
  dpll_cmd_pin_get_one+0x3b6/0x4b0
  dpll_pin_event_send+0x72/0x140
  __dpll_pin_unregister+0x5a/0x2b0
  dpll_pin_unregister+0x49/0x70

Fix this by skipping ref_sync pins whose priv pointer cannot be resolved for the current dpll device.

---
 drivers/dpll/dpll_netlink.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/dpll/dpll_netlink.c +3 -0
@@ -424,6 +424,9 @@ dpll_msg_add_pin_ref_sync(struct sk_buff
 		if (!dpll_pin_available(ref_sync_pin))
 			continue;
 		ref_sync_pin_priv = dpll_pin_on_dpll_priv(dpll, ref_sync_pin);
+		/* Pin may have been unregistered from this dpll already */
+		if (!ref_sync_pin_priv)
+			continue;
 		if (WARN_ON(!ops->ref_sync_get))
 			return -EOPNOTSUPP;
 		ret = ops->ref_sync_get(pin, pin_priv, ref_sync_pin,
author maintainer
#1316 lore raw

PATCH 1276/1276 perf build-id: Fix off-by-one bug when printing kernel/module build-id

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Michael Petlan <[email protected]>

commit 017bca78e4d72b1ff027d368c20a1b2c654edaf7 upstream.

When changing sprintf functions to snprintf, one byte got lost. Since snprintf ones do not handle the '\0' terminating character, the number of printed characters is 40, while sizeof(sbuild_id) is 41, including the terminating '\0' character.

This makes the later check fail so that nothing is printed.

Fix that.

Before:

[Michael@Carbon ~]$ perf buildid-list -k
[Michael@Carbon ~]$

After:

    [Michael@Carbon ~]$ perf buildid-list -k
    a527806324d543c4bc3ff2f9c9519d494fed5f68
    [Michael@Carbon ~]$
Fixes fccaaf6fbbc59910 ("perf build-id: Change sprintf functions to snprintf")
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/builtin-buildid-list.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-buildid-list.c +2 -2
@@ -58,7 +58,7 @@ static int sysfs__fprintf_build_id(FILE
 	int ret;
 
 	ret = sysfs__snprintf_build_id("/", sbuild_id, sizeof(sbuild_id));
-	if (ret != sizeof(sbuild_id))
+	if (ret + 1 != sizeof(sbuild_id))
 		return ret < 0 ? ret : -EINVAL;
 
 	return fprintf(fp, "%s\n", sbuild_id);
@@ -70,7 +70,7 @@ static int filename__fprintf_build_id(co
 	int ret;
 
 	ret = filename__snprintf_build_id(name, sbuild_id, sizeof(sbuild_id));
-	if (ret != sizeof(sbuild_id))
+	if (ret + 1 != sizeof(sbuild_id))
 		return ret < 0 ? ret : -EINVAL;
 
 	return fprintf(fp, "%s\n", sbuild_id);
Tested-by on the v1 series
#1318 lore raw
In reply to Greg Kroah-Hartman

Greg Kroah-Hartman wrote on Tue, Jul 21, 2026 at 05:07:23PM +0200:

Quoted 5 lines

This is the start of the stable review cycle for the 6.12.97 release. There are 1276 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.

Quoted 8 lines

Responses should be made by Thu, 23 Jul 2026 15:23:00 +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.97-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.

Tested 160123ebe781 ("Linux 6.12.97-rc1") on:
- arm i.MX6ULL (Armadillo 640)
- arm64 i.MX8ULP (Armadillo IoT A9E)

No obvious regression in dmesg or basic tests:

Signature · 1 line
Dominique Martinet
Tested-by on the v1 series
#1319 lore raw
In reply to Greg Kroah-Hartman

Am 21.07.2026 um 17:07 schrieb Greg Kroah-Hartman:

Quoted 4 lines

This is the start of the stable review cycle for the 6.12.97 release. There are 1276 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]
Tested-by on the v1 series
#1321 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.97 release. There are 1276 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 Thu, 23 Jul 2026 15:23:00 +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.97-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.

thanks,

greg k-h

Built and booted successfully on RISC-V RV64 (HiFive Unmatched).

reviewer Tested-by on the v1 series
#1322 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.97 release. There are 1276 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 Thu, 23 Jul 2026 15:23:00 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.97-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.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

Tested-by on the v1 series
#1323 lore raw
In reply to Greg Kroah-Hartman

Hi!

Quoted 4 lines

This is the start of the stable review cycle for the 6.12.97 release. There are 1276 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.

CIP testing did not find any problems here:

https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.12.y

Best regards,
Pavel

Quoted 5,057 lines

Responses should be made by Thu, 23 Jul 2026 15:23:00 +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.97-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.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 6.12.97-rc1

Michael Petlan <[email protected]>
perf build-id: Fix off-by-one bug when printing kernel/module build-id

Ivan Vecera <[email protected]>
dpll: fix NULL pointer dereference in dpll_msg_add_pin_ref_sync()

Stig Hornang <[email protected]>
Bluetooth: L2CAP: fix tx ident leak for commands without a response

Luiz Augusto von Dentz <[email protected]>

    Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev

Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix regressions caused by reusing ident

Chuck Lever <[email protected]>
perf synthetic-events: Fix stale build ID in module MMAP2 records

Guenter Roeck <[email protected]>
crypto: ccp - Fix leaking the same page twice

Mohammad Heib <[email protected]>
ice: drop udp_tunnel_get_rx_info() call from ndo_open()

Mohammad Heib <[email protected]>
i40e: drop udp_tunnel_get_rx_info() call from i40e_open()

Ian Rogers <[email protected]>
perf build-id: Ensure snprintf string is empty when size is 0

Borislav Petkov (AMD) <[email protected]>
crypto: ccp - Always pass in an error pointer to __sev_platform_shutdown_locked()

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix attempting to send HCI_Disconnect to BIS handle

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Remove check of BDADDR_ANY in hci_conn_hash_lookup_big_state

Paolo Abeni <[email protected]>
udp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv()

Ashish Kalra <[email protected]>
crypto: ccp - Fix SNP panic notifier unregistration

Ashish Kalra <[email protected]>
crypto: ccp - Fix dereferencing uninitialized error pointer

Ashish Kalra <[email protected]>
crypto: ccp - Fix __sev_snp_shutdown_locked

Arnaldo Carvalho de Melo <[email protected]>
perf libunwind arm64: Fix missing close parens in an if statement

David Howells <[email protected]>
afs: Fix afs_dynroot_readdir() to not use the RCU read lock

David Howells <[email protected]>
afs: Fix afs_atcell_get_link() to check if ws_cell is unset first

Easwar Hariharan <[email protected]>
jiffies: Cast to unsigned long in secs_to_jiffies() conversion

Lorenzo Bianconi <[email protected]>
net: airoha: Fix channel configuration for ETS Qdisc

James Clark <[email protected]>
perf arm-spe: Use old behavior when opening old SPE files

Kuniyuki Iwashima <[email protected]>
rtnetlink: Make per-netns RTNL dereference helpers to macro.

Gil Portnoy <[email protected]>
ksmbd: fix durable reconnect double-bind race in ksmbd_reopen_durable_fd

Thomas Richter <[email protected]>
perf callchain: Handle multiple address spaces

Randy Dunlap <[email protected]>
seqlock: fix scoped_seqlock_read kernel-doc

Ian Rogers <[email protected]>
perf inject: With --convert-callchain ignore the dummy event for dwarf stacks

Dust Li <[email protected]>
dibs: loopback: validate offset and size in move_data()

Sandipan Das <[email protected]>
perf/x86/amd/brs: Fix kernel address leakage

Matt Bobrowski <[email protected]>
bpf: Reject BPF_MAP_TYPE_INODE_STORAGE creation if BPF LSM is uninitialized

Marc Zyngier <[email protected]>
KVM: arm64: Fix propagation of TLBI level in kvm_pgtable_stage2_relax_perms()

Oliver Upton <[email protected]>
KVM: arm64: Ensure level is always initialized when relaxing perms

Marc Zyngier <[email protected]>
KVM: Move kvm_io_bus_get_dev() locking responsibilities to callers

SeongJae Park <[email protected]>
mm/damon/core: always put unsuccessfully committed target pids

Amir Goldstein <[email protected]>
selftests/fs/statmount: build with tools include dir

Eric Biggers <[email protected]>
fscrypt: Replace mk_users keyring with simple list

Eric Biggers <[email protected]>
fscrypt: Fix key setup in edge case with multiple data unit sizes

Randy Dunlap <[email protected]>
slab: recognize @GFP parameter as optional in kernel-doc

Linus Torvalds <[email protected]>
default_gfp(): avoid using the "newfangled" __VA_OPT__ trick

Linus Torvalds <[email protected]>
add default_gfp() helper macro and use it in the new *alloc_obj() helpers

Kees Cook <[email protected]>
slab: Introduce kmalloc_flex() and family

Kees Cook <[email protected]>
slab: Introduce kmalloc_obj() and family

Qu Wenruo <[email protected]>
btrfs: fix incorrect buffered IO fallback for append direct writes

Qu Wenruo <[email protected]>
btrfs: fix false IO failure after falling back to buffered write

Rochan Avlur <[email protected]>
exfat: preserve benign secondary entries during rename and move

Chi Zhiling <[email protected]>
exfat: fix incorrect directory checksum after rename to shorter name

Yuezhang Mo <[email protected]>
exfat: move exfat_chain_set() out of __exfat_resolve_path()

Yuezhang Mo <[email protected]>
exfat: add exfat_get_dentry_set_by_ei() helper

Yuezhang Mo <[email protected]>
exfat: rename argument name for exfat_move_file and exfat_rename_file

Yuezhang Mo <[email protected]>
exfat: remove unnecessary read entry in __exfat_rename()

Ahsan Atta <[email protected]>
crypto: qat - fix restarting state leak on allocation failure

Tycho Andersen (AMD) <[email protected]>
crypto: ccp - Do not initialize SNP for ioctl(SNP_CONFIG)

Tom Lendacky <[email protected]>
crypto: ccp - Fix a case where SNP_SHUTDOWN is missed

Ashish Kalra <[email protected]>
crypto: ccp - Move SEV/SNP Platform initialization to KVM

Ashish Kalra <[email protected]>
crypto: ccp - Register SNP panic notifier only if SNP is enabled

Ashish Kalra <[email protected]>
crypto: ccp - Reset TMR size at SNP Shutdown

Ashish Kalra <[email protected]>
crypto: ccp - Move dev_info/err messages for SEV/SNP init and shutdown

Qu Wenruo <[email protected]>
btrfs: check and set EXTENT_DELALLOC_NEW before clearing EXTENT_DELALLOC

Qu Wenruo <[email protected]>
btrfs: remove the COW fixup mechanism

Qu Wenruo <[email protected]>
btrfs: remove folio parameter from ordered io related functions

Qu Wenruo <[email protected]>
btrfs: replace for_each_set_bit() with for_each_set_bitmap()

Qu Wenruo <[email protected]>
btrfs: concentrate the error handling of submit_one_sector()

Neill Kapron <[email protected]>
usb: gadget: f_fs: Tie read_buffer lifetime to ffs_epfile

Thorsten Blum <[email protected]>
crypto: atmel-sha204a - fail on hwrng registration error in probe path

Tyler Baker <[email protected]>
usb: gadget: f_fs: initialize reset_work at allocation time

Thorsten Blum <[email protected]>
crypto: atmel-sha204a - drop hwrng quality reduction for ATSHA204A

Uwe Kleine-König <[email protected]>
crypto: atmel - Drop explicit initialization of struct i2c_device_id::driver_data to 0

Mauricio Faria de Oliveira <[email protected]>
usb: atm: ueagle-atm: wait for pre-firmware load in .disconnect()

Johan Hovold <[email protected]>
USB: iowarrior: fix use-after-free on disconnect race

Oliver Neukum <[email protected]>
usb: iowarrior: remove inherent race with minor number

Vlad Poenaru <[email protected]>
bpf: Allow LPM map access from sleepable BPF programs

Andrii Nakryiko <[email protected]>
bpf: Consistently use bpf_rcu_lock_held() everywhere

Luis Gerhorst <[email protected]>

    bpf, arm64, powerpc: Add bpf_jit_bypass_spec_v1/v4()

Kumar Kartikeya Dwivedi <[email protected]>
bpf: Convert lpm_trie.c to rqspinlock

Tristan Madani <[email protected]>
hfs/hfsplus: fix u32 overflow in check_and_correct_requested_length

Viacheslav Dubeyko <[email protected]>
hfs/hfsplus: prevent getting negative values of offset/length

Oleg Makarenko <[email protected]>
HID: pidff: Use correct effect type in effect update

Tomasz Pakuła <[email protected]>
HID: pidff: Rework pidff_upload_effect

Tomasz Pakuła <[email protected]>
HID: pidff: Add missing spaces

Tomasz Pakuła <[email protected]>
HID: pidff: Fix missing blank lines after declarations

Manish Khadka <[email protected]>
HID: appleir: fix UAF on pending key_up_timer in remove()

Thomas Gleixner <[email protected]>
treewide: Switch/rename to timer_delete[_sync]()

Jann Horn <[email protected]>
proc: protect ptrace_may_access() with exec_update_lock (part 1)

Oleg Nesterov <[email protected]>
seqlock: Change do_task_stat() to use scoped_seqlock_read()

Peter Zijlstra <[email protected]>
seqlock: Introduce scoped_seqlock_read()

Trung Nguyen <[email protected]>
HID: multitouch: fix out-of-bounds bit access on mt_io_flags

Angela Czubak <[email protected]>
HID: add haptics page defines

Zide Chen <[email protected]>
perf/x86/intel/uncore: Defer ADL global PMON enable to enable_box()

Jann Horn <[email protected]>
proc: protect ptrace_may_access() with exec_update_lock (FD links)

Christoph Hellwig <[email protected]>
proc: rename proc_setattr to proc_nochmod_setattr

Namjae Jeon <[email protected]>
ksmbd: track the connection owning a byte-range lock

DaeMyung Kang <[email protected]>
ksmbd: centralize ksmbd_conn final release to plug transport leak

Namjae Jeon <[email protected]>
ksmbd: use opener credentials for FSCTL mutations

Davide Ornaghi <[email protected]>
ksmbd: fix path resolution in ksmbd_vfs_kern_path_create

Jori Koolstra <[email protected]>
vfs: make LAST_XXX private to fs/namei.c

Al Viro <[email protected]>
ksmbd_vfs_rename(): vfs_path_parent_lookup() accepts ERR_PTR() as name

Michael Bommarito <[email protected]>
smb: client: resolve SWN tcon from live registrations

Markus Elfring <[email protected]>
smb: client: Improve unlocking of a mutex in cifs_get_swn_reg()

Jose Fernandez (Anthropic) <[email protected]>
mm: swap_cgroup: fix NULL deref in lookup_swap_cgroup_id on swapless host

Siwei Zhang <[email protected]>
Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_new_connection_cb()

Pauli Virtanen <[email protected]>
Bluetooth: 6lowpan: fix cyclic locking warning on netdev unregister

Siwei Zhang <[email protected]>
Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn()

Pauli Virtanen <[email protected]>
Bluetooth: separate CIS_LINK and BIS_LINK link types

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO

Runyu Xiao <[email protected]>

    Bluetooth: L2CAP: cancel pending_rx_work before taking conn->lock

Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix not tracking outstanding TX ident

Florian Westphal <[email protected]>
netfilter: ebtables: zero chainstack array

Qianfeng Rong <[email protected]>
netfilter: ebtables: Use vmalloc_array() to improve code

Xiaolei Wang <[email protected]>
media: nxp: imx8-isi: Fix use-after-free on remove

Frank Li <[email protected]>
media: nxp: imx8-isi: use devm_pm_runtime_enable() to simplify code

Michael Wigham <[email protected]>
io_uring/rw: preserve partial result for iopoll

Jens Axboe <[email protected]>
io_uring/rw: ensure reissue path is correctly handled for IOPOLL

Runyu Xiao <[email protected]>
gpio: sch: use raw_spinlock_t in the irq startup path

Marco Elver <[email protected]>
Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref

Giovanni Cabiddu <[email protected]>
crypto: qat - fix VF2PF work teardown race in adf_disable_sriov()

Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB reads in rtw_get_sec_ie(), rtw_get_wapi_ie(), and rtw_get_wps_attr()

Nikolay Kulikov <[email protected]>
staging: rtl8723bs: fix spaces around binary operators

William Hansen-Baird <[email protected]>
staging: rtl8723bs: core: move constants to right side in comparison

Marco Nenciarini <[email protected]>
PCI: Skip Resizable BAR restore on read error

Ilpo Järvinen <[email protected]>
PCI: Move Resizable BAR code to rebar.c

Ilpo Järvinen <[email protected]>
PCI: Fix restoring BARs on BAR resize rollback path

Ilpo Järvinen <[email protected]>
PCI: Free saved list without holding pci_bus_sem

Ilpo Järvinen <[email protected]>
PCI: Prevent resource tree corruption when BAR resize fails

Ilpo Järvinen <[email protected]>
PCI: Use pbus_select_window() during BAR resize

Manivannan Sadhasivam <[email protected]>
PCI: mediatek: Fix IRQ domain leak when port fails to enable

Christian Marangi <[email protected]>
PCI: mediatek: Use generic MACRO for TPVPERL delay

Christian Marangi <[email protected]>
PCI: mediatek: Convert bool to single quirks entry and bitmap

Nam Cao <[email protected]>
PCI: mediatek: Switch to msi_create_parent_irq_domain()

Jiri Slaby (SUSE) <[email protected]>
PCI: controller: Use dev_fwnode() instead of of_fwnode_handle()

Mahesh Vaidya <[email protected]>
PCI: altera: Fix resource leaks on probe failure

Alex Williamson <[email protected]>
vfio/mlx5: Fix racy bitfields and tighten struct layout

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Update offsets for 2i2 Gen 4 firmware 2417

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Allow selecting config_set by firmware version

Cássio Gabriel <[email protected]>
ALSA: hda/cs35l41: Fix firmware load work teardown

Zhao Dongdong <[email protected]>
ALSA: aoa: check snd_ctl_new1() return value

Biren Pandya <[email protected]>
iio: pressure: mpl115: fix runtime PM leak on read error

Sakari Ailus <[email protected]>
iio: pressure: Remove redundant pm_runtime_mark_last_busy() calls

Samuel Moelius <[email protected]>
iio: adc: ad7380: select REGMAP

Zhang Lixu <[email protected]>
iio: hid-sensor-rotation: Fix stale or zero output when reading raw values

Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Fix possible deadlock and missing notifications

Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Use devm_acpi_install_notify_handler()

Rafael J. Wysocki <[email protected]>
ACPI: bus: Introduce devm_acpi_install_notify_handler()

Rafael J. Wysocki <[email protected]>
ACPI: driver: Check ACPI_COMPANION() against NULL during probe

Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup

Haoze Xie <[email protected]>
rust: block: fix GenDisk cleanup paths

Sergey Shtylyov <[email protected]>
mmc: sdhci-of-dwcmshc: check bus clock enable result in the probe() method

Ao Sun <[email protected]>
mmc: block: fix RPMB device unregister ordering

Pengpeng Hou <[email protected]>
mtd: rawnand: lpc32xx_slc: fail DMA transfer on completion timeout

Pengpeng Hou <[email protected]>
mtd: rawnand: lpc32xx_mlc: fail DMA transfers on timeout

Pengpeng Hou <[email protected]>
mtd: rawnand: fsl_ifc: return errors for failed page reads

Runyu Xiao <[email protected]>
mmc: vub300: defer reset until cmd_mutex is unlocked

Pengpeng Hou <[email protected]>
mtd: mchp23k256: use SPI match data for chip caps

Pengpeng Hou <[email protected]>
mtd: onenand: samsung: report DMA completion timeouts

Rafael Beims <[email protected]>
wifi: mwifiex: fix permanently busy scans after multiple roam iterations

Zhiling Zou <[email protected]>
wifi: mac80211: free ack status frame on TX header build failure

Junrui Luo <[email protected]>
powerpc/spufs: fix out-of-bounds access in spufs_mem_mmap_access()

Zhao Dongdong <[email protected]>
reset: sunxi: fix memory region leak on ioremap failure

Robby Cai <[email protected]>
reset: imx7: Correct polarity of MIPI CSI resets on i.MX8MQ

Florian Westphal <[email protected]>
ipvs: reload ip header after head reallocation

Julian Anastasov <[email protected]>
ipvs: fix more places with wrong ipv6 transport offsets

Maoyi Xie <[email protected]>
memstick: ms_block: reject a card that reports too many blocks

James Raphael Tiovalen <[email protected]>
macsec: fix promiscuity refcount leak in macsec_dev_open()

Xuanqiang Luo <[email protected]>
llc: fix SAP refcount leak when creating incoming sockets

Laxman Acharya Padhya <[email protected]>
Bluetooth: btrtl: validate firmware patch bounds

Asim Viladi Oglu Manizada <[email protected]>
net: openvswitch: reject oversized nested action attrs

Abhishek Ojha <[email protected]>
regulator: ltc3676: Fix incorrect IRQSTAT bit offsets

Dawei Feng <[email protected]>

    wifi: mac80211: fix memory leak in ieee80211_register_hw()

Rafael Beims <[email protected]>
wifi: mwifiex: fix roaming to different channel in host_mlme mode

Runyu Xiao <[email protected]>
wifi: rt2x00: avoid full teardown before work setup in probe

Thorsten Blum <[email protected]>
powerpc/pseries: fix memory leak on krealloc failure in papr_init

Thomas Huth <[email protected]>
selftests/landlock: Fix screwed up pointers in the scoped_signal_test

Thomas Huth <[email protected]>
selftests/landlock: Skip scoped_signal subtest with MSG_OOB if not available

Peng Fan <[email protected]>
pmdomain: imx: Fix i.MX8MP VC8000E power up sequence

Peng Fan <[email protected]>
pmdomain: imx: Fix i.MX8MP power notifier

Farhad Alemi <[email protected]>
cgroup/cpuset: rebind mm mempolicy to effective_mems, not mems_allowed

Gerald Schaefer <[email protected]>
s390/mm: Fix type mismatch in get_align_mask().

Crystal Wood <[email protected]>
tracing/osnoise: Call synchronize_rcu() when unregistering

Tao Liu <[email protected]>
riscv: Prevent NULL pointer dereference in machine_kexec_prepare()

Michael Bommarito <[email protected]>
drbd: reject data replies with an out-of-range payload size

TJ Adams <[email protected]>
ata: libata-core: Skip HPA resize for locked drives

Jinjie Ruan <[email protected]>
arm64: smp: Fix hot-unplug tearing by forcing unregistration

Daehyeon Ko <[email protected]>
macsec: don't read an unset MAC header in macsec_encrypt()

Yizhou Zhao <[email protected]>
ipvs: reset full ip_vs_seq structs in ip_vs_conn_new

Yizhou Zhao <[email protected]>
ipvs: use parsed transport offset in SCTP state lookup

Shuangpeng Bai <[email protected]>
llc: fix SAP refcount leak in llc_ui_autobind()

Nirmoy Das <[email protected]>
selftests: net: make busywait timeout clock portable

Yousef Alhouseen <[email protected]>
mac802154: remove interfaces with RCU list deletion

Gerald Schaefer <[email protected]>
s390/monwriter: Reject buffer reuse with different data length

Haoxiang Li <[email protected]>
irqchip/irq-riscv-imsic-early: Fix fwnode leak on state setup failure

Zi Yan <[email protected]>
mm/compaction: handle free_pages_prepare() properly in compaction_free()

Martin Kaiser <[email protected]>
riscv: probes: save original sp in rethook trampoline

HyeongJun An <[email protected]>
hwmon: (asus_atk0110) Check package count before accessing element

Maoyi Xie <[email protected]>
net: wwan: iosm: bound device offsets in the MUX downlink decoder

Wentao Liang <[email protected]>
ata: pata_pxa: Fix DMA channel leak on probe error

Bryam Vargas <[email protected]>
orangefs: keep the readdir entry size 64-bit in fill_from_part()

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix double addition of offset for @+FOFFSET

Joshua Crofts <[email protected]>
hwmon: (max1619) add missing 'select REGMAP' to Kconfig

David Lee <[email protected]>
fhandle: reject detached mounts in capable_wrt_mount()

Bryam Vargas <[email protected]>
net/sched: sch_taprio: Replace direct dequeue call with peek and qdisc_dequeue_peeked

Bryam Vargas <[email protected]>
net/sched: sch_multiq: Replace direct dequeue call with peek and qdisc_dequeue_peeked

Andrea Righi <[email protected]>
net: lan743x: Initialize eth_syslock spinlock before use

Haoxiang Li <[email protected]>
fsl/fman: Free init resources on KeyGen failure in fman_init()

Runyu Xiao <[email protected]>
hwmon: (occ) unregister sysfs devices outside occ lock

Haoxiang Li <[email protected]>
net: liquidio: fix BAR resource leak on PF number failure

Pengpeng Hou <[email protected]>
hwmon: (w83793) remove vrm sysfs file on probe failure

Pengpeng Hou <[email protected]>
hwmon: (w83627hf) remove VID sysfs files on error and remove

Conor Dooley <[email protected]>
rtc: mpfs: fix counter upload completion condition

Abdun Nihaal <[email protected]>
bnx2x: fix potential memory leak in bnx2x_alloc_mem_bp()

Sabrina Dubroca <[email protected]>
espintcp: use sk_msg_free_partial to fix partial send

Hongchen Zhang <[email protected]>
LoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()

Sven Eckelmann <[email protected]>
batman-adv: clean untagged VLAN on netdev registration failure

Miguel Ojeda <[email protected]>
rust: block: allow(deprecated) for fetch_update for Rust >= 1.99.0

Sven Eckelmann <[email protected]>
batman-adv: ensure minimal ethernet header on TX

Sven Eckelmann <[email protected]>
batman-adv: retrieve ethhdr after potential skb realloc on RX

Heiko Carstens <[email protected]>
s390: Revert support for DCACHE_WORD_ACCESS

Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: move rcu_read_lock()/spin_lock() from _bh variants

Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Avoid logging "(null)" for DMI values

Shitalkumar Gandhi <[email protected]>
ieee802154: ca8210: fix pointer truncation in kfifo on 64-bit

Shitalkumar Gandhi <[email protected]>
ieee802154: ca8210: fix cas_ctl leak on spi_async failure

Michael Bommarito <[email protected]>
ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation

Michael Bommarito <[email protected]>
ieee802154: admin-gate legacy LLSEC dump operations

Haoxiang Li <[email protected]>
octeontx2-af: Free BPID bitmap on setup failure

Maoyi Xie <[email protected]>
net: ip6_gre: require CAP_NET_ADMIN in the device netns for changelink

Maoyi Xie <[email protected]>
net: ipip: require CAP_NET_ADMIN in the device netns for changelink

Maoyi Xie <[email protected]>
net: ip_vti: require CAP_NET_ADMIN in the device netns for changelink

Maoyi Xie <[email protected]>
net: ip6_vti: require CAP_NET_ADMIN in the device netns for changelink

Dawei Feng <[email protected]>
net: ena: clean up XDP TX queues when regular TX setup fails

Zihan Xi <[email protected]>
net/sched: act_ct: preserve tc_skb_cb across defragmentation

Haoxiang Li <[email protected]>
net: ixp4xx_hss: fix duplicate HDLC netdev allocation

Haoxiang Li <[email protected]>
net: wwan: t7xx: destroy DMA pool on CLDMA late init failure

Maoyi Xie <[email protected]>
net: sit: require CAP_NET_ADMIN in the device netns for changelink

Andreas Kemnade <[email protected]>
gpios: palmas: add .get_direction() op

Paul Louvel <[email protected]>
gpio-f7188x: Add support for NCT6126D version B

Runyu Xiao <[email protected]>
gpio: tegra: do not call pinctrl for GPIO direction

Bradley Morgan <[email protected]>
cpu: hotplug: Bound hotplug states sysfs output

Bradley Morgan <[email protected]>
cpu: hotplug: Preserve per instance callback errors

Cao Ruichuang <[email protected]>
selftests/ftrace: Drop invalid top-level local in test_ownership

Zhan Xusheng <[email protected]>
posix-cpu-timers: Use u64 multiplication in update_rlimit_cpu()

Michael Bommarito <[email protected]>
tracing/user_events: Fix use-after-free in user_event_mm_dup()

Doruk Tan Ozturk <[email protected]>
net/mlx5e: macsec: fix use-after-free of metadata_dst on RX SC delete

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix type confusion in CDC union descriptor parsing

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix race condition in reset_device sysfs callback

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix potential infinite loop in CDC union descriptor parsing

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix out-of-bounds read in ims_pcu_irq() debug logging

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix firmware leak in async update

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix DMA mapping violation in line setup

Dmitry Torokhov <[email protected]>
Input: ims-pcu - add response length checks

Dmitry Torokhov <[email protected]>
Input: ims-pcu - validate control endpoint type

Dmitry Torokhov <[email protected]>
Input: ims-pcu - release data interface on disconnect

Dmitry Torokhov <[email protected]>
Input: ims-pcu - only expose sysfs attributes on control interface

Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix use-after-free and double-free in disconnect

Haoxiang Li <[email protected]>
scsi: elx: efct: Fix I/O leak on unsupported additional CDB

WenTao Liang <[email protected]>
scsi: elx: efct: Fix refcount leak in efct_hw_io_abort()

Bryam Vargas <[email protected]>
scsi: target: core: Fix iSCSI ISID use-after-free in REGISTER AND MOVE

Bryam Vargas <[email protected]>
scsi: target: Bound PR-OUT TransportID parsing to the received buffer

Michael Bommarito <[email protected]>
scsi: xen: scsiback: Free unsubmitted command instead of double-putting it

Michael Bommarito <[email protected]>
scsi: xen: scsiback: Free the command tag on the TMR submit-failure path

Xu Rao <[email protected]>
scsi: sg: Report request-table problems when any status is set

Abdun Nihaal <[email protected]>
scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup()

Haoxiang Li <[email protected]>
scsi: hpsa: Fix DMA mapping leak on IOACCEL2 reset path

Jhonraushan <[email protected]>
accel/ivpu: Reject firmware log with size smaller than header

Mikulas Patocka <[email protected]>
dm-verity: make error counter atomic

Mikulas Patocka <[email protected]>
dm-verity: increase sprintf buffer size

Mikulas Patocka <[email protected]>
dm-verity: fix a possible NULL pointer dereference

Mikulas Patocka <[email protected]>
dm-verity: avoid double increment of &use_bh_wq_enabled

Mikulas Patocka <[email protected]>
dm-integrity: don't increment hash_offset twice

Mikulas Patocka <[email protected]>
dm-integrity: fix a bug if the bio is out of limits

Mikulas Patocka <[email protected]>
dm_early_create: fix freeing used table on dm_resume failure

Mikulas Patocka <[email protected]>
dm-stats: fix merge accounting

Mikulas Patocka <[email protected]>
dm-stats: fix dm_jiffies_to_msec64

Benjamin Marzinski <[email protected]>
dm-log: fix a bitset_size overflow on 32bit machines

Mikulas Patocka <[email protected]>
dm-ioctl: fix a possible overflow in list_version_get_info

Mikulas Patocka <[email protected]>
dm-bufio: fix wrong count calculation in dm_bufio_issue_discard

Samuel Moelius <[email protected]>
dm era: fix out-of-bounds memory access for non-zero start sector

Ming-Hung Tsai <[email protected]>
dm thin metadata: fix metadata snapshot consistency on commit failure

Genjian Zhang <[email protected]>
dm thin metadata: fix superblock refcount leak on snapshot shadow failure

Haoxiang Li <[email protected]>
net: sparx5: unregister blocking notifier on init failure

Mike Waychison <[email protected]>
block: fix race in blk_time_get_ns() returning 0

Jiri Olsa <[email protected]>
bpf: Add missing access_ok call to copy_user_syms

Jann Horn <[email protected]>

    bpf,fork: wipe ->bpf_storage before bailouts that access it

Oliver Hartkopp <[email protected]>
can: bcm: add missing rcu list annotations and operations

Oliver Hartkopp <[email protected]>
can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure

Lee Jones <[email protected]>
can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAF

Oliver Hartkopp <[email protected]>
can: isotp: use unconditional synchronize_rcu() in isotp_release()

Fan Wu <[email protected]>
can: esd_usb: kill anchored URBs before freeing netdevs

Maoyi Xie <[email protected]>
netdev-genl: report NAPI thread PID in the caller's pid namespace

Bryam Vargas <[email protected]>
nvmet-rdma: handle inline data with a nonzero offset

Benjamin Coddington <[email protected]>
NFS: Charge unstable writes by request size, not folio size

Weiming Shi <[email protected]>
sctp: validate STALE_COOKIE cause length before reading staleness

Kunihiko Hayashi <[email protected]>
spi: uniphier: Fix completion initialization order before devm_request_irq()

Wang Yan <[email protected]>
time: Fix off-by-one in compat settimeofday() usec validation

Jaewon Yang <[email protected]>
tpm: Make the TPM character devices non-seekable

Thorsten Blum <[email protected]>
tpm: fix event_size output in tpm1_binary_bios_measurements_show

Maoyi Xie <[email protected]>
xfrm: xfrm_interface: require CAP_NET_ADMIN in the device netns for changelink

Sanman Pradhan <[email protected]>
xfrm: use compat translator only for u64 alignment mismatch

Wentao Liang <[email protected]>
xen/gntdev: fix error handling in ioctl

Paul Greenwalt <[email protected]>
ice: fix ice_init_link() error return preventing probe

Xuanqiang Luo <[email protected]>
i2c: mlxbf: Fix use-after-free in mlxbf_i2c_init_resource()

Roman Vivchar <[email protected]>
i2c: mediatek: fix WRRD for SoCs without auto_restart option

Joshua Crofts <[email protected]>
hwmon: (max6697) add missing 'select REGMAP_I2C' to Kconfig

Joshua Crofts <[email protected]>
hwmon: (ltc2992) add missing 'select REGMAP_I2C' to Kconfig

Ibrahim Hashimov <[email protected]>
ksmbd: fix integer overflow in set_file_allocation_info()

Fredric Cover <[email protected]>
smb: client: use kvzalloc() for megabyte buffer in simple fallocate

Holger Dengler <[email protected]>
pkey: Move keytype check from pkey api to handler

Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Don't log during intermediate wakeups

Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Add delay_suspend module parameter

Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops

Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Check for intermediate wakeup in function

Haoxiang Li <[email protected]>
platform/x86: dell-laptop: fix missing cleanups in init error path

Frank Li <[email protected]>
dmaengine: dw-edma: Add spinlock to protect DONE_INT_MASK and ABORT_INT_MASK

Kartik Rajput <[email protected]>
dmaengine: tegra: Fix burst size calculation

Michael Bommarito <[email protected]>
tpm: tpm2-sessions: wait for async KPP completion in tpm_buf_append_salt

Jarkko Sakkinen <[email protected]>
tpm: tpm_tis_spi: Use wait_woken() in wait_for_tmp_stat()

Bhargav Joshi <[email protected]>
irqchip/crossbar: Use correct index in crossbar_domain_free()

Yiyang Chen <[email protected]>
taskstats: retain dead thread stats in TGID queries

Florian Fuchs <[email protected]>
mtd: maps: vmu-flash: fix NULL pointer dereference in initialization

Miquel Raynal <[email protected]>
mtd: rawnand: Pause continuous reads at block boundaries

Takahiro Kuwano <[email protected]>
mtd: spi-nor: spansion: use die erase for multi-die devices only

Miquel Raynal <[email protected]>
mtd: spi-nor: swp: Improve locking user experience

Holger Dengler <[email protected]>
s390/pkey: Check length in pkey_pckmo handler implementation

Holger Dengler <[email protected]>
s390/pkey: Check length in PKEY_VERIFYPROTK ioctl

Sebastian Alba Vives <[email protected]>
fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header()

Maoyi Xie <[email protected]>

    net: thunderbolt: Fix frags[] overflow by bounding frame_count

Manivannan Sadhasivam <[email protected]>
bus: mhi: ep: Protect mhi_ep_handle_syserr() in the error path

Sebastian Alba Vives <[email protected]>
fpga: dfl: add bounds check in dfh_get_param_size()

Michael Bommarito <[email protected]>
ocfs2: reject non-inline dinodes with i_size and zero i_clusters

Michael Bommarito <[email protected]>
ocfs2: reject dinodes whose i_rdev disagrees with the file type

Michael Bommarito <[email protected]>
ocfs2: reject dinodes with non-canonical i_mode type

Joseph Qi <[email protected]>
ocfs2: add journal NULL check in ocfs2_checkpoint_inode()

Ian Bridges <[email protected]>
ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits

Kyle Zeng <[email protected]>
ocfs2: avoid moving extents to occupied clusters

Arseniy Krasnov <[email protected]>
mtd: rawnand: fix condition in 'nand_select_target()'

Vasiliy Kovalev <[email protected]>
net/9p: fix infinite loop in p9_client_rpc on fatal signal

Bastien Curutchet <[email protected]>
mtd: rawnand: pl353: fix probe resource allocation

Tristan Madani <[email protected]>
ocfs2: use kzalloc for quota recovery bitmap allocation

Ionut Nechita <[email protected]>
scsi: sas: Skip opt_sectors when DMA reports no real optimization hint

Martin Wilck <[email protected]>
scsi: smartpqi: Use shost_to_hba() in pqi_scan_finished()

Breno Leitao <[email protected]>
9p: skip nlink update in cacheless mode to fix WARN_ON

Ruoyu Wang <[email protected]>
mtd: slram: remove failed entries from the device list

Karl Mehltretter <[email protected]>
kcov: use WRITE_ONCE() for selftest mode stores

Muchun Song <[email protected]>
mm/mm_init: fix uninitialized struct pages for ZONE_DEVICE

Krzysztof Wilczyński <[email protected]>
proc: only bump parent nlink when registering directories

Kiryl Shutsemau (Meta) <[email protected]>
fs/proc/task_mmu: use huge_page_size() in pagemap_scan_hugetlb_entry()

Kiryl Shutsemau (Meta) <[email protected]>
fs/proc/task_mmu: fix hugetlb self-deadlock in pagemap_scan_pte_hole()

SeongJae Park <[email protected]>
mm/damon/sysfs-schemes: put stats for scheme_add_dirs() internal error

SeongJae Park <[email protected]>
mm/damon/sysfs-schemes: fix dir put orders in access_pattern_add_dirs()

Zishun Yi <[email protected]>
riscv: cacheinfo: Fix node reference leak in populate_cache_leaves

Aaron Tomlin <[email protected]>
mips: sched: Fix CPUMASK_OFFSTACK memory corruption

Bryam Vargas <[email protected]>
selftests/landlock: Test SCOPE_SIGNAL on the SIGIO/fowner pgid path

WenTao Liang <[email protected]>
power: supply: charger-manager: fix refcount leak in is_full_charged()

Tristan Madani <[email protected]>
ntfs3: fix out-of-bounds read in decompress_lznt

Michael Bommarito <[email protected]>
ntfs3: validate split-point offset in indx_insert_into_buffer

Michael Bommarito <[email protected]>
ntfs3: bound to_move in indx_insert_into_root before hdr_insert_head

Michael Bommarito <[email protected]>

    ntfs3: cap RESTART_TABLE free-chain walker at rt->used

Michael Bommarito <[email protected]>

    fs/ntfs3: bound NTFS_DE view.data_off in UpdateRecordData{Root,Allocation}

Michael Bommarito <[email protected]>
fs/ntfs3: add depth limit to indx_find_buffer to prevent stack overflow

Konstantin Komarov <[email protected]>
fs/ntfs3: validate lcns_follow in log_replay conversion

Konstantin Komarov <[email protected]>
fs/ntfs3: bound attr_off in UpdateResidentValue against data_off

Michael Bommarito <[email protected]>

    fs/ntfs3: bound copy_lcns dp->page_lcns[] index in analysis pass

Konstantin Komarov <[email protected]>
fs/ntfs3: bound DeleteIndexEntryAllocation memmove length

Zhan Xusheng <[email protected]>
fs/ntfs3: fix syncing wrong inode on DIRSYNC cross-directory rename

SeongJae Park <[email protected]>
mm/damon/core: make charge_addr_from aware of end-address exclusivity

Muchun Song <[email protected]>
mm/memory_hotplug: fix incorrect altmap passing in error path

Ma Ke <[email protected]>
power: supply: cpcap-battery: Fix missing nvmem_device_put() causing reference leak

Maciej W. Rozycki <[email protected]>
MIPS: DEC: Ensure 32-bit stack location for o32 prom_printf()

Johan Hovold <[email protected]>
MIPS: ip22-gio: fix device reference leak in probe

Johan Hovold <[email protected]>
MIPS: ip22-gio: fix kfree() of static object

Johan Hovold <[email protected]>
MIPS: ip22-gio: fix gio device memory leak

Wasim Nazir <[email protected]>
remoteproc: qcom: Fix leak when custom dump_segments addition fails

Chuck Lever <[email protected]>
SUNRPC: Bound-check xdr_buf_to_bvec() stores before writing

Chuck Lever <[email protected]>
lockd: Plug nlm_file refcount leak on cached nlm_do_fopen() failure

Chuck Lever <[email protected]>
lockd: Plug nlm_file leak when nlm_do_fopen() fails

Chuck Lever <[email protected]>
sunrpc: wait for in-flight TLS handshake callback when cancel loses race

Chris Mason <[email protected]>
sunrpc: pin svc_xprt across the asynchronous TLS handshake callback

Abdun Nihaal <[email protected]>
nvdimm/btt: Free arena sub-allocations on discover_arenas() error path

Abdun Nihaal <[email protected]>
nvdimm/btt: Free arenas on btt_init() error paths

Junrui Luo <[email protected]>
jbd2: fix integer underflow in jbd2_journal_initialize_fast_commit()

Pauli Virtanen <[email protected]>
Bluetooth: SCO: hold sk properly in sco_conn_ready

Pauli Virtanen <[email protected]>
Bluetooth: SCO: fix sleeping under spinlock in sco_conn_ready

Benoît Sevens <[email protected]>
HID: playstation: validate num_touch_reports in DualShock 4 reports

Bartosz Golaszewski <[email protected]>
mfd: tps6586x: Fix OF node refcount

Shyam Prasad N <[email protected]>
cifs: invalidate cfid on unlink/rename/rmdir

Sven Eckelmann <[email protected]>
batman-adv: tt: prevent TVLV OOB check overflow

Sven Eckelmann <[email protected]>
batman-adv: mcast: avoid OOB read of num_dests header

Sven Eckelmann <[email protected]>
batman-adv: frag: fix primary_if leak on failed linearization

Sven Eckelmann <[email protected]>
batman-adv: frag: free unfragmentable packet

Sven Eckelmann <[email protected]>
batman-adv: fix VLAN priority offset

Sven Eckelmann <[email protected]>
batman-adv: tt: avoid request storms during pending request

Sven Eckelmann <[email protected]>
batman-adv: dat: fix tie-break for candidate selection

Sven Eckelmann <[email protected]>
batman-adv: dat: ensure accessible eth_hdr proto field

Sven Eckelmann <[email protected]>
batman-adv: bla: reacquire gw address after skb realloc

Sven Eckelmann <[email protected]>
batman-adv: dat: acquire ARP hw source only after skb realloc

Sven Eckelmann <[email protected]>

    batman-adv: access unicast_ttvn skb->data only after skb realloc

Sven Eckelmann <[email protected]>
batman-adv: gw: acquire ethernet header only after skb realloc

Sumanth Korikkar <[email protected]>
s390/perf_cpum_cf: Add missing array_index_nospec() to __hw_perf_event_init()

Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Set non-turbo capacity to HWP_GUARANTEED_PERF()

Sandipan Das <[email protected]>
perf/x86/amd/lbr: Fix kernel address leakage

Thorsten Blum <[email protected]>
x86/boot: Reject too long acpi_rsdp= values

Thorsten Blum <[email protected]>
x86/boot: Validate console=uart8250 baud rate to fix early boot hang

Ali Ahmet MEMIS <[email protected]>
tools/power/x86/intel-speed-select: Harden daemon pidfile open

Guangshuo Li <[email protected]>
mfd: sm501: Fix reference leak on failed device registration

Armin Wolf <[email protected]>
leds: uleds: Fix potential buffer overread

Ondrej Mosnacek <[email protected]>
selinux: fix incorrect execmem checks on overlayfs

Tristan Madani <[email protected]>
selinux: avoid sk_socket dereference in selinux_sctp_bind_connect()

Stephen Smalley <[email protected]>
selinux: check connect-related permissions on TCP Fast Open

Wang Jun <[email protected]>
soc: fsl: qe: panic on ioremap() failure in qe_reset()

Siddharth Vadapalli <[email protected]>
soc: ti: k3-ringacc: Fix access mode for k3_ringacc_ring_pop_tail_io/proxy

Guangshuo Li <[email protected]>
gpu: host1x: Fix device reference leak in host1x_device_parse_dt() error path

Xiang Mei (Microsoft) <[email protected]>
netfilter: bridge: fix stale prevhdr pointer in br_ip6_fragment()

Wyatt Feng <[email protected]>
netfilter: xt_nat: reject unsupported target families

Yizhou Zhao <[email protected]>
netfilter: ecache: fix inverted time_after() check

Yizhou Zhao <[email protected]>
netfilter: nf_conncount: fix zone comparison in tuple dedup

Xiang Mei <[email protected]>
netfilter: nf_conntrack_reasm: guard mac_header adjustment after IPv6 defrag

Florian Westphal <[email protected]>
netfilter: nf_nat_sip: reload possible stale data pointer

Florian Westphal <[email protected]>
netfilter: nft_set_pipapo: don't leak bad clone into future transaction

Haoze Xie <[email protected]>
netfilter: nf_queue: pin bridge device while NFQUEUE holds fake dst

Wyatt Feng <[email protected]>
netfilter: xt_cluster: reject template conntracks in hash match

David Carlier <[email protected]>
netfilter: nfnl_cthelper: apply per-class values when updating policies

Muhammad Bilal <[email protected]>
netfilter: nf_conntrack_irc: fix parse_dcc() off-by-one OOB read

Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback

Cássio Gabriel <[email protected]>
ASoC: mediatek: mt8183: Release reserved memory on cleanup

Cássio Gabriel <[email protected]>
ASoC: mediatek: mt8192: Release reserved memory on cleanup

Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Validate size in snd_sof_update_control

Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/get

Abdun Nihaal <[email protected]>
fbdev: tridentfb: fix potential memory leak in trident_pci_probe()

Abdun Nihaal <[email protected]>
fbdev: nvidia: fix potential memory leak in nvidiafb_probe()

Abdun Nihaal <[email protected]>
fbdev: vesafb: fix memory leak in vesafb_probe()

Abdun Nihaal <[email protected]>
fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()

Abdun Nihaal <[email protected]>
fbdev: tdfxfb: fix potential memory leak in tdfxfb_probe()

Abdun Nihaal <[email protected]>
fbdev: uvesafb: fix potential memory leak in uvesafb_probe()

Abdun Nihaal <[email protected]>
fbdev: s3fb: fix potential memory leak in s3_pci_probe()

Abdun Nihaal <[email protected]>
fbdev: i740fb: fix potential memory leak in i740fb_probe()

Abdun Nihaal <[email protected]>
fbdev: radeon: fix potential memory leak in radeonfb_pci_register()

Abdun Nihaal <[email protected]>
fbdev: efifb: fix memory leak in efifb_probe()

Li RongQing <[email protected]>
fbdev: sm712: Fix operator precedence in big_swap macro

Abdun Nihaal <[email protected]>
fbdev: hecubafb: fix potential memory leak in hecubafb_probe()

Abdun Nihaal <[email protected]>
fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()

Abdun Nihaal <[email protected]>
fbdev: metronomefb: fix potential memory leak in metronomefb_probe()

Weiming Shi <[email protected]>
KVM: arm64: nv: Fix SPSR_EL2 restore in kvm_hyp_handle_mops()

Oliver Upton <[email protected]>
KVM: arm64: nv: Drop bogus WARN for write to ZCR_EL2

Sean Christopherson <[email protected]>
KVM: x86: Ignore pending PV EOI if the vCPU has since disabled PV EOIs

Atish Patra <[email protected]>
KVM: SEV: Do not allow intra-host migration/mirroring of SNP VMs

Matthew Rosato <[email protected]>
KVM: s390: pci: Fix handling of AIF enable without AISB

Hyunwoo Kim <[email protected]>
KVM: arm64: vgic: Check the interrupt is still ours before migrating it

Haoxiang Li <[email protected]>
KVM: s390: pci: Fix GISC refcount leak on AIF enable failure

Qiang Ma <[email protected]>
LoongArch: KVM: Return full old CSR value from kvm_emu_xchg_csr()

Bibo Mao <[email protected]>
LoongArch: KVM: Fix FPU register width with user access API

Qiang Ma <[email protected]>
LoongArch: KVM: Check the return values for put_user()

Bibo Mao <[email protected]>
LoongArch: KVM: Check irq validity in kvm_vcpu_ioctl_interrupt()

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Move expander gpio-line-names to board files

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Fix expander gpio line typo

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Move gpio-line-names to board files

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Fix GPIO names typo

Krzysztof Kozlowski <[email protected]>
arm64: dts: imx8ulp-evk: Correct Type-C int GPIO flags

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Enable internal ADC reference

Judith Mendez <[email protected]>
arm64: dts: ti: k3-am62a7-sk: Add bootph-all tag to vqmmc

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Move divergent mecio1 ADC channels to board files

David Jander <[email protected]>
ARM: dts: stm32: stm32mp15x-mecio1-io: Fix ADC sampling times

Nickolay Goppen <[email protected]>
arm64: dts: qcom: sdm630: describe adsp_mem region properly

Mark Rutland <[email protected]>
arm64: fpsimd: Fix type mismatch in sve_{save,load}_state()

Yong Wang <[email protected]>
net: ife: require ETH_HLEN to be pullable in ife_decode()

Zhengchuan Liang <[email protected]>
net: atm: reject out-of-range traffic classes in QoS validation

Michael Bommarito <[email protected]>
net: qrtr: fix 32-bit integer overflow in qrtr_endpoint_post()

Cássio Gabriel <[email protected]>
ASoC: SOF: topology: validate vendor array size before parsing

Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Fix TOCTOU in bytes_put and bytes_get

Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Use overflow checks in control_update size calc

Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc4-control: Fix TOCTOU in sof_ipc4_bytes_put

Zhang Tianci <[email protected]>
vduse: Fix race in vduse_dev_msg_sync and vduse_dev_read_iter

Wentao Liang <[email protected]>
mlxsw: fix refcount leak in mlxsw_sp_vrs_lpm_tree_replace()

Wentao Liang <[email protected]>
mlxsw: fix refcount leak in mlxsw_sp_port_lag_join()

Guangshuo Li <[email protected]>
smb: client: fix overflow in passthrough ioctl bounds check

Anas Khan <[email protected]>
drm/xe: remove duplicate <kunit/test-bug.h> include

Harman Kalra <[email protected]>
octeontx2-af: fix VF bringup affecting PF promiscuous state

Li RongQing <[email protected]>
net/mlx5: Fix L3 tunnel entropy refcount leak

Wang Yan <[email protected]>
selftests/net: fix EVP_MD_CTX leak in tcp_mmap

Timur Tabi <[email protected]>
regulator: core: regulator_lock_two() should test for EDEADLK not EDEADLOCK

Cao Guanghui <[email protected]>
dm era: fix NULL pointer dereference in metadata_open()

Chuck Lever <[email protected]>
SUNRPC: pin upper rpc_clnt across the TLS connect_worker

Chuck Lever <[email protected]>
SUNRPC: release lower rpc_clnt if killed waiting for XPRT_LOCKED

Guangshuo Li <[email protected]>
cifs: validate DFS referral string offsets

Rongguang Wei <[email protected]>
s390/zcrypt: Remove the empty file

Julian Anastasov <[email protected]>
ipvs: ensure inner headers in ICMP errors are in headroom

Yizhou Zhao <[email protected]>
ipvs: fix PMTU for GUE/GRE tunnel ICMP errors

Yizhou Zhao <[email protected]>
ipvs: use parsed transport offset in TCP state lookup

Yizhou Zhao <[email protected]>
ipvs: pass parsed transport offset to state handlers

Tamaki Yanagawa <[email protected]>
netfilter: nft_lookup: fix catchall element handling with inverted lookups

Eric Dumazet <[email protected]>
ipv6: mcast: Fix potential UAF in MLD delayed work

Kuniyuki Iwashima <[email protected]>
ipv6: mcast: Replace locking comments with lockdep annotations.

Eric Dumazet <[email protected]>
ipv4: igmp: Fix potential UAF in igmp_gq_start_timer()

Rosen Penev <[email protected]>
gpio: mvebu: free generic chips on unbind

Sandipan Das <[email protected]>
perf/x86/amd/core: Avoid enabling BRS from the SVM reload path

Suman Ghosh <[email protected]>
octeontx2-pf: check DMAC extraction support before filtering

Samuel Moelius <[email protected]>
net/sched: cake: reject overhead values that underflow length

Maíra Canal <[email protected]>
drm/v3d: Reject invalid indirect BO handle in indirect CSD setup

Enrico Pozzobon <[email protected]>
net: usb: lan78xx: disable VLAN filter in promiscuous mode

Oleksij Rempel <[email protected]>
net: usb: lan78xx: move functions to avoid forward definitions

Chuck Lever <[email protected]>
net/tls: Consume empty data records in tls_sw_read_sock()

Hui Wang <[email protected]>
ring-buffer: Fix event length with forced 8-byte alignment

Weiming Shi <[email protected]>

    Bluetooth: bpa10x: avoid OOB read of revision string in bpa10x_setup()

Pauli Virtanen <[email protected]>
Bluetooth: ISO: exclude RFU bits from ISO_SDU_Length

Cen Zhang <[email protected]>
Bluetooth: MGMT: Fix adv monitor add failure cleanup

Cen Zhang <[email protected]>
Bluetooth: 6lowpan: hold L2CAP conn across debugfs control

Eric Dumazet <[email protected]>
amt: fix size calculation in amt_get_size()

Xiang Mei <[email protected]>
net/smc: fix UAF in smc_cdc_rx_handler() by pinning the socket

Jamal Hadi Salim <[email protected]>
net/sched: act_pedit: fix TOCTOU heap OOB write in tc offload

Xiang Mei <[email protected]>
net: qualcomm: rmnet: validate MAP frame length before ingress parsing

Shigeru Yoshida <[email protected]>
qede: fix off-by-one in BD ring consumption on build_skb failure

Jens Emil Schulz Østergaard <[email protected]>
net: microchip: vcap: fix races on the shared Super VCAP block

Feng Liu <[email protected]>
net/mlx5e: Fix HV VHCA stats agent registration race

Feng Liu <[email protected]>
net/mlx5e: Fix HV VHCA stats zero-sized buffer allocation

Shay Drory <[email protected]>
net/mlx5: LAG, MPESW, Fix missing complete() on devcom error

Wyatt Feng <[email protected]>
netfilter: xt_connmark: reject invalid shift parameters

Zhixing Chen <[email protected]>
netfilter: ip6tables: mark malformed IPv6 extension headers for hotdrop

Feng Wu <[email protected]>
netfilter: xt_rateest: fix u64 truncation in xt_rateest_mt()

Wyatt Feng <[email protected]>
netfilter: xt_u32: reject invalid shift counts

Qihang <[email protected]>
gue: validate REMCSUM private option length

Xiang Mei <[email protected]>
net: usb: net1080: validate packet_len before pad-byte access in rx_fixup

Yiyang Chen <[email protected]>
selftests/hid: Cover hid_bpf_get_data() size overflow

Yiyang Chen <[email protected]>
selftests/hid: Load only requested struct_ops maps

Yiyang Chen <[email protected]>
HID: bpf: Fix hid_bpf_get_data() range check

Anshuman Khandual <[email protected]>
arm64/mm: Optimize TLB flush in unmap_hotplug_[pmd|pud]_range()

Lee Jones <[email protected]>
HID: core: Fix OOB read in hid_get_report for numbered reports

Georgiy Osokin <[email protected]>
HID: picolcd: prevent NULL pointer dereference in picolcd_send_and_wait()

Karuna Ramkumar <[email protected]>
ata: libata-scsi: limit simulated SCSI command copy to response length

Myeonghun Pak <[email protected]>
ata: sata_gemini: unwind clocks on IDE pinctrl errors

David Howells <[email protected]>
cifs: Fix missing credit release on failure in cifs_issue_read()

David Howells <[email protected]>
netfs: Drop the error arg from netfs_read_subreq_terminated()

Michal Wajdeczko <[email protected]>
drm/xe/pf: Don't attempt to process FAST_REQ or EVENT relays

Shuicheng Lin <[email protected]>
drm/xe/hw_engine: Fix double-free of managed BO in error path

Francois Dugast <[email protected]>
drm/xe/pt: Fix NULL pointer dereference in xe_pt_zap_ptes_entry()

David Howells <[email protected]>
netfs: Fix writeback error handling

Amir Goldstein <[email protected]>
ovl: fix comment about locking order

Michael Bommarito <[email protected]>
minix: avoid overflow in bitmap block count calculation

David Howells <[email protected]>
afs: Fix unchecked-length string display in debug statement

David Howells <[email protected]>
afs: Fix the volume AFS_VOLUME_RM_TREE is set on

David Howells <[email protected]>
afs: Fix vllist leak

David Howells <[email protected]>
afs: Fix missing NULL pointer check in afs_break_some_callbacks()

David Howells <[email protected]>
afs: Fix callback service message parsers to pass through -EAGAIN

David Howells <[email protected]>

    afs: Fix misplaced inc of net->cells_outstanding

David Howells <[email protected]>
afs: Change dynroot to create contents on demand

David Howells <[email protected]>
afs: Remove the "autocell" mount option

David Howells <[email protected]>
afs: Fix afs_atcell_get_link() to handle RCU pathwalk

David Howells <[email protected]>
afs: Make /afs/@cell and /afs/.@cell symlinks

David Howells <[email protected]>
afs: Add rootcell checks

David Howells <[email protected]>
afs: Make /afs/.<cell> as well as /afs/<cell> mountpoints

Li RongQing <[email protected]>

    afs: Remove erroneous seq |= 1 in volume lookup loop

Zilin Guan <[email protected]>
afs: use kvfree() to free memory allocated by kvcalloc()

David Howells <[email protected]>
afs: Fix double netfs initialisation in afs_root_iget()

Dan Carpenter <[email protected]>
afs: Fix error code in afs_extract_vl_addrs()

Christian Brauner <[email protected]>
fs: refuse O_TMPFILE creation with an unmapped fsuid or fsgid

Samuel Moelius <[email protected]>
net/sched: hhf: clear heavy-hitter state on reset

Viacheslav Bocharov <[email protected]>
pinctrl: meson: restore non-sleeping GPIO access

Vladimir Zapolskiy <[email protected]>
gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe

Gil Portnoy <[email protected]>

    ksmbd: fix use-after-free of fp->owner.name in durable handle owner check

Haofeng Li <[email protected]>
ksmbd: reject undersized DACLs before parsing ACEs

Sechang Lim <[email protected]>
net/sched: act_bpf: use rcu_dereference_bh() to read the filter

Gleb Markov <[email protected]>
cxgb4: Fix decode strings dump for T6 adapters

Longjun Tang <[email protected]>
virtio_net: disable cb when NAPI is busy-polled

Qingshuang Fu <[email protected]>
irqchip/ts4800: Fix missing chained handler cleanup on remove

Yuho Choi <[email protected]>
irqchip/gic-v3-its: Fix OF node reference leak

Martin Kaiser <[email protected]>
tracing: eprobe: read the complete FILTER_PTR_STRING pointer

Masami Hiramatsu (Google) <[email protected]>
tracing/events: Fix to check the simple_tsk_fn creation

Boris Brezillon <[email protected]>
drm/panthor: Interrupt group start/resumption if group_bind_locked() fails

Boris Brezillon <[email protected]>
drm/panthor: Fix a leak when a group is evicted before the tiler OOM is serviced

Boris Brezillon <[email protected]>
drm/panthor: Don't overrule pending immediate ticks in sched_resume_tick()

Boris Brezillon <[email protected]>
drm/panthor: Fix potential invalid pointer deref in group_process_tiler_oom()

Ido Schimmel <[email protected]>
bridge: stp: Fix a potential use-after-free when deleting a bridge

Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: Introduce slaves_lock to avoid race condition and UAF

Rosen Penev <[email protected]>
net: gianfar: dispose irq mappings on probe failure and device removal

Petr Wozniak <[email protected]>
net: phy: sfp: free mii_bus in sfp_i2c_mdiobus_destroy

Xiang Mei <[email protected]>
usbnet: gl620a: fix out-of-bounds read in genelink_rx_fixup()

Pengfei Zhang <[email protected]>
ipv6: fib6: fix NULL deref in fib6_walk_continue() on multi-batch dump

Guenter Roeck <[email protected]>
hwmon: (aspeed-g6-pwm-tach) Guard fan RPM calculation against divide-by-zero

Guenter Roeck <[email protected]>
hwmon: (pmbus) Fix passing events to regulator core

Matti Vaittinen <[email protected]>
hwmon: adm1275: Prevent reading uninitialized stack

Luca Weiss <[email protected]>
ASoC: codecs: lpass-va-macro: Fix LPASS Codec Version for SC7280

Srinivas Kandagatla <[email protected]>
ASoC: codecs: lpass-va-macro: add SM6115 compatible

Maciej W. Rozycki <[email protected]>
MIPS: DEC: Ensure RTC platform device deregistration upon failure

Yousef Alhouseen <[email protected]>
sctp: fix SCTP_RESET_STREAMS stream list length limit

Wei Fang <[email protected]>
net: enetc: check the number of BDs needed for xdp_frame

Matvey Kovalev <[email protected]>

    qede: fix out-of-bounds check for cqe->len_list[]

Nuoqi Gui <[email protected]>
seg6: validate SRH length before reading fixed fields

Pengpeng Hou <[email protected]>
gpio: htc-egpio: use managed gpiochip registration

Pengpeng Hou <[email protected]>
gpio: mvebu: fail probe if gpiochip registration fails

Pengpeng Hou <[email protected]>
spi: sh-msiof: abort transfers when reset times out

Martin Kaiser <[email protected]>
tracing: probes: fix typo in a log message

Shuaisong Yang <[email protected]>
net: hns3: differentiate autoneg default values between copper and fiber

Shuaisong Yang <[email protected]>
net: hns3: fix permanent link down deadlock after reset

Shuaisong Yang <[email protected]>
net: hns3: refactor MAC autoneg and speed configuration

Shuaisong Yang <[email protected]>
net: hns3: unify copper port ksettings configuration path

Peiyang Wang <[email protected]>
net: hns3: clear hns alarm: comparison of integer expressions of different signedness

Jijie Shao <[email protected]>
net: hns3: use hns3_get_ops() helper to reduce the unnecessary middle layer conversion

Jijie Shao <[email protected]>
net: hns3: use hns3_get_ae_dev() helper to reduce the unnecessary middle layer conversion

Jian Shen <[email protected]>
net: hns3: use string choices helper

Rosen Penev <[email protected]>
net: hisilicon: hns3: use ethtool string helpers

Rob Herring (Arm) <[email protected]>
dt-bindings: net: renesas,ether: Drop example "ethernet-phy-ieee802.3-c22" fallback

Eric Dumazet <[email protected]>
net: udp_tunnel: prevent double queueing in udp_tunnel_nic_device_sync

Stanislav Fomichev <[email protected]>
udp_tunnel: remove rtnl_lock dependency

Shengjiu Wang <[email protected]>
ASoC: fsl_asrc_dma: fix eDMA maxburst misalignment with channel count

Shitalkumar Gandhi <[email protected]>
net: ethernet: sunplus: spl2sw: fix phy_node refcount leak in remove

Ruoyu Wang <[email protected]>
net: sungem: fix probe error cleanup

Yun Zhou <[email protected]>
net: mvneta: re-enable percpu interrupt on resume

Subbaraya Sundeep <[email protected]>
octeontx2-af: Validate NIX maximum LFs correctly

David Yang <[email protected]>
net: dsa: realtek: fix memory leak in rtl8366rb_setup_led()

Haoxiang Li <[email protected]>
rtc: cmos: unregister HPET IRQ handler on probe failure

Fredrik M Olsson <[email protected]>
rtc: ds1307: Fix off-by-one issue with wday for rx8130

Huiwen He <[email protected]>
smb/client: preserve errors from smb2_set_sparse()

Li RongQing <[email protected]>
ACPI: processor_idle: Mark LPI enter functions as __cpuidle

Rafael J. Wysocki <[email protected]>
thermal: testing: zone: Flush work items during cleanup

Fernando Fernandez Mancera <[email protected]>
ipv6: fix missing notification for ignore_routes_with_linkdown

Kuniyuki Iwashima <[email protected]>

    ipv6: Convert net.ipv6.conf.${DEV}.XXX sysctl to per-netns RTNL.

Kuniyuki Iwashima <[email protected]>

    ipv6: Add __in6_dev_get_rtnl_net().

Kuniyuki Iwashima <[email protected]>
rtnetlink: Define rtnl_net_trylock().

Kuniyuki Iwashima <[email protected]>
rtnetlink: Add assertion helpers for per-netns RTNL.

Kuniyuki Iwashima <[email protected]>
rtnetlink: Add per-netns RTNL.

Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in disable_policy sysctl

Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in forwarding sysctl

Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in ignore_routes_with_linkdown sysctl

Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in disable_ipv6 sysctl

Jamal Hadi Salim <[email protected]>
net/sched: cls_api: Handle TC_ACT_CONSUMED in tcf_qevent_handle

Eric Dumazet <[email protected]>
veth: fix NAPI leak in XDP enable error path

Aleksandrova Alyona <[email protected]>
net: dsa: sja1105: round up PTP perout pin duration

Xiang Mei <[email protected]>
net, bpf: check master for NULL in xdp_master_redirect()

Krzysztof Wilczyński <[email protected]>
alpha/PCI: Fix __pci_mmap_fits() overflow for zero-length BARs

Krzysztof Wilczyński <[email protected]>
alpha/PCI: Add security_locked_down() check to pci_mmap_resource()

Koichiro Den <[email protected]>
NTB: epf: Fix doorbell bitmask and IRQ vector handling

Koichiro Den <[email protected]>
NTB: epf: Report 0-based doorbell vector via ntb_db_event()

Koichiro Den <[email protected]>
NTB: epf: Make db_valid_mask cover only real doorbell bits

Qingshuang Fu <[email protected]>
gpio: davinci: fix IRQ domain leak on devm_kzalloc failure

Florian Westphal <[email protected]>
netfilter: nft_compat: ebtables emulation must reject non-bridge targets

Runyu Xiao <[email protected]>

    netfilter: nft_synproxy: stop bypassing the priv->info snapshot

Fernando Fernandez Mancera <[email protected]>
netfilter: nf_conncount: prevent connlimit drops for early confirmed ct

Mathias Krause <[email protected]>
netfilter: nf_nat: avoid invalid nat_net pointer use on failed nf_nat_init()

Bradley Morgan <[email protected]>
bpf: Disable xfrm_decode_session hook attachment

Chen Cheng <[email protected]>
md/raid5: avoid R5_Overlap races while breaking stripe batches

Chen Cheng <[email protected]>
md/raid5: use stripe state snapshot in break_stripe_batch_list()

Kuniyuki Iwashima <[email protected]>
ipv4: fib: Don't ignore error route in local/main tables.

Jakub Kicinski <[email protected]>
eth: bnxt: improve the timing of stats

Jakub Kicinski <[email protected]>

    eth: bnxt: rename ring_err_stats -> ring_drv_stats

Jakub Kicinski <[email protected]>
eth: bnxt: gather and report HW-GRO stats

Rosen Penev <[email protected]>
net: bnxt: use ethtool string helpers

Xiang Mei <[email protected]>
ipv6: Fix null-ptr-deref in fib6_nh_mtu_change().

Gil Portnoy <[email protected]>

    ksmbd: fix use-after-free of conn->preauth_info in concurrent SMB2 NEGOTIATE

Stepan Ionichev <[email protected]>
rtc: msc313: fix NULL deref in shared IRQ handler at probe

Mohamed Khalfella <[email protected]>
i40e: Fix i40e_debug() to use struct i40e_hw argument

ZhaoJinming <[email protected]>
ice: dpll: fix memory leak in ice_dpll_init_info error paths

ZhaoJinming <[email protected]>
ice: dpll: set pointers to NULL after kfree in ice_dpll_deinit_info

Marcin Szycik <[email protected]>
ice: call netif_keep_dst() once when entering switchdev mode

Lukasz Czapnik <[email protected]>
ice: fix AQ error code comparison in ice_set_pauseparam()

Dawid Osuchowski <[email protected]>
ice: fix FDIR CTRL VSI resource leak in ice_reset_all_vfs()

Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-ntb: Add check to detect 'db_count' value of 0

Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-vntb: Add check to detect 'db_count' value of 0

Xiang Mei <[email protected]>
drm/edid: fix OOB read in drm_parse_tiled_block()

Bartosz Golaszewski <[email protected]>
power: sequencing: fix ABBA deadlock in pwrseq_device_unregister()

Amery Hung <[email protected]>
bpf: Fix effective prog array index with BPF_F_PREORDER

Avinash Duduskar <[email protected]>
bpf: zero-initialize the fib lookup flow struct

Yichong Chen <[email protected]>
bpftool: Fix vmlinux BTF leak in cgroup commands

Nuoqi Gui <[email protected]>
bpf: Fix stack slot index in nospec checks

Ronan Dalton <[email protected]>

    rtc: ds1307: handle oscillator stop flag for ds1337/ds1339/ds3231

Antoni Pokusinski <[email protected]>

    rtc: abx80x: fix the RTC_VL_CLR clearing all status flags

Ioana Ciornei <[email protected]>
dpaa2-switch: do not accept VLAN uppers while bridged

Weiming Shi <[email protected]>
ipv6: ndisc: fix NULL deref in accept_untracked_na()

Michael Bommarito <[email protected]>
net/sched: act_ct: fix nf_connlabels leak on two error paths

Geetha sowjanya <[email protected]>
octeontx2-pf: mcs: Fix mcs resources free on PF shutdown

Subbaraya Sundeep <[email protected]>
octeontx2-pf: Clear stats of all resources when freeing resources

Geetha sowjanya <[email protected]>
octeontx2-af: mcs: Fix unsupported secy stats read

Wayen Yan <[email protected]>
net: ethernet: mtk_ppe: Fix rhashtable leak in mtk_ppe_init error paths

Weiming Shi <[email protected]>
tipc: fix use-after-free of the discoverer in tipc_disc_rcv()

Ruoyu Wang <[email protected]>
net: marvell: prestera: initialize err in prestera_port_sfp_bind

Aboorva Devarajan <[email protected]>
selftests/mm: fix exclusive_cow test fork() handling

Sayali Patil <[email protected]>
selftests/mm: allow PUD-level entries in compound testcase of hmm tests

Sayali Patil <[email protected]>
selftests/mm: clarify alternate unmapping in compaction_test

Sayali Patil <[email protected]>
selftests/mm: ensure destination is hugetlb-backed in hugetlb-mremap

Sayali Patil <[email protected]>
selftest/mm: register existing mapping with userfaultfd in hugetlb-mremap

Sayali Patil <[email protected]>
selftests/mm: restore default nr_hugepages value via exit trap in charge_reserved_hugetlb.sh

Bhargav Joshi <[email protected]>
irqchip/crossbar: Fix parent domain resource leak

Sebastian Andrzej Siewior <[email protected]>
mailbox: imx: Forward the timeout/ error in imx_mu_generic_tx()

Florian Westphal <[email protected]>
netfilter: nft_meta_bridge: fix NFT_META_BRI_IIFPVID stack leak

Florian Westphal <[email protected]>
netfilter: nf_reject: skip iphdr options when looking for icmp header

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: make sure gc is properly stopped

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: fix order of kfree_rcu() and rcu_assign_pointer()

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: annotate "pos" for concurrent readers/writers

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix data race between add and dump in all hash types

Abd-Alrhman Masalkhi <[email protected]>
md/raid1: free r1_bio when REQ_NOWAIT is set and read would block on retry

Robertus Diawan Chris <[email protected]>
mac802154: Prevent overwrite return code in mac802154_perform_association()

Aleksandr Nogikh <[email protected]>
ieee802154: fix kernel-infoleak in dgram_recvmsg()

Ivan Abramov <[email protected]>

    ieee802154: Remove WARN_ON() in cfg802154_pernet_exit()

Xu Rao <[email protected]>
ACPI: IPMI: Fix inverted interface check in ipmi_bmc_gone()

Andy Shevchenko <[email protected]>
ACPI: resource: Amend kernel-doc style

Ricardo Neri <[email protected]>
thermal: intel: Fix dangling resources on thermal_throttle_online() failure

Breno Leitao <[email protected]>
arm64/hw_breakpoint: reject unaligned watchpoints that would truncate BAS

Cen Zhang <[email protected]>
ALSA: usb-audio: Kill MIDI 2.0 URBs before freeing endpoints

Yun Zhou <[email protected]>
flow_dissector: check device type before reading ETH_ADDRS

Cosmin Ratiu <[email protected]>
devlink: Fix parent ref leak in devl_rate_node_create()

Ioana Ciornei <[email protected]>
dpaa2-switch: fix VLAN upper check not rejecting bridge join

Xiang Mei <[email protected]>
virtio-net: fix len check in receive_big()

Quang Nguyen <[email protected]>
spi: rpc-if: Use correct device for hardware reinitialization on resume

Mark Tomlinson <[email protected]>
PCI: iproc: Restore .map_irq() for the platform bus driver

Xin Long <[email protected]>
sctp: hold socket lock when dumping endpoints in sctp_diag

Jakub Kicinski <[email protected]>
net: psample: fix info leak in PSAMPLE_ATTR_DATA

Ratheesh Kannoth <[email protected]>
octeontx2-pf: Fix leak of SQ timestamp buffer on teardown

Thadeu Lima de Souza Cascardo <[email protected]>
drm/amdgpu: initialize irq.lock spinlock earlier

Mario Limonciello <[email protected]>
drm/amdkfd: fix list_del corruption in kfd_criu_resume_svm

Yunxiang Li <[email protected]>
drm/amdkfd: Avoid double-unpin of DOORBELL/MMIO BOs on free

Sen Wang <[email protected]>
ASoC: tlv320aic3x: restrict CLKDIV bypass Q values in dual-rate mode

Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Bounds-check CPU in cs_etm__get_queue()

Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Require full global header in auxtrace_info size check

Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Validate num_cpu before metadata allocation

Arnaldo Carvalho de Melo <[email protected]>
perf machine: Use snprintf() for guestmount path construction

Eric Dumazet <[email protected]>
xfrm: validate selector family and prefixlen during match

Eric Dumazet <[email protected]>

    xfrm: annotate data-races around xfrm_policy_count[] and xfrm_policy_default[]

Herbert Xu <[email protected]>
xfrm: Fix xfrm state cache insertion race

Jisheng Zhang <[email protected]>
spi: dw: fix wrong BAUDR setting after resume

Guangshuo Li <[email protected]>
drm/i915: clear CRTC color blob pointers after dropping refs

Pengpeng Hou <[email protected]>
gpio: mlxbf3: fail probe if gpiochip registration fails

Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Reject CPU IDs that would overflow signed comparison

Leo Yan <[email protected]>
perf: Remove redundant kernel.h include

Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Bounds-check array offsets in bpil_offs_to_addr()

Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Validate func_info_rec_size and sub_id in synthesize_bpf_prog_name()

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use snprintf() for root_dir path construction

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Break infinite loop on zero-filled notes in sysfs__read_build_id()

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Validate p_filesz before use in filename__read_build_id()

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Fix bswap copy-paste error for 32-bit ELF p_filesz

Ian Rogers <[email protected]>
perf maps: Add maps__mutate_mapping

Pengpeng Hou <[email protected]>
sparc: led: avoid trimming a newline from empty writes

John Johansen <[email protected]>
apparmor: fix label can not be immediately before a declaration

Adrian Hunter <[email protected]>
i3c: master: Prevent reuse of dynamic address on device add failure

Adrian Hunter <[email protected]>
i3c: master: Make hot-join workqueue freezable to block hot-join during suspend

Marco Crivellari <[email protected]>
i3c: master: add WQ_PERCPU to alloc_workqueue users

Marco Crivellari <[email protected]>
workqueue: Add new WQ_PERCPU flag

Zygmunt Krynicki <[email protected]>
apparmor: put secmark label after secid lookup

Zygmunt Krynicki <[email protected]>
apparmor: aa_getprocattr free procattr leak on format failure

Georgia Garcia <[email protected]>
apparmor: remove or add symlinks to rawdata according to export_binary

Maxime Bélair <[email protected]>
apparmor: fix potential UAF in aa_replace_profiles

Ryan Lee <[email protected]>
apparmor: grab ns lock and refresh when looking up changehat child profiles

John Johansen <[email protected]>
apparmor: fix rawdata_f_data implicit flex array

Zygmunt Krynicki <[email protected]>
apparmor: aa_label_alloc use aa_label_free on alloc failure

Ruoyu Wang <[email protected]>
apparmor: check label build before no_new_privs test

Andrew Morton <[email protected]>
security/apparmor/apparmorfs.c: conditionally compile get_loaddata_common_ref()

Yuanhe Shu <[email protected]>
Revert "PCI/MSI: Unmap MSI-X region on error"

Manivannan Sadhasivam <[email protected]>
PCI: mediatek: Use actual physical address instead of virt_to_phys()

Ryder Lee <[email protected]>
PCI: mediatek: Fix possible truncation in mtk_pcie_parse_port()

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Add bounds checks to read_build_id() note iteration in minimal build

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Add bounds checks to elf_read_build_id() note iteration

Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Add NULL check for btf__type_by_id() in synthesize_bpf_prog_name()

Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix mount_overload() snprintf truncation and toupper range

Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix filename__write_int() writing uninitialized stack data

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use snprintf() in dso__read_running_kernel_build_id()

Ian Rogers <[email protected]>
perf dso: Move build_id to dso_id

Ian Rogers <[email protected]>
perf build-id: Change sprintf functions to snprintf

Ian Rogers <[email protected]>
perf dso: Add support for reading the e_machine type for a dso

Ian Rogers <[email protected]>
perf dso: Use lock annotations to fix asan deadlock

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Bounds-check descsz in sysfs__read_build_id() GNU fallback

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Fix thread__set_comm_from_proc() on empty comm file

Arnaldo Carvalho de Melo <[email protected]>
perf intel-pt: Fix snprintf size tracking bug in insn decoder

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Bounds-check .gnu_debuglink section data

Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Fix signed overflow in sysfs__read_build_id() size check

Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix missing null termination in filename__read_int/ull()

Arnaldo Carvalho de Melo <[email protected]>
perf pmu: Fix perf_pmu__parse_scale/unit() OOB access on empty sysfs file

Arnaldo Carvalho de Melo <[email protected]>
perf pmu: Fix pmu_id() heap underwrite on empty identifier file

James Clark <[email protected]>
perf cs-etm: Queue context packets for frontend

Chuck Lever <[email protected]>
xprtrdma: Return sendctx slot after Send preparation failure

Chuck Lever <[email protected]>
xprtrdma: Repost Receive buffers for malformed replies

Chuck Lever <[email protected]>
xprtrdma: Sanitize the reply credit grant after parsing

Chris Mason <[email protected]>
xprtrdma: Fix bcall rep leak and unbounded peek

Chuck Lever <[email protected]>
xprtrdma: Resize reply buffers before reposting receives

Chuck Lever <[email protected]>
xprtrdma: Document and assert reply-handler invariants

Chuck Lever <[email protected]>
xprtrdma: Check frwr_wp_create() during connect

Chris Mason <[email protected]>
xprtrdma: Initialize re_id before removal registration

Chris Mason <[email protected]>
xprtrdma: Fix ep kref imbalance on ADDR_CHANGE

Arnaldo Carvalho de Melo <[email protected]>
perf hists: Fix snprintf() in hists__scnprintf_title() UID filter path

Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Use scnprintf() in snprintf_hex() and synthesize_bpf_prog_name()

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix idle-hist callchain display using wrong rb_first variant

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Bounds-check prio before test_bit() in timehist

Lad Prabhakar <[email protected]>
PCI: rcar-host: Remove unused LIST_HEAD(res)

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use perf_env__get_cpu_topology() in machine__resolve()

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use scnprintf() in cpu_map__snprint() to prevent overflow

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Fix get_max_num() size_t underflow on empty sysfs file

Jamie Nguyen <[email protected]>

    fs/ntfs3: resize log->one_page_buf when adopting on-disk page size

Shuvam Pandey <[email protected]>
PCI: meson: Add missing remove callback

Shuvam Pandey <[email protected]>
PCI: meson: Propagate devm_add_action_or_reset() failure

Li RongQing <[email protected]>
PCI: mediatek: Fix operator precedence in PCIE_FTS_NUM_L0 macro

Yang Erkun <[email protected]>

    nfs: use nfsi->rwsem to protect traversal of the file lock list

Mike Snitzer <[email protected]>
NFSv4/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS in pg_get_mirror_count_write

Mike Snitzer <[email protected]>
NFSv4/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS on fatal DS connect errors

Clark Wang <[email protected]>
nfs: keep PG_UPTODATE clear after read errors in page groups

Dai Ngo <[email protected]>
NFSv4/pnfs: defer return_range callbacks until after inode unlock

Chuck Lever <[email protected]>
xprtrdma: Decouple req recycling from RPC completion

Chuck Lever <[email protected]>
xprtrdma: Use sendctx DMA state for Send signaling

Chuck Lever <[email protected]>
xprtrdma: Post receive buffers after RPC completion

Chuck Lever <[email protected]>
xprtrdma: Close lost-wakeup race in xprt_rdma_alloc_slot

Chuck Lever <[email protected]>
xprtrdma: Avoid 250 ms delay on backlog wakeup

Sagi Grimberg <[email protected]>
pNFS/filelayout: fix cheking if a layout is striped

Phillip Varney <[email protected]>
clk: qcom: a53: Corrected frequency multiplier for 1152MHz

Nuno Sá <[email protected]>
dmaengine: dma-axi-dmac: use DMA pool to manange DMA descriptor

Nuno Sá <[email protected]>
dmaengine: dma-axi-dmac: Properly free struct axi_dmac_desc

Nuno Sá <[email protected]>
dmaengine: Fix possible use after free

Icenowy Zheng <[email protected]>
dmaengine: qcom: gpi: set DMA_PRIVATE capability

Arnaldo Carvalho de Melo <[email protected]>
perf timechart: Fix cpu2y() OOB read on untrusted CPU index

Arnaldo Carvalho de Melo <[email protected]>
perf c2c: Fix use-after-free in he__get_c2c_hists() error path

Arnaldo Carvalho de Melo <[email protected]>

    perf stat: Introduce perf_env__get_cpu_topology() to guard NULL env->cpu

Arnaldo Carvalho de Melo <[email protected]>
perf mmap: Fix NULL deref in aio cleanup on alloc failure

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Replace BUG_ON and add NULL checks in replay event helpers

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Use thread__put() in free_idle_threads()

Namhyung Kim <[email protected]>
perf sched: Fix thread leaks in 'perf sched timehist'

Madadi Vineeth Reddy <[email protected]>
perf sched timehist: Add pre-migration wait time option

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Clean up idle_threads entry on init failure

Arnaldo Carvalho de Melo <[email protected]>
perf c2c: Bounds-check CPU IDs in setup_nodes() topology loop

Arnaldo Carvalho de Melo <[email protected]>
perf c2c: Bounds-check CPU and node IDs before bitmap and array access

Arnaldo Carvalho de Melo <[email protected]>
perf stat: Bounds-check CPU index in topology aggregation callbacks

Arnaldo Carvalho de Melo <[email protected]>
perf mmap: Guard cpu__get_node() return in aio_bind()

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix register_pid() overflow, strcpy, and BUG_ON

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Add bounds check to cpu__get_node()

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix NULL dereference in latency_runtime_event

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Replace BUG_ON on invalid CPU with graceful skip

Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix thread reference leak in latency_switch_event

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Guard test_bit from out-of-bounds sample CPU

Rui Qi <[email protected]>
perf: Fix off-by-one stack buffer overflow in kallsyms__parse()

Shengjiu Wang <[email protected]>
dmaengine: imx-sdma: Refine spba bus searching in probe

Xu Rao <[email protected]>
thunderbolt: debugfs: Fix margining error counter buffer leak

Srinivasan Shanmugam <[email protected]>
drm/amd/display: Add missing kdoc for ALLM parameters

Jamie Nguyen <[email protected]>
fs/ntfs3: fix mount failure on 64K page-size kernels

Konstantin Komarov <[email protected]>
fs/ntfs3: add bounds check to run_get_highest_vcn()

Rosen Penev <[email protected]>
HID: logitech-hidpp: remove excess kernel-doc member in hidpp_scroll_counter

Yuho Choi <[email protected]>
clk: at91: keep securam node alive while mapping it

Aldo Conte <[email protected]>
iio: tcs3472: power down chip on probe failure

Sanjay Chitroda <[email protected]>

    iio: accel: mma8452: handle I2C read error(s) in mma8452_read()

Guilherme Ivo Bozi <[email protected]>
iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling

Joshua Crofts <[email protected]>
iio: magnetometer: ak8975: fix potential kernel stack memory leak

Joshua Crofts <[email protected]>
iio: light: si1133: prevent race condition on timeout

Joshua Crofts <[email protected]>
iio: light: si1133: reset counter to prevent race condition

Arnaldo Carvalho de Melo <[email protected]>
perf header: Sanity check HEADER_EVENT_DESC attr.size before swap

Shawn Guo <[email protected]>
PCI: qcom: Disable ASPM L0s for SA8775P

James Kim <[email protected]>
char: tlclk: fix use-after-free in tlclk_cleanup()

Seungjin Bae <[email protected]>
usb: host: max3421: Reject hub port requests for non-existent ports

Seungjin Bae <[email protected]>

    usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()

Guangshuo Li <[email protected]>
staging: most: video: avoid double free on video register failure

Ian Rogers <[email protected]>
perf event: Fix size of synthesized sample with branch stacks

Namhyung Kim <[email protected]>

    perf inject: Add --convert-callchain option

Leo Yan <[email protected]>
perf arm-spe: Add branch stack

Graham Woodward <[email protected]>
perf arm-spe: Correctly set sample flags

Graham Woodward <[email protected]>
perf arm-spe: Use ARM_SPE_OP_BRANCH_ERET when synthesizing branches

Leo Yan <[email protected]>
perf arm-spe: Use metadata to decide the data source feature

Sergey Senozhatsky <[email protected]>
mailbox: mtk-adsp: fix UAF during device teardown

Jie Gan <[email protected]>
coresight: Fix source not disabled on idr_alloc_u32 failure

Mihai Sain <[email protected]>
clk: at91: sam9x7: Fix gmac_gclk clock definition

Leo Yan <[email protected]>
perf pmu: Skip test on Arm64 when #slots is zero

Andy Shevchenko <[email protected]>
phy: phy-can-transceiver: Check driver match and driver data against NULL

Qiang Yu <[email protected]>
PCI: qcom: Set max OPP before DBI access during resume

Sumit Kumar <[email protected]>
bus: mhi: ep: Fix potential deadlock in mhi_ep_reset_worker()

Hsiu Che Yu <[email protected]>
rust: alloc: fix assert in Vec::reserve doc test

Rong Zhang <[email protected]>
PCI: loongson: Do not ignore downstream devices on external bridges

Ian Rogers <[email protected]>
perf sched: Add missing mmap2 handler in timehist

Rafael J. Wysocki <[email protected]>
platform/x86: xo15-ebook: Fix wakeup source and GPE handling

Rafael J. Wysocki <[email protected]>
x86/platform/olpc: xo15: Drop wakeup source on driver removal

Guixin Liu <[email protected]>
PCI: Check ROM header and data structure addr before accessing

Guixin Liu <[email protected]>
PCI: Introduce named defines for PCI ROM

Carlos Bilbao <[email protected]>
PCI/ASPM: Don't reconfigure ASPM entering low-power state

Leo Yan <[email protected]>
coresight: etm4x: Correct TRCVMIDCCTLR1 save and restore

Yingchao Deng <[email protected]>
coresight: cti: Fix DT filter signals silently ignored

Ian Rogers <[email protected]>
perf debuginfo: Fix libdw API contract violations

Alexandru Hossu <[email protected]>
staging: nvec: fix use-after-free in nvec_rx_completed()

Mario Limonciello <[email protected]>
gpiolib: acpi: Only trigger ActiveBoth interrupts on boot

Nam Cao <[email protected]>
eventpoll: Fix epoll_wait() report false negative

Christian Brauner <[email protected]>

    eventpoll: rename epi->next and txlist for clarity

Christian Brauner <[email protected]>
eventpoll: wrap EP_UNACTIVE_PTR in typed sentinel helpers

Christian Brauner <[email protected]>
eventpoll: extract ep_deliver_event() from ep_send_events()

Christian Brauner <[email protected]>
eventpoll: split ep_insert() into alloc + register stages

Christian Brauner <[email protected]>
eventpoll: rename attach_epitem() to ep_attach_file()

Christian Brauner <[email protected]>
eventpoll: expand top-of-file overview / locking doc

Yizhou Zhao <[email protected]>

    net/9p: fix race condition on rdma->state in trans_rdma.c

Aleksandr Nogikh <[email protected]>
ocfs2: fix circular locking dependency in ocfs2_dio_end_io_write

Charles Keepax <[email protected]>
mfd: cs42l43: Sanity check firmware size

Matthew Bystrin <[email protected]>
mfd: rsmu: Fix page register setup

Guangshuo Li <[email protected]>
ksmbd: fix use-after-free in same_client_has_lease()

Brett Creeley <[email protected]>
ionic: Fix check in ionic_get_link_ext_stats

Selvamani Rajagopal <[email protected]>
dt-bindings: net: updated interrupt type to be active low, level triggered

Selvamani Rajagopal <[email protected]>
net: ethernet: oa_tc6: Remove FCS size in RX frame

Selvamani Rajagopal <[email protected]>

    net: ethernet: oa_tc6: mdiobus->parent initialized with NULL

Wayen.Yan <[email protected]>
net: airoha: Fix always-true condition in PPE1 queue reservation loop

Lorenzo Bianconi <[email protected]>
net: airoha: Add sched ETS offload support

Lorenzo Bianconi <[email protected]>
net: airoha: Introduce ndo_select_queue callback

Eric Dumazet <[email protected]>

    tcp: ipv6: clamp default adverting MSS to avoid GSO_BY_FRAGS (0xFFFF)

Eric Dumazet <[email protected]>
tipc: fix UAF in tipc_l2_send_msg()

Gui-Dong Han <[email protected]>
KEYS: Use acquire when reading state in keyring search

Aboorva Devarajan <[email protected]>
powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus

Aboorva Devarajan <[email protected]>
powerpc/powernv: fix preempt count leak in pnv_kexec_wait_secondaries_down

Aboorva Devarajan <[email protected]>
powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del

Yadan Fan <[email protected]>
MIPS: mm: Fix out-of-bounds write in maar_res_walk()

Sechang Lim <[email protected]>
bpf, sockmap: fix integer overflow in bpf_msg_pop_data() bounds check

Weiming Shi <[email protected]>
bpf, sockmap: reject overflowing copy + len in bpf_msg_push_data()

Al Viro <[email protected]>
udf: fix nls leak on udf_fill_super() failure

Leon Hwang <[email protected]>
bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket

Leo Yan <[email protected]>
selftests/bpf: Initialize operation name before use

Jiri Olsa <[email protected]>
selftests/bpf: Fix typo in verify_umulti_link_info

Huiwen He <[email protected]>
smb/client: always return a value for FS_IOC_GETFLAGS

Jian Zhang <[email protected]>
cifs: remove all cifs files before kill super

Takashi Iwai <[email protected]>
ALSA: core: Fix unintuitive behavior of snd_power_ref_and_wait()

Florian Westphal <[email protected]>
netfilter: nf_conncount: callers must hold rcu read lock

Runyu Xiao <[email protected]>
kcm: use WRITE_ONCE() when changing lower socket callbacks

Ovidiu Panait <[email protected]>
net: bcmgenet: Use weighted round-robin TX DMA arbitration

Matthieu Buffet <[email protected]>
landlock: Fix unmarked concurrent access to socket family

Grzegorz Nitka <[email protected]>
dpll: balance create/delete notifications in __dpll_pin_(un)register

Grzegorz Nitka <[email protected]>
dpll: guard sync-pair removal on full pin unregister

Grzegorz Nitka <[email protected]>
dpll: emit per-dpll delete notifications in dpll_pin_on_pin_unregister()

Grzegorz Nitka <[email protected]>
dpll: send delete notification before unregister in on-pin rollback

Grzegorz Nitka <[email protected]>
dpll: fix stale iteration in dpll_pin_on_pin_unregister()

Ivan Vecera <[email protected]>
dpll: Enhance and consolidate reference counting logic

Ivan Vecera <[email protected]>
dpll: Support dynamic pin index allocation

Petr Oros <[email protected]>
dpll: Add notifier chain for dpll events

Ivan Vecera <[email protected]>
dpll: Allow associating dpll pin with a firmware node

Arkadiusz Kubalewski <[email protected]>
dpll: add reference sync get/set

Arkadiusz Kubalewski <[email protected]>
dpll: add reference-sync netlink attribute

Ruoyu Wang <[email protected]>
net: wwan: t7xx: check skb_clone in control TX

Wentao Guan <[email protected]>
net: ethernet: mtk_wed: debugfs: correct index in wed_amsdu_show()

Ratheesh Kannoth <[email protected]>
octeontx2-af: npc: Fix size of entry2cntr_map

Dragos Tatulea <[email protected]>
net/mlx5: Check max_macs devlink param value against max capability

Sun Jian <[email protected]>
bpf: Run generic devmap egress prog on private skb

Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: fix loading WO firmware for MT7986

Aditya Garg <[email protected]>
net: mana: guard TX wq object destroy with INVALID_MANA_HANDLE check

Aditya Garg <[email protected]>
net: mana: initialize gdma queue id to INVALID_QUEUE_ID

Victor Nogueira <[email protected]>
net/sched: sch_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen

Victor Nogueira <[email protected]>
net/sched: sch_fq_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen

Chuck Lever <[email protected]>
handshake: Require admin permission for DONE command

Lucas Tsai <[email protected]>
power: supply: core: fix supplied_from allocations

Guangshuo Li <[email protected]>
ASoC: adau1372: Clear PLL_EN on failed PLL lock without reset GPIO

Lars Pöschel <[email protected]>
spi: xilinx: use FIFO occupancy register to determine buffer size

HanQuan <[email protected]>
ALSA: seq: Fix kernel heap address leak in bounce_error_event()

Herbert Xu <[email protected]>
crypto: rng - Free default RNG on module exit

Felix Gu <[email protected]>
crypto: cavium/cpt - fix DMA cleanup using wrong loop index

Felix Gu <[email protected]>
crypto: marvell/octeontx - fix DMA cleanup using wrong loop index

Dave Jiang <[email protected]>
cxl/test: Add check after kzalloc() memory in alloc_mock_res()

Dave Jiang <[email protected]>
cxl/test: Unregister cxl_acpi in cxl_test_init() error path

Michael Bommarito <[email protected]>
tipc: reject inverted service ranges from peer bindings

Michael Bommarito <[email protected]>
tipc: prevent snt_unacked underflow on CONN_ACK

Michael Bommarito <[email protected]>
tipc: require net admin for TIPCv2 netlink mutators

Victor Nogueira <[email protected]>
net/sched: sch_hfsc: Don't make class passive twice

Samuel Moelius <[email protected]>
net: pfcp: allocate per-cpu tstats for PFCP netdevs

Xin Long <[email protected]>
sctp: validate embedded address parameter length

Xiang Mei <[email protected]>
bridge: cfm: reject invalid CCM interval at configuration time

Kuniyuki Iwashima <[email protected]>
net: fib_rules: Don't dump dying fib_rule in fib_rules_dump().

Jamal Hadi Salim <[email protected]>
net/sched: cls_flow: Dont expose folded kernel pointers

George Moussalem <[email protected]>
net: dsa: qca8k: fix led devicename when using external mdio bus

HyeongJun An <[email protected]>
ASoC: tegra: tegra210_ahub: Validate written enum value

HyeongJun An <[email protected]>
ASoC: fsl: fsl_audmix: Validate written enum values

HyeongJun An <[email protected]>
ASoC: codecs: hdac_hdmi: Validate written enum value

Leon Romanovsky <[email protected]>
RDMA/mlx5: Release the HW‑provided UAR index rather than the SW one

Maher Sanalla <[email protected]>
RDMA/mlx5: Fix undefined shift of user RQ WQE size

Patrisious Haddad <[email protected]>
RDMA/mlx5: Remove raw RSS QP restrack tracking

Patrisious Haddad <[email protected]>
RDMA/mlx5: Remove DCT restrack tracking

Maxwell Doose <[email protected]>
fs: efs: remove unneeded debug prints

Samuel Moelius <[email protected]>
Bluetooth: vhci: validate devcoredump state before side effects

Samuel Moelius <[email protected]>
Bluetooth: hci: validate codec capability element length

Zhao Dongdong <[email protected]>
Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path

Jordan Walters <[email protected]>
Bluetooth: hci_core: Fix UAF in hci_unregister_dev()

Weiming Shi <[email protected]>
Bluetooth: eir: Fix stack OOB write when prepending the Flags AD

Zijun Hu <[email protected]>
Bluetooth: hci_qca: fix NULL pointer dereference in qca_dmp_hdr() for non-serdev device

Heiko Carstens <[email protected]>
s390/process: Fix kernel thread function pointer type

Richard Fitzgerald <[email protected]>
ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset()

Daniel Borkmann <[email protected]>
bpf: Tighten cgroup storage cookie checks for prog arrays

Giovanni Cabiddu <[email protected]>
vfio/qat: fix f_pos race in qat_vf_resume_write()

Sergey Shtylyov <[email protected]>
of: cpu: add check in __of_find_n_match_cpu_property()

Dave Jiang <[email protected]>
cxl/test: Zero out LSA backing memory to avoid leaking to user

Dave Jiang <[email protected]>
cxl/test: Fix integer overflow in mock LSA bounds checks

Yonghong Song <[email protected]>
selftests/bpf: Fix bpf_iter/task_vma test

Yun Zhou <[email protected]>
ext4: validate donor file superblock early in EXT4_IOC_MOVE_EXT

Aditya Prakash Srivastava <[email protected]>
ext4: fix kernel BUG in ext4_write_inline_data_end

Louis Scalbert <[email protected]>
bonding: 3ad: fix mux port state on oper down

Richard Fitzgerald <[email protected]>
ASoC: cs35l56: Don't leave parent IRQ disabled if system_suspend fails

Richard Fitzgerald <[email protected]>
ASoC: cs35l56: Fix missing calls to wm_adsp2_remove()

Srujana Challa <[email protected]>

    vdpa/octeon_ep: Fix PF->VF mailbox data address calculation

longlong yan <[email protected]>
tools/virtio: check mmap return value in vringh_test

Qing Ming <[email protected]>
vhost/net: complete zerocopy ubufs only once

Zhang Tianci <[email protected]>
vduse: Requeue failed read to send_list head

Filip Hejsek <[email protected]>
virtio_console: read size from config space during device init

Qihang Tang <[email protected]>
vhost/vdpa: validate virtqueue index in mmap and fault paths

Qihang Tang <[email protected]>
vduse: hold vduse_lock across IDR lookup in open path

Val Packett <[email protected]>
ASoC: codecs: aw88261: fix incorrect masks for boost regs

Ruoyu Wang <[email protected]>
spi: meson-spifc: fix runtime PM leak on remove

Chuck Lever <[email protected]>
NFSD: Handle layout stid in nfsd4_drop_revoked_stid()

Jason Gunthorpe <[email protected]>
IB/mlx4: Fill in the access_flags if IB_MR_REREG_ACCESS is not specified

Filipe Manana <[email protected]>
btrfs: fix deadlock cloning inline extent when using flushoncommit

Johannes Thumshirn <[email protected]>
btrfs: zoned: don't account data relocation space-info in statfs free space

Nikita Zhandarovich <[email protected]>
hwmon: (it87) Clamp negative values to zero in set_fan()

David Laight <[email protected]>
fbdev: sm501fb: Fix buffer errors in OF binding code

Filipe Manana <[email protected]>
btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs()

Ryder Lee <[email protected]>
wifi: mt76: mt7996: fix potential tx_retries underflow

Ryder Lee <[email protected]>
wifi: mt76: mt7925: fix potential tx_retries underflow

Ryder Lee <[email protected]>
wifi: mt76: mt7921: fix potential tx_retries underflow

Ryder Lee <[email protected]>
wifi: mt76: mt7915: fix potential tx_retries underflow

Bjoern A. Zeeb <[email protected]>

    wifi: mt76: fix argument to ieee80211_is_first_frag()

Sean Wang <[email protected]>
wifi: mt76: mt792x: skip MLD header rewrite for 802.3 encap TX

Sean Wang <[email protected]>
wifi: mt76: mt7925: keep TX BA state in the primary WCID

Javier Tia <[email protected]>
wifi: mt76: mt7925: fix stale pointer comparisons in change_vif_links

Myeonghun Pak <[email protected]>
wifi: mt76: mt7925: clean up DMA on probe failure

Hongyan Xia <[email protected]>
sched/fair: Fix cpu_util runnable_avg arithmetic

Wolfram Sang <[email protected]>
hwspinlock: qcom: avoid uninitialized struct members

Hui Zhu <[email protected]>
vmalloc: fix NULL pointer dereference in is_vm_area_hugepages()

Luca Leonardo Scorcia <[email protected]>
pinctrl: mediatek: mt8167: Fix Schmitt trigger register offset of pins 34-39

Luca Leonardo Scorcia <[email protected]>
pinctrl: mediatek: mt8516: Fix Schmitt trigger register offset of pins 34-39

Mike Christie <[email protected]>
scsi: target: Remove tcm_loop target reset handling

David Disseldorp <[email protected]>
scsi: target: Fix hexadecimal CHAP_I handling

Yuho Choi <[email protected]>
watchdog: unregister PM notifier on watchdog unregister

Al Viro <[email protected]>

    configfs: fix lockless traversals of ->s_children

Dmitry Vyukov <[email protected]>
firmware_loader: Fix recursive lock in device_cache_fw_images()

Aaron Ma <[email protected]>
ASoC: amd: acp-sdw-sof: Bound DAI link iteration

Felix Gu <[email protected]>
spi: ep93xx: fix double-free of zeropage on DMA setup failure

Jason Gunthorpe <[email protected]>
IB/mlx5: Properly support implicit ODP rereg_mr

Jason Gunthorpe <[email protected]>
IB/mlx5: Don't take the rereg_mr fallback without a new translation

Samuel Moelius <[email protected]>
thermal: testing: reject missing command arguments

Pengjie Zhang <[email protected]>
cpufreq: Documentation: fix conservative governor freq_step description

Yuho Choi <[email protected]>
ACPI: IPMI: Fix message kref handling on dead device

Kyle Zeng <[email protected]>
ALSA: seq: Clear variable event pointer on read

Rui Qi <[email protected]>

    riscv: stacktrace: Remove bogus -0x4 offset in non-FP walk_stackframe

Hui Wang <[email protected]>
riscv: cpu_ops: Change return value type of cpu_is_stopped() to bool

HyeongJun An <[email protected]>
ALSA: seq: Fix partial userptr event expansion

Tristan Madani <[email protected]>
wifi: wcn36xx: fix OOB read from short trigger BA firmware response

Tristan Madani <[email protected]>
wifi: wcn36xx: fix OOB read from firmware count in PRINT_REG_INFO indication

Tristan Madani <[email protected]>
wifi: wcn36xx: fix heap overflow from oversized firmware HAL response

Leon Hwang <[email protected]>
bpf: Update transport_header when encapsulating UDP tunnel in lwt

Leon Hwang <[email protected]>
bpf: Check tail zero of bpf_prog_info

Bernard Metzler <[email protected]>
RDMA/siw: Fix endpoint/socket association handling

Alexander Stein <[email protected]>
arm64: dts: tqma8mpql-mba8mpxl: configure sai clock in audio codec as well

Richard Zhu <[email protected]>
arm64: dts: imx95: Correct PCIe outbound address space configuration

Jacob Moroni <[email protected]>

    RDMA/irdma: Initialize iwmr->access during MR registration

Jacob Moroni <[email protected]>
RDMA/irdma: Fix OOB read during CQ MR registration

Jason Gunthorpe <[email protected]>
IB/cm: Fix av cm device leak on an error path in cm_init_av_by_path()

Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: call nf_ct_gre_keymap_destroy() if master helper is pptp

Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: revert ct extension genid infrastructure

Fernando Fernandez Mancera <[email protected]>
netfilter: synproxy: protect nf_ct_seqadj_init() with conntrack lock

Fernando Fernandez Mancera <[email protected]>
netfilter: synproxy: fix unaligned memory access in timestamp adjustment

Fernando Fernandez Mancera <[email protected]>
netfilter: synproxy: adjust duplicate timestamp options

Fernando Fernandez Mancera <[email protected]>
netfilter: synproxy: drop packets if timestamp adjustment fails

Pablo Neira Ayuso <[email protected]>
netfilter: nfnetlink_cthelper: use {READ,WRITE}_ONCE for accessing helper flags

Fernando Fernandez Mancera <[email protected]>
netfilter: nfnetlink_osf: fix mss parsing on big-endian architectures

Joseph Qi <[email protected]>
ocfs2: fix race between ocfs2_control_install_private() and ocfs2_control_release()

Zhang Cen <[email protected]>
ocfs2/dlm: require a ref for locking_state debugfs open

Zhang Cen <[email protected]>
ocfs2: reject FITRIM ranges shorter than a cluster

Dmitry Antipov <[email protected]>
ocfs2: fix buffer head management in ocfs2_read_blocks()

Zhang Cen <[email protected]>
ocfs2: rebase copied fsdlm LVB pointers in locking_state

Alex Deucher <[email protected]>
drm/amdkfd: always resume_all after suspend_all

Antony Antony <[email protected]>
xfrm: fix NAT-related field inheritance in SA migration

Sandipan Das <[email protected]>
perf/x86/amd/uncore: Use Node ID to identify DF and UMC domains

Zide Chen <[email protected]>
perf/x86/intel/uncore: Fix discovery unit lookup for multi-die systems

Sandipan Das <[email protected]>
perf/x86/amd/core: Always use the NMI latency mitigation

Michael S. Tsirkin <[email protected]>
vhost: fix vhost_get_avail_idx for a non empty ring

Woojin Ji <[email protected]>
bpftool: Use libbpf error code for flow dissector query

Yunxiang Li <[email protected]>
drm/amdgpu: set sub_block_index for mca ras sub-blocks

Al Viro <[email protected]>

    configfs_lookup(): don't leave ->s_dentry dangling on failure

Alexander Potapenko <[email protected]>

    lib/test_meminit: use && for bools

Frederic Weisbecker <[email protected]>
tick/sched: Fix TOCTOU in nohz idle time fetch

Nathan Chancellor <[email protected]>
driver core: Use system_percpu_wq instead of system_wq

Guanyou.Chen <[email protected]>
sched: restore timer_slack_ns when resetting RT policy on fork

Danila Chernetsov <[email protected]>
ext2: fix ignored return value of generic_write_sync()

Sang-Heon Jeon <[email protected]>
mm/fake-numa: fix under-allocation detection in uniform split

Deepanshu Kartikey <[email protected]>
bpf: fix UAF by restoring RCU-delayed inode freeing in bpffs

Chanwoo Lee <[email protected]>
scsi: ufs: Fix wrong value printed in unexpected UPIU response case

Dan Carpenter <[email protected]>
scsi: pm8001: Fix error code in non_fatal_log_show()

Martin Wilck <[email protected]>
scsi: Revert "scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans"

Alison Schofield <[email protected]>
nvdimm/btt: Handle preemption in BTT lane acquisition

Yuho Choi <[email protected]>
ARM: imx31: Fix IIM mapping leak in revision check

Bart Van Assche <[email protected]>
ata: libata: Fix ata_exec_internal()

J. Neuschäfer <[email protected]>
HID: wiimote: Fix table layout and whitespace errors

Yuho Choi <[email protected]>
ARM: imx3: Fix CCM node reference leak

Chuck Lever <[email protected]>
NFSD: Fix delegation reference leak in nfsd4_revoke_states

John Madieu <[email protected]>
ASoC: rsnd: Fix RSND_SOC_MASK width to single nibble

Zhang Yi <[email protected]>
ext4: fix LOGFLUSH shutdown ordering to allow ordered-mode data writeback

Chen Cheng <[email protected]>
md/raid10: reset read_slot when reusing r10bio for discard

Danilo Krummrich <[email protected]>
rpmsg: use generic driver_override infrastructure

Danilo Krummrich <[email protected]>
Drivers: hv: vmbus: use generic driver_override infrastructure

Danilo Krummrich <[email protected]>
cdx: use generic driver_override infrastructure

Danilo Krummrich <[email protected]>
amba: use generic driver_override infrastructure

Renjiang Han <[email protected]>
media: qcom: venus: relax encoder frame/blur step size on v6

Renjiang Han <[email protected]>
media: qcom: venus: relax encoder frame/blur dimension steps on v4

Renjiang Han <[email protected]>
media: qcom: venus: drop extra padding in NV12 raw size calculation

Tristan Madani <[email protected]>
RDMA/rxe: Copy WQE to local buffer in non-SRQ receive path

Tristan Madani <[email protected]>
RDMA/rxe: Fix TOCTOU heap overflow in get_srq_wqe

zhoumin <[email protected]>
EDAC/{skx_common,skx}: Fix UBSAN shift-out-of-bounds in skx_get_dimm_info

Jessica Zhang <[email protected]>
drm/msm/dp: Fix the ISR_* enum values

Jessica Zhang <[email protected]>
drm/msm/dp: fix HPD state status bit shift value

Andrea Righi <[email protected]>
sched/deadline: Reject debugfs dl_server writes for offline CPUs

Juri Lelli <[email protected]>
sched/deadline: Always stop dl-server before changing parameters

Herbert Xu <[email protected]>
crypto: tegra - Return ENOMEM when input buffer allocation fails for ccm

Herbert Xu <[email protected]>
crypto: tegra - Fix dma_free_coherent size error

Weili Qian <[email protected]>
crypto: hisilicon/qm - disable error report before flr

Tetsuo Handa <[email protected]>

    ocfs2: kill osb->system_file_mutex lock

ZhengYuan Huang <[email protected]>
ocfs2: don't BUG_ON an invalid journal dinode

Dan Carpenter <[email protected]>
rapidio/tsi721: prevent a bad dereference in tsi721_db_dpc()

Davidlohr Bueso <[email protected]>
dax/kmem: account for partial discontiguous resource upon removal

Carlos Llamas <[email protected]>
libbpf: Fix UAF in strset__add_str()

Siddharth Nayyar <[email protected]>
bpftool: Fix typo in struct_ops map FD generation for light skeleton

Michael Bommarito <[email protected]>
libbpf: Harden parse_vma_segs() path parsing

Timur Tabi <[email protected]>
drm/nouveau/bios: specify correct display fuse register for Ampere and Ada

Mikko Perttunen <[email protected]>
drm/tegra: Fix iommu_map_sgtable() return value check

Mikko Perttunen <[email protected]>
gpu: host1x: Fix iommu_map_sgtable() return value check

Felix Gu <[email protected]>
drm/tegra: dc: Fix device node reference leak in tegra_dc_has_output()

Mikko Perttunen <[email protected]>
gpu: host1x: Allow entries in BO caches to be freed

Ion Agorria <[email protected]>
drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove

Svyatoslav Ryhel <[email protected]>
drm/tegra: gr2d/gr3d: Initialize address register map before HOST1X client is registered

Jiayuan Chen <[email protected]>
net/sched: cls_bpf: prevent unbounded recursion in offload rollback

Eric Dumazet <[email protected]>
ipv6: guard against possible NULL deref in __in6_dev_stats_get()

Breno Leitao <[email protected]>
workqueue: drop spurious '*' from print_worker_info() fn declaration

Nilay Shroff <[email protected]>
nvme-multipath: fix flex array size in struct nvme_ns_head

Geliang Tang <[email protected]>
nvmet-tcp: fix page fragment cache leak in error path

Charles Keepax <[email protected]>
pinctrl: cs42l43: Fix polarity on debounce

Joey Lu <[email protected]>
pinctrl: nuvoton: ma35d1: fix MFP register offset and pin table

Zhang Cen <[email protected]>
ALSA: seq: midi: Serialize output teardown with event_input

Miquel Raynal <[email protected]>
mtd: spi-nor: Drop duplicate Kconfig dependency

Danilo Krummrich <[email protected]>
driver core: Guard deferred probe timeout extension with delayed_work_pending()

Danilo Krummrich <[email protected]>
driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()

Easwar Hariharan <[email protected]>
jiffies: Define secs_to_jiffies()

Rosen Penev <[email protected]>
mips: n64: add __iomem for writel call

Rosen Penev <[email protected]>
mips: ralink: mt7621: add missing __iomem

Maciej W. Rozycki <[email protected]>
MIPS: DEC: Remove do_IRQ() call indirection

Maciej W. Rozycki <[email protected]>
MIPS: Fix big-endian stack argument fetching in o32 wrapper

Jiakai Xu <[email protected]>
PM: sleep: Use complete() in device_pm_sleep_init()

Tao Cui <[email protected]>
RDMA/counter: Fix incorrect port index in rdma_counter_init() error cleanup

Lianfa Weng <[email protected]>
RDMA/hns: Fix log flood after cmd_mbox failure

Lianfa Weng <[email protected]>
RDMA/hns: Fix warning in poll cq direct mode

Guangshuo Li <[email protected]>
IB/mlx4: Fix refcount leak in add_port() error path

Zhu Yanjun <[email protected]>
RDMA/rxe: Fix a use-after-free problem in rxe_mmap

Jacob Moroni <[email protected]>
RDMA/irdma: Fix out-of-bounds write in irdma_copy_user_pgaddrs

Samuel Holland <[email protected]>
bus: sunxi-rsb: Always check register address validity

Shiraz Saleem <[email protected]>
RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed

Ronaldo Nunez <[email protected]>
pwm: imx27: Fix variable truncation in .apply()

Lifeng Zheng <[email protected]>
cpufreq: conservative: Simplify frequency limit handling

Pengjie Zhang <[email protected]>
cpufreq: Documentation: fix sampling_down_factor range

Saravana Kannan <[email protected]>
Revert "treewide: Fix probing of devices in DT overlays"

Zhang Yuwei <[email protected]>
driver core: Use mod_delayed_work to prevent lost deferred probe work

Stepan Ionichev <[email protected]>
device property: fix fwnode reference leak in fwnode_graph_get_endpoint_by_id()

Baokun Li <[email protected]>
writeback: drop now-unnecessary rcu_barrier() in cgroup_writeback_umount()

Pengpeng Hou <[email protected]>
tracing: Bound synthetic-field strings with seq_buf

Harshal Dev <[email protected]>
arm64: dts: qcom: sm8650: Add power-domain and iface clk for ice node

Harshal Dev <[email protected]>
arm64: dts: qcom: sm8450: Add power-domain and iface clk for ice node

Harshal Dev <[email protected]>
arm64: dts: qcom: kodiak: Add power-domain and iface clk for ice node

Harshal Dev <[email protected]>
arm64: dts: qcom: sc7180: Add power-domain and iface clk for ice node

Geert Uytterhoeven <[email protected]>
firmware: arm_scmi: Fix OOB in scmi_power_name_get()

Sven Püschel <[email protected]>
media: rockchip: rga: fix too small buffer size

Eric Dumazet <[email protected]>

    net/sched: sch_drr: annotate data-races around cl->deficit

Chen-Yu Tsai <[email protected]>
regulator: dt-bindings: mt6359: Drop regulator-name pattern restrictions

Randy Dunlap <[email protected]>
bitops: use common function parameter names

Greg Kroah-Hartman <[email protected]>
sysfs: clamp show() return value in sysfs_kf_read()

Sudeep Holla <[email protected]>
firmware: arm_scmi: Read sensor config as 32-bit value

Jose A. Perez de Azpillaga <[email protected]>
staging: media: atomisp: fix loop shadowing in ia_css_stream_destroy()

Yuho Choi <[email protected]>
media: atomisp: gc2235: fix UAF and memory leak

Zilin Guan <[email protected]>
media: atomisp: Fix memory leak in atomisp_fixed_pattern_table()

Kevin Brodsky <[email protected]>
selftests/mm: Fix resv_sz when parsing arm64 signal frame

Roman Kvasnytskyi <[email protected]>
selftests/bpf: Reject unsupported -k option in vmtest.sh

Liviu Dudau <[email protected]>
drm/syncobj: Fix memory leak in drm_syncobj_find_fence()

Junxian Huang <[email protected]>
RDMA/hns: Initialize seqfile before creating file

Sara Venkatesh <[email protected]>
RDMA/srpt: fix integer overflow in immediate data length check

Prathamesh Deshpande <[email protected]>
RDMA/mlx5: Fix devx subscribe-event unwind NULL dereference

Alexander Chesnokov <[email protected]>
RDMA/hns: Fix arithmetic overflow in calc_hem_config()

Prathamesh Deshpande <[email protected]>
IB/mlx5: Fix transport-domain rollback and initialize lb mutex earlier

Linmao Li <[email protected]>
ipv6: addrconf: bail out of dad_failure when state is no longer POSTDAD

Eric Dumazet <[email protected]>
net/sched: sch_htb: annotate data-races (I)

Eric Dumazet <[email protected]>

    net/sched: sch_htb: do not change sch->flags in htb_dump()

Qiang Ma <[email protected]>
spi: hisi-kunpeng: Use dev_err_probe() for host registration failure

Sean Christopherson <[email protected]>
crypto: ccp - Treat zero-length cert chain as query for blob lengths

Eric Dumazet <[email protected]>
net/sched: sch_hfsc: annotate data-races in hfsc_dump_class_stats()

Stepan Ionichev <[email protected]>
clk: scpi: Unregister child clock providers on remove

Rafael J. Wysocki <[email protected]>
thermal: hwmon: Fix critical temperature attribute removal

Pengpeng Hou <[email protected]>
evm: terminate and bound the evm_xattrs read buffer

Lin He <[email protected]>
drm/hisilicon/hibmc: use clock to look up the PLL value

Lin He <[email protected]>
drm/hisilicon/hibmc: move display contrl config to hibmc_probe()

Kuldeep Singh <[email protected]>
arm64: dts: qcom: sm8450: Fix ICE reg size

Kuldeep Singh <[email protected]>
arm64: dts: qcom: kodiak: Fix ICE reg size

Cristian Marussi <[email protected]>
clk: scmi: Fix clock rate rounding

Hsiu Che Yu <[email protected]>
rust: alloc: fix Vec::extend_with SAFETY comment

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8192-asurada: Move PCIe DMA bounce buffer to host

Sean Christopherson <[email protected]>
iommu/amd: Fix a stale comment about which legacy mode is user visible

Wenmeng Liu <[email protected]>
media: qcom: camss: vfe: fix PIX subdev naming on VFE lite

Shuangpeng Bai <[email protected]>
nilfs2: fix backing_dev_info reference leak

Alexander Aring <[email protected]>
dlm: fix add msg handle in send_queue ordered

Krzysztof Kozlowski <[email protected]>
ARM: multi_v7_defconfig: Correct QCOM_RPMH and QCOM_RPMHPD

Weiming Shi <[email protected]>
crypto: asymmetric_keys - fix OOB read in pefile_digest_pe_contents

Thorsten Blum <[email protected]>
crypto: ecrdsa - fix unknown OID check in ecrdsa_param_curve

Lothar Rubusch <[email protected]>
crypto: atmel-sha204a - fix blocking and non-blocking rng logic

Tycho Andersen (AMD) <[email protected]>
crypto: ccp - Fix snp_filter_reserved_mem_regions() off-by-one

Kuniyuki Iwashima <[email protected]>
vxlan: Fix potential null-ptr-deref in vxlan_gro_prepare_receive().

Peng Fan <[email protected]>
arm64: dts: imx8x-colibri: Correct SODIMM PAD settings

Weixin Guo <[email protected]>
arm64: dts: rockchip: fix rk809 interrupt pin on rk3566-roc-pc

Alice Ryhl <[email protected]>
drm/gpuvm: take refcount on DRM device

Felix Gu <[email protected]>
pinctrl: sunxi: fix regulator leak in sunxi_pmx_request() error path

Damian Muszynski <[email protected]>
crypto: qat - fix heartbeat error injection

Ashish Mhetre <[email protected]>
memory: tegra: Wire up system sleep PM ops

Nas Chung <[email protected]>
media: v4l2-common: Add YUV24 format info

Samuel Holland <[email protected]>
media: cedrus: Fix failure to clean up hardware on probe failure

Felix Gu <[email protected]>
watchdog: sprd_wdt: Remove redundant sprd_wdt_disable() on register failure

Balakrishnan Sambath <[email protected]>
watchdog: sama5d4_wdt: Fix WDDIS detection on SAM9X60 and SAMA7G5

Yingjie Gao <[email protected]>
watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH

Jihed Chaibi <[email protected]>
ARM: dts: am335x-sl50: Fix audio bitclock and frame master endpoint

Tristan Madani <[email protected]>
wifi: ath9k: fix OOB access from firmware tx status queue ID

Prasanna Kumar T S M <[email protected]>
soc: xilinx: Shutdown and free rx mailbox channel

Xingjing Deng <[email protected]>
kconfig: fix potential NULL pointer dereference in conf_askvalue

Tristan Madani <[email protected]>
wifi: rtw88: fix OOB read from firmware RX descriptor exceeding DMA buffer

Shin-Yi Lin <[email protected]>
wifi: rtw89: Correct data type for scan index to avoid infinite loop

Danilo Krummrich <[email protected]>

    driver core: use READ_ONCE() for dev->driver in dev_has_sync_state()

Srinivasan Shanmugam <[email protected]>
drm/amdkfd: Validate CRIU-restored IDs before idr_alloc

Krzysztof Kozlowski <[email protected]>
dt-bindings: pinctrl: nvidia,tegra234: Add missing required block

Jon Hunter <[email protected]>
arm64: tegra: Fix Tegra234 MGBE PTP clock

Louis Kotze <[email protected]>
wifi: cfg80211: fix grammar in MLO group key error message

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-mezzanine: Fix camss ports unit_address_vs_reg warning

Krzysztof Kozlowski <[email protected]>

    arm64: dts: qcom: sc8180x: Fix phy simple_bus_reg warning

Diederik de Haas <[email protected]>
arm64: dts: rockchip: Fix gmac0 reset pin for NanoPi R5S

Baolin Liu <[email protected]>
Documentation: proc: fix section numbering in table of contents

Gregory Bell <[email protected]>
selftests/bpf: Use local type for bpf_fou_encap in test_tunnel_kern

Gregory Bell <[email protected]>
selftests/bpf: Use local type for flow_offload_tuple_rhash in xdp_flowtable

Yang Wang <[email protected]>
drm/amd/pm: remove trailing semicolon from AMDGPU_PM_POLICY_ATTR macro

Aaron Tomlin <[email protected]>
libbpf: Report error when a negative kprobe offset is specified

Yuho Choi <[email protected]>
drm/radeon: fix memory leak in radeon_ring_restore() on lock failure

Werner Kasselman <[email protected]>
drm/radeon: fix integer overflow in radeon_align_pitch()

Werner Kasselman <[email protected]>
drm/amdgpu: fix integer overflow in amdgpu_gem_align_pitch()

Jonathan Cavitt <[email protected]>
drm/gpuvm: Do not prepare NULL objects

Tomi Valkeinen <[email protected]>
drm/tidss: Drop extra drm_mode_config_reset() call

Thomas Zimmermann <[email protected]>
drm/rockchip: Test for imported buffers with drm_gem_is_imported()

Chen Ni <[email protected]>
clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_exclusive()

Ian Bridges <[email protected]>
fbcon: fix NULL pointer dereference for a console without vc_data

David Howells <[email protected]>
afs: Fix further netns teardown to cancel the preallocation charger

Matvey Kovalev <[email protected]>
afs: fix NULL pointer dereference in afs_get_tree()

David Howells <[email protected]>
afs: Fix netns teardown to cancel the preallocation charger

David Howells <[email protected]>
rxrpc: Fix leak of released call in recvmsg(MSG_PEEK)

Jeffrey Altman <[email protected]>
rxrpc: rxrpc_verify_data ensure rx_dec_buffer alloc

Matthias Feser <[email protected]>
serial: 8250_omap: clear rx_running on zero-length DMA completes

Tapio Reijonen <[email protected]>

    serial: max310x: implement gpio_chip::get_direction()

Stephan Gerhold <[email protected]>
serial: msm: Disable DMA for kernel console UART

Guoniu Zhou <[email protected]>
dt-bindings: power: imx93: Add MIPI PHY power domain

Chen-Yu Tsai <[email protected]>
dt-bindings: media: sun4i-a10-video-engine: Add interconnect properties

Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix sequence number when no EOF

Ricardo Ribalda <[email protected]>
media: uvcvideo: Relax the constrains for interpolating the hw clock

Ricardo Ribalda <[email protected]>
media: uvcvideo: Do not add clock samples with small sof delta

Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix dev_sof filtering in hw timestamp

Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix buffer sequence in frame gaps

Ricardo Ribalda <[email protected]>
media: uvcvideo: Avoid partial metadata buffers

Ricardo Ribalda <[email protected]>
media: uvcvideo: Use hw timestaming if the clock buffer is full

Su Hui <[email protected]>
time/jiffies: Change register_refined_jiffies() to void __init

Thomas Gleixner <[email protected]>
time/jiffies: Register jiffies clocksource before usage

Eric Biggers <[email protected]>
crypto: hisi-trng - Remove crypto_rng interface

Eric Biggers <[email protected]>
crypto: crypto4xx - Remove insecure and unused rng_alg

Herbert Xu <[email protected]>
crypto: crypto4xx - Remove ahash-related code

Kuniyuki Iwashima <[email protected]>
af_unix: Drop all SCM attributes for SOCKMAP.

Kuniyuki Iwashima <[email protected]>
af_unix: Don't use skb_recv_datagram() in unix_stream_read_skb().

Kuniyuki Iwashima <[email protected]>
af_unix: Don't check SOCK_DEAD in unix_stream_read_skb().

Kuniyuki Iwashima <[email protected]>
af_unix: Don't hold unix_state_lock() in __unix_dgram_recvmsg().

Alexander Mikhalitsyn <[email protected]>
af_unix/scm: fix whitespace errors

Kuniyuki Iwashima <[email protected]>
af_unix: Set drop reason in unix_stream_read_skb().

Kuniyuki Iwashima <[email protected]>
af_unix: Set drop reason in manage_oob().

Kuniyuki Iwashima <[email protected]>
af_unix: Set drop reason in unix_release_sock().

Kuniyuki Iwashima <[email protected]>
net: dropreason: Gather SOCKET_ drop reasons.

Stephen Dolan <[email protected]>
x86/mm: Fix check/use ordering in switch_mm_irqs_off()

Vasant Hegde <[email protected]>

    iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

Vasant Hegde <[email protected]>

    iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19

Eric Biggers <[email protected]>
crypto: sun4i-ss - Remove insecure and unused rng_alg

Jingguo Tan <[email protected]>
vsock/virtio: bind uarg before filling zerocopy skb

Stefano Garzarella <[email protected]>
vsock/virtio: fix zerocopy completion for multi-skb sends

Sagi Grimberg <[email protected]>
nvmet-tcp: Fix potential UAF when ddgst mismatch

Shivam Kumar <[email protected]>
nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error path

Mikhail Gavrilov <[email protected]>
timekeeping: Register default clocksource before taking tk_core.lock

Michael Bommarito <[email protected]>
iommu/vt-d: Clear Present bit before tearing down scalable-mode context entry

Lu Baolu <[email protected]>
iommu/vt-d: Cleanup intel_context_flush_present()

Yi Liu <[email protected]>
iommu: Pass old domain to set_dev_pasid op

Hyunwoo Kim <[email protected]>
KVM: arm64: Clear __hyp_running_vcpu when flushing the pKVM hyp vCPU

Hyunwoo Kim <[email protected]>
KVM: arm64: Bound used_lrs when flushing the pKVM hyp vCPU

Muhammet Kaan KILINÇ <[email protected]>
crypto: algif_skcipher - force synchronous processing

Adam Li <[email protected]>
sched/fair: Only update stats for allowed CPUs when looking for dst group

Pawan Gupta <[email protected]>
bpf: Prefer dirty packs for eBPF allocations

Pawan Gupta <[email protected]>
bpf: Prefer packs that won't trigger an IBPB flush on allocation

Pawan Gupta <[email protected]>
bpf: Skip redundant IBPB in pack allocator

Pawan Gupta <[email protected]>
bpf: Restrict JIT predictor flush to cBPF

Pawan Gupta <[email protected]>
x86/bugs: Enable IBPB flush on BPF JIT allocation

Pawan Gupta <[email protected]>
bpf: Support for hardening against JIT spraying

Kuniyuki Iwashima <[email protected]>
tcp: Add preempt_{disable,enable}_nested() in reqsk_queue_hash_req().

Lu Baolu <[email protected]>
iommu/vt-d: Clear Present bit before tearing down context entry

ChenXiaoSong <[email protected]>
smb/server: do not require delete access for non-replacing links

-------------

Diffstat:

 Documentation/admin-guide/pm/cpufreq.rst           |   6 +-
 Documentation/core-api/workqueue.rst               |   6 +
 .../media/allwinner,sun4i-a10-video-engine.yaml    |  10 +
 .../devicetree/bindings/net/microchip,lan8650.yaml |   2 +-
 .../devicetree/bindings/net/renesas,ether.yaml     |   3 +-
 .../pinctrl/nvidia,tegra234-pinmux-aon.yaml        |   4 +
 .../bindings/pinctrl/nvidia,tegra234-pinmux.yaml   |   4 +
 .../bindings/regulator/mt6359-regulator.yaml       |  43 --
 Documentation/driver-api/dpll.rst                  |  25 +
 Documentation/driver-api/nvdimm/btt.rst            |   5 +-
 Documentation/driver-api/pci/pci.rst               |   3 +
 Documentation/filesystems/proc.rst                 |  14 +-
 Documentation/netlink/specs/dpll.yaml              |  19 +
 Documentation/netlink/specs/handshake.yaml         |   1 +
 Documentation/process/deprecated.rst               |  31 ++
 Makefile                                           |   4 +-
 arch/alpha/kernel/pci-sysfs.c                      |  13 +-
 arch/arm/boot/dts/st/stm32mp151c-mecio1r0.dts      | 128 +++++
 arch/arm/boot/dts/st/stm32mp153c-mecio1r1.dts      | 144 +++++
 arch/arm/boot/dts/st/stm32mp15x-mecio1-io.dtsi     | 146 +----
 arch/arm/boot/dts/ti/omap/am335x-sl50.dts          |   4 +-
 arch/arm/configs/multi_v7_defconfig                |   4 +-
 arch/arm/configs/sunxi_defconfig                   |   1 -
 arch/arm/mach-imx/cpu-imx31.c                      |   9 +-
 arch/arm/mach-imx/mm-imx3.c                        |   2 +
 .../dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts    |   3 +
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts      |   4 +-
 arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi   |   4 +-
 arch/arm64/boot/dts/freescale/imx95.dtsi           |  10 +-
 arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi   |   2 +-
 arch/arm64/boot/dts/nvidia/tegra234.dtsi           |   8 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |   6 +-
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |   8 +-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi              |   2 +-
 arch/arm64/boot/dts/qcom/sdm630.dtsi               |   9 +-
 .../qcom/sdm845-db845c-navigation-mezzanine.dtso   |   5 +
 arch/arm64/boot/dts/qcom/sm8450.dtsi               |   8 +-
 arch/arm64/boot/dts/qcom/sm8650.dtsi               |   6 +-
 arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts     |   2 +-
 arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts |   6 +-
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts            |   2 +
 arch/arm64/include/asm/kvm_hyp.h                   |   1 +
 arch/arm64/kernel/entry-fpsimd.S                   |   8 +-
 arch/arm64/kernel/hw_breakpoint.c                  |   9 +
 arch/arm64/kernel/smp.c                            |  16 +-
 arch/arm64/kvm/arm.c                               |   2 +
 arch/arm64/kvm/hyp/include/hyp/switch.h            |  11 +-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c                 |  12 +
 arch/arm64/kvm/hyp/pgtable.c                       |   3 +-
 arch/arm64/kvm/vgic/vgic-its.c                     |   2 +
 arch/arm64/kvm/vgic/vgic.c                         |  11 +-
 arch/arm64/mm/mmu.c                                |  11 +-
 arch/arm64/net/bpf_jit_comp.c                      |  25 +-
 arch/loongarch/include/asm/pgtable.h               |   4 +
 arch/loongarch/kvm/exit.c                          |   1 -
 arch/loongarch/kvm/vcpu.c                          |  11 +-
 arch/mips/dec/int-handler.S                        |   2 +-
 arch/mips/dec/platform.c                           |   6 +-
 arch/mips/dec/prom/init.c                          |   6 +-
 arch/mips/dec/setup.c                              |   6 -
 arch/mips/fw/lib/call_o32.S                        |   2 +-
 arch/mips/include/asm/dec/prom.h                   |  15 +-
 arch/mips/kernel/mips-mt-fpaff.c                   |  28 +-
 arch/mips/mm/init.c                                |  12 +-
 arch/mips/n64/init.c                               |   2 +-
 arch/mips/ralink/mt7621.c                          |   2 +-
 arch/mips/sgi-ip22/ip22-gio.c                      |   7 +-
 arch/powerpc/kexec/core_64.c                       |   4 +-
 arch/powerpc/net/bpf_jit_comp.c                    |   2 +-
 arch/powerpc/net/bpf_jit_comp64.c                  |  21 +-
 arch/powerpc/perf/core-fsl-emb.c                   |   3 +-
 arch/powerpc/platforms/cell/spufs/file.c           |   6 +-
 arch/powerpc/platforms/powernv/setup.c             |   3 +-
 .../platforms/pseries/papr_platform_attributes.c   |   8 +-
 arch/riscv/include/asm/cpu_ops.h                   |   2 +-
 arch/riscv/kernel/cacheinfo.c                      |   2 +-
 arch/riscv/kernel/cpu-hotplug.c                    |   4 +-
 arch/riscv/kernel/cpu_ops_sbi.c                    |  11 +-
 arch/riscv/kernel/machine_kexec.c                  |   3 +
 arch/riscv/kernel/probes/rethook_trampoline.S      |   3 +
 arch/riscv/kernel/stacktrace.c                     |   2 +-
 arch/riscv/net/bpf_jit_comp64.c                    |   2 +-
 arch/riscv/net/bpf_jit_core.c                      |   3 +-
 arch/s390/Kconfig                                  |   1 -
 arch/s390/include/asm/asm-extable.h                |   4 -
 arch/s390/include/asm/word-at-a-time.h             |  22 -
 arch/s390/kernel/perf_cpum_cf.c                    |   3 +
 arch/s390/kernel/process.c                         |   2 +-
 arch/s390/kvm/pci.c                                |  12 +-
 arch/s390/mm/extable.c                             |  18 -
 arch/s390/mm/mmap.c                                |   2 +-
 arch/sparc/kernel/led.c                            |   2 +-
 arch/x86/boot/compressed/acpi.c                    |   7 +-
 arch/x86/boot/early_serial_console.c               |  11 +-
 arch/x86/events/amd/brs.c                          |  10 +-
 arch/x86/events/amd/core.c                         |  18 +-
 arch/x86/events/amd/lbr.c                          |   3 +-
 arch/x86/events/amd/uncore.c                       |   6 +-
 arch/x86/events/intel/uncore_discovery.c           |   4 +-
 arch/x86/events/intel/uncore_snb.c                 |   7 -
 arch/x86/include/asm/nospec-branch.h               |   4 +
 arch/x86/kernel/cpu/bugs.c                         |  50 +-
 arch/x86/kvm/lapic.c                               |   8 +-
 arch/x86/kvm/svm/sev.c                             |   6 +-
 arch/x86/mm/tlb.c                                  |  16 +-
 arch/x86/net/bpf_jit_comp.c                        |   5 +-
 arch/x86/platform/olpc/olpc-xo15-sci.c             |   1 +
 block/blk.h                                        |  13 +-
 crypto/algif_skcipher.c                            |  75 +--
 crypto/asymmetric_keys/verify_pefile.c             |   2 +
 crypto/ecrdsa.c                                    |   2 +-
 crypto/rng.c                                       |  11 +
 drivers/accel/ivpu/ivpu_fw_log.c                   |   4 +
 drivers/acpi/ac.c                                  |   6 +-
 drivers/acpi/acpi_ipmi.c                           |   4 +-
 drivers/acpi/acpi_pad.c                            |   6 +-
 drivers/acpi/acpi_tad.c                            |   6 +-
 drivers/acpi/bus.c                                 |  70 +++
 drivers/acpi/nfit/core.c                           |  89 ++-
 drivers/acpi/pfr_telemetry.c                       |   6 +-
 drivers/acpi/pfr_update.c                          |   6 +-
 drivers/acpi/processor_idle.c                      |   4 +-
 drivers/acpi/resource.c                            |   6 +-
 drivers/acpi/riscv/cpuidle.c                       |   2 +-
 drivers/acpi/thermal.c                             |   2 +-
 drivers/amba/bus.c                                 |  37 +-
 drivers/ata/libata-core.c                          |  21 +-
 drivers/ata/libata-scsi.c                          |   7 +-
 drivers/ata/pata_pxa.c                             |   1 +
 drivers/ata/sata_gemini.c                          |   2 +-
 drivers/base/dd.c                                  |   7 +-
 drivers/base/firmware_loader/main.c                |   3 +-
 drivers/base/power/main.c                          |   6 +-
 drivers/base/property.c                            |   4 +-
 drivers/block/drbd/drbd_receiver.c                 |   5 +
 drivers/bluetooth/bpa10x.c                         |   8 +-
 drivers/bluetooth/btmtk.c                          |   4 +-
 drivers/bluetooth/btrtl.c                          |   5 +-
 drivers/bluetooth/hci_qca.c                        |   2 +-
 drivers/bluetooth/hci_vhci.c                       |  10 +
 drivers/bus/imx-weim.c                             |   6 -
 drivers/bus/mhi/ep/main.c                          |   9 +-
 drivers/bus/sunxi-rsb.c                            |   3 +
 drivers/cdx/cdx.c                                  |  40 +-
 drivers/char/tlclk.c                               |   4 +
 drivers/char/tpm/eventlog/tpm1.c                   |   4 +-
 drivers/char/tpm/tpm-dev.c                         |   2 +-
 drivers/char/tpm/tpm2-sessions.c                   |  45 +-
 drivers/char/tpm/tpm_tis_core.c                    |  35 +-
 drivers/char/tpm/tpmrm-dev.c                       |   2 +-
 drivers/char/virtio_console.c                      |  52 +-
 drivers/clk/at91/pmc.c                             |   2 +-
 drivers/clk/at91/sam9x7.c                          |  18 +-
 drivers/clk/clk-scmi.c                             |   4 +-
 drivers/clk/clk-scpi.c                             |   2 +-
 drivers/clk/qcom/a53-pll.c                         |   2 +-
 drivers/clocksource/timer-sun5i.c                  |   3 +
 drivers/cpufreq/cpufreq_conservative.c             |  12 +-
 drivers/cpufreq/intel_pstate.c                     |   6 +-
 drivers/crypto/allwinner/Kconfig                   |   8 -
 drivers/crypto/allwinner/sun4i-ss/Makefile         |   1 -
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c  |  36 --
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c  |  69 ---
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h       |  20 -
 drivers/crypto/amcc/crypto4xx_alg.c                | 106 ----
 drivers/crypto/amcc/crypto4xx_core.c               | 130 +----
 drivers/crypto/amcc/crypto4xx_core.h               |  11 -
 drivers/crypto/amcc/crypto4xx_reg_def.h            |  11 -
 drivers/crypto/atmel-ecc.c                         |   2 +-
 drivers/crypto/atmel-sha204a.c                     |  37 +-
 drivers/crypto/cavium/cpt/cptvf_reqmanager.c       |   4 +-
 drivers/crypto/ccp/sev-dev.c                       | 183 +++----
 drivers/crypto/hisilicon/Kconfig                   |   1 -
 drivers/crypto/hisilicon/qm.c                      |   4 +-
 drivers/crypto/hisilicon/trng/trng.c               | 296 +---------
 .../intel/qat/qat_common/adf_accel_devices.h       |   2 +
 drivers/crypto/intel/qat/qat_common/adf_aer.c      |   7 +-
 .../crypto/intel/qat/qat_common/adf_common_drv.h   |   3 +-
 .../intel/qat/qat_common/adf_heartbeat_inject.c    |   6 +-
 .../crypto/intel/qat/qat_common/adf_hw_arbiter.c   |  25 -
 drivers/crypto/intel/qat/qat_common/adf_isr.c      |  39 ++
 drivers/crypto/intel/qat/qat_common/adf_sriov.c    |  20 +-
 drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c |   4 +-
 drivers/crypto/tegra/tegra-se-aes.c                |  33 +-
 drivers/dax/kmem.c                                 |   6 +
 drivers/dma/dma-axi-dmac.c                         |  68 ++-
 drivers/dma/dmaengine.c                            |   3 +-
 drivers/dma/dw-edma/dw-edma-core.h                 |   2 +-
 drivers/dma/dw-edma/dw-edma-v0-core.c              |   6 +
 drivers/dma/imx-sdma.c                             |   4 +-
 drivers/dma/qcom/gpi.c                             |   1 +
 drivers/dma/tegra186-gpc-dma.c                     |   7 +
 drivers/dpll/dpll_core.c                           | 283 +++++++++-
 drivers/dpll/dpll_core.h                           |   8 +
 drivers/dpll/dpll_netlink.c                        | 199 ++++++-
 drivers/dpll/dpll_netlink.h                        |   2 +
 drivers/dpll/dpll_nl.c                             |  10 +-
 drivers/dpll/dpll_nl.h                             |   1 +
 drivers/edac/skx_common.c                          |   3 +
 drivers/firmware/arm_scmi/power.c                  |   6 +-
 drivers/firmware/arm_scmi/sensors.c                |   2 +-
 drivers/fpga/dfl.c                                 |   2 +
 drivers/fpga/microchip-spi.c                       |   3 +
 drivers/gpio/gpio-davinci.c                        |   4 +-
 drivers/gpio/gpio-f7188x.c                         |   6 +-
 drivers/gpio/gpio-htc-egpio.c                      |   6 +-
 drivers/gpio/gpio-mlxbf3.c                         |   3 +-
 drivers/gpio/gpio-mvebu.c                          |   6 +-
 drivers/gpio/gpio-palmas.c                         |  19 +
 drivers/gpio/gpio-sch.c                            |  32 +-
 drivers/gpio/gpio-tegra.c                          |  18 +-
 drivers/gpio/gpio-timberdale.c                     |   2 +-
 drivers/gpio/gpiolib-acpi-core.c                   |  19 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c   |  16 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c            |  25 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c            |   2 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c            |   3 +
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c           |   3 +
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  |  20 +-
 drivers/gpu/drm/amd/amdkfd/kfd_events.c            |   5 +
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c               |   1 +
 .../amd/display/modules/info_packet/info_packet.c  |   2 +
 drivers/gpu/drm/amd/pm/amdgpu_pm.c                 |   6 +-
 drivers/gpu/drm/drm_edid.c                         |   8 +
 drivers/gpu/drm/drm_gpuvm.c                        |   9 +-
 drivers/gpu/drm/drm_syncobj.c                      |  10 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c     |  78 +--
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c    |  11 +
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c   |  22 -
 drivers/gpu/drm/i915/display/intel_atomic.c        |   6 +
 drivers/gpu/drm/i915/gt/intel_region_lmem.c        |   2 +-
 drivers/gpu/drm/msm/dp/dp_display.c                |   4 +-
 drivers/gpu/drm/msm/dp/dp_reg.h                    |   4 +-
 .../gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c |   3 +-
 drivers/gpu/drm/panthor/panthor_sched.c            |  25 +-
 drivers/gpu/drm/radeon/radeon_gem.c                |  13 +-
 drivers/gpu/drm/radeon/radeon_ring.c               |   4 +-
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c        |   2 +-
 drivers/gpu/drm/tegra/dc.c                         |   4 +-
 drivers/gpu/drm/tegra/gem.c                        |  22 +-
 drivers/gpu/drm/tegra/gr2d.c                       |  19 +-
 drivers/gpu/drm/tegra/gr3d.c                       |  19 +-
 drivers/gpu/drm/tegra/submit.c                     |   3 +-
 drivers/gpu/drm/tidss/tidss_kms.c                  |   2 -
 drivers/gpu/drm/v3d/v3d_submit.c                   |   2 +
 drivers/gpu/drm/xe/tests/xe_pci.c                  |   1 -
 drivers/gpu/drm/xe/xe_guc_relay.c                  |  13 +-
 drivers/gpu/drm/xe/xe_hw_engine.c                  |   4 +-
 drivers/gpu/drm/xe/xe_pt.c                         |  12 +-
 drivers/gpu/drm/xe/xe_vram.c                       |   2 +-
 drivers/gpu/host1x/bus.c                           |  62 ++-
 drivers/gpu/host1x/job.c                           |  10 +-
 drivers/hid/bpf/hid_bpf_dispatch.c                 |   5 +-
 drivers/hid/hid-appleir.c                          |  45 +-
 drivers/hid/hid-core.c                             |   7 +
 drivers/hid/hid-logitech-hidpp.c                   |   1 -
 drivers/hid/hid-multitouch.c                       |  32 +-
 drivers/hid/hid-picolcd_core.c                     |   3 +-
 drivers/hid/hid-playstation.c                      |  12 +
 drivers/hid/hid-wiimote-modules.c                  |  58 +-
 drivers/hid/usbhid/hid-pidff.c                     | 258 +++++----
 drivers/hv/vmbus_drv.c                             |  43 +-
 drivers/hwmon/Kconfig                              |   3 +
 drivers/hwmon/aspeed-g6-pwm-tach.c                 |   5 +-
 drivers/hwmon/asus_atk0110.c                       |   3 +
 drivers/hwmon/it87.c                               |   3 +
 drivers/hwmon/occ/common.c                         |  34 +-
 drivers/hwmon/occ/common.h                         |   1 +
 drivers/hwmon/pmbus/adm1275.c                      |   2 +-
 drivers/hwmon/pmbus/pmbus_core.c                   |  13 +-
 drivers/hwmon/w83627hf.c                           |   4 +
 drivers/hwmon/w83793.c                             |   1 +
 drivers/hwspinlock/qcom_hwspinlock.c               |   5 +-
 .../hwtracing/coresight/coresight-cti-platform.c   |   1 +
 drivers/hwtracing/coresight/coresight-etm4x-core.c |   4 +-
 drivers/hwtracing/coresight/coresight-sysfs.c      |   4 +-
 drivers/i2c/busses/i2c-mlxbf.c                     |   4 +-
 drivers/i2c/busses/i2c-mt65xx.c                    |   2 +-
 drivers/i2c/i2c-core-of.c                          |   5 -
 drivers/i3c/master.c                               |  21 +-
 drivers/iio/accel/mma8452.c                        |   2 +
 drivers/iio/adc/Kconfig                            |   1 +
 drivers/iio/adc/xilinx-ams.c                       |   5 +
 drivers/iio/light/si1133.c                         |  14 +-
 drivers/iio/light/tcs3472.c                        |  38 +-
 drivers/iio/magnetometer/ak8975.c                  |  14 +
 drivers/iio/orientation/hid-sensor-rotation.c      |  40 +-
 drivers/iio/pressure/bmp280-core.c                 |   5 -
 drivers/iio/pressure/icp10100.c                    |   1 -
 drivers/iio/pressure/mpl115.c                      |   6 +-
 drivers/iio/pressure/zpa2326.c                     |   2 -
 drivers/infiniband/core/cm.c                       |  13 +-
 drivers/infiniband/core/counters.c                 |   2 +-
 drivers/infiniband/hw/hns/hns_roce_cq.c            |   6 +-
 drivers/infiniband/hw/hns/hns_roce_debugfs.c       |  19 +-
 drivers/infiniband/hw/hns/hns_roce_hem.c           |   8 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |  18 +-
 drivers/infiniband/hw/hns/hns_roce_main.c          |   2 +-
 drivers/infiniband/hw/hns/hns_roce_mr.c            |   6 +-
 drivers/infiniband/hw/hns/hns_roce_srq.c           |   2 +-
 drivers/infiniband/hw/irdma/verbs.c                |  19 +-
 drivers/infiniband/hw/irdma/verbs.h                |   1 -
 drivers/infiniband/hw/mana/main.c                  |   3 +-
 drivers/infiniband/hw/mlx4/mlx4_ib.h               |   1 +
 drivers/infiniband/hw/mlx4/mr.c                    |   9 +-
 drivers/infiniband/hw/mlx4/sysfs.c                 |  45 +-
 drivers/infiniband/hw/mlx5/devx.c                  |  30 +-
 drivers/infiniband/hw/mlx5/main.c                  |  17 +-
 drivers/infiniband/hw/mlx5/mr.c                    |  17 +-
 drivers/infiniband/hw/mlx5/qp.c                    |  13 +-
 drivers/infiniband/hw/mlx5/restrack.c              |   3 -
 drivers/infiniband/sw/rxe/rxe_mmap.c               |  19 +-
 drivers/infiniband/sw/rxe/rxe_resp.c               |  33 +-
 drivers/infiniband/sw/siw/siw_cm.c                 |  30 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c              |   5 +-
 drivers/input/misc/ims-pcu.c                       | 129 ++++-
 drivers/iommu/amd/amd_iommu.h                      |   6 +-
 drivers/iommu/amd/amd_iommu_types.h                |  32 +-
 drivers/iommu/amd/init.c                           |  90 ++-
 drivers/iommu/amd/iommu.c                          |   2 +-
 drivers/iommu/amd/pasid.c                          |   3 +-
 drivers/iommu/amd/ppr.c                            |  10 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c    |   3 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |   3 +-
 drivers/iommu/intel/iommu.c                        |  14 +-
 drivers/iommu/intel/iommu.h                        |  26 +-
 drivers/iommu/intel/pasid.c                        |  50 +-
 drivers/iommu/intel/svm.c                          |   3 +-
 drivers/iommu/iommu.c                              |   3 +-
 drivers/irqchip/irq-crossbar.c                     |  10 +-
 drivers/irqchip/irq-gic-v3-its.c                   |   6 +-
 drivers/irqchip/irq-riscv-imsic-early.c            |  15 +-
 drivers/irqchip/irq-ts4800.c                       |  10 +
 drivers/leds/uleds.c                               |   3 +-
 drivers/mailbox/imx-mailbox.c                      |   3 +-
 drivers/mailbox/mtk-adsp-mailbox.c                 |   9 +-
 drivers/md/dm-bufio.c                              |   4 +-
 drivers/md/dm-era-target.c                         |  10 +-
 drivers/md/dm-integrity.c                          |  10 +-
 drivers/md/dm-ioctl.c                              |   4 +-
 drivers/md/dm-log.c                                |   3 +
 drivers/md/dm-stats.c                              |  10 +-
 drivers/md/dm-thin-metadata.c                      |  67 +--
 drivers/md/dm-verity-loadpin.c                     |   2 +-
 drivers/md/dm-verity-target.c                      |  16 +-
 drivers/md/dm-verity.h                             |   2 +-
 drivers/md/raid1.c                                 |   6 +
 drivers/md/raid10.c                                |   1 +
 drivers/md/raid5.c                                 |  55 +-
 .../media/platform/nxp/imx8-isi/imx8-isi-core.c    |  18 +-
 drivers/media/platform/qcom/camss/camss-vfe.c      |   2 +-
 drivers/media/platform/qcom/venus/helpers.c        |   4 +-
 .../media/platform/qcom/venus/hfi_platform_v4.c    |  20 +-
 .../media/platform/qcom/venus/hfi_platform_v6.c    |  16 +-
 drivers/media/platform/rockchip/rga/rga-hw.c       |   2 +-
 drivers/media/platform/rockchip/rga/rga-hw.h       |   2 +-
 drivers/media/usb/uvc/uvc_video.c                  | 179 +++---
 drivers/media/v4l2-core/v4l2-common.c              |   1 +
 drivers/memory/tegra/mc.c                          |  14 +
 drivers/memstick/core/ms_block.c                   |   4 +
 drivers/mfd/cs42l43.c                              |   2 +-
 drivers/mfd/rsmu_i2c.c                             |   6 +-
 drivers/mfd/rsmu_spi.c                             |   5 +-
 drivers/mfd/sm501.c                                |   4 +-
 drivers/mfd/tps6586x.c                             |   2 +-
 drivers/mmc/core/block.c                           |   3 +-
 drivers/mmc/host/sdhci-of-dwcmshc.c                |  14 +-
 drivers/mmc/host/vub300.c                          |  26 +-
 drivers/mtd/devices/mchp23k256.c                   |   2 +-
 drivers/mtd/devices/slram.c                        |  22 +-
 drivers/mtd/maps/vmu-flash.c                       |   1 +
 drivers/mtd/nand/onenand/onenand_samsung.c         |   7 +-
 drivers/mtd/nand/raw/fsl_ifc_nand.c                |   9 +-
 drivers/mtd/nand/raw/lpc32xx_mlc.c                 |  12 +-
 drivers/mtd/nand/raw/lpc32xx_slc.c                 |  12 +-
 drivers/mtd/nand/raw/nand_base.c                   |  24 +-
 drivers/mtd/nand/raw/pl35x-nand-controller.c       |   2 +-
 drivers/mtd/spi-nor/Kconfig                        |   1 -
 drivers/mtd/spi-nor/spansion.c                     |   4 +-
 drivers/mtd/spi-nor/swp.c                          |  11 +-
 drivers/net/amt.c                                  |   6 +-
 drivers/net/bonding/bond_3ad.c                     |   1 +
 drivers/net/can/usb/esd_usb.c                      |   5 +-
 drivers/net/dsa/qca/qca8k-leds.c                   |   3 +-
 drivers/net/dsa/realtek/rtl8366rb-leds.c           |   8 +-
 drivers/net/dsa/sja1105/sja1105_ptp.c              |   2 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.c       |  23 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |   3 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c   |   3 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  83 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h          |  19 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c  | 134 +++--
 drivers/net/ethernet/broadcom/genet/bcmgenet.c     |  23 +-
 .../ethernet/cavium/liquidio/cn23xx_pf_device.c    |  18 +-
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c         |   8 -
 drivers/net/ethernet/emulex/benet/be_main.c        |   3 +-
 .../net/ethernet/freescale/dpaa2/dpaa2-switch.c    |  10 +-
 drivers/net/ethernet/freescale/enetc/enetc.c       |   7 +
 drivers/net/ethernet/freescale/fman/fman.c         |   4 +-
 drivers/net/ethernet/freescale/gianfar.c           |  16 +-
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |   2 +-
 .../hisilicon/hns3/hns3_common/hclge_comm_cmd.c    |   2 +-
 .../hns3/hns3_common/hclge_comm_tqp_stats.c        |  11 +-
 .../hns3/hns3_common/hclge_comm_tqp_stats.h        |   2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c |  34 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |  36 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |   2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 152 +++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c |  76 ++-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 196 ++++---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |   1 +
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |   7 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c    |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c |   3 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h |   2 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |   8 +-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c   |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_debug.h       |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |   2 -
 drivers/net/ethernet/intel/ice/ice_common.c        |   1 -
 drivers/net/ethernet/intel/ice/ice_dpll.c          |  20 +-
 drivers/net/ethernet/intel/ice/ice_eswitch.c       |   4 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c       |  12 +-
 drivers/net/ethernet/intel/ice/ice_main.c          |  20 +-
 drivers/net/ethernet/intel/ice/ice_vf_lib.c        |   2 +-
 drivers/net/ethernet/marvell/mvneta.c              |   3 +
 drivers/net/ethernet/marvell/octeontx2/af/mcs.c    |   6 +-
 .../ethernet/marvell/octeontx2/af/rvu_debugfs.c    |   3 +-
 .../ethernet/marvell/octeontx2/af/rvu_devlink.c    |  27 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_nix.c    |  15 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_npc.c    |  40 +-
 .../ethernet/marvell/octeontx2/nic/cn10k_macsec.c  |  10 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  44 +-
 .../net/ethernet/marvell/prestera/prestera_main.c  |   2 +-
 drivers/net/ethernet/mediatek/airoha_eth.c         | 231 +++++++-
 drivers/net/ethernet/mediatek/mtk_ppe.c            |   4 +-
 drivers/net/ethernet/mediatek/mtk_wed_debugfs.c    |   6 +-
 drivers/net/ethernet/mediatek/mtk_wed_mcu.c        |   8 +-
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c     |   3 +-
 .../ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c |  29 +-
 .../ethernet/mellanox/mlx5/core/en_accel/macsec.c  |  47 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   3 +-
 .../net/ethernet/mellanox/mlx5/core/lag/mpesw.c    |   7 +-
 .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c  |   8 +-
 .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h  |   6 +-
 .../net/ethernet/mellanox/mlx5/core/lib/port_tun.c |   3 +-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  12 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |   2 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |   1 +
 drivers/net/ethernet/microchip/lan743x_main.c      |   2 +-
 .../ethernet/microchip/lan966x/lan966x_vcap_impl.c |   5 +-
 .../ethernet/microchip/sparx5/sparx5_switchdev.c   |   4 +-
 .../ethernet/microchip/sparx5/sparx5_vcap_impl.c   |   5 +-
 drivers/net/ethernet/microchip/vcap/vcap_api.c     |  72 +--
 drivers/net/ethernet/microchip/vcap/vcap_api.h     |   3 +-
 .../net/ethernet/microchip/vcap/vcap_api_debugfs.c |   8 +-
 .../microchip/vcap/vcap_api_debugfs_kunit.c        |   3 +-
 .../net/ethernet/microchip/vcap/vcap_api_kunit.c   |   3 +-
 .../net/ethernet/microchip/vcap/vcap_api_private.h |   3 +
 drivers/net/ethernet/microsoft/mana/gdma_main.c    |   2 +
 drivers/net/ethernet/microsoft/mana/mana_en.c      |   3 +-
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |   3 +-
 drivers/net/ethernet/oa_tc6.c                      |  14 +-
 .../net/ethernet/pensando/ionic/ionic_ethtool.c    |  11 +-
 drivers/net/ethernet/qlogic/qede/qede_filter.c     |   3 -
 drivers/net/ethernet/qlogic/qede/qede_fp.c         |   9 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |   1 -
 .../net/ethernet/qualcomm/rmnet/rmnet_handlers.c   |   5 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h    |   1 +
 .../net/ethernet/qualcomm/rmnet/rmnet_map_data.c   |  78 +--
 drivers/net/ethernet/sfc/ef10.c                    |   1 -
 drivers/net/ethernet/sun/sungem.c                  |  13 +-
 drivers/net/ethernet/sunplus/spl2sw_phy.c          |   6 +-
 drivers/net/ieee802154/ca8210.c                    |   9 +-
 drivers/net/macsec.c                               |   9 +-
 drivers/net/netdevsim/udp_tunnels.c                |   4 -
 drivers/net/pfcp.c                                 |   1 +
 drivers/net/phy/sfp.c                              |   1 +
 drivers/net/thunderbolt/main.c                     |   8 +-
 drivers/net/usb/gl620a.c                           |   6 +-
 drivers/net/usb/lan78xx.c                          | 318 +++++------
 drivers/net/usb/net1080.c                          |   2 +-
 drivers/net/veth.c                                 |   2 +
 drivers/net/virtio_net.c                           |  12 +-
 drivers/net/vxlan/vxlan_core.c                     |   8 +-
 drivers/net/wan/ixp4xx_hss.c                       |   4 +-
 drivers/net/wireless/ath/ath9k/xmit.c              |   5 +
 drivers/net/wireless/ath/wcn36xx/smd.c             |  13 +
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   2 +-
 drivers/net/wireless/marvell/mwifiex/join.c        |   1 -
 drivers/net/wireless/mediatek/mt76/mac80211.c      |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c    |  10 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c    |   5 +-
 drivers/net/wireless/mediatek/mt76/mt7925/mac.c    |  20 +-
 drivers/net/wireless/mediatek/mt76/mt7925/main.c   |   4 +-
 drivers/net/wireless/mediatek/mt76/mt7925/pci.c    |   4 +-
 drivers/net/wireless/mediatek/mt76/mt792x_core.c   |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   6 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c     |  12 +-
 drivers/net/wireless/realtek/rtw88/pci.c           |   5 +
 drivers/net/wireless/realtek/rtw89/fw.c            |   2 +-
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c         |  40 +-
 drivers/net/wwan/t7xx/t7xx_hif_cldma.c             |   3 +
 drivers/net/wwan/t7xx/t7xx_port_wwan.c             |   2 +
 drivers/ntb/hw/epf/ntb_hw_epf.c                    |  81 ++-
 drivers/nvdimm/btt.c                               |  14 +-
 drivers/nvdimm/nd.h                                |  11 +-
 drivers/nvdimm/region_devs.c                       |  66 +--
 drivers/nvme/host/core.c                           |   2 +-
 drivers/nvme/target/rdma.c                         |  18 +-
 drivers/nvme/target/tcp.c                          |  11 +-
 drivers/of/cpu.c                                   |   2 +-
 drivers/of/dynamic.c                               |   1 -
 drivers/of/platform.c                              |   5 -
 drivers/pci/Makefile                               |   2 +-
 drivers/pci/controller/Kconfig                     |   1 +
 drivers/pci/controller/dwc/pci-meson.c             |  13 +-
 drivers/pci/controller/dwc/pcie-designware-host.c  |   2 +-
 drivers/pci/controller/dwc/pcie-qcom.c             |  43 +-
 .../pci/controller/mobiveil/pcie-mobiveil-host.c   |   8 +-
 drivers/pci/controller/pci-loongson.c              |  31 +-
 drivers/pci/controller/pcie-altera-msi.c           |   2 +-
 drivers/pci/controller/pcie-altera.c               |  31 +-
 drivers/pci/controller/pcie-iproc-bcma.c           |   2 +-
 drivers/pci/controller/pcie-iproc-platform.c       |   2 +-
 drivers/pci/controller/pcie-iproc.c                |   1 -
 drivers/pci/controller/pcie-iproc.h                |   2 -
 drivers/pci/controller/pcie-mediatek-gen3.c        |   4 +-
 drivers/pci/controller/pcie-mediatek.c             | 180 +++---
 drivers/pci/controller/pcie-rcar-host.c            |   1 -
 drivers/pci/controller/pcie-xilinx-dma-pl.c        |   2 +-
 drivers/pci/controller/pcie-xilinx-nwl.c           |   2 +-
 drivers/pci/controller/plda/pcie-plda-host.c       |   2 +-
 drivers/pci/endpoint/functions/pci-epf-ntb.c       |  21 +-
 drivers/pci/endpoint/functions/pci-epf-vntb.c      |   9 +-
 drivers/pci/msi/msi.c                              |   4 +-
 drivers/pci/pci-sysfs.c                            |  17 +-
 drivers/pci/pci.c                                  | 137 -----
 drivers/pci/pci.h                                  |   4 +
 drivers/pci/rebar.c                                | 197 +++++++
 drivers/pci/rom.c                                  | 149 ++++-
 drivers/pci/setup-bus.c                            | 104 +++-
 drivers/pci/setup-res.c                            |  53 --
 drivers/phy/phy-can-transceiver.c                  |   3 +
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c           |   2 +-
 drivers/pinctrl/mediatek/pinctrl-mt8167.c          |   2 +-
 drivers/pinctrl/mediatek/pinctrl-mt8516.c          |   2 +-
 drivers/pinctrl/meson/pinctrl-meson.c              |   2 +-
 drivers/pinctrl/nuvoton/pinctrl-ma35.c             |   3 +-
 drivers/pinctrl/nuvoton/pinctrl-ma35d1.c           | 470 +++++++++-------
 drivers/pinctrl/sunxi/pinctrl-sunxi.c              |   2 +-
 drivers/platform/x86/amd/pmc/pmc-quirks.c          |  39 ++
 drivers/platform/x86/amd/pmc/pmc.c                 |  83 ++-
 drivers/platform/x86/amd/pmc/pmc.h                 |   2 +
 drivers/platform/x86/dell/dell-laptop.c            |   5 +
 drivers/platform/x86/xo15-ebook.c                  |   7 +-
 drivers/pmdomain/imx/imx8m-blk-ctrl.c              |  46 +-
 drivers/power/sequencing/core.c                    |   9 +-
 drivers/power/supply/charger-manager.c             |   6 +-
 drivers/power/supply/cpcap-battery.c               |  11 +-
 drivers/power/supply/power_supply_core.c           |  11 +-
 drivers/pwm/pwm-imx27.c                            |   8 +-
 drivers/rapidio/devices/tsi721.c                   |   3 +-
 drivers/regulator/core.c                           |   4 +-
 drivers/regulator/ltc3676.c                        |  10 +-
 drivers/remoteproc/qcom_common.c                   |  14 +-
 drivers/reset/reset-imx7.c                         |   6 +
 drivers/reset/reset-sunxi.c                        |   4 +-
 drivers/rpmsg/qcom_glink_native.c                  |   2 -
 drivers/rpmsg/rpmsg_core.c                         |  43 +-
 drivers/rpmsg/virtio_rpmsg_bus.c                   |   1 -
 drivers/rtc/rtc-abx80x.c                           |   3 +-
 drivers/rtc/rtc-cmos.c                             |   6 +
 drivers/rtc/rtc-ds1307.c                           |  30 +-
 drivers/rtc/rtc-mpfs.c                             |   2 +-
 drivers/rtc/rtc-msc313.c                           |   4 +-
 drivers/s390/char/monwriter.c                      |   3 +
 drivers/s390/crypto/pkey_api.c                     |   8 +-
 drivers/s390/crypto/pkey_pckmo.c                   |   4 +
 drivers/s390/crypto/zcrypt_cex2a.c                 |   0
 drivers/s390/crypto/zcrypt_cex2a.h                 |   0
 drivers/s390/crypto/zcrypt_cex2c.c                 |   0
 drivers/s390/crypto/zcrypt_cex2c.h                 |   0
 drivers/scsi/elx/efct/efct_hw.c                    |   2 +
 drivers/scsi/elx/efct/efct_unsol.c                 |   1 +
 drivers/scsi/hpsa.c                                |   4 +
 drivers/scsi/lpfc/lpfc_init.c                      |   3 +-
 drivers/scsi/pm8001/pm8001_ctl.c                   |   5 +-
 drivers/scsi/scsi_scan.c                           |   2 +-
 drivers/scsi/scsi_transport_sas.c                  | 101 ++--
 drivers/scsi/sg.c                                  |   7 +-
 drivers/scsi/smartpqi/smartpqi_init.c              |   2 +-
 drivers/soc/fsl/qe/qe.c                            |   3 +
 drivers/soc/ti/k3-ringacc.c                        |   4 +-
 drivers/soc/xilinx/zynqmp_power.c                  |   4 +-
 drivers/spi/spi-dw.h                               |   1 +
 drivers/spi/spi-ep93xx.c                           |   1 +
 drivers/spi/spi-hisi-kunpeng.c                     |   6 +-
 drivers/spi/spi-meson-spifc.c                      |   1 +
 drivers/spi/spi-rpc-if.c                           |   6 +-
 drivers/spi/spi-sh-msiof.c                         |  10 +-
 drivers/spi/spi-uniphier.c                         |   4 +-
 drivers/spi/spi-xilinx.c                           |  11 +-
 drivers/spi/spi.c                                  |   5 -
 drivers/staging/media/atomisp/i2c/atomisp-gc2235.c |  29 +-
 drivers/staging/media/atomisp/pci/atomisp_cmd.c    |   6 +-
 drivers/staging/media/atomisp/pci/sh_css.c         |   8 +-
 drivers/staging/media/sunxi/cedrus/cedrus.c        |   4 +-
 drivers/staging/most/video/video.c                 |   7 +-
 drivers/staging/nvec/nvec.c                        |   4 +-
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c     |  93 ++--
 drivers/staging/rtl8723bs/core/rtw_security.c      |   2 +-
 drivers/target/iscsi/iscsi_target_auth.c           |   6 +-
 drivers/target/loopback/tcm_loop.c                 |  64 ---
 drivers/target/target_core_fabric_lib.c            |  89 ++-
 drivers/target/target_core_internal.h              |   3 +-
 drivers/target/target_core_pr.c                    |  12 +-
 drivers/thermal/intel/therm_throt.c                |   7 +-
 drivers/thermal/testing/command.c                  |  48 +-
 drivers/thermal/testing/thermal_testing.h          |   8 +
 drivers/thermal/testing/zone.c                     |   7 +-
 drivers/thermal/thermal_hwmon.c                    |   5 +-
 drivers/thunderbolt/debugfs.c                      |   8 +-
 drivers/tty/serial/8250/8250_omap.c                |   3 +-
 drivers/tty/serial/max310x.c                       |  12 +
 drivers/tty/serial/msm_serial.c                    |   3 +-
 drivers/ufs/core/ufshcd.c                          |   2 +-
 drivers/usb/atm/ueagle-atm.c                       |  36 +-
 drivers/usb/gadget/function/f_fs.c                 |   6 +-
 drivers/usb/host/max3421-hcd.c                     |   8 +
 drivers/usb/misc/iowarrior.c                       |  74 +--
 drivers/vdpa/octeon_ep/octep_vdpa_main.c           |   7 +-
 drivers/vdpa/vdpa_user/vduse_dev.c                 |  72 ++-
 drivers/vfio/pci/mlx5/cmd.h                        |  15 +-
 drivers/vfio/pci/qat/main.c                        |  18 +-
 drivers/vhost/net.c                                |  15 +-
 drivers/vhost/vdpa.c                               |  29 +-
 drivers/vhost/vhost.c                              |  11 +-
 drivers/video/fbdev/aty/radeon_base.c              |   1 +
 drivers/video/fbdev/broadsheetfb.c                 |   8 +-
 drivers/video/fbdev/carminefb.c                    |   1 +
 drivers/video/fbdev/core/fbcon.c                   |   7 +-
 drivers/video/fbdev/efifb.c                        |   1 +
 drivers/video/fbdev/hecubafb.c                     |   6 +-
 drivers/video/fbdev/i740fb.c                       |   1 +
 drivers/video/fbdev/metronomefb.c                  |   8 +-
 drivers/video/fbdev/nvidia/nvidia.c                |   1 +
 drivers/video/fbdev/s3fb.c                         |   1 +
 drivers/video/fbdev/sm501fb.c                      |  16 +-
 drivers/video/fbdev/sm712.h                        |   2 +-
 drivers/video/fbdev/tdfxfb.c                       |   1 +
 drivers/video/fbdev/tridentfb.c                    |   1 +
 drivers/video/fbdev/uvesafb.c                      |   4 +-
 drivers/video/fbdev/vesafb.c                       |   1 +
 drivers/watchdog/sama5d4_wdt.c                     |  48 +-
 drivers/watchdog/sp5100_tco.c                      |   3 +-
 drivers/watchdog/sprd_wdt.c                        |   5 +-
 drivers/watchdog/watchdog_core.c                   |   3 +
 drivers/xen/gntdev.c                               |   8 +-
 drivers/xen/xen-scsiback.c                         |  30 +-
 fs/9p/vfs_addr.c                                   |   3 +-
 fs/9p/vfs_inode.c                                  |   9 +
 fs/afs/callback.c                                  |   7 +-
 fs/afs/cell.c                                      |  43 +-
 fs/afs/cmservice.c                                 |   2 -
 fs/afs/dir.c                                       |   5 +-
 fs/afs/dynroot.c                                   | 509 ++++++++---------
 fs/afs/file.c                                      |  15 +-
 fs/afs/fs_operation.c                              |   2 +-
 fs/afs/inode.c                                     |   1 -
 fs/afs/internal.h                                  |  12 +-
 fs/afs/main.c                                      |   3 +
 fs/afs/proc.c                                      |  10 +-
 fs/afs/rxrpc.c                                     |  11 +-
 fs/afs/super.c                                     |  16 +-
 fs/afs/vl_list.c                                   |  10 +-
 fs/afs/volume.c                                    |   2 +-
 fs/btrfs/btrfs_inode.h                             |   3 +-
 fs/btrfs/compression.c                             |   2 +-
 fs/btrfs/direct-io.c                               |  69 ++-
 fs/btrfs/disk-io.c                                 |  16 +-
 fs/btrfs/extent-tree.c                             |   5 +-
 fs/btrfs/extent_io.c                               | 106 ++--
 fs/btrfs/file.c                                    |  27 +-
 fs/btrfs/fs.h                                      |   7 -
 fs/btrfs/inode.c                                   | 228 ++------
 fs/btrfs/ordered-data.c                            |  41 +-
 fs/btrfs/ordered-data.h                            |   8 +-
 fs/btrfs/reflink.c                                 | 106 ++--
 fs/btrfs/super.c                                   |   3 +-
 fs/ceph/addr.c                                     |  13 +-
 fs/configfs/dir.c                                  |  57 +-
 fs/crypto/fscrypt_private.h                        |  87 +--
 fs/crypto/inline_crypt.c                           |   8 +-
 fs/crypto/keyring.c                                | 239 ++++----
 fs/crypto/keysetup.c                               | 121 ++--
 fs/dlm/midcomms.c                                  |   4 +-
 fs/efs/file.c                                      |  21 +-
 fs/eventpoll.c                                     | 609 ++++++++++++++-------
 fs/exfat/dir.c                                     |  49 +-
 fs/exfat/exfat_fs.h                                |   7 +-
 fs/exfat/inode.c                                   |   2 +-
 fs/exfat/namei.c                                   | 206 +++----
 fs/ext2/file.c                                     |   9 +-
 fs/ext4/inode.c                                    |   3 +-
 fs/ext4/ioctl.c                                    |  15 +-
 fs/fhandle.c                                       |   2 +-
 fs/fs-writeback.c                                  |   5 -
 fs/hfs/bfind.c                                     |   2 +-
 fs/hfs/bnode.c                                     |  54 +-
 fs/hfs/brec.c                                      |   2 +-
 fs/hfs/btree.c                                     |   2 +-
 fs/hfs/btree.h                                     |  71 +--
 fs/hfs/hfs_fs.h                                    |  88 +--
 fs/hfs/inode.c                                     |   3 +-
 fs/hfsplus/bfind.c                                 |   2 +-
 fs/hfsplus/bnode.c                                 |  60 +-
 fs/hfsplus/brec.c                                  |   2 +-
 fs/hfsplus/btree.c                                 |   2 +-
 fs/hfsplus/hfsplus_fs.h                            |  40 +-
 fs/jbd2/journal.c                                  |   2 +
 fs/lockd/svcsubs.c                                 |   4 +-
 fs/minix/minix.h                                   |   2 +-
 fs/namei.c                                         |  24 +-
 fs/netfs/buffered_read.c                           |  16 +-
 fs/netfs/objects.c                                 |  15 +-
 fs/netfs/read_collect.c                            |  47 +-
 fs/netfs/write_issue.c                             |  11 +-
 fs/nfs/callback_proc.c                             |   9 +-
 fs/nfs/delegation.c                                |   9 +-
 fs/nfs/filelayout/filelayout.c                     |   2 +
 fs/nfs/flexfilelayout/flexfilelayout.c             |  29 +
 fs/nfs/flexfilelayout/flexfilelayout.h             |  16 +
 fs/nfs/fscache.c                                   |   6 +-
 fs/nfs/fscache.h                                   |   3 +-
 fs/nfs/internal.h                                  |  12 +-
 fs/nfs/nfs4proc.c                                  |  22 +-
 fs/nfs/pnfs.c                                      |   4 +-
 fs/nfs/pnfs_nfs.c                                  |   2 +-
 fs/nfs/read.c                                      |  25 +-
 fs/nfs/write.c                                     |  14 +-
 fs/nfsd/nfs4state.c                                |  16 +-
 fs/nilfs2/super.c                                  |   2 -
 fs/ntfs3/fslog.c                                   | 147 ++++-
 fs/ntfs3/index.c                                   |  45 +-
 fs/ntfs3/lznt.c                                    |   2 +-
 fs/ntfs3/namei.c                                   |   2 +-
 fs/ntfs3/ntfs_fs.h                                 |   3 +-
 fs/ntfs3/run.c                                     |   9 +-
 fs/ocfs2/alloc.c                                   |   2 +-
 fs/ocfs2/aops.c                                    |  13 +-
 fs/ocfs2/buffer_head_io.c                          |   7 +-
 fs/ocfs2/dlm/dlmdebug.c                            |  16 +-
 fs/ocfs2/dlmglue.c                                 |  17 +
 fs/ocfs2/inode.c                                   | 150 ++++-
 fs/ocfs2/journal.c                                 |  13 +-
 fs/ocfs2/journal.h                                 |   3 +
 fs/ocfs2/move_extents.c                            |   4 +-
 fs/ocfs2/ocfs2.h                                   |   2 -
 fs/ocfs2/quota_local.c                             |   2 +-
 fs/ocfs2/stack_user.c                              |  10 +-
 fs/ocfs2/super.c                                   |   2 -
 fs/ocfs2/sysfile.c                                 |   9 +-
 fs/orangefs/dir.c                                  |   7 +-
 fs/overlayfs/inode.c                               |   4 +-
 fs/proc/array.c                                    |  15 +-
 fs/proc/base.c                                     | 184 +++----
 fs/proc/fd.c                                       |  31 +-
 fs/proc/generic.c                                  |   9 +-
 fs/proc/internal.h                                 |   6 +-
 fs/proc/namespaces.c                               |  16 +-
 fs/proc/proc_net.c                                 |   2 +-
 fs/proc/task_mmu.c                                 |  61 ++-
 fs/smb/client/cifs_swn.c                           | 329 ++++++++---
 fs/smb/client/cifssmb.c                            |  10 +-
 fs/smb/client/connect.c                            |   3 +
 fs/smb/client/file.c                               |   4 +-
 fs/smb/client/inode.c                              |  30 +-
 fs/smb/client/ioctl.c                              |  12 +-
 fs/smb/client/misc.c                               |   8 +
 fs/smb/client/smb2ops.c                            |  38 +-
 fs/smb/client/smb2pdu.c                            |  10 +-
 fs/smb/client/trace.h                              |   2 +
 fs/smb/server/connection.c                         | 101 +++-
 fs/smb/server/connection.h                         |   6 +
 fs/smb/server/misc.c                               |  33 --
 fs/smb/server/misc.h                               |   1 -
 fs/smb/server/oplock.c                             |  13 +-
 fs/smb/server/server.c                             |  12 +
 fs/smb/server/smb2pdu.c                            |  53 +-
 fs/smb/server/smbacl.c                             |   7 +-
 fs/smb/server/vfs.c                                |  78 +--
 fs/smb/server/vfs_cache.c                          | 114 +++-
 fs/smb/server/vfs_cache.h                          |   1 +
 fs/sysfs/file.c                                    |   4 +
 fs/udf/super.c                                     |   2 +-
 include/acpi/acpi_bus.h                            |   2 +
 include/asm-generic/bitops/lock.h                  |  22 +-
 include/dt-bindings/power/fsl,imx93-power.h        |   1 +
 include/linux/amba/bus.h                           |   5 -
 include/linux/bpf.h                                |  14 +-
 include/linux/bpf_local_storage.h                  |   3 -
 include/linux/bpf_lsm.h                            |   4 +
 include/linux/cdx/cdx_bus.h                        |   4 -
 include/linux/device.h                             |   5 +-
 include/linux/dpll.h                               |  55 ++
 include/linux/filter.h                             |  15 +-
 include/linux/gfp.h                                |   4 +
 include/linux/hid.h                                |  29 +
 include/linux/host1x.h                             |   7 +
 include/linux/hyperv.h                             |   5 -
 include/linux/i3c/master.h                         |   2 +-
 include/linux/inetdevice.h                         |   5 +
 include/linux/iommu.h                              |   2 +-
 include/linux/jiffies.h                            |  15 +-
 include/linux/namei.h                              |   7 +-
 include/linux/netfs.h                              |   7 +-
 include/linux/nfs_page.h                           |   1 +
 include/linux/nfs_xdr.h                            |   1 -
 include/linux/pci.h                                |   4 +-
 include/linux/rpmsg.h                              |   4 -
 include/linux/rtnetlink.h                          |  63 ++-
 include/linux/seqlock.h                            | 110 ++++
 include/linux/slab.h                               | 100 ++++
 include/linux/sunrpc/clnt.h                        |   1 +
 include/linux/sunrpc/xprt.h                        |   2 +
 include/linux/vmalloc.h                            |   4 +-
 include/linux/workqueue.h                          |   1 +
 include/net/addrconf.h                             |  15 +-
 include/net/bluetooth/hci.h                        |  21 +-
 include/net/bluetooth/hci_core.h                   |  49 +-
 include/net/bluetooth/l2cap.h                      |  13 +-
 include/net/dropreason-core.h                      |  21 +-
 include/net/fib_rules.h                            |   5 +
 include/net/gue.h                                  |   2 +-
 include/net/ip_fib.h                               |   7 +-
 include/net/ip_vs.h                                |   3 +-
 include/net/net_namespace.h                        |   4 +
 include/net/netfilter/nf_conntrack_extend.h        |  12 -
 include/net/netfilter/nf_queue.h                   |   1 +
 include/net/scm.h                                  |   4 +-
 include/net/sctp/sctp.h                            |   3 +-
 include/net/tc_act/tc_pedit.h                      |  18 +-
 include/net/udp_tunnel.h                           |  86 ++-
 include/net/xfrm.h                                 |  15 +-
 include/trace/events/afs.h                         |   4 +
 include/uapi/linux/bpf.h                           |   1 +
 include/uapi/linux/dpll.h                          |   1 +
 io_uring/rw.c                                      |  13 +-
 kernel/bpf/bpf_inode_storage.c                     |   9 +
 kernel/bpf/bpf_lsm.c                               |   3 +
 kernel/bpf/cgroup.c                                | 108 ++--
 kernel/bpf/core.c                                  |  85 ++-
 kernel/bpf/devmap.c                                |  12 +
 kernel/bpf/dispatcher.c                            |   2 +-
 kernel/bpf/hashtab.c                               |  21 +-
 kernel/bpf/helpers.c                               |  12 +-
 kernel/bpf/inode.c                                 |  13 +-
 kernel/bpf/lpm_trie.c                              |  11 +-
 kernel/bpf/syscall.c                               |   5 +-
 kernel/bpf/verifier.c                              |   3 +-
 kernel/cgroup/cpuset.c                             |   7 +-
 kernel/cpu.c                                       |  20 +-
 kernel/fork.c                                      |   9 +-
 kernel/kcov.c                                      |   4 +-
 kernel/sched/core.c                                |   1 +
 kernel/sched/debug.c                               |   9 +-
 kernel/sched/fair.c                                |  25 +-
 kernel/taskstats.c                                 |  62 ++-
 kernel/time/jiffies.c                              |  16 +-
 kernel/time/posix-cpu-timers.c                     |   2 +-
 kernel/time/tick-sched.c                           |  11 +-
 kernel/time/time.c                                 |   2 +-
 kernel/time/timekeeping.c                          |   7 +-
 kernel/trace/bpf_trace.c                           |  11 +-
 kernel/trace/ring_buffer.c                         |   3 +-
 kernel/trace/trace_eprobe.c                        |   2 +-
 kernel/trace/trace_events_hist.c                   |  41 +-
 kernel/trace/trace_events_user.c                   |  43 +-
 kernel/trace/trace_osnoise.c                       |   4 +-
 kernel/trace/trace_probe.c                         |   1 +
 kernel/trace/trace_probe.h                         |   2 +-
 kernel/workqueue.c                                 |   2 +-
 lib/test_meminit.c                                 |   2 +-
 mm/compaction.c                                    |   7 +-
 mm/damon/core.c                                    |  51 +-
 mm/damon/sysfs-schemes.c                           |  17 +-
 mm/memory_hotplug.c                                |   2 +-
 mm/mm_init.c                                       |  13 +-
 mm/numa_emulation.c                                |  17 +-
 mm/swap_cgroup.c                                   |   6 +
 net/9p/client.c                                    |   2 +
 net/9p/trans_rdma.c                                |  19 +-
 net/Kconfig.debug                                  |  15 +
 net/atm/common.c                                   |   2 +
 net/batman-adv/distributed-arp-table.c             |  30 +-
 net/batman-adv/fragmentation.c                     |   8 +-
 net/batman-adv/gateway_client.c                    |   3 +-
 net/batman-adv/main.c                              |  13 +-
 net/batman-adv/multicast_forw.c                    |   7 +-
 net/batman-adv/routing.c                           |   3 +-
 net/batman-adv/soft-interface.c                    |  17 +-
 net/batman-adv/soft-interface.h                    |   2 +
 net/batman-adv/translation-table.c                 |   5 +-
 net/bluetooth/6lowpan.c                            |  74 +--
 net/bluetooth/eir.c                                |   8 +-
 net/bluetooth/hci_codec.c                          |   2 +-
 net/bluetooth/hci_conn.c                           |  62 +--
 net/bluetooth/hci_core.c                           |  83 +--
 net/bluetooth/hci_event.c                          |  28 +-
 net/bluetooth/hci_sync.c                           | 179 +++++-
 net/bluetooth/iso.c                                |   4 +-
 net/bluetooth/l2cap_core.c                         | 206 +++++--
 net/bluetooth/l2cap_sock.c                         | 103 ++--
 net/bluetooth/mgmt.c                               |   5 +-
 net/bluetooth/msft.c                               |   2 +-
 net/bluetooth/sco.c                                |  62 ++-
 net/bluetooth/smp.c                                |  27 +-
 net/bridge/br_cfm.c                                |   6 +
 net/bridge/br_cfm_netlink.c                        |   4 +-
 net/bridge/br_if.c                                 |   3 +
 net/bridge/br_stp.c                                |   3 +-
 net/bridge/netfilter/ebtables.c                    |  13 +-
 net/bridge/netfilter/nft_meta_bridge.c             |   4 +-
 net/can/bcm.c                                      | 127 ++++-
 net/can/isotp.c                                    |   9 +-
 net/core/dev.c                                     |   2 +
 net/core/fib_rules.c                               |   6 +-
 net/core/filter.c                                  |  28 +-
 net/core/flow_dissector.c                          |  12 +-
 net/core/lwt_bpf.c                                 |  12 +
 net/core/net_namespace.c                           |   6 +
 net/core/netdev-genl.c                             |   4 +-
 net/core/rtnetlink.c                               |  81 +++
 net/devlink/rate.c                                 |  10 +-
 net/handshake/genl.c                               |   2 +-
 net/ieee802154/core.c                              |   2 +-
 net/ieee802154/header_ops.c                        |   9 +-
 net/ieee802154/ieee802154.h                        |  17 +
 net/ieee802154/netlink.c                           |  36 +-
 net/ife/ife.c                                      |   2 +-
 net/ipv4/igmp.c                                    |  14 +-
 net/ipv4/inet_connection_sock.c                    |   6 +
 net/ipv4/ip_vti.c                                  |   3 +
 net/ipv4/ipip.c                                    |   3 +
 net/ipv4/netfilter/nf_reject_ipv4.c                |   2 +-
 net/ipv4/udp_tunnel_core.c                         |  16 +-
 net/ipv4/udp_tunnel_nic.c                          |  80 ++-
 net/ipv6/addrconf.c                                | 101 ++--
 net/ipv6/ip6_fib.c                                 |  17 +-
 net/ipv6/ip6_gre.c                                 |   6 +
 net/ipv6/ip6_vti.c                                 |   3 +
 net/ipv6/mcast.c                                   | 165 +++---
 net/ipv6/ndisc.c                                   |   8 +-
 net/ipv6/netfilter.c                               |   4 +-
 net/ipv6/netfilter/ip6t_ah.c                       |   5 +
 net/ipv6/netfilter/ip6t_hbh.c                      |   1 +
 net/ipv6/netfilter/ip6t_rt.c                       |   3 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c            |   3 +-
 net/ipv6/route.c                                   |   9 +-
 net/ipv6/seg6.c                                    |   3 +
 net/ipv6/sit.c                                     |   3 +
 net/kcm/kcmsock.c                                  |   8 +-
 net/llc/af_llc.c                                   |   1 +
 net/llc/llc_conn.c                                 |   1 -
 net/mac80211/main.c                                |   3 +-
 net/mac80211/tx.c                                  |  17 +-
 net/mac802154/iface.c                              |   2 +-
 net/mac802154/scan.c                               |   1 +
 net/netfilter/ipset/ip_set_core.c                  |   4 +-
 net/netfilter/ipset/ip_set_hash_gen.h              |  69 ++-
 net/netfilter/ipvs/ip_vs_app.c                     |  10 +-
 net/netfilter/ipvs/ip_vs_conn.c                    |   4 +-
 net/netfilter/ipvs/ip_vs_core.c                    |  36 +-
 net/netfilter/ipvs/ip_vs_proto_sctp.c              |  18 +-
 net/netfilter/ipvs/ip_vs_proto_tcp.c               |  11 +-
 net/netfilter/ipvs/ip_vs_proto_udp.c               |   3 +-
 net/netfilter/ipvs/ip_vs_xmit.c                    |   6 +-
 net/netfilter/nf_conncount.c                       |  23 +-
 net/netfilter/nf_conntrack_core.c                  |  83 +--
 net/netfilter/nf_conntrack_ecache.c                |   2 +-
 net/netfilter/nf_conntrack_extend.c                |  32 +-
 net/netfilter/nf_conntrack_irc.c                   |   6 +-
 net/netfilter/nf_conntrack_seqadj.c                |   2 +
 net/netfilter/nf_nat_core.c                        |  10 +
 net/netfilter/nf_nat_sip.c                         |  11 +
 net/netfilter/nf_queue.c                           |  14 +
 net/netfilter/nf_synproxy_core.c                   |  40 +-
 net/netfilter/nfnetlink_cthelper.c                 |  24 +-
 net/netfilter/nfnetlink_osf.c                      |   6 +-
 net/netfilter/nfnetlink_queue.c                    |   3 +
 net/netfilter/nft_compat.c                         |  24 +-
 net/netfilter/nft_lookup.c                         |  10 +-
 net/netfilter/nft_set_pipapo.c                     |  34 +-
 net/netfilter/nft_set_pipapo.h                     |   8 +
 net/netfilter/nft_synproxy.c                       |   9 +-
 net/netfilter/xt_cluster.c                         |   2 +-
 net/netfilter/xt_connmark.c                        |  14 +-
 net/netfilter/xt_nat.c                             |   9 +
 net/netfilter/xt_rateest.c                         |   2 +-
 net/netfilter/xt_u32.c                             |  12 +-
 net/openvswitch/conntrack.c                        |   2 +-
 net/openvswitch/flow_netlink.c                     | 201 +++++--
 net/psample/psample.c                              |   6 +-
 net/qrtr/af_qrtr.c                                 |   2 +-
 net/rxrpc/recvmsg.c                                |   5 +-
 net/sched/act_api.c                                |  13 +-
 net/sched/act_bpf.c                                |   2 +-
 net/sched/act_ct.c                                 |  13 +-
 net/sched/act_pedit.c                              |  13 +-
 net/sched/cls_api.c                                |  25 +-
 net/sched/cls_bpf.c                                |  10 +-
 net/sched/cls_flow.c                               |  12 +-
 net/sched/sch_cake.c                               |   5 +-
 net/sched/sch_codel.c                              |  48 +-
 net/sched/sch_drr.c                                |   8 +-
 net/sched/sch_fq_codel.c                           |  41 +-
 net/sched/sch_hfsc.c                               |  24 +-
 net/sched/sch_hhf.c                                |  27 +
 net/sched/sch_htb.c                                |  14 +-
 net/sched/sch_multiq.c                             |   2 +-
 net/sched/sch_taprio.c                             |   2 +-
 net/sched/sch_teql.c                               | 126 +++--
 net/sctp/diag.c                                    |  67 ++-
 net/sctp/sm_make_chunk.c                           |  10 +-
 net/sctp/sm_statefuns.c                            |  23 +-
 net/sctp/socket.c                                  |  38 +-
 net/smc/smc_cdc.c                                  |  15 +-
 net/smc/smc_loopback.c                             |   5 +
 net/sunrpc/clnt.c                                  |  19 +-
 net/sunrpc/svcsock.c                               |  10 +
 net/sunrpc/xdr.c                                   |  14 +-
 net/sunrpc/xprt.c                                  |  16 +
 net/sunrpc/xprtrdma/backchannel.c                  |   5 +-
 net/sunrpc/xprtrdma/frwr_ops.c                     |   2 +-
 net/sunrpc/xprtrdma/rpc_rdma.c                     | 171 ++++--
 net/sunrpc/xprtrdma/transport.c                    |  85 ++-
 net/sunrpc/xprtrdma/verbs.c                        | 126 ++++-
 net/sunrpc/xprtrdma/xprt_rdma.h                    |   4 +-
 net/sunrpc/xprtsock.c                              |  16 +-
 net/tipc/bearer.c                                  |   1 +
 net/tipc/core.c                                    |   5 +
 net/tipc/discover.c                                |  14 +-
 net/tipc/name_distr.c                              |  13 +-
 net/tipc/netlink.c                                 |  12 +
 net/tipc/socket.c                                  |   3 +
 net/tls/tls_sw.c                                   |  11 +
 net/unix/af_unix.c                                 |  94 ++--
 net/vmw_vsock/virtio_transport_common.c            |  88 ++-
 net/wireless/nl80211.c                             |   2 +-
 net/xfrm/espintcp.c                                |  34 +-
 net/xfrm/xfrm_interface_core.c                     |   3 +
 net/xfrm/xfrm_policy.c                             |  27 +-
 net/xfrm/xfrm_state.c                              |  26 +-
 net/xfrm/xfrm_user.c                               |  20 +-
 rust/kernel/alloc/kvec.rs                          |   4 +-
 rust/kernel/block/mq/gen_disk.rs                   |  15 +-
 rust/kernel/block/mq/request.rs                    |   2 +
 samples/trace_events/trace-events-sample.c         |   4 +
 scripts/kconfig/conf.c                             |   6 +-
 security/apparmor/apparmorfs.c                     | 111 +++-
 security/apparmor/domain.c                         |  58 +-
 security/apparmor/include/apparmorfs.h             |  12 +
 security/apparmor/label.c                          |   2 +-
 security/apparmor/net.c                            |   1 +
 security/apparmor/policy.c                         |  20 +-
 security/apparmor/procattr.c                       |   2 +
 security/bpf/hooks.c                               |   3 +
 security/integrity/evm/evm_secfs.c                 |  16 +-
 security/keys/keyring.c                            |   2 +-
 security/landlock/net.c                            |  11 +-
 security/selinux/hooks.c                           |  80 ++-
 sound/aoa/fabrics/layout.c                         |   6 +
 sound/core/init.c                                  |  11 +-
 sound/core/seq/seq_clientmgr.c                     |  33 +-
 sound/core/seq/seq_memory.c                        |   2 +-
 sound/core/seq/seq_midi.c                          |  55 +-
 sound/pci/hda/cs35l41_hda.c                        |  77 ++-
 sound/pci/hda/cs35l41_hda.h                        |   5 +
 sound/soc/amd/acp/acp-sdw-sof-mach.c               |   7 +-
 sound/soc/codecs/adau1372.c                        |   5 +
 sound/soc/codecs/aw88261.c                         |  12 +-
 sound/soc/codecs/cs35l56-shared.c                  |   1 +
 sound/soc/codecs/cs35l56.c                         |  14 +-
 sound/soc/codecs/hdac_hdmi.c                       |   4 +-
 sound/soc/codecs/lpass-va-macro.c                  |   8 +-
 sound/soc/codecs/tlv320aic3x.c                     |  25 +-
 sound/soc/fsl/fsl_asrc_dma.c                       |  20 +
 sound/soc/fsl/fsl_audmix.c                         |   6 +
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c         |  11 +
 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c         |   9 +
 sound/soc/qcom/qdsp6/q6apm.c                       |   8 +
 sound/soc/sh/rcar/rsnd.h                           |   2 +-
 sound/soc/sof/ipc3-control.c                       |  79 ++-
 sound/soc/sof/ipc4-control.c                       |  11 +-
 sound/soc/sof/topology.c                           |   5 +-
 sound/soc/tegra/tegra210_ahub.c                    |   4 +-
 sound/usb/midi2.c                                  |   5 +
 sound/usb/mixer_scarlett2.c                        | 201 ++++++-
 tools/bpf/bpftool/cgroup.c                         |  14 +-
 tools/bpf/bpftool/gen.c                            |   2 +-
 tools/bpf/bpftool/net.c                            |   4 +-
 tools/include/uapi/linux/bpf.h                     |   1 +
 tools/include/uapi/linux/mount.h                   | 235 ++++++++
 tools/include/uapi/linux/nsfs.h                    |  45 ++
 tools/lib/api/fs/fs.c                              |  19 +-
 tools/lib/bpf/libbpf.c                             |   9 +-
 tools/lib/bpf/strset.c                             |  62 ++-
 tools/lib/bpf/usdt.c                               |  16 +-
 tools/lib/symbol/kallsyms.c                        |   5 +-
 tools/perf/Documentation/perf-inject.txt           |   5 +
 tools/perf/Documentation/perf-sched.txt            |   8 +
 tools/perf/arch/arm64/util/header.c                |   1 -
 tools/perf/arch/common.c                           |   4 +-
 tools/perf/bench/inject-buildid.c                  |   9 +-
 tools/perf/builtin-annotate.c                      |   3 +-
 tools/perf/builtin-buildid-cache.c                 |  12 +-
 tools/perf/builtin-buildid-list.c                  |  10 +-
 tools/perf/builtin-c2c.c                           |  24 +-
 tools/perf/builtin-diff.c                          |   3 +-
 tools/perf/builtin-inject.c                        | 197 ++++++-
 tools/perf/builtin-report.c                        |  14 +-
 tools/perf/builtin-sched.c                         | 261 ++++++---
 tools/perf/builtin-script.c                        |   1 +
 tools/perf/builtin-stat.c                          |  50 +-
 tools/perf/include/perf/perf_dlfilter.h            |   2 +-
 tools/perf/tests/dlfilter-test.c                   |   8 +-
 tools/perf/tests/dso-data.c                        |   4 +-
 tools/perf/tests/pmu-events.c                      |  24 +-
 tools/perf/tests/sample-parsing.c                  |   5 +-
 tools/perf/tests/sdt.c                             |   2 +-
 tools/perf/tests/symbols.c                         |   4 +-
 tools/perf/util/arm-spe.c                          | 221 +++++++-
 tools/perf/util/bpf-event.c                        |  18 +-
 tools/perf/util/bpf-utils.c                        |  16 +
 tools/perf/util/build-id.c                         |  40 +-
 tools/perf/util/build-id.h                         |   6 +-
 tools/perf/util/cpumap.c                           |  28 +-
 tools/perf/util/cs-etm-base.c                      |   4 +-
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c    |  21 +-
 tools/perf/util/cs-etm.c                           | 311 +++++++----
 tools/perf/util/cs-etm.h                           |   8 +-
 tools/perf/util/debuginfo.c                        |   9 +-
 tools/perf/util/disasm.c                           |   2 +-
 tools/perf/util/dso.c                              | 276 +++++++---
 tools/perf/util/dso.h                              |  93 ++--
 tools/perf/util/dsos.c                             |  20 +-
 tools/perf/util/env.h                              |  14 +
 tools/perf/util/event.c                            |  17 +-
 tools/perf/util/event.h                            |   1 +
 tools/perf/util/header.c                           |  56 +-
 tools/perf/util/hist.c                             |   7 +-
 tools/perf/util/intel-bts.c                        |   3 +-
 .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  11 +-
 tools/perf/util/intel-pt.c                         |  27 +-
 tools/perf/util/machine.c                          |  70 +--
 tools/perf/util/map.c                              |  15 +-
 tools/perf/util/map.h                              |   5 +-
 tools/perf/util/maps.c                             | 156 ++++--
 tools/perf/util/maps.h                             |   3 +
 tools/perf/util/mmap.c                             |  18 +-
 tools/perf/util/pmu.c                              |  10 +-
 tools/perf/util/probe-event.c                      |   4 +-
 tools/perf/util/probe-file.c                       |   4 +-
 tools/perf/util/probe-finder.c                     |   2 +-
 .../util/scripting-engines/trace-event-python.c    |   7 +-
 tools/perf/util/sort.c                             |  27 +-
 tools/perf/util/svghelper.c                        |  10 +-
 tools/perf/util/symbol-elf.c                       | 116 ++--
 tools/perf/util/symbol-minimal.c                   |  16 +-
 tools/perf/util/symbol.c                           |  21 +-
 tools/perf/util/synthetic-events.c                 |  48 +-
 tools/perf/util/synthetic-events.h                 |   6 +-
 tools/perf/util/thread.c                           |   5 +
 tools/perf/util/unwind-libunwind-local.c           |  16 +-
 tools/power/x86/intel-speed-select/isst-daemon.c   |   9 +-
 tools/testing/cxl/test/cxl.c                       |  10 +-
 tools/testing/cxl/test/mem.c                       |   6 +-
 .../selftests/bpf/prog_tests/fill_link_info.c      |   2 +-
 .../selftests/bpf/prog_tests/verifier_log.c        |   1 +
 .../selftests/bpf/progs/bpf_iter_task_vmas.c       |   2 +-
 .../testing/selftests/bpf/progs/test_tunnel_kern.c |  13 +-
 tools/testing/selftests/bpf/progs/xdp_flowtable.c  |   7 +-
 tools/testing/selftests/bpf/vmtest.sh              |   2 +-
 .../selftests/filesystems/statmount/Makefile       |   3 +-
 .../selftests/filesystems/statmount/statmount.h    |  36 ++
 .../ftrace/test.d/00basic/test_ownership.tc        |   2 +-
 tools/testing/selftests/hid/Makefile               |   2 +-
 tools/testing/selftests/hid/hid_bpf.c              |  36 +-
 tools/testing/selftests/hid/progs/hid.c            |  15 +
 .../selftests/landlock/scoped_signal_test.c        | 237 +++++++-
 .../selftests/mm/charge_reserved_hugetlb.sh        |   3 +-
 tools/testing/selftests/mm/compaction_test.c       |   3 +
 tools/testing/selftests/mm/hmm-tests.c             |  63 ++-
 tools/testing/selftests/mm/hugepage-mremap.c       |  32 +-
 tools/testing/selftests/mm/pkey-arm64.h            |   3 +-
 tools/testing/selftests/net/lib.sh                 |  25 +-
 tools/testing/selftests/net/tcp_mmap.c             |   4 +
 tools/virtio/vringh_test.c                         |   5 +
 virt/kvm/kvm_main.c                                |  16 +-
 1201 files changed, 17287 insertions(+), 9232 deletions(-)