6.12.114-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 1/869 spi: mpc52xx: clean up interrupt handling
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 76645c1fd682c9df746c3f7c149b868ceff914fb ]
The driver is relying on the assumption that the invalid interrupt 0 can be freed without any side effects, but that is not the case on architectures like x86 where it would trigger a warning about freeing an already free interrupt.
This should not cause any trouble on powerpc where this driver is used, but make the code more portable (and obviously correct) by making sure that the interrupts have been requested before freeing them.
--- drivers/spi/spi-mpc52xx.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
drivers/spi/spi-mpc52xx.c +16 -10
@@ -475,13 +475,15 @@ static int mpc52xx_spi_probe(struct platform_device *op)if (ms->irq0 && ms->irq1) { rc =request_irq (ms->irq0, mpc52xx_spi_irq,0 ,"mpc5200-spi-modf" , ms); - rc |=request_irq (ms->irq1, mpc52xx_spi_irq,0 , -"mpc5200-spi-spif" , ms); -if (rc) { -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); - ms->irq0 = ms->irq1 =0 ; +if (rc ==0 ) { + rc =request_irq (ms->irq1, mpc52xx_spi_irq,0 , +"mpc5200-spi-spif" , ms); +if (rc) +free_irq (ms->irq0, ms); } + +if (rc) + ms->irq0 = ms->irq1 =0 ; }else {/* operate in polled mode */ ms->irq0 = ms->irq1 =0 ;
@@ -501,8 +503,10 @@ static int mpc52xx_spi_probe(struct platform_device *op) err_register:dev_err (&ms->host->dev,"initialization failed\n" ); -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); +if (ms->irq0) { +free_irq (ms->irq0, ms); +free_irq (ms->irq1, ms); + }cancel_work_sync (&ms->work); err_gpio:while (i-- >0 )
@@ -525,8 +529,10 @@ static void mpc52xx_spi_remove(struct platform_device *op)spi_unregister_controller (host); -free_irq (ms->irq0, ms); -free_irq (ms->irq1, ms); +if (ms->irq0) { +free_irq (ms->irq0, ms); +free_irq (ms->irq1, ms); + }cancel_work_sync (&ms->work);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 10/869 xfs: catch stale AGF/AGF metadata
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit db6a2274162de615ff74b927d38942fe3134d298 ]
There is a race condition that can trigger in dmflakey fstests that can result in asserts in xfs_ialloc_read_agi() and xfs_alloc_read_agf() firing. The asserts look like this:
XFS: Assertion failed: pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks), file: fs/xfs/libxfs/xfs_alloc.c, line: 3440
.....
Call Trace: <TASK> xfs_alloc_read_agf+0x2ad/0x3a0 xfs_alloc_fix_freelist+0x280/0x720 xfs_alloc_vextent_prepare_ag+0x42/0x120 xfs_alloc_vextent_iterate_ags+0x67/0x260 xfs_alloc_vextent_start_ag+0xe4/0x1c0 xfs_bmapi_allocate+0x6fe/0xc90 xfs_bmapi_convert_delalloc+0x338/0x560 xfs_map_blocks+0x354/0x580 iomap_writepages+0x52b/0xa70 xfs_vm_writepages+0xd7/0x100 do_writepages+0xe1/0x2c0 __writeback_single_inode+0x44/0x340 writeback_sb_inodes+0x2d0/0x570 __writeback_inodes_wb+0x9c/0xf0 wb_writeback+0x139/0x2d0 wb_workfn+0x23e/0x4c0 process_scheduled_works+0x1d4/0x400 worker_thread+0x234/0x2e0 kthread+0x147/0x170 ret_from_fork+0x3e/0x50 ret_from_fork_asm+0x1a/0x30
I've seen the AGI variant from scrub running on the filesysetm after unmount failed due to systemd interference:
XFS: Assertion failed: pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) || xfs_is_shutdown(pag->pag_mount), file: fs/xfs/libxfs/xfs_ialloc.c, line: 2804
.....
Call Trace: <TASK> xfs_ialloc_read_agi+0xee/0x150 xchk_perag_drain_and_lock+0x7d/0x240 xchk_ag_init+0x34/0x90 xchk_inode_xref+0x7b/0x220 xchk_inode+0x14d/0x180 xfs_scrub_metadata+0x2e2/0x510 xfs_ioc_scrub_metadata+0x62/0xb0 xfs_file_ioctl+0x446/0xbf0 __se_sys_ioctl+0x6f/0xc0 __x64_sys_ioctl+0x1d/0x30 x64_sys_call+0x1879/0x2ee0 do_syscall_64+0x68/0x130 ? exc_page_fault+0x62/0xc0 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Essentially, it is the same problem. When _flakey_drop_and_remount() loads the drop-writes table, it makes all writes silently fail. Writes are reported to the fs as completed successfully, but they are not issued to the backing store. The filesystem sees the successful write completion and marks the metadata buffer clean and removes it from the AIL.
If this happens at the same time as memory pressure is occuring, the now-clean AGF and/or AGI buffers can be reclaimed from memory.
Shortly afterwards, but before _flakey_drop_and_remount() runs unmount, background writeback is kicked and it tries to allocate blocks for the dirty pages in memory. This then tries to access the AGF buffer we just turfed out of memory. It's not found, so it gets read in from disk.
This is all fine, except for the fact that the last writeback of the AGF did not actually reach disk. The AGF on disk is stale compared to the in-memory state held by the perag, and so they don't match and the assert fires.
Then other operations on that inode hang because the task was killed whilst holding inode locks. e.g:
Workqueue: xfs-conv/dm-12 xfs_end_io Call Trace: <TASK> __schedule+0x650/0xb10 schedule+0x6d/0xf0 schedule_preempt_disabled+0x15/0x30 rwsem_down_write_slowpath+0x31a/0x5f0 down_write+0x43/0x60 xfs_ilock+0x1a8/0x210 xfs_trans_alloc_inode+0x9c/0x240 xfs_iomap_write_unwritten+0xe3/0x300 xfs_end_ioend+0x90/0x130 xfs_end_io+0xce/0x100 process_scheduled_works+0x1d4/0x400 worker_thread+0x234/0x2e0 kthread+0x147/0x170 ret_from_fork+0x3e/0x50 ret_from_fork_asm+0x1a/0x30 </TASK>
and it's all down hill from there.
Memory pressure is one way to trigger this, another is to run "echo 3 > /proc/sys/vm/drop_caches" randomly while tests are running.
Regardless of how it is triggered, this effectively takes down the system once umount hangs because it's holding a sb->s_umount lock exclusive and now every sync(1) call gets stuck on it.
Fix this by replacing the asserts with a corruption detection check and a shutdown.
6.12:
Fixed conflict due to the following missing commit:
e9c4d8bfb26c ("xfs: factor out a generic xfs_group structure")
--- fs/xfs/libxfs/xfs_alloc.c | 41 ++++++++++++++++++++++++++++++-------- fs/xfs/libxfs/xfs_ialloc.c | 31 ++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 12 deletions(-)
fs/xfs/libxfs/xfs_alloc.c +33 -8
@@ -3435,16 +3435,41 @@ xfs_alloc_read_agf(set_bit (XFS_AGSTATE_AGF_INIT , &pag->pag_opstate); } +#ifdef DEBUG - else if (!xfs_is_shutdown(pag->pag_mount)) { -ASSERT (pag->pagf_freeblks ==be32_to_cpu (agf->agf_freeblks)); -ASSERT (pag->pagf_btreeblks ==be32_to_cpu (agf->agf_btreeblks)); -ASSERT (pag->pagf_flcount ==be32_to_cpu (agf->agf_flcount)); -ASSERT (pag->pagf_longest ==be32_to_cpu (agf->agf_longest)); -ASSERT (pag->pagf_bno_level ==be32_to_cpu (agf->agf_bno_level)); -ASSERT (pag->pagf_cnt_level ==be32_to_cpu (agf->agf_cnt_level)); +/* +* It's possible for the AGF to be out of sync if the block device is +* silently dropping writes. This can happen in fstests with dmflakey +* enabled, which allows the buffer to be cleaned and reclaimed by +* memory pressure and then re-read from disk here. We will get a +* stale version of the AGF from disk, and nothing good can happen from +* here. Hence if we detect this situation, immediately shut down the +* filesystem. +* +* This can also happen if we are already in the middle of a forced +* shutdown, so don't bother checking if we are already shut down. +*/ +if (!xfs_is_shutdown (pag->pag_mount)) { +bool ok = true; + + ok &= pag->pagf_freeblks ==be32_to_cpu (agf->agf_freeblks); + ok &= pag->pagf_freeblks ==be32_to_cpu (agf->agf_freeblks); + ok &= pag->pagf_btreeblks ==be32_to_cpu (agf->agf_btreeblks); + ok &= pag->pagf_flcount ==be32_to_cpu (agf->agf_flcount); + ok &= pag->pagf_longest ==be32_to_cpu (agf->agf_longest); + ok &= pag->pagf_bno_level ==be32_to_cpu (agf->agf_bno_level); + ok &= pag->pagf_cnt_level ==be32_to_cpu (agf->agf_cnt_level); + +if (XFS_IS_CORRUPT (pag->pag_mount, !ok)) { +xfs_ag_mark_sick (pag,XFS_SICK_AG_AGF ); +xfs_trans_brelse (tp, agfbp); +xfs_force_shutdown (pag->pag_mount, +SHUTDOWN_CORRUPT_ONDISK ); +return -EFSCORRUPTED ; + } } -#endif +#endif /* DEBUG */ +if (agfbpp) *agfbpp = agfbp;else
fs/xfs/libxfs/xfs_ialloc.c +27 -4
@@ -2785,12 +2785,35 @@ xfs_ialloc_read_agi(set_bit (XFS_AGSTATE_AGI_INIT , &pag->pag_opstate); } +#ifdef DEBUG /* -* It's possible for these to be out of sync if -* we are in the middle of a forced shutdown. +* It's possible for the AGF to be out of sync if the block device is +* silently dropping writes. This can happen in fstests with dmflakey +* enabled, which allows the buffer to be cleaned and reclaimed by +* memory pressure and then re-read from disk here. We will get a +* stale version of the AGF from disk, and nothing good can happen from +* here. Hence if we detect this situation, immediately shut down the +* filesystem. +* +* This can also happen if we are already in the middle of a forced +* shutdown, so don't bother checking if we are already shut down. */ -ASSERT (pag->pagi_freecount ==be32_to_cpu (agi->agi_freecount) || -xfs_is_shutdown (pag->pag_mount)); +if (!xfs_is_shutdown (pag->pag_mount)) { +bool ok = true; + + ok &= pag->pagi_freecount ==be32_to_cpu (agi->agi_freecount); + ok &= pag->pagi_count ==be32_to_cpu (agi->agi_count); + +if (XFS_IS_CORRUPT (pag->pag_mount, !ok)) { +xfs_ag_mark_sick (pag,XFS_SICK_AG_AGI ); +xfs_trans_brelse (tp, agibp); +xfs_force_shutdown (pag->pag_mount, +SHUTDOWN_CORRUPT_ONDISK ); +return -EFSCORRUPTED ; + } + } +#endif /* DEBUG */ +if (agibpp) *agibpp = agibp;else
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 11/869 xfs: avoid dquot buffer pin deadlock
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit d62016b1a2df24c8608fe83cd3ae8090412881b3 ]
On shutdown when quotas are enabled, the shutdown can deadlock trying to unpin the dquot buffer buf_log_item like so:
[ 3319.483590] task:kworker/20:0H state:D stack:14360 pid:1962230 tgid:1962230 ppid:2 task_flags:0x4208060 flags:0x00004000 [ 3319.493966] Workqueue: xfs-log/dm-6 xlog_ioend_work [ 3319.498458] Call Trace: [ 3319.500800] <TASK> [ 3319.502809] __schedule+0x699/0xb70 [ 3319.512672] schedule+0x64/0xd0 [ 3319.515573] schedule_timeout+0x30/0xf0 [ 3319.528125] __down_common+0xc3/0x200 [ 3319.531488] __down+0x1d/0x30 [ 3319.534186] down+0x48/0x50 [ 3319.540501] xfs_buf_lock+0x3d/0xe0 [ 3319.543609] xfs_buf_item_unpin+0x85/0x1b0 [ 3319.547248] xlog_cil_committed+0x289/0x570 [ 3319.571411] xlog_cil_process_committed+0x6d/0x90 [ 3319.575590] xlog_state_shutdown_callbacks+0x52/0x110 [ 3319.580017] xlog_force_shutdown+0x169/0x1a0 [ 3319.583780] xlog_ioend_work+0x7c/0xb0 [ 3319.587049] process_scheduled_works+0x1d6/0x400 [ 3319.591127] worker_thread+0x202/0x2e0 [ 3319.594452] kthread+0x20c/0x240
The CIL push has seen the deadlock, so it has aborted the push and is running CIL checkpoint completion to abort all the items in the checkpoint. This calls ->iop_unpin(remove = true) to clean up the log items in the checkpoint.
When a buffer log item is unpined like this, it needs to lock the buffer to run io completion to correctly fail the buffer and run all the required completions to fail attached log items as well. In this case, the attempt to lock the buffer on unpin is hanging because the buffer is already locked.
I suspected a leaked XFS_BLI_HOLD state because of XFS_BLI_STALE handling changes I was testing, so I went looking for pin events on HOLD buffers and unpin events on locked buffer. That isolated this one buffer with these two events:
xfs_buf_item_pin: dev 251:6 daddr 0xa910 bbcount 0x2 hold 2 pincount 0 lock 0 flags DONE|KMEM recur 0 refcount 1 bliflags HOLD|DIRTY|LOGGED liflags DIRTY
....xfs_buf_item_unpin: dev 251:6 daddr 0xa910 bbcount 0x2 hold 4 pincount 1 lock 0 flags DONE|KMEM recur 0 refcount 1 bliflags DIRTY liflags ABORTED
Firstly, bbcount = 0x2, which means it is not a single sector structure. That rules out every xfs_trans_bhold() case except one:
dquot buffers.
Then hung task dumping gave this trace:
[ 3197.312078] task:fsync-tester state:D stack:12080 pid:2051125 tgid:2051125 ppid:1643233 task_flags:0x400000 flags:0x00004002 [ 3197.323007] Call Trace: [ 3197.325581] <TASK> [ 3197.327727] __schedule+0x699/0xb70 [ 3197.334582] schedule+0x64/0xd0 [ 3197.337672] schedule_timeout+0x30/0xf0 [ 3197.350139] wait_for_completion+0xbd/0x180 [ 3197.354235] __flush_workqueue+0xef/0x4e0 [ 3197.362229] xlog_cil_force_seq+0xa0/0x300 [ 3197.374447] xfs_log_force+0x77/0x230 [ 3197.378015] xfs_qm_dqunpin_wait+0x49/0xf0 [ 3197.382010] xfs_qm_dqflush+0x55/0x460 [ 3197.385663] xfs_qm_dquot_isolate+0x29e/0x4d0 [ 3197.389977] __list_lru_walk_one+0x141/0x220 [ 3197.398867] list_lru_walk_one+0x10/0x20 [ 3197.402713] xfs_qm_shrink_scan+0x6a/0x100 [ 3197.406699] do_shrink_slab+0x18a/0x350 [ 3197.410512] shrink_slab+0xf7/0x430 [ 3197.413967] drop_slab+0x97/0xf0 [ 3197.417121] drop_caches_sysctl_handler+0x59/0xc0 [ 3197.421654] proc_sys_call_handler+0x18b/0x280 [ 3197.426050] proc_sys_write+0x13/0x20 [ 3197.429750] vfs_write+0x2b8/0x3e0 [ 3197.438532] ksys_write+0x7e/0xf0 [ 3197.441742] __x64_sys_write+0x1b/0x30 [ 3197.445363] x64_sys_call+0x2c72/0x2f60 [ 3197.449044] do_syscall_64+0x6c/0x140 [ 3197.456341] entry_SYSCALL_64_after_hwframe+0x76/0x7e
Yup, another test run by check-parallel is running drop_caches concurrently and the dquot shrinker for the hung filesystem is running. That's trying to flush a dirty dquot from reclaim context, and it waiting on a log force to complete. xfs_qm_dqflush is called with the dquot buffer held locked, and so we've called xfs_log_force() with that buffer locked.
Now the log force is waiting for a workqueue flush to complete, and that workqueue flush is waiting of CIL checkpoint processing to finish.
The CIL checkpoint processing is aborting all the log items it has, and that requires locking aborted buffers to cancel them.
Now, normally this isn't a problem if we are issuing a log force to unpin an object, because the ->iop_unpin() method wakes pin waiters first. That results in the pin waiter finishing off whatever it was doing, dropping the lock and then xfs_buf_item_unpin() can lock the buffer and fail it.
However, xfs_qm_dqflush() is waiting on the -dquot- unpin event, not the dquot buffer unpin event, and so it never gets woken and so does not drop the buffer lock.
Inodes do not have this problem, as they can only be written from one spot (->iop_push) whilst dquots can be written from multiple places (memory reclaim, ->iop_push, xfs_dq_dqpurge, and quotacheck).
The reason that the dquot buffer has an attached buffer log item is that it has been recently allocated. Initialisation of the dquot buffer logs the buffer directly, thereby pinning it in memory. We then modify the dquot in a separate operation, and have memory reclaim racing with a shutdown and we trigger this deadlock.
check-parallel reproduces this reliably on 1kB FSB filesystems with quota enabled because it does all of these things concurrently without having to explicitly write tests to exercise these corner case conditions.
xfs_qm_dquot_logitem_push() doesn't have this deadlock because it checks if the dquot is pinned before locking the dquot buffer and skipping it if it is pinned. This means the xfs_qm_dqunpin_wait() log force in xfs_qm_dqflush() never triggers and we unlock the buffer safely allowing a concurrent shutdown to fail the buffer appropriately.
xfs_qm_dqpurge() could have this problem as it is called from quotacheck and we might have allocated dquot buffers when recording the quota updates. This can be fixed by calling xfs_qm_dqunpin_wait() before we lock the dquot buffer. Because we hold the dquot locked, nothing will be able to add to the pin count between the unpin_wait and the dqflush callout, so this now makes xfs_qm_dqpurge() safe against this race.
xfs_qm_dquot_isolate() can also be fixed this same way but, quite frankly, we shouldn't be doing IO in memory reclaim context. If the dquot is pinned or dirty, simply rotate it and let memory reclaim come back to it later, same as we do for inodes.
This then gets rid of the nasty issue in xfs_qm_flush_one() where quotacheck writeback races with memory reclaim flushing the dquots. We can lift xfs_qm_dqunpin_wait() up into this code, then get rid of the "can't get the dqflush lock" buffer write to cycle the dqlfush lock and enable it to be flushed again. checking if the dquot is pinned and returning -EAGAIN so that the dquot walk will revisit the dquot again later.
Finally, with xfs_qm_dqunpin_wait() lifted into all the callers, we can remove it from the xfs_qm_dqflush() code.
6.12:
Fix conflicts due to following missing commits:
fs/xfs/xfs_buf.c:
eb43b0b5cab8 ("xfs: simplify xfs_buf_delwri_pushbuf")
fs/xfs/xfs_qm.c:
da0c02516c50 ("mm/list_lru: simplify the list_lru walk callback function") fb56fdf8b9a2 ("mm/list_lru: split the lock to per-cgroup scope")
We delete the code so we don't really need to add them.
--- fs/xfs/xfs_buf.c | 55 ----------------------------- fs/xfs/xfs_buf.h | 1 - fs/xfs/xfs_dquot.c | 4 +-- fs/xfs/xfs_qm.c | 87 ++++++++++------------------------------------ fs/xfs/xfs_trace.h | 1 - 5 files changed, 20 insertions(+), 128 deletions(-)
fs/xfs/xfs_buf.c +0 -55
@@ -2389,61 +2389,6 @@ xfs_buf_delwri_submit(return error; } -/* -* Push a single buffer on a delwri queue. -* -* The purpose of this function is to submit a single buffer of a delwri queue -* and return with the buffer still on the original queue. The waiting delwri -* buffer submission infrastructure guarantees transfer of the delwri queue -* buffer reference to a temporary wait list. We reuse this infrastructure to -* transfer the buffer back to the original queue. -* -* Note the buffer transitions from the queued state, to the submitted and wait -* listed state and back to the queued state during this call. The buffer -* locking and queue management logic between _delwri_pushbuf() and -* _delwri_queue() guarantee that the buffer cannot be queued to another list -* before returning. -*/ -int -xfs_buf_delwri_pushbuf ( -struct xfs_buf *bp, -struct list_head *buffer_list) -{ -LIST_HEAD (submit_list); -int error; - -ASSERT (bp->b_flags & _XBF_DELWRI_Q); - -trace_xfs_buf_delwri_pushbuf (bp, _RET_IP_); - -/* -* Isolate the buffer to a new local list so we can submit it for I/O -* independently from the rest of the original list. -*/ -xfs_buf_lock (bp); -list_move (&bp->b_list, &submit_list); -xfs_buf_unlock (bp); - -/* -* Delwri submission clears the DELWRI_Q buffer flag and returns with -* the buffer on the wait list with the original reference. Rather than -* bounce the buffer from a local wait list back to the original list -* after I/O completion, reuse the original list as the wait list. -*/ -xfs_buf_delwri_submit_buffers (&submit_list, buffer_list); - -/* -* The buffer is now locked, under I/O and wait listed on the original -* delwri queue. Wait for I/O completion, restore the DELWRI_Q flag and -* return with the buffer unlocked and on the original queue. -*/ - error =xfs_buf_iowait (bp); - bp->b_flags |= _XBF_DELWRI_Q; -xfs_buf_unlock (bp); - -return error; -} -void xfs_buf_set_ref (struct xfs_buf *bp,int lru_ref) {/*
fs/xfs/xfs_buf.h +0 -1
@@ -334,7 +334,6 @@ extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *);void xfs_buf_delwri_queue_here (struct xfs_buf *bp,struct list_head *bl);extern int xfs_buf_delwri_submit (struct list_head *);extern int xfs_buf_delwri_submit_nowait (struct list_head *); -extern int xfs_buf_delwri_pushbuf (struct xfs_buf *,struct list_head *);static inline xfs_daddr_t xfs_buf_daddr (struct xfs_buf *bp) {
fs/xfs/xfs_dquot.c +1 -3
@@ -1405,11 +1405,9 @@ xfs_qm_dqflush(ASSERT (XFS_DQ_IS_LOCKED (dqp));ASSERT (!completion_done (&dqp->q_flush)); +ASSERT (atomic_read (&dqp->q_pincount) ==0 );trace_xfs_dqflush (dqp); - -xfs_qm_dqunpin_wait (dqp); - fa =xfs_qm_dqflush_check (dqp);if (fa) { xfs_alert(mp, "corrupt dquot ID 0x%x in memory at %pS",
fs/xfs/xfs_qm.c +19 -68
133 lines not on this page · raw message
fs/xfs/xfs_trace.h +0 -1
@@ -493,7 +493,6 @@ DEFINE_BUF_EVENT(xfs_buf_iowait_done);DEFINE_BUF_EVENT (xfs_buf_delwri_queue);DEFINE_BUF_EVENT (xfs_buf_delwri_queued);DEFINE_BUF_EVENT (xfs_buf_delwri_split); -DEFINE_BUF_EVENT (xfs_buf_delwri_pushbuf);DEFINE_BUF_EVENT (xfs_buf_get_uncached);DEFINE_BUF_EVENT (xfs_buf_item_relse);DEFINE_BUF_EVENT (xfs_buf_iodone_async);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 12/869 xfs: rearrange code in xfs_buf_item.c
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit d2fe5c4c8d25999862d615f616aea7befdd62799 ]
The code to initialise, release and free items is all the way down the bottom of the file. Upcoming fixes need to these functions earlier in the file, so move them to the top.
There is one code change in this move - the parameter to xfs_buf_item_relse() is changed from the xfs_buf to the xfs_buf_log_item - the thing that the function is releasing.
--- fs/xfs/xfs_buf_item.c | 116 +++++++++++++++++++++--------------------- fs/xfs/xfs_buf_item.h | 1 - 2 files changed, 58 insertions(+), 59 deletions(-)
fs/xfs/xfs_buf_item.c +58 -58
@@ -32,6 +32,61 @@ static inline struct xfs_buf_log_item *BUF_ITEM(struct xfs_log_item *lip) return container_of(lip, struct xfs_buf_log_item, bli_item); } +static void +xfs_buf_item_get_format ( +struct xfs_buf_log_item *bip, +int count) +{ +ASSERT (bip->bli_formats ==NULL ); + bip->bli_format_count = count; + +if (count ==1 ) { + bip->bli_formats = &bip->__bli_format; +return ; + } + + bip->bli_formats =kzalloc (count *sizeof (struct xfs_buf_log_format ), +GFP_KERNEL | __GFP_NOFAIL); +} + +static void +xfs_buf_item_free_format ( +struct xfs_buf_log_item *bip) +{ +if (bip->bli_formats != &bip->__bli_format) { +kfree (bip->bli_formats); + bip->bli_formats =NULL ; + } +} + +static void +xfs_buf_item_free ( +struct xfs_buf_log_item *bip) +{ +xfs_buf_item_free_format (bip); +kvfree (bip->bli_item.li_lv_shadow); +kmem_cache_free (xfs_buf_item_cache, bip); +} + +/* +* xfs_buf_item_relse() is called when the buf log item is no longer needed. +*/ +static void +xfs_buf_item_relse ( +struct xfs_buf_log_item *bip) +{ +struct xfs_buf *bp = bip->bli_buf; + +trace_xfs_buf_item_relse (bp, _RET_IP_); + +ASSERT (!test_bit (XFS_LI_IN_AIL , &bip->bli_item.li_flags)); +ASSERT (atomic_read (&bip->bli_refcount) ==0 ); + + bp->b_log_item =NULL ; +xfs_buf_rele (bp); +xfs_buf_item_free (bip); +} +/* Is this log iovec plausibly large enough to contain the buffer log format? */ bool xfs_buf_log_check_iovec(
@@ -563,7 +618,7 @@ xfs_buf_item_unpin(ASSERT (list_empty (&bp->b_li_list)); }else {xfs_trans_ail_delete (lip,SHUTDOWN_LOG_IO_ERROR ); -xfs_buf_item_relse (bp); +xfs_buf_item_relse (bip);ASSERT (bp->b_log_item ==NULL ); }xfs_buf_relse (bp);
@@ -673,7 +728,7 @@ xfs_buf_item_put(*/ if (aborted)xfs_trans_ail_delete (lip,0 ); -xfs_buf_item_relse (bip->bli_buf); +xfs_buf_item_relse (bip);return true; }
@@ -824,33 +879,6 @@ static const struct xfs_item_ops xfs_buf_item_ops = { .iop_push = xfs_buf_item_push, }; -STATIC void -xfs_buf_item_get_format ( -struct xfs_buf_log_item *bip, -int count) -{ -ASSERT (bip->bli_formats ==NULL ); - bip->bli_format_count = count; - -if (count ==1 ) { - bip->bli_formats = &bip->__bli_format; -return ; - } - - bip->bli_formats =kzalloc (count *sizeof (struct xfs_buf_log_format ), -GFP_KERNEL | __GFP_NOFAIL); -} - -STATIC void -xfs_buf_item_free_format ( -struct xfs_buf_log_item *bip) -{ -if (bip->bli_formats != &bip->__bli_format) { -kfree (bip->bli_formats); - bip->bli_formats =NULL ; - } -} -/* * Allocate a new buf log item to go with the given buffer. * Set the buffer's b_log_item field to point to the new
@@ -1072,34 +1100,6 @@ xfs_buf_item_dirty_format(return false; } -STATIC void -xfs_buf_item_free ( -struct xfs_buf_log_item *bip) -{ -xfs_buf_item_free_format (bip); -kvfree (bip->bli_item.li_lv_shadow); -kmem_cache_free (xfs_buf_item_cache, bip); -} - -/* -* xfs_buf_item_relse() is called when the buf log item is no longer needed. -*/ -void -xfs_buf_item_relse ( -struct xfs_buf *bp) -{ -struct xfs_buf_log_item *bip = bp->b_log_item; - -trace_xfs_buf_item_relse (bp, _RET_IP_); -ASSERT (!test_bit (XFS_LI_IN_AIL , &bip->bli_item.li_flags)); - -if (atomic_read (&bip->bli_refcount)) -return ; - bp->b_log_item =NULL ; -xfs_buf_rele (bp); -xfs_buf_item_free (bip); -} -void xfs_buf_item_done (struct xfs_buf *bp)
@@ -1119,5 +1119,5 @@ xfs_buf_item_done(xfs_trans_ail_delete (&bp->b_log_item->bli_item, (bp->b_flags & _XBF_LOGRECOVERY) ?0 :SHUTDOWN_CORRUPT_INCORE ); -xfs_buf_item_relse (bp); +xfs_buf_item_relse (bp->b_log_item); }
fs/xfs/xfs_buf_item.h +0 -1
@@ -49,7 +49,6 @@ struct xfs_buf_log_item {int xfs_buf_item_init (struct xfs_buf *,struct xfs_mount *);void xfs_buf_item_done (struct xfs_buf *bp); -void xfs_buf_item_relse (struct xfs_buf *);bool xfs_buf_item_put (struct xfs_buf_log_item *);void xfs_buf_item_log (struct xfs_buf_log_item *,uint ,uint );bool xfs_buf_item_dirty_format (struct xfs_buf_log_item *);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 13/869 xfs: factor out stale buffer item completion
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit 816c330b605c3f4813c0dc0ab5af5cce17ff06b3 ]
The stale buffer item completion handling is currently only done from BLI unpinning. We need to perform this function from where-ever the last reference to the BLI is dropped, so first we need to factor this code out into a helper.
--- fs/xfs/xfs_buf_item.c | 60 ++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 23 deletions(-)
fs/xfs/xfs_buf_item.c +37 -23
@@ -539,6 +539,42 @@ xfs_buf_item_pin(atomic_inc (&bip->bli_buf->b_pin_count); } +/* +* For a stale BLI, process all the necessary completions that must be +* performed when the final BLI reference goes away. The buffer will be +* referenced and locked here - we return to the caller with the buffer still +* referenced and locked for them to finalise processing of the buffer. +*/ +static void +xfs_buf_item_finish_stale ( +struct xfs_buf_log_item *bip) +{ +struct xfs_buf *bp = bip->bli_buf; +struct xfs_log_item *lip = &bip->bli_item; + +ASSERT (bip->bli_flags &XFS_BLI_STALE ); +ASSERT (xfs_buf_islocked (bp)); +ASSERT (bp->b_flags &XBF_STALE ); +ASSERT (bip->__bli_format.blf_flags &XFS_BLF_CANCEL ); +ASSERT (list_empty (&lip->li_trans)); +ASSERT (!bp->b_transp); + +if (bip->bli_flags &XFS_BLI_STALE_INODE ) { +xfs_buf_item_done (bp); +xfs_buf_inode_iodone (bp); +ASSERT (list_empty (&bp->b_li_list)); +return ; + } + +/* +* We may or may not be on the AIL here, xfs_trans_ail_delete() will do +* the right thing regardless of the situation in which we are called. +*/ +xfs_trans_ail_delete (lip,SHUTDOWN_LOG_IO_ERROR ); +xfs_buf_item_relse (bip); +ASSERT (bp->b_log_item ==NULL ); +} +/* * This is called to unpin the buffer associated with the buf log item which was * previously pinned with a call to xfs_buf_item_pin(). We enter this function
@@ -588,13 +624,6 @@ xfs_buf_item_unpin( }if (stale) { -ASSERT (bip->bli_flags &XFS_BLI_STALE ); -ASSERT (xfs_buf_islocked (bp)); -ASSERT (bp->b_flags &XBF_STALE ); -ASSERT (bip->__bli_format.blf_flags &XFS_BLF_CANCEL ); -ASSERT (list_empty (&lip->li_trans)); -ASSERT (!bp->b_transp); -trace_xfs_buf_item_unpin_stale (bip);/*
@@ -605,22 +634,7 @@ xfs_buf_item_unpin(* processing is complete. */ xfs_buf_rele (bp); - -/* -* If we get called here because of an IO error, we may or may -* not have the item on the AIL. xfs_trans_ail_delete() will -* take care of that situation. xfs_trans_ail_delete() drops -* the AIL lock. -*/ -if (bip->bli_flags &XFS_BLI_STALE_INODE ) { -xfs_buf_item_done (bp); -xfs_buf_inode_iodone (bp); -ASSERT (list_empty (&bp->b_li_list)); - }else { -xfs_trans_ail_delete (lip,SHUTDOWN_LOG_IO_ERROR ); -xfs_buf_item_relse (bip); -ASSERT (bp->b_log_item ==NULL ); - } +xfs_buf_item_finish_stale (bip);xfs_buf_relse (bp);return ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 14/869 xfs: fix unmount hang with unflushable inodes stuck in the AIL
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit 7b5f775be14ac1532c049022feadcfe44769566d ]
Unmount of a shutdown filesystem can hang with stale inode cluster buffers in the AIL like so:
[95964.140623] Call Trace: [95964.144641] __schedule+0x699/0xb70 [95964.154003] schedule+0x64/0xd0 [95964.156851] xfs_ail_push_all_sync+0x9b/0xf0 [95964.164816] xfs_unmount_flush_inodes+0x41/0x70 [95964.168698] xfs_unmountfs+0x7f/0x170 [95964.171846] xfs_fs_put_super+0x3b/0x90 [95964.175216] generic_shutdown_super+0x77/0x160 [95964.178060] kill_block_super+0x1b/0x40 [95964.180553] xfs_kill_sb+0x12/0x30 [95964.182796] deactivate_locked_super+0x38/0x100 [95964.185735] deactivate_super+0x41/0x50 [95964.188245] cleanup_mnt+0x9f/0x160 [95964.190519] __cleanup_mnt+0x12/0x20 [95964.192899] task_work_run+0x89/0xb0 [95964.195221] resume_user_mode_work+0x4f/0x60 [95964.197931] syscall_exit_to_user_mode+0x76/0xb0 [95964.201003] do_syscall_64+0x74/0x130
$ pstree -N mnt |grep umount |-check-parallel---nsexec---run_test.sh---753---umount
It always seems to be generic/753 that triggers this, and repeating a quick group test run triggers it every 10-15 iterations. Hence it generally triggers once up every 30-40 minutes of test time. just running generic/753 by itself or concurrently with a limited group of tests doesn't reproduce this issue at all.
Tracing on a hung system shows the AIL repeating every 50ms a log force followed by an attempt to push pinned, aborted inodes from the AIL (trimmed for brevity):
xfs_log_force: lsn 0x1c caller xfsaild+0x18e xfs_log_force: lsn 0x0 caller xlog_cil_flush+0xbd xfs_log_force: lsn 0x1c caller xfs_log_force+0x77 xfs_ail_pinned: lip 0xffff88826014afa0 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED xfs_ail_pinned: lip 0xffff88814000a708 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED xfs_ail_pinned: lip 0xffff88810b850c80 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED xfs_ail_pinned: lip 0xffff88810b850af0 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED xfs_ail_pinned: lip 0xffff888165cf0a28 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED xfs_ail_pinned: lip 0xffff88810b850bb8 lsn 1/37472 type XFS_LI_INODE flags IN_AIL|ABORTED
....
The inode log items are marked as aborted, which means that either:
a) a transaction commit has occurred, seen an error or shutdown, and called xfs_trans_free_items() to abort the items. This should happen before any pinning of log items occurs.
or
b) a dirty transaction has been cancelled. This should also happen before any pinning of log items occurs.
or
c) AIL insertion at journal IO completion is marked as aborted. In this case, the log item is pinned by the CIL until journal IO completes and hence needs to be unpinned. This is then done after the ->iop_committed() callback is run, so the pin count should be balanced correctly.
Yet none of these seemed to be occurring. Further tracing indicated this:
d) Shutdown during CIL pushing resulting in log item completion being called from checkpoint abort processing. Items are unpinned and released without serialisation against each other, journal IO completion or transaction commit completion.
In this case, we may still have a transaction commit in flight that holds a reference to a xfs_buf_log_item (BLI) after CIL insertion. e.g. a synchronous transaction will flush the CIL before the transaction is torn down. The concurrent CIL push then aborts insertion it and drops the commit/AIL reference to the BLI. This can leave the transaction commit context with the last reference to the BLI which is dropped here:
xfs_trans_free_items()
->iop_release
xfs_buf_item_release
xfs_buf_item_put
if (XFS_LI_ABORTED)
xfs_trans_ail_delete
xfs_buf_item_relse()
Unlike the journal completion ->iop_unpin path, this path does not run stale buffer completion process when it drops the last reference, hence leaving the stale inodes attached to the buffer sitting the AIL. There are no other references to those inodes, so there is no other mechanism to remove them from the AIL. Hence unmount hangs.
The buffer lock context for stale buffers is passed to the last BLI reference. This is normally the last BLI unpin on journal IO completion. The unpin then processes the stale buffer completion and releases the buffer lock. However, if the final unpin from journal IO completion (or CIL push abort) does not hold the last reference to the BLI, there -must- still be a transaction context that references the BLI, and so that context must perform the stale buffer completion processing before the buffer is unlocked and the BLI torn down.
The fix for this is to rework the xfs_buf_item_relse() path to run stale buffer completion processing if it drops the last reference to the BLI. We still hold the buffer locked, so the buffer owner and lock context is the same as if we passed the BLI and buffer to the ->iop_unpin() context to finish stale process on journal commit.
However, we have to be careful here. In a shutdown state, we can be freeing dirty BLIs from xfs_buf_item_put() via xfs_trans_brelse() and xfs_trans_bdetach(). The existing code handles this case by considering shutdown state as "aborted", but in doing so largely masks the failure to clean up stale BLI state from the xfs_buf_item_relse() path. i.e regardless of the shutdown state and whether the item is in the AIL, we must finish the stale buffer cleanup if we are are dropping the last BLI reference from the ->iop_relse path in transaction commit context.
--- fs/xfs/xfs_buf_item.c | 121 +++++++++++++++++++++++++++++------------- fs/xfs/xfs_buf_item.h | 2 +- 2 files changed, 86 insertions(+), 37 deletions(-)
fs/xfs/xfs_buf_item.c +85 -36
@@ -707,43 +707,42 @@ xfs_buf_item_push(* Drop the buffer log item refcount and take appropriate action. This helper * determines whether the bli must be freed or not, since a decrement to zero * does not necessarily mean the bli is unused. -* -* Return true if the bli is freed, false otherwise. */ -bool +void xfs_buf_item_put (struct xfs_buf_log_item *bip) { -struct xfs_log_item *lip = &bip->bli_item; -bool aborted; -bool dirty; + +ASSERT (xfs_buf_islocked (bip->bli_buf));/* drop the bli ref and return if it wasn't the last one */ if (!atomic_dec_and_test (&bip->bli_refcount)) -return false; +return ; -/* -* We dropped the last ref and must free the item if clean or aborted. -* If the bli is dirty and non-aborted, the buffer was clean in the -* transaction but still awaiting writeback from previous changes. In -* that case, the bli is freed on buffer writeback completion. -*/ - aborted =test_bit (XFS_LI_ABORTED , &lip->li_flags) || -xlog_is_shutdown (lip->li_log); - dirty = bip->bli_flags &XFS_BLI_DIRTY ; -if (dirty && !aborted) -return false; +/* If the BLI is in the AIL, then it is still dirty and in use */ +if (test_bit (XFS_LI_IN_AIL , &bip->bli_item.li_flags)) { +ASSERT (bip->bli_flags &XFS_BLI_DIRTY ); +return ; + }/* -* The bli is aborted or clean. An aborted item may be in the AIL -* regardless of dirty state. For example, consider an aborted -* transaction that invalidated a dirty bli and cleared the dirty -* state. +* In shutdown conditions, we can be asked to free a dirty BLI that +* isn't in the AIL. This can occur due to a checkpoint aborting a BLI +* instead of inserting it into the AIL at checkpoint IO completion. If +* there's another bli reference (e.g. a btree cursor holds a clean +* reference) and it is released via xfs_trans_brelse(), we can get here +* with that aborted, dirty BLI. In this case, it is safe to free the +* dirty BLI immediately, as it is not in the AIL and there are no +* other references to it. +* +* We should never get here with a stale BLI via that path as +* xfs_trans_brelse() specifically holds onto stale buffers rather than +* releasing them. */ -if (aborted) -xfs_trans_ail_delete (lip,0 ); +ASSERT (!(bip->bli_flags &XFS_BLI_DIRTY ) || +test_bit (XFS_LI_ABORTED , &bip->bli_item.li_flags)); +ASSERT (!(bip->bli_flags &XFS_BLI_STALE ));xfs_buf_item_relse (bip); -return true; }/*
@@ -764,6 +763,15 @@ xfs_buf_item_put(* if necessary but do not unlock the buffer. This is for support of * xfs_trans_bhold(). Make sure the XFS_BLI_HOLD field is cleared if we don't * free the item. +* +* If the XFS_BLI_STALE flag is set, the last reference to the BLI *must* +* perform a completion abort of any objects attached to the buffer for IO +* tracking purposes. This generally only happens in shutdown situations, +* normally xfs_buf_item_unpin() will drop the last BLI reference and perform +* completion processing. However, because transaction completion can race with +* checkpoint completion during a shutdown, this release context may end up +* being the last active reference to the BLI and so needs to perform this +* cleanup. */ STATIC void xfs_buf_item_release(
@@ -771,18 +779,19 @@ xfs_buf_item_release( {struct xfs_buf_log_item *bip =BUF_ITEM (lip);struct xfs_buf *bp = bip->bli_buf; -bool released;bool hold = bip->bli_flags &XFS_BLI_HOLD ;bool stale = bip->bli_flags &XFS_BLI_STALE ; -#if defined(DEBUG ) || defined(XFS_WARN ) -bool ordered = bip->bli_flags &XFS_BLI_ORDERED ; -bool dirty = bip->bli_flags &XFS_BLI_DIRTY ;bool aborted =test_bit (XFS_LI_ABORTED , &lip->li_flags); +bool dirty = bip->bli_flags &XFS_BLI_DIRTY ; +#if defined(DEBUG ) || defined(XFS_WARN ) +bool ordered = bip->bli_flags &XFS_BLI_ORDERED ;#endif trace_xfs_buf_item_release (bip); +ASSERT (xfs_buf_islocked (bp)); +/* * The bli dirty state should match whether the blf has logged segments * except for ordered buffers, where only the bli should be dirty.
@@ -798,16 +807,56 @@ xfs_buf_item_release( bp->b_transp =NULL ; bip->bli_flags &= ~(XFS_BLI_LOGGED |XFS_BLI_HOLD |XFS_BLI_ORDERED ); +/* If there are other references, then we have nothing to do. */ +if (!atomic_dec_and_test (&bip->bli_refcount)) + goto out_release; + +/* +* Stale buffer completion frees the BLI, unlocks and releases the +* buffer. Neither the BLI or buffer are safe to reference after this +* call, so there's nothing more we need to do here. +* +* If we get here with a stale buffer and references to the BLI remain, +* we must not unlock the buffer as the last BLI reference owns lock +* context, not us. +*/ +if (stale) { +xfs_buf_item_finish_stale (bip); +xfs_buf_relse (bp); +ASSERT (!hold); +return ; + } + +/* +* Dirty or clean, aborted items are done and need to be removed from +* the AIL and released. This frees the BLI, but leaves the buffer +* locked and referenced. +*/ +if (aborted ||xlog_is_shutdown (lip->li_log)) { +ASSERT (list_empty (&bip->bli_buf->b_li_list)); +xfs_buf_item_done (bp); + goto out_release; + } + +/* +* Clean, unreferenced BLIs can be immediately freed, leaving the buffer +* locked and referenced. +* +* Dirty, unreferenced BLIs *must* be in the AIL awaiting writeback. +*/ +if (!dirty) +xfs_buf_item_relse (bip); +else +ASSERT (test_bit (XFS_LI_IN_AIL , &lip->li_flags)); + +/* Not safe to reference the BLI from here */ +out_release:/* -* Unref the item and unlock the buffer unless held or stale. Stale -* buffers remain locked until final unpin unless the bli is freed by -* the unref call. The latter implies shutdown because buffer -* invalidation dirties the bli and transaction. +* If we get here with a stale buffer, we must not unlock the +* buffer as the last BLI reference owns lock context, not us. */ - released =xfs_buf_item_put (bip); -if (hold || (stale && !released)) +if (stale || hold)return ; -ASSERT (!stale || aborted);xfs_buf_relse (bp); }
fs/xfs/xfs_buf_item.h +1 -1
@@ -49,7 +49,7 @@ struct xfs_buf_log_item {int xfs_buf_item_init (struct xfs_buf *,struct xfs_mount *);void xfs_buf_item_done (struct xfs_buf *bp); -bool xfs_buf_item_put (struct xfs_buf_log_item *); +void xfs_buf_item_put (struct xfs_buf_log_item *bip);void xfs_buf_item_log (struct xfs_buf_log_item *,uint ,uint );bool xfs_buf_item_dirty_format (struct xfs_buf_log_item *);void xfs_buf_inode_iodone (struct xfs_buf *);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 15/869 drm/amd: Create a device link between APU display and XHCI devices
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 75c8746b9d0a0317d8a58aa0efa2ff2f7359908b ]
Some AMD APU multi-function devices expose an integrated USB xHCI controller. In some circumstances (such as larger VRAM), the PM core can resume can fail when the xHCI controller is resuming in parallel with the GPU/display function.
On affected systems, the xHCI controller can complete pci_pm_resume and start resuming USB devices while the GPU is still in its much longer resume path. This race condition leads to USB device resume failures followed by:
xhci_hcd ...: xHCI host not responding to stop endpoint command xhci_hcd ...: HC died; cleaning up
Create a device link from any xHCI controller sharing the same PCIe root port as the APU display function. The link uses DL_FLAG_STATELESS and DL_FLAG_PM_RUNTIME to ensure the GPU completes its resume before the xHCI controller begins resuming USB devices.
This device link is done specifically in amdgpu so that if the platform firmware has been modified such that this issue doesn't happen the version can be detected and the workaround skipped.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 10 +++++ .../drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 45 +++++++++++++++++++ 3 files changed, 67 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +12 -0
@@ -1247,6 +1247,14 @@ static bool smu_is_workload_profile_available(struct smu_context *smu,return smu->workload_map && smu->workload_map[profile].valid_mapping; } +static int smu_set_power_dep (struct smu_context *smu,bool enable) +{ +if (!smu->ppt_funcs->set_power_dep) +return 0 ; + +return smu->ppt_funcs->set_power_dep (smu, enable); +} +static int smu_sw_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1312,6 +1320,8 @@ static int smu_sw_init(void *handle)if (!smu->ppt_funcs->get_fan_control_mode) smu->adev->pm.no_fan = true; +smu_set_power_dep (smu, true); +return 0 ; }
@@ -1334,6 +1344,8 @@ static int smu_sw_fini(void *handle)smu_fini_microcode (smu); +smu_set_power_dep (smu, false); +return 0 ; }
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +10 -0
@@ -566,6 +566,9 @@ struct smu_context {bool pm_enabled;bool is_apu; +/* Power dependency link from an integrated xHCI controller to the GPU */ +struct device_link *usb_power_link; +uint32_t smc_driver_if_version;uint32_t smc_fw_if_version;uint32_t smc_fw_version;
@@ -1445,6 +1448,13 @@ struct pptable_funcs {*/ int (*set_wbrf_exclusion_ranges)(struct smu_context *smu,struct freq_band_range *exclusion_ranges); +/** +* @set_power_dep: Create or destroy a power dependency link +* from an integrated xHCI controller to the GPU so that the GPU is +* resumed before the USB controller during PM resume. @enable is true +* to create the link and false to tear it down. +*/ +int (*set_power_dep)(struct smu_context *smu,bool enable); }; typedef enum {
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +45 -0
57 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 16/869 ata: libata-scsi: do not lose CHECK CONDITION for failed ATAPI commands
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengyu Liang <[email protected]>
[ Upstream commit bc8ce2cea5f77c4bd1a5184705e300e83546c0c4 ]
Since commit 2e1d2e65e773 ("ata: libata-scsi: terminate deferred commands on time out"), atapi_qc_complete() sets SAM_STAT_CHECK_CONDITION for a failed command only if cmd->result is zero, so that the DID_TIME_OUT or DID_REQUEUE host byte of a terminated command is preserved.
However, cmd->result can also be non-zero for a regular failed ATAPI command completed through libata EH: ata_eh_analyze_tf() calls ata_eh_decide_disposition(), that is, scsi_check_sense(), on the sense data obtained with REQUEST SENSE, and scsi_check_sense() sets the SCSI midlayer internal byte of the result for some sense codes, e.g. SCSIML_STAT_TGT_FAILURE for ILLEGAL REQUEST with ASC 0x20 (INVALID COMMAND OPERATION CODE) or 0x24 (INVALID FIELD IN CDB), or SCSIML_STAT_MED_ERROR for MEDIUM ERROR with ASC 0x11 (UNRECOVERED READ ERROR). For such commands, atapi_qc_complete() keeps the result as is and the command completes with a GOOD status byte, even though it failed and valid sense data is available.
As a result, passthrough users see these failed ATAPI commands as successful. For example, with the emulated IDE CD-ROM drive of QEMU and no medium loaded, a PLAY AUDIO MSF command issued with SG_IO completes with status 0x00 (and no DRIVER_SENSE) instead of 0x02 (CHECK CONDITION) with sense key ILLEGAL REQUEST, ASC/ASCQ 0x20/0x00, and the CDROM ioctls CDROMPLAYTRKIND, CDROMSUBCHNL, CDROMPAUSE, CDROMRESUME, CDROMPLAYMSF and CDROM_GET_MCN return 0 instead of -ENOMEDIUM or -EOPNOTSUPP.
Fix this by setting the status byte to SAM_STAT_CHECK_CONDITION whenever the host byte is not set. Use set_status_byte() rather than overwriting the whole result, so that the SCSI midlayer internal byte set by scsi_check_sense() is preserved, as ata_scsi_qc_complete() already does for ATA commands.
--- drivers/ata/libata-scsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/ata/libata-scsi.c +8 -2
@@ -3030,8 +3030,14 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)if (qc->cdb[0 ] ==ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) qc->dev->sdev->locked =0 ; -if (!cmd->result) - cmd->result =SAM_STAT_CHECK_CONDITION ; +/* +* Report CHECK CONDITION unless the command was terminated +* with a host byte set. Only set the status byte, so that the +* SCSI midlayer internal byte, which scsi_check_sense() may +* have set from the sense data, is preserved. +*/ +if (get_host_byte (cmd) ==DID_OK ) +set_status_byte (cmd,SAM_STAT_CHECK_CONDITION );ata_qc_done (qc);return ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 17/869 mm/mremap: fix locked_vm leak by splitting VMA for MREMAP_DONTUNMAP
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <[email protected]>
[ Upstream commit 597e4b9ab48a3f841080f627722064853d3f650e ]
The MREMAP_DONTUNMAP feature is highly unusual in that it permits mremap() operations that keep the original VMA in place.
Historically this has led to a lot of bugs where non-obvious interactions occur between existing mremap() operations and the original VMA.
Fix another of these - partial copies.
The long-standing mremap() partial VMA logic has the baked-in assumption that the originating VMA is unmapped and thus moved.
However MREMAP_DONTUNMAP defeats this by performing a partial copy instead since it keeps the source VMA around.
An mremap(..., MREMAP_DONTUNMAP) operation disallows resizing of the VMA, but the operation can be performed partially:
|-----------------|
| |
| v
<------> <------>
.new_sz. new_sz
|--.------.--| |------|
| .source. | | dest |
|--.------.--| |------|
<------------>
old_szThe page tables in the specified range are moved, but the original VMA is kept intact.
This interacts poorly with mlock()'d VMAs, as the VMA_LOCKED_BIT flag is cleared for the entire source VMA and set for the entire destination VMA.
This results in an mm->locked_vm leak as the change is therefore not accounted correctly.
The clear solution here is to make the portion of the source VMA which is mremap()'d distinct from the rest of it, a.k.a. split it.
Therefore resolve this issue by splitting it ahead of the rest of the mremap() operation if the VMA is mlock()'d.
This is valid, as the source VMA will lose its VMA_LOCKED_BIT flag, so if a partial remap it will become distinct from the rest of the VMA.
In order to make this change re-expose split_vma() in vma.h for CONFIG_MMU (nommu doesn't compile mremap.c and uses a static helper instead).
Finally, update the sys_map_count check to account for this case.
Note that the early check does not use needs_pre_split() - this is because the VMA has not been looked up by this point, so be conservative and assume that the VMA is mlock()'d in this case for the purposes of the sys_map_count check.
--- mm/mremap.c | 21 +++++++++++++++++++-- mm/vma.c | 4 ++-- mm/vma.h | 5 +++++ 3 files changed, 26 insertions(+), 4 deletions(-)
mm/mremap.c +19 -2
@@ -702,6 +702,8 @@ static unsigned long move_vma(struct vm_area_struct *vma,int err =0 ;bool need_rmap_locks;struct vma_iterator vmi; +const bool split_before = vma->vm_start != old_addr; +const bool split_after = vma->vm_end != old_addr + old_len;/* * We'd prefer to avoid failure later on in do_munmap:
@@ -714,9 +716,9 @@ static unsigned long move_vma(struct vm_area_struct *vma, to_account = new_len;if (vma->vm_ops && vma->vm_ops->may_split) { -if (vma->vm_start != old_addr) +if (split_before) err = vma->vm_ops->may_split (vma, old_addr); -if (!err && vma->vm_end != old_addr + old_len) +if (!err && split_after) err = vma->vm_ops->may_split (vma, old_addr + old_len);if (err)return err;
@@ -734,6 +736,21 @@ static unsigned long move_vma(struct vm_area_struct *vma,if (err)return err; +/* +* To account mlock()'d pages correctly in the MREMAP_DONTUNMAP +* case perform any split ahead of time for an mlock()'d VMA. +*/ +if ((flags &MREMAP_DONTUNMAP ) && (vma->vm_flags &VM_LOCKED )) { +vma_iter_init (&vmi, mm, old_addr); + +if (split_before) + err =split_vma (&vmi, vma, old_addr,1 ); +if (!err && split_after) + err =split_vma (&vmi, vma, old_addr + old_len,0 ); +if (err) +return err; + } +if (vm_flags &VM_ACCOUNT ) {if (security_vm_enough_memory_mm (mm, to_account >>PAGE_SHIFT ))return -ENOMEM ;
mm/vma.c +2 -2
@@ -457,8 +457,8 @@ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma,* Split a vma into two pieces at address 'addr', a new vma is allocated * either for the first part or the tail. */ -static int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, -unsigned long addr,int new_below) +int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, +unsigned long addr,int new_below) {if (vma->vm_mm->map_count >= sysctl_max_map_count)return -ENOMEM ;
mm/vma.h +5 -0
@@ -343,6 +343,11 @@ bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot);int mm_take_all_locks (struct mm_struct *mm);void mm_drop_all_locks (struct mm_struct *mm); +#ifdef CONFIG_MMU +int split_vma (struct vma_iterator *vmi,struct vm_area_struct *vma, +unsigned long addr,int new_below); +#endif +static inline bool vma_wants_manual_pte_write_upgrade (struct vm_area_struct *vma) {/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2/869 usb: gadget: f_hid: Add missing error code
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ethan Tidmore <[email protected]>
[ Upstream commit 2c863dbbeac7b919d4634ad886978a6731916de3 ]
Currently in cdev_alloc() error path no error code is assigned.
Assign error code '-ENOMEM'.
Detected by Smatch:drivers/usb/gadget/function/f_hid.c:1291 hidg_bind()
warn: missing error code 'status'
--- drivers/usb/gadget/function/f_hid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_hid.c +3 -1
@@ -1272,8 +1272,10 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)/* create char device */ hidg->cdev =cdev_alloc (); -if (!hidg->cdev) +if (!hidg->cdev) { + status = -ENOMEM ; goto fail_free_all; + } hidg->cdev->ops = &f_hidg_fops; status =cdev_device_add (hidg->cdev, &hidg->dev);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 3/869 iommu/amd: Disable AMD IOMMU if CMPXCHG16B feature is not supported
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suravee Suthikulpanit <[email protected]>
[ Upstream commit 82582f85ed22ba6cd27fea76b4248745f3b9fdf7 ]
According to the AMD IOMMU spec, IOMMU hardware reads the entire DTE in a single 256-bit transaction. It is recommended to update DTE using 128-bit operation followed by an INVALIDATE_DEVTAB_ENTYRY command when the IV=1b or V=1b before the change.
According to the AMD BIOS and Kernel Developer's Guide (BDKG) dated back to family 10h Processor [1], which is the first introduction of AMD IOMMU, AMD processor always has CPUID Fn0000_0001_ECX[CMPXCHG16B]=1. Therefore, it is safe to assume cmpxchg128 is available with all AMD processor w/ IOMMU.
In addition, the CMPXCHG16B feature has already been checked separately before enabling the GA, XT, and GAM modes. Consolidate the detection logic, and fail the IOMMU initialization if the feature is not supported.
[1] https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/programmer-references/31116.pdf
--- drivers/iommu/amd/init.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
drivers/iommu/amd/init.c +9 -14
@@ -1787,13 +1787,8 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h,else iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ; -/* -* Note: GA (128-bit IRTE) mode requires cmpxchg16b supports. -* GAM also requires GA mode. Therefore, we need to -* check cmpxchg16b support before enabling it. -*/ -if (!boot_cpu_has (X86_FEATURE_CX16 ) || - ((h->efr_attr & (0x1 <<IOMMU_FEAT_GASUP_SHIFT )) ==0 )) +/* GAM requires GA mode. */ +if ((h->efr_attr & (0x1 <<IOMMU_FEAT_GASUP_SHIFT )) ==0 ) amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ;break ;case 0x11 :
@@ -1803,13 +1798,8 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h,else iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ; -/* -* Note: GA (128-bit IRTE) mode requires cmpxchg16b supports. -* XT, GAM also requires GA mode. Therefore, we need to -* check cmpxchg16b support before enabling them. -*/ -if (!boot_cpu_has (X86_FEATURE_CX16 ) || - ((h->efr_reg & (0x1 <<IOMMU_EFR_GASUP_SHIFT )) ==0 )) { +/* XT and GAM require GA mode. */ +if ((h->efr_reg & (0x1 <<IOMMU_EFR_GASUP_SHIFT )) ==0 ) { amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ;break ; }
@@ -3106,6 +3096,11 @@ static int __init early_amd_iommu_init(void)return -EINVAL ; } +if (!boot_cpu_has (X86_FEATURE_CX16 )) { +pr_err ("Failed to initialize. The CMPXCHG16B feature is required.\n" ); +return -EINVAL ; + } +/* * Validate checksum here so we don't need to do it when * we actually parse the table
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 4/869 iommu/amd: Fix ivrs_base memleak in early_amd_iommu_init()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhen Ni <[email protected]>
[ Upstream commit 923b70581cb6acede90f8aaf4afe5d1c58c67b71 ]
Fix a permanent ACPI table memory leak in early_amd_iommu_init() when CMPXCHG16B feature is not supported
--- drivers/iommu/amd/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/amd/init.c +2 -1
@@ -3098,7 +3098,8 @@ static int __init early_amd_iommu_init(void)if (!boot_cpu_has (X86_FEATURE_CX16 )) {pr_err ("Failed to initialize. The CMPXCHG16B feature is required.\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto out; }/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 5/869 ice: fix use-after-free in dynamic port cleanup
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xuanqiang Luo <[email protected]>
[ Upstream commit 1402fc67d2f4e2e1fc7bf8ee0825b8ad994557ff ]
ice_dealloc_dynamic_port() uses dyn_port->vsi->idx to erase the dynamic port from pf->dyn_ports. However, it frees the VSI before reading the index for the erase, resulting in a use-after-free.
Follow the reverse of the allocation order in ice_alloc_dynamic_port() by erasing the xarray entry before freeing the VSI.
--- drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +1 -1
@@ -588,8 +588,8 @@ static void ice_dealloc_dynamic_port(struct ice_dynamic_port *dyn_port)xa_erase (&pf->sf_nums, devlink_port->attrs.pci_sf.sf);ice_eswitch_detach_sf (pf, dyn_port); -ice_vsi_free (dyn_port->vsi);xa_erase (&pf->dyn_ports, dyn_port->vsi->idx); +ice_vsi_free (dyn_port->vsi);kfree (dyn_port); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 6/869 xfs: stop exchanging reflink flags when exchanging mappings
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Norbert Szetei <[email protected]>
[ Upstream commit d84d6c1a7f1e2de9e601703a326a4c1b7b421943 ]
When an exchange covers both files from offset 0 to i_disk_size, xmi_can_exchange_reflink_flags() assumes every mapping moved and hands the reflink flag over to the other file.
That assumption is wrong. A file can still own shared blocks past i_disk_size, e.g. after EXCHANGE_RANGE_TO_EOF sets a smaller size without unmapping anything. The flag is cleared anyway, and the next write to such a block happens in place instead of CoW, corrupting the other file that shares it.
Commit a23eca88448e ("xfs: fix exchange-range reflink flag clearing issue with INO1_WRITTEN") fixed one instance of this. Rather than add another special case, stop moving the flags. xfs_exchmaps_ensure_reflink() already sets the flag on both inodes before the exchange, so both just keep it.
Nothing sets CLEAR_INO{1,2}_REFLINK anymore. Intents logged by older kernels may still carry them; recovery already masks them off, so they stay in the log format mask and are ignored.
XFS_IOC_SWAPEXT has the same problem: it moves the reflink flag from one inode to the other along with the extents. Just removing that is not enough here: the exchange path flags both inodes up front in xfs_exchmaps_ensure_reflink(), but swapext has no such step, so the inode receiving the shared extents would be left without the flag. Set it on both inodes instead, and make sure both have a CoW fork, since an inode with the reflink flag is expected to have one.
The flag now stays until FALLOC_FL_UNSHARE_RANGE, xfs_scrub, or a truncate to zero removes it.
The reflink-exchange eligibility helper contains a duplicate INO1_WRITTEN guard in the code being updated. Remove both copies with the helper, as neither is needed once reflink flag clearing is removed.
Stable-dep-of: 7dfb218c829c ("xfs: fix exchange-range-to-eof file size exchange")
--- fs/xfs/libxfs/xfs_exchmaps.c | 90 ++-------------------------------- fs/xfs/libxfs/xfs_log_format.h | 4 +- fs/xfs/xfs_bmap_util.c | 15 +++--- 3 files changed, 10 insertions(+), 99 deletions(-)
fs/xfs/libxfs/xfs_exchmaps.c +3 -87
@@ -49,7 +49,7 @@ struct xfs_exchmaps_adjacent { .right2 = { .br_startblock = HOLESTARTBLOCK }, \ } -/* Information to reset reflink flag / CoW fork state after an exchange. */ +/* Information to reset CoW fork state after an exchange. */ /* * If the reflink flag is set on either inode, make sure it has an incore CoW
@@ -127,9 +127,7 @@ xmi_has_more_exchange_work(const struct xfs_exchmaps_intent *xmi)static inline bool xmi_has_postop_work (const struct xfs_exchmaps_intent *xmi) { -return xmi->xmi_flags & (XFS_EXCHMAPS_CLEAR_INO1_REFLINK | -XFS_EXCHMAPS_CLEAR_INO2_REFLINK | - __XFS_EXCHMAPS_INO2_SHORTFORM); +return xmi->xmi_flags & __XFS_EXCHMAPS_INO2_SHORTFORM; }/* Check all mappings to make sure we can actually exchange them. */
@@ -525,18 +523,6 @@ xfs_exchmaps_link_to_sf(return error; } -/* Clear the reflink flag after an exchange. */ -static inline void -xfs_exchmaps_clear_reflink ( -struct xfs_trans *tp, -struct xfs_inode *ip) -{ -trace_xfs_reflink_unset_inode_flag (ip); - - ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK ; -xfs_trans_log_inode (tp, ip,XFS_ILOG_CORE ); -} -/* Finish whatever work might come after an exchange operation. */ static int xfs_exchmaps_do_postop_work(
@@ -557,16 +543,6 @@ xfs_exchmaps_do_postop_work(return error; } -if (xmi->xmi_flags &XFS_EXCHMAPS_CLEAR_INO1_REFLINK ) { -xfs_exchmaps_clear_reflink (tp, xmi->xmi_ip1); - xmi->xmi_flags &= ~XFS_EXCHMAPS_CLEAR_INO1_REFLINK ; - } - -if (xmi->xmi_flags &XFS_EXCHMAPS_CLEAR_INO2_REFLINK ) { -xfs_exchmaps_clear_reflink (tp, xmi->xmi_ip2); - xmi->xmi_flags &= ~XFS_EXCHMAPS_CLEAR_INO2_REFLINK ; - } -return 0 ; }
@@ -946,56 +922,13 @@ xfs_exchmaps_intent_destroy_cache(void) }/* -* Decide if we will exchange the reflink flags between the two files after the -* exchange. The only time we want to do this is if we're exchanging all -* mappings under EOF and the inode reflink flags have different states. +* Allocate and initialize a new incore intent item from a request. */ -static inline bool -xmi_can_exchange_reflink_flags ( -const struct xfs_exchmaps_req *req, -unsigned int reflink_state) -{ -struct xfs_mount *mp = req->ip1->i_mount; - -/* -* The INO1_WRITTEN optimization can skip exchanging hole and -* unwritten mappings, which means we cannot guarantee that all -* shared extents actually moved to the other file. Clearing the -* reflink flag of an inode that still holds shared extents breaks -* the CoW write path, so refuse to exchange the flags in that case. -*/ -if (req->flags &XFS_EXCHMAPS_INO1_WRITTEN ) -return false; - -/* -* The INO1_WRITTEN optimization can skip exchanging hole and -* unwritten mappings, which means we cannot guarantee that all -* shared extents actually moved to the other file. Clearing the -* reflink flag of an inode that still holds shared extents breaks -* the CoW write path, so refuse to exchange the flags in that case. -*/ -if (req->flags &XFS_EXCHMAPS_INO1_WRITTEN ) -return false; - -if (hweight32 (reflink_state) !=1 ) -return false; -if (req->startoff1 !=0 || req->startoff2 !=0 ) -return false; -if (req->blockcount !=XFS_B_TO_FSB (mp, req->ip1->i_disk_size)) -return false; -if (req->blockcount !=XFS_B_TO_FSB (mp, req->ip2->i_disk_size)) -return false; -return true; -} - - -/* Allocate and initialize a new incore intent item from a request. */ struct xfs_exchmaps_intent *xfs_exchmaps_init_intent (const struct xfs_exchmaps_req *req) {struct xfs_exchmaps_intent *xmi; -unsigned int rs =0 ; xmi =kmem_cache_zalloc (xfs_exchmaps_intent_cache,GFP_NOFS | __GFP_NOFAIL);
@@ -1019,23 +952,6 @@ xfs_exchmaps_init_intent( xmi->xmi_isize2 = req->ip1->i_disk_size; } -/* Record the state of each inode's reflink flag before the op. */ -if (xfs_is_reflink_inode (req->ip1)) - rs |=1 ; -if (xfs_is_reflink_inode (req->ip2)) - rs |=2 ; - -/* -* Figure out if we're clearing the reflink flags (which effectively -* exchanges them) after the operation. -*/ -if (xmi_can_exchange_reflink_flags (req, rs)) { -if (rs &1 ) - xmi->xmi_flags |=XFS_EXCHMAPS_CLEAR_INO1_REFLINK ; -if (rs &2 ) - xmi->xmi_flags |=XFS_EXCHMAPS_CLEAR_INO2_REFLINK ; - } -if (S_ISDIR (VFS_I (xmi->xmi_ip2)->i_mode) ||S_ISLNK (VFS_I (xmi->xmi_ip2)->i_mode)) xmi->xmi_flags |= __XFS_EXCHMAPS_INO2_SHORTFORM;
fs/xfs/libxfs/xfs_log_format.h +1 -3
@@ -948,10 +948,8 @@ struct xfs_xmi_log_format {*/ #define XFS_EXCHMAPS_INO1_WRITTEN (1ULL << 2) -/* Clear the reflink flag from inode1 after the operation. */ +/* No longer set, but older intents may carry them; keep them valid. */ #define XFS_EXCHMAPS_CLEAR_INO1_REFLINK (1ULL << 3) - -/* Clear the reflink flag from inode2 after the operation. */ #define XFS_EXCHMAPS_CLEAR_INO2_REFLINK (1ULL << 4)#define XFS_EXCHMAPS_LOGGED_FLAGS (XFS_EXCHMAPS_ATTR_FORK | \
fs/xfs/xfs_bmap_util.c +6 -9
@@ -1504,7 +1504,6 @@ xfs_swap_extents(struct xfs_bstat *sbp = &sxp->sx_stat;int src_log_flags, target_log_flags;int error =0 ; -uint64_t f;int resblks =0 ;unsigned int flags =0 ;struct timespec64 ctime, mtime;
@@ -1648,14 +1647,12 @@ xfs_swap_extents(if (error) goto out_trans_cancel; -/* Do we have to swap reflink flags? */ -if ((ip->i_diflags2 &XFS_DIFLAG2_REFLINK ) ^ - (tip->i_diflags2 &XFS_DIFLAG2_REFLINK )) { - f = ip->i_diflags2 &XFS_DIFLAG2_REFLINK ; - ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK ; - ip->i_diflags2 |= tip->i_diflags2 &XFS_DIFLAG2_REFLINK ; - tip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK ; - tip->i_diflags2 |= f &XFS_DIFLAG2_REFLINK ; +/* Either inode may now own shared blocks; flag both, with CoW forks. */ +if ((ip->i_diflags2 | tip->i_diflags2) &XFS_DIFLAG2_REFLINK ) { + ip->i_diflags2 |=XFS_DIFLAG2_REFLINK ; + tip->i_diflags2 |=XFS_DIFLAG2_REFLINK ; +xfs_ifork_init_cow (ip); +xfs_ifork_init_cow (tip); }/* Swap the cow forks. */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 7/869 xfs: fix exchange-range-to-eof file size exchange
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
[ Upstream commit 7dfb218c829c1acb626e0fe92c5fddb9a26a03e9 ]
Norbert Szetei posted a patch containing an incomplete description of a bug in XFS_IOC_EXCHANGE_RANGE's TO_EOF flag. The bug tricks exchange-range into modifying a file so that it has shared blocks starting beyond EOF, which is never allowed because files never have written data beyond EOF, and you can only share written data blocks. This is key to all the incorrect behavior that follows.
Eventually I got from Norbert a description of what's going wrong:
Quoted 37 lines
Fair. Here it is with physical block numbers, 4k blocks. peer is the file that gets rewritten and file1 is the one that ends up with the flag cleared.
Start, nothing shared:
peer size 4096 -> [100] file1 size 12288 -> [200] [201] [202] donor1 size 4096 -> [300] donor2 size 4096 -> [400]1. FICLONERANGE peer's block into file1's middle slot:
peer size 4096 -> [100] file1 size 12288 -> [200] [100] [202] reflink flag set ^^^^^ both files own block 1002.
XFS_IOC_EXCHANGE_RANGEfile1 against donor1,file1_offset0,file2_offset8192, length 0,TO_EOF. One block is exchanged, and the sizes are exchanged with it:file1 size 4096 -> [200] [100] [300] reflink flag set ^^^^^^^^^^^ still owned, now past the size donor1 size 12288 -> [202]file1 says it is one block long while it still owns three. Nothing was unmapped.
file2_offsetis block 2, so this exchange cannot clear a flag.3.
XFS_IOC_EXCHANGE_RANGEfile1 against donor2, both offsets 0, length 4096. Byi_disk_sizethis is two one-block files exchanging everything, soxmi_can_exchange_reflink_flags()agrees and the flag is cleared:file1 size 4096 -> [400] [100] [300] reflink flag CLEARED donor2 size 4096 -> [200]Block 100 is still shared with peer.
Quoted 8 lines
4.
pwrite(file1, 4096, 4096), which is file1's second slot, block 100.xfs_is_cow_inode(file1)is false, so no CoW:peer size 4096 -> [100] same block, new contentsBlock 100 is the only one that matters here. PoC below, it reads a file called peer in the current directory. The filesystem needs reflink and exchange-range, which mkfs.xfs 7.x turns on by default.
So yes, TO_EOF is screwing up the file size even if it's actually exchanging the data block correctly. The following is the intended behavior of XFS_EXCHANGE_RANGE_TO_EOF, as described by its manpage:
"Ignore the length parameter. All bytes in file1_fd from file1_offset
to EOF are moved to file2_fd, and file2's size is set to (file2_offset+(file1_length-file1_offset)). Meanwhile, all bytes in file2 from file2_offset to EOF are moved to file1 and file1's size is set to (file1_offset+(file2_length-file2_offset))."
In other words, if we only exchange a portion of the file data, then we should only exchange the portion of the file size that relates to the exchanged data. Unfortunately, the code swaps the ondisk file size and the incore file sizes, which is incorrect if the caller passes in a nonzero offset.
Having confused the file sizes, the PoC uses a second exchange-range call on what looks like a non-reflinked single-block file. Because the file size is set incorrectly, exchange-range thinks it's exchanging the full contents of two files and clears the reflink flag on the broken file. That enables an extending write of the broken file to rewrite the shared block that's just past EOF. This has become known colloquially as refluxfs.
Once the file sizes are set correctly, the second exchange-range no longer thinks that it's doing a full-contents swap, so it won't clear the reflink flag on either of its file arguments.
Norbert followed up to an earlier version of this patch with a second complaint about us not handling the i_disk_size state correctly:
Quoted 6 lines
The offsets are bounded against the incore
i_sizebut subtracted from the ondiski_disk_size, so a file that has not been written back givesxmi_isize1= 0 + (0 - 12288).For instance, you can do:
Quoted 9 lines
$ xfs_io -f -c "pwrite -q 0 4096" -c fsync file1 $ xfs_io -f -c "pwrite -q 0 12288" \ -c "exchangerange -s 0 -d 12288 file1" dirty $ stat -c %s file1 0 $ stat -c %i file1 131 $ sudo xfs_io -r -c "bulkstat_single 131" . | grep bs_size bs_size = 18446744073709539328
That's wrong, and the new file size update logic depends on the ondisk i_disk_size matching the incore i_size, so flush the pagecache as needed to push it upwards.
--- fs/xfs/libxfs/xfs_exchmaps.c | 13 +++++++-- fs/xfs/xfs_exchrange.c | 51 ++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 16 deletions(-)
fs/xfs/libxfs/xfs_exchmaps.c +11 -2
@@ -929,6 +929,7 @@ xfs_exchmaps_init_intent( const struct xfs_exchmaps_req *req) {struct xfs_exchmaps_intent *xmi; +struct xfs_mount *mp = req->ip1->i_mount; xmi =kmem_cache_zalloc (xfs_exchmaps_intent_cache,GFP_NOFS | __GFP_NOFAIL);
@@ -946,10 +947,18 @@ xfs_exchmaps_init_intent(return xmi; } +/* +* If the caller wanted, set each file's size to that file's exchange +* offset + length exchanged from the other file because the ranges in +* each file might be different lengths. +*/ if (req->flags &XFS_EXCHMAPS_SET_SIZES ) { +loff_t off1 =XFS_FSB_TO_B (mp, xmi->xmi_startoff1); +loff_t off2 =XFS_FSB_TO_B (mp, xmi->xmi_startoff2); + xmi->xmi_flags |=XFS_EXCHMAPS_SET_SIZES ; - xmi->xmi_isize1 = req->ip2->i_disk_size; - xmi->xmi_isize2 = req->ip1->i_disk_size; + xmi->xmi_isize1 = off1 + (req->ip2->i_disk_size - off2); + xmi->xmi_isize2 = off2 + (req->ip1->i_disk_size - off1); } if (S_ISDIR(VFS_I(xmi->xmi_ip2)->i_mode) ||
fs/xfs/xfs_exchrange.c +37 -14
75 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 8/869 ip6_gre: remove obsolete ERSPAN PMTU update
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <[email protected]>
[ Upstream commit 8bc60db48e8cba35488bbd6e1f94aa990afa275a ]
A tc tunnel_key action can attach a METADATA_IP_TUNNEL dst to an skb, and mirred can redirect it to a native ip6erspan device. The legacy PMTU update in ip6erspan_tunnel_xmit() treats that metadata dst as a route. Since it has no output device, dst_dev(dst)->mtu dereferences NULL.
On v7.2 with KASAN, an initial UID/GID 65534 process with CapEff 0 used self-created user and network namespaces to trigger:
KASAN: null-ptr-deref RIP: ip6erspan_tunnel_xmit+0x10fc/0x2cc0 Kernel panic - not syncing: Fatal exception in interrupt
The update is obsolete. Commit fe1a4ca0a2b7 ("ip6_gre: process toobig in a better way") changed IPv6 GRE Too Big handling to update the underlay route and removed the equivalent block from __gre6_xmit(). ip6_tnl_xmit() then propagates the underlay PMTU to the overlay route.
Remove the stale ERSPAN copy and its now-unused dst variable. This eliminates the metadata-dst dereference and keeps ERSPAN aligned with IPv6 GRE PMTU handling.
--- net/ipv6/ip6_gre.c | 7 ------- 1 file changed, 7 deletions(-)
net/ipv6/ip6_gre.c +0 -7
@@ -951,7 +951,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, {struct ip_tunnel_info *tun_info =NULL ;struct ip6_tnl *t =netdev_priv (dev); -struct dst_entry *dst =skb_dst (skb);IP_TUNNEL_DECLARE_FLAGS (flags) = { };bool truncate = false;int encap_limit =-1 ;
@@ -1087,12 +1086,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,gre_build_header (skb,8 , flags, proto,0 ,htonl (atomic_fetch_inc (&t->o_seqno))); -/* TooBig packet may have updated dst->dev's mtu */ -if (!t->parms.collect_md && dst) { - mtu =READ_ONCE (dst_dev (dst)->mtu); -if (dst6_mtu (dst) > mtu) - dst->ops->update_pmtu (dst,NULL , skb, mtu, false); - } err =ip6_tnl_xmit (skb, dev, dsfield, &fl6, encap_limit, &mtu,NEXTHDR_GRE );if (err !=0 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 9/869 xfs: xfs_ifree_cluster vs xfs_iflush_shutdown_abort deadlock
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
[ Upstream commit 09234a632be42573d9743ac5ff6773622d233ad0 ]
Lock order of xfs_ifree_cluster() is cluster buffer -> try ILOCK -> IFLUSHING, except for the last inode in the cluster that is triggering the free. In that case, the lock order is ILOCK -> cluster buffer -> IFLUSHING.
xfs_iflush_cluster() uses cluster buffer -> try ILOCK -> IFLUSHING, so this can safely run concurrently with xfs_ifree_cluster().
xfs_inode_item_precommit() uses ILOCK -> cluster buffer, but this cannot race with xfs_ifree_cluster() so being in a different order will not trigger a deadlock.
xfs_reclaim_inode() during a filesystem shutdown uses ILOCK -> IFLUSHING -> cluster buffer via xfs_iflush_shutdown_abort(), and this deadlocks against xfs_ifree_cluster() like so:
sysrq: Show Blocked State
task:kworker/10:37 state:D stack:12560 pid:276182 tgid:276182 ppid:2 flags:0x00004000
Workqueue: xfs-inodegc/dm-3 xfs_inodegc_worker Call Trace: <TASK> __schedule+0x650/0xb10 schedule+0x6d/0xf0 schedule_timeout+0x8b/0x180 schedule_timeout_uninterruptible+0x1e/0x30 xfs_ifree+0x326/0x730 xfs_inactive_ifree+0xcb/0x230 xfs_inactive+0x2c8/0x380 xfs_inodegc_worker+0xaa/0x180 process_scheduled_works+0x1d4/0x400 worker_thread+0x234/0x2e0 kthread+0x147/0x170 ret_from_fork+0x3e/0x50 ret_from_fork_asm+0x1a/0x30 </TASK> task:fsync-tester state:D stack:12160 pid:2255943 tgid:2255943 ppid:3988702 flags:0x00004006 Call Trace: <TASK> __schedule+0x650/0xb10 schedule+0x6d/0xf0 schedule_timeout+0x31/0x180 __down_common+0xbe/0x1f0 __down+0x1d/0x30 down+0x48/0x50 xfs_buf_lock+0x3d/0xe0 xfs_iflush_shutdown_abort+0x51/0x1e0 xfs_icwalk_ag+0x386/0x690 xfs_reclaim_inodes_nr+0x114/0x160 xfs_fs_free_cached_objects+0x19/0x20 super_cache_scan+0x17b/0x1a0 do_shrink_slab+0x180/0x350 shrink_slab+0xf8/0x430 drop_slab+0x97/0xf0 drop_caches_sysctl_handler+0x59/0xc0 proc_sys_call_handler+0x189/0x280 proc_sys_write+0x13/0x20 vfs_write+0x33d/0x3f0 ksys_write+0x7c/0xf0 __x64_sys_write+0x1b/0x30 x64_sys_call+0x271d/0x2ee0 do_syscall_64+0x68/0x130 entry_SYSCALL_64_after_hwframe+0x76/0x7e
We can't change the lock order of xfs_ifree_cluster() - XFS_ISTALE and XFS_IFLUSHING are serialised through to journal IO completion by the cluster buffer lock being held.
There's quite a few asserts in the code that check that XFS_ISTALE does not occur out of sync with buffer locking (e.g. in xfs_iflush_cluster). There's also a dependency on the inode log item being removed from the buffer before XFS_IFLUSHING is cleared, also with asserts that trigger on this.
Further, we don't have a requirement for the inode to be locked when completing or aborting inode flushing because all the inode state updates are serialised by holding the cluster buffer lock across the IO to completion.
We can't check for XFS_IRECLAIM in xfs_ifree_mark_inode_stale() and skip the inode, because there is no guarantee that the inode will be reclaimed. Hence it *must* be marked XFS_ISTALE regardless of whether reclaim is preparing to free that inode. Similarly, we can't check for IFLUSHING before locking the inode because that would result in dirty inodes not being marked with ISTALE in the event of racing with XFS_IRECLAIM.
Hence we have to address this issue from the xfs_reclaim_inode() side. It is clear that we cannot hold the inode locked here when calling xfs_iflush_shutdown_abort() because it is the inode->buffer lock order that causes the deadlock against xfs_ifree_cluster().
Hence we need to drop the ILOCK before aborting the inode in the shutdown case. Once we've aborted the inode, we can grab the ILOCK again and then immediately reclaim it as it is now guaranteed to be clean.
Note that dropping the ILOCK in xfs_reclaim_inode() means that it can now be locked by xfs_ifree_mark_inode_stale() and seen whilst in this state. This is safe because we have left the XFS_IFLUSHING flag on the inode and so xfs_ifree_mark_inode_stale() will simply set XFS_ISTALE and move to the next inode. An ASSERT check in this path needs to be tweaked to take into account this new shutdown interaction.
--- fs/xfs/xfs_icache.c | 8 ++++++++ fs/xfs/xfs_inode.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
fs/xfs/xfs_icache.c +8 -0
@@ -923,7 +923,15 @@ xfs_reclaim_inode(*/ if (xlog_is_shutdown (ip->i_mount->m_log)) {xfs_iunpin_wait (ip); +/* +* Avoid a ABBA deadlock on the inode cluster buffer vs +* concurrent xfs_ifree_cluster() trying to mark the inode +* stale. We don't need the inode locked to run the flush abort +* code, but the flush abort needs to lock the cluster buffer. +*/ +xfs_iunlock (ip,XFS_ILOCK_EXCL );xfs_iflush_shutdown_abort (ip); +xfs_ilock (ip,XFS_ILOCK_EXCL ); goto reclaim; }if (xfs_ipincount (ip))
fs/xfs/xfs_inode.c +1 -1
@@ -1624,7 +1624,7 @@ xfs_ifree_mark_inode_stale( iip = ip->i_itemp;if (__xfs_iflags_test (ip,XFS_IFLUSHING )) {ASSERT (!list_empty (&iip->ili_item.li_bio_list)); -ASSERT (iip->ili_last_fields); +ASSERT (iip->ili_last_fields ||xlog_is_shutdown (mp->m_log)); goto out_iunlock; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainercover 6.12.114-rc1 review
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +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.114-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.114-rc1
Philipp Stanner <[email protected]>
drm/panfrost: Fix scheduler workqueue bug
David Hildenbrand <[email protected]>
s390/uv: Don't return 0 from make_hva_secure() if the operation was not successful
Toke Høiland-Jørgensen <[email protected]>
wifi: atk9k: Revert "wifi: ath9k: reject short WMI command responses"
Mattia Meleleo <[email protected]>
bpf, sockmap: Account for receive queue in FIONREAD without a verdict program
Thomas Gleixner <[email protected]>
irqwork: Move data struct to a types header
Suren Baghdasaryan <[email protected]>
types: move struct rcuwait into types.h
Ben Cressey <[email protected]>
dm-integrity: fix buffer overflow with keyed discard
Steven Rostedt <[email protected]>
tracing: Fix comment in tracing_buffers_splice_read()
Karl Mehltretter <[email protected]>
tracing: Fix ring_buffer_read_page_size() kernel-doc
Stanley Chu <[email protected]>
i3c: master: svc: Fix i3c_master_get_free_addr return check
Stanley Chu <[email protected]>
i3c: master: svc: Fix npcm845 FIFO_EMPTY quirk
Stanley Chu <[email protected]>
i3c: master: svc: Fix missed IBI after false SLVSTART on NPCM845
Ruoyu Wang <[email protected]>
gpiolib: initialize return value in gpiochip_set_multiple()
Mathieu Dubois-Briand <[email protected]>
gpiolib: Allow to use setters with return value for output-only gpios
Rafael J. Wysocki <[email protected]>
soundwire: intel_auxdevice: Fix system suspend/resume handling
Shibo Zhu <[email protected]>
PM: sleep: Unblock runtime PM when device prepare fails
Muchun Song <[email protected]>
mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback
Steffen Klassert <[email protected]>
Revert "esp: do not unref managed frag pages in esp_ssg_unref()"
Qiuxu Zhuo <[email protected]>
EDAC/igen6: Fix NULL pointer dereference
Pablo Neira Ayuso <[email protected]>
netfilter: ctnetlink: do not expose expectation DEAD flag
Qiuxu Zhuo <[email protected]>
EDAC/igen6: Fix the flood of invalid error reports
Harald Freudenberger <[email protected]>
s390/zcrypt: Fix memory leak with CCA cards used as accelerator
Eric Dumazet <[email protected]>
net: do not acquire dev->tx_global_lock in netdev_watchdog_up()
David Howells <[email protected]>
netfs: Fix folio state after ENOMEM whilst under writeback iteration
Yichong Chen <[email protected]>
netfs: release readahead folios on iterator preparation failure
Joseph Qi <[email protected]>
ocfs2: use correct endian in ocfs2_dinode_has_extents
Tejun Heo <[email protected]>
sched/psi: Create the psimon kthread outside of cgroup_mutex
Conor Dooley <[email protected]>
spi: microchip-core-qspi: stop checking viability of op->max_freq in supports_op callback
Max Kellermann <[email protected]>
ceph: always call ceph_shift_unused_folios_left()
Viacheslav Dubeyko <[email protected]>
ceph: introduce ceph_submit_write() method
Max Kellermann <[email protected]>
ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error
Hristo Venev <[email protected]>
ceph: do not skip the first folio of the next object in writeback
Adrian Hunter <[email protected]>
i3c: mipi-i3c-hci: Preserve RUN bit when aborting DMA ring
Jon Hunter <[email protected]>
soc/tegra: pmc: Add kerneldoc for wake-up variables
Thierry Reding <[email protected]>
soc/tegra: pmc: Document tegra_pmc.syscore field
Ming Qian <[email protected]>
media: verisilicon: Fix kernel panic due to __initconst misuse
Kuniyuki Iwashima <[email protected]>
mpls: Set rt->rt_nhn just before returning from mpls_nh_build_multi().
Kuniyuki Iwashima <[email protected]>
net: Fix wild-memory-access in __register_pernet_operations() when CONFIG_NET_NS=n.
Pankaj Gupta <[email protected]>
KVM: SEV: Drop FOLL_WRITE for encrypted region registration
Wludzik, Jozef <[email protected]>
accel/ivpu: Fix race condition when mapping dmabuf
Nitin Rawat <[email protected]>
scsi: ufs: qcom : Fix NULL pointer dereference in ufs_qcom_setup_clocks
Claudio Imbrenda <[email protected]>
s390/kvm: Mask extra bits from program interrupt code
Claudio Imbrenda <[email protected]>
KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion
Claudio Imbrenda <[email protected]>
KVM: s390: pv: fix race when making a page secure
Claudio Imbrenda <[email protected]>
KVM: s390: move gmap_shadow_pgt_lookup() into kvm
Claudio Imbrenda <[email protected]>
KVM: s390: use __kvm_faultin_pfn()
Claudio Imbrenda <[email protected]>
KVM: s390: move pv gmap functions into kvm
Claudio Imbrenda <[email protected]>
KVM: s390: wrapper for KVM_BUG
Claudio Imbrenda <[email protected]>
s390/kvm: Initialize uninitialized flags variable
Cyril Bur <[email protected]>
riscv: uaccess: Only restore the CSR_STATUS SUM bit
Ming Lei <[email protected]>
ublk: fix dead loop when canceling io command
Steven Rostedt <[email protected]>
xfs: remove unused trace event xfs_dqreclaim_dirty
Adrian Hunter <[email protected]>
i3c: master: Fix recursive locking during device registration
Zide Chen <[email protected]>
perf/x86/intel/uncore: Fix uncore_box ref/unref ordering
Shukai Ni <[email protected]>
dm-integrity: replace forgeable discard filler with a keyed sector marker
Cen Zhang <[email protected]>
ocfs2: validate external xattr entries when reading metadata
Kaitao Cheng <[email protected]>
bpf: Clear rb node linkage when freeing bpf_rb_root
Hou Tao <[email protected]>
bpf: Remove migrate_{disable|enable} in bpf_obj_free_fields()
Dan Williams <[email protected]>
cxl/region: Resolve region deletion races
Guoniu Zhou <[email protected]>
pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI
Sebastian Ene <[email protected]>
firmware: arm_ffa: Fix Endpoint Memory Access Descriptor offset calculation
Sudeep Holla <[email protected]>
firmware: arm_ffa: Add support for IMPDEF value in the memory access descriptor
Damien Riégel <[email protected]>
greybus: raw: fix use-after-free if write is called after disconnect
Yosry Ahmed <[email protected]>
KVM: nSVM: Triple fault if restore host CR3 fails on nested #VMEXIT
Rafael J. Wysocki <[email protected]>
ACPI: platform: Use acpi_bus_get_primary_device()
Al Viro <[email protected]>
functionfs: fix the open/removal races
Benjamin Leggett <[email protected]>
drm/virtio: use the DMA API for resource backing on Xen
Vivek Kasireddy <[email protected]>
drm/virtio: Add a helper to map and note the dma addrs and lengths
Dongwon Kim <[email protected]>
drm/virtio: Use drm_gem_plane_helper_prepare_fb()
Sajal Gupta <[email protected]>
drm/gud: validate GUD_ROTATION_0 is present in supported rotations
Tetsuo Handa <[email protected]>
printk: Don't WARN on kthread_run failure.
Eduard Zingerman <[email protected]>
bpf: check_cond_jmp_op(): properly infer if register is null
Lorenzo Bianconi <[email protected]>
net: stmmac: fix dma mapping leak in stmmac_tso_xmit()
Huiwen He <[email protected]>
smb/client: invalidate fscache for fallocate range operations
Eric Dumazet <[email protected]>
ipv6: mcast: use rcu_assign_pointer() for __rcu list updates
Eduard Zingerman <[email protected]>
bpf: backtrack_insn(): Handle ld_{abs,ind} subprog exit edge
Eduard Zingerman <[email protected]>
bpf: backtracking shouldn't clear outer frame R1-R5 for callbacks
FAN YE <[email protected]>
btrfs: zstd: fix lost wakeup when waiting for a workspace
Kuniyuki Iwashima <[email protected]>
net: Remove conflicting altnames for dying netns in __dev_change_net_namespace().
Nicolas Dichtel <[email protected]>
net: plumb extack in __dev_change_net_namespace()
Nicolas Dichtel <[email protected]>
net: rename netns_local to netns_immutable
Gao Xiang <[email protected]>
erofs: disable LZ4 rolling decompression for now
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Mark signal tracepoint siginfo arguments as scalar
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Mark syscall helpers as sleepable
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Refactor and fix init_config access
Eduard Zingerman <[email protected]>
bpf: zero extend the result of an arena 32-bit cmpxchg
Eduard Zingerman <[email protected]>
bpf: don't rewrite bpf_fastcall patterns entered by a jump
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Check ancestor frames for rbtree callbacks
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Reject legacy packet loads from callbacks
Eduard Zingerman <[email protected]>
bpf: Don't infer non-NULL from a pointer with an unbounded offset
Ning Ding <[email protected]>
bpf: Keep refcount_acquire nullable for borrowed RCU kptrs
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Mark NULL kptr stores precise
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Preserve inner map identity in callback frames
Vincent Donnefort <[email protected]>
tracing: Fix subbuf resize races with trace_pipe_raw readers
Eduard Zingerman <[email protected]>
bpf: mark a NULL call argument precise
Karl Mehltretter <[email protected]>
iommu/amd: Do not reallocate GA log buffers on resume
Alexander Graf <[email protected]>
virtio_ring: fix stale descriptor flags after a failed packed add
Jia Jia <[email protected]>
vduse: validate virtqueue alignment
Jia Jia <[email protected]>
vhost: invalidate vring access on IOTLB transitions
Krystian Kaniewski <[email protected]>
Bluetooth: hci_sysfs: Fix NULL pointer dereference in device_del()
Carolina Jubran <[email protected]>
net/mlx5e: Move representor vnic reporter to eswitch devlink port
Dapeng Mi <[email protected]>
perf/x86/intel: Prevent drain_pebs() reentry
Arunpravin Paneer Selvam <[email protected]>
drm/amdgpu: skip the VMID 0 flush for VRAM
Paulo Alcantara <[email protected]>
smb: client: honor forceuid/forcegid when mapping SIDs to uid/gid
Paulo Alcantara <[email protected]>
smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr()
Arie Miller <[email protected]>
hwmon: (asus_rog_ryujin) Validate HID report lengths
Arie Miller <[email protected]>
hwmon: (asus_rog_ryujin) Add per-device configuration
Guenter Roeck <[email protected]>
hwmon: (asus_rog_ryujin) Rely on subsystem locking
Stanley Chu <[email protected]>
i3c: master: svc: Prevent IRQ storm from false SLVSTART on NPCM845
Stanley Chu <[email protected]>
i3c: master: svc: Fix npcm845 invalid slvstart event
Stanley Chu <[email protected]>
i3c: master: svc: Fix npcm845 FIFO empty issue
Brandon Brnich <[email protected]>
media: chips-media: wave5: Release m2m_ctx after Instance Removed from List
Pengpeng Hou <[email protected]>
genirq/proc: Size interrupt directory names for 10-digit interrupt numbers
Andy Shevchenko <[email protected]>
genirq: Consistently use '%u' format specifier for unsigned int variables
Thomas Gleixner <[email protected]>
genirq/proc: Switch to lock guards
Chen-Yu Tsai <[email protected]>
pinctrl: mediatek: paris: bypass pinctrl GPIO layer in set GPIO direction
Bartosz Golaszewski <[email protected]>
pinctrl: mediatek: paris: use new GPIO line value setter callbacks
Bartosz Golaszewski <[email protected]>
pinctrl: mediatek: paris: don't double-check the GPIO number
Bartosz Golaszewski <[email protected]>
gpiolib: introduce gpio_chip setters that return values
Bartosz Golaszewski <[email protected]>
gpiolib: rework the wrapper around gpio_chip::set_multiple()
Bartosz Golaszewski <[email protected]>
gpiolib: wrap gpio_chip::set()
Bartosz Golaszewski <[email protected]>
gpiolib: make value setters have return values
Candice Li <[email protected]>
drm/amdgpu: Bound GPIO I2C table entry count from VBIOS
Alex Deucher <[email protected]>
drm/amdgpu: rework i2c init and fini
Alex Deucher <[email protected]>
drm/amdgpu/atombios: drop empty function
Dr. David Alan Gilbert <[email protected]>
drm/amdgpu: Remove unused amdgpu_i2c functions
Stepan Ionichev <[email protected]>
tty: serial: 8250: protect against NULL uart->port.dev in register
Jiri Slaby (SUSE) <[email protected]>
serial: 8250: invert serial8250_register_8250_port() CIR condition
Herve Codina <[email protected]>
driver core: Avoid warning when removing a device while its supplier is unbinding
Rafael J. Wysocki <[email protected]>
driver core: Add device_link_test() for testing device link flags
Colin Ian King <[email protected]>
PM: sleep: Fix bit masking operation
Rafael J. Wysocki <[email protected]>
PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally
Rafael J. Wysocki <[email protected]>
PM: runtime: Introduce pm_runtime_blocked()
Rafael J. Wysocki <[email protected]>
PM: Block enabling of runtime PM during system suspend
Rafael J. Wysocki <[email protected]>
PM: Rearrange documentation related to __pm_runtime_disable()
Rafael J. Wysocki <[email protected]>
PM: sleep: core: Restrict power.set_active propagation
Rafael J. Wysocki <[email protected]>
PM: sleep: core: Synchronize runtime PM status of parents and children
Sicong Huang <[email protected]>
virt: acrn: Fix irqfd use-after-free during eventfd shutdown
Dr. David Alan Gilbert <[email protected]>
virt: acrn: Remove unused list 'acrn_irqfd_clients'
Tao Cui <[email protected]>
RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: fix P2P-Device binding handling
Johannes Berg <[email protected]>
wifi: iwlwifi: simplify nested if checks
Yunxiang Li <[email protected]>
drm/amdgpu/ras: add ras_suspend callback and use it for cp_ecc_error_irq
Victor Skvortsov <[email protected]>
drm/amdgpu: Update SRIOV Exchange Headers for RAS Telemetry Support
Yongqiang Sun <[email protected]>
drm/amdkfd: fix SMI event cross-process information leak
Namjae Jeon <[email protected]>
ksmbd: fix maximum allowed access checks
Alexey Velichayshiy <[email protected]>
ksmbd: remove redundant DACL check in smb_check_perm_dacl
Val Packett <[email protected]>
remoteproc: qcom_wcnss: Fix handling the lack of PD regulators in v3
Gou Hao <[email protected]>
powerpc/xive: propagate IPI init errors to prevent use-after-free
Gou Hao <[email protected]>
powerpc/xive: add error return value to xive_smp_probe()
Rafael J. Wysocki <[email protected]>
ACPI: bus: Introduce acpi_bus_get_primary_device()
Muchun Song <[email protected]>
mm/hugetlb: initialize gigantic bootmem hugepage struct pages earlier
Kiryl Shutsemau <[email protected]>
mm/hugetlb: refactor code around vmemmap_walk
Chris Mason <[email protected]>
nfsd: convert nfsd_net boolean flags to unsigned long flags word
Ye Liu <[email protected]>
mm/page_owner: use memcg_data snapshot to avoid TOCTOU in print_page_owner_memcg()
Evgenii Burenchev <[email protected]>
drm/amd/display: Fix dangling pointer in plane reset function
Evgenii Burenchev <[email protected]>
drm/amd/display: Fix dangling pointer in CRTC reset function
Alex Bereza <[email protected]>
dmaengine: xilinx_dma: Fix CPU stall in xilinx_dma_poll_timeout
Yiyang Chen <[email protected]>
bpf: Reject MEM_ALLOC BTF accesses past object bounds
Malaya Kumar Rout <[email protected]>
time/namespace: Validate nanosecond field in proc_timens_set_offset()
Nicholas Dudar <[email protected]>
bpf: Reject writes through untrusted BTF pointers
Armin Wolf <[email protected]>
platform/x86: dell-wmi-base: Fix handling of ultra performance key
Nicholas Dudar <[email protected]>
bpf: Reject rdonly/rdwr_buf_size kfunc arguments that exceed u32 max
Qing Ming <[email protected]>
usb: gadget: uac: validate rate list length before storing
Marco Scardovi <[email protected]>
platform/x86: asus-wmi: fix resource leaks on probe failure
Maher Azzouzi <[email protected]>
esp: do not unref managed frag pages in esp_ssg_unref()
Leon Romanovsky <[email protected]>
RDMA/rvt: Return NULL after port allocation failure
Reinette Chatre <[email protected]>
fs/resctrl: Prevent use-after-free in rdtgroup_kn_put()
Sudeep Holla <[email protected]>
firmware: arm_scmi: Fix SCMI device destroy lifetimes
Ruoyu Wang <[email protected]>
drm/msm: Only fini scheduler after successful init
Philipp Stanner <[email protected]>
drm/sched: Use struct for drm_sched_init() params
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Zero queue and stack outputs on lock failure
Pu Lehui <[email protected]>
riscv, bpf: Fix kernel stack corruption in tailcall with CFI
Kees Cook <[email protected]>
kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI
Aditya Prakash Srivastava <[email protected]>
ext4: fix ABBA deadlock in ext4_xattr_inode_cache_find()
Leon Hwang <[email protected]>
bpf: Fix WARNING in bpf_tracing_link_release
Justin Yeh <[email protected]>
pinctrl: mediatek: use devm_gpiochip_add_data() for GPIO chip
Li Qiang <[email protected]>
scsi: ufs: core: Validate string descriptors
Bean Huo <[email protected]>
scsi: ufs: core: Convert string descriptor format macros to enum
Nicolin Chen <[email protected]>
iommu/tegra241-cmdqv: Don't fall back to a freed smmu after devm_krealloc()
Nicolin Chen <[email protected]>
iommu/tegra241-cmdqv: Fix VINTF0 leak on the init-failure path
Louis-Alexis Eyraud <[email protected]>
clk: mediatek: pllfh: Fix IO remapping leak in register_pllfhs error path
Gary Guo <[email protected]>
PCI: Fix UAF when probe runs concurrent to dyn ID removal
Gary Guo <[email protected]>
PCI: Fix dyn_id add TOCTOU
Gary Guo <[email protected]>
PCI: Make pci_match_one_device() match on ID instead of device
Leon Romanovsky <[email protected]>
RDMA/cxgb4: Fix dereg_skb leak and double free in write_tpt_entry()
Adrián Larumbe <[email protected]>
drm/panthor: Add vm_bind region with kbo range overlap check
Jani Nikula <[email protected]>
overflow: add range_overflows() and range_end_overflows()
Jani Nikula <[email protected]>
drm/i915: document range_overflows() and range_end_overflows() macros
Jani Nikula <[email protected]>
drm/i915: rename range_overflows_end() to range_end_overflows()
Jeff Johnson <[email protected]>
wifi: ath12k: fix overreads in ath12k_wmi_process_csa_switch_count_event()
Felix Fietkau <[email protected]>
wifi: mt76: mt7996: hold dev->mt76.mutex while disabling tx worker in SER
Felix Fietkau <[email protected]>
wifi: mt76: cancel reset and rc work on device unregister
Dmitry Baryshkov <[email protected]>
drm/msm: don't tear down KMS twice when KMS init fails
Yonghong Song <[email protected]>
bpf: Reject >8 byte return values on return-reading trampoline paths
Felix Fietkau <[email protected]>
wifi: mt76: mt7996: do not attach hif2 WED when the main WED attach failed
Will Deacon <[email protected]>
arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry
Zhao Li <[email protected]>
wifi: nl80211: clean up color-change beacon data on errors
Johannes Berg <[email protected]>
wifi: nl80211: check link is beaconing for color change
Jason Huang <[email protected]>
wifi: brcmfmac: fix P2P action frame handling without device vif
Zhao Li <[email protected]>
wifi: cfg80211: stop PMSR before P2P and NAN teardown
Karl Mehltretter <[email protected]>
serial: core: do fallible allocations before the console can be registered
Karl Mehltretter <[email protected]>
serial: core: clear freed pointers on uart_register_driver() failure
Karl Mehltretter <[email protected]>
tty: skip cdev_del() when no cdev is registered
Haoxiang Li <[email protected]>
HID: logitech-hidpp: Fix FF device cleanup on init failure
Vicki Pfau <[email protected]>
HID: steam: Reject short reads
Zheng Qixing <[email protected]>
blk-cgroup: fix race between policy activation and blkg destruction
Caleb Sander Mateos <[email protected]>
ublk: check import_ubuf() return value
Cen Zhang <[email protected]>
ocfs2: validate inline xattrs during inode block validation
Rafael J. Wysocki <[email protected]>
thermal: hwmon: Remove hwmon class device along with its parent
Linus Walleij <[email protected]>
ARM: 9481/2: breakpoint: CFI breakpoints only on demand
Cen Zhang <[email protected]>
ocfs2: o2hb: quiesce negotiate handlers and timeout work
Yufan Chen <[email protected]>
ocfs2/heartbeat: fix slot mapping rollback leaks on error paths
Jiri Olsa <[email protected]>
bpf: Clear buf on error in __bpf_get_task_stack
Jiri Olsa <[email protected]>
bpf: Remove trace_in argument from __bpf_get_stack
Jiri Olsa <[email protected]>
bpf: Factor callchain_finalize function from __bpf_get_stack
Jiri Olsa <[email protected]>
bpf: Factor callchain_store function from __bpf_get_stack
Harry Wentland <[email protected]>
drm/amd/display: Resize MST HDCP per-connector arrays to 32
Ray Wu <[email protected]>
drm/amd/display: disable replay when crc source is enabled
Yeoreum Yun <[email protected]>
coresight: etm4x: missing cscfg_csdev_disable_active_config() in perf enable
Yang Xiuwei <[email protected]>
scsi: sd: Fix special_vec mempool leak when scsi_alloc_sgtables() fails
Bart Van Assche <[email protected]>
scsi: sd: Move the sd_config_discard() function definition
Filipe Manana <[email protected]>
btrfs: defrag: fix deadlock between defrag and delalloc space reservation
Qu Wenruo <[email protected]>
btrfs: always wait for ordered extents to avoid OE races
Sun YangKai <[email protected]>
btrfs: check if root is readonly when setting posix acl
Johannes Thumshirn <[email protected]>
btrfs: zoned: don't clobber the extent buffer when zeroing it out
Qu Wenruo <[email protected]>
btrfs: qgroup: fix a wrong length calculation in qgroup_free_reserved_data()
Pauli Virtanen <[email protected]>
Bluetooth: L2CAP: use proto_lock for l2cap_data to fix l2cap_disconn_ind
Pauli Virtanen <[email protected]>
Bluetooth: ISO: fix race of kfree vs kref_get_unless_zero
Sanghyun Park <[email protected]>
bpf: Fix mmap_lock leak in irq_work path
Lu Baolu <[email protected]>
iommu/vt-d: Flush context cache with correct SID when tearing down aliases
Chuck Lever <[email protected]>
NFS: Return a delegation the client fails to record
Kuniyuki Iwashima <[email protected]>
amt: Don't support cross-netns setup.
John Johansen <[email protected]>
apparmor: fix unconfined user namespace restriction forced stack
Ning Ding <[email protected]>
bpf: Compare iterator types during state pruning
Daniel Borkmann <[email protected]>
bpf, s390: Clear fetch destination on faulting arena atomic
Marek Szyprowski <[email protected]>
clocksource/drivers/samsung_pwm: Switch to raw_spinlock_t type
Maurizio Lombardi <[email protected]>
nvmet: fix max_qid race between configfs and controller allocation
ZhengYuan Huang <[email protected]>
ocfs2: validate orphan slot during inode read
ZhengYuan Huang <[email protected]>
ocfs2: validate DIO orphan slot during inode read
Usama Arif <[email protected]>
blk-iolatency: clear delay state when freeing policy data
Usama Arif <[email protected]>
blk-iocost: clear delay state when freeing policy data
Yu Kuai <[email protected]>
blk-cgroup: delay freeing policy data after rcu grace period
John Johansen <[email protected]>
apparmor: fix deadlock in complain-mode change_hat
Yiyang Chen <[email protected]>
bpf: Check pointer type for all atomic RMW paths
Yunseong Kim <[email protected]>
ksmbd: fix slab-out-of-bounds read in ksmbd_alloc_user()
Namjae Jeon <[email protected]>
ksmbd: serialize oplock close with pending break ownership
Ilan Dudnik <[email protected]>
ksmbd: defer publishing granted locks to prevent UAF/double-free race
Gao Xiang <[email protected]>
erofs: fix interlaced ztailpacking pclusters
Namjae Jeon <[email protected]>
ksmbd: safely discard unregistered deferred locks
Namjae Jeon <[email protected]>
ksmbd: detach blocked lock requests before freeing
Namjae Jeon <[email protected]>
ksmbd: scope session state changes to bound connections
Jeuk Kim <[email protected]>
NFSv4/flexfiles: fix NULL dereference for NFSv4.0 data servers
Jiayuan Chen <[email protected]>
bpf, xdp: move offload check into dev_xdp_install()
Petr Oros <[email protected]>
dpll: fix NULL deref in dpll_device_ops() during teardown race
Anton Protopopov <[email protected]>
virtio_net: Fix resize of the RX ring
Runyu Xiao <[email protected]>
ALSA: mtpav: shut down output timer before card teardown
Eric Dumazet <[email protected]>
ip6mr: do not clone dst in ip6mr_cache_report()
Nikolay Aleksandrov <[email protected]>
net: bridge: arp/nd proxy: fix reading neigh ha
Nikolay Aleksandrov <[email protected]>
vxlan: fix reading neigh ha
Jérémy Jean <[email protected]>
NFSv4.1: zero referring call lists before decoding
Jamal Hadi Salim <[email protected]>
net/sched: account classifier filter allocations to memcg
Michael Kelley <[email protected]>
Drivers: hv: vmbus: Skip VMBus module cleanup for non-nested root partition
Pauli Virtanen <[email protected]>
Bluetooth: L2CAP: access chan->conn safely in get/setsockopt
Breno Leitao <[email protected]>
Bluetooth: L2CAP: convert to getsockopt_iter
Breno Leitao <[email protected]>
net: add getsockopt_iter callback to proto_ops
Radek Podgorny <[email protected]>
Bluetooth: do not leak an hci_conn when a second LE connect is rejected
Stanislav Fomichev <[email protected]>
xsk: honor XDP_TX_METADATA in zero-copy path
Anshumali Gaur <[email protected]>
octeontx2-vf: fix workqueue and netdev race in probe/remove
Victor Nogueira <[email protected]>
net/sched: act_ife: Only operate on Ethernet frames
Eric Dumazet <[email protected]>
net/sched: add qstats_cpu_drop_inc() helper
Eric Dumazet <[email protected]>
net_sched: sch_fq: add three drop_reason
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: skip double clone set expressions on element insert
Florian Westphal <[email protected]>
netfilter: nf_tables: prepare for multiple elements in nft_trans_elem structure
Florian Westphal <[email protected]>
netfilter: nf_tables: add nft_trans_commit_list_add_elem helper
Florian Westphal <[email protected]>
netfilter: nf_tables: prefer nft_trans_elem_alloc helper
Usama Arif <[email protected]>
mm/huge_memory: transfer the pmd dirty bit to the folio on zap
Christian Borntraeger <[email protected]>
KVM: s390: Fix memory corruption by not reinjecting CK machine checks
Qihang <[email protected]>
KVM: arm64: vgic-v3: take an LPI reference in vgic_v3_save_pending_tables
Tiezhu Yang <[email protected]>
LoongArch: BPF: Refactor jump offset calculation in tail call
Chao Yu <[email protected]>
f2fs: fix to avoid potential deadloop in f2fs_fsync_node_pages()
Jesse Zhang <[email protected]>
drm/amdgpu: force complete the KIQ ring fences on reset
Jesse Zhang <[email protected]>
drm/amdgpu: force complete the MES ring fences on reset
Priya Hosur <[email protected]>
drm/amdkfd: Add TLB flush after MES queue eviction/suspension
Xiaogang Chen <[email protected]>
drm/amdkfd: Fix error path at svm_migrate_copy_to_ram
James Zhu <[email protected]>
drm/amdkfd: return migration pages from copy function - again
Xiaogang Chen <[email protected]>
drm/amdkfd: Fix the case that vm range is hole at svm_migrate_copy_to_vram
James Zhu <[email protected]>
Revert "drm/amdkfd: return migration pages from copy function"
James Zhu <[email protected]>
drm/amdkfd: return migration pages from copy function
Emily Deng <[email protected]>
drm/amdkfd: Fix partial migrate issue
Cen Zhang (Microsoft Security FORGE Labs) <[email protected]>
ksmbd: fix tree connection use-after-free in smb2_tree_connect()
Kairui Song <[email protected]>
mm/mglru: fix and remove redundant unevictable folio handling
Kairui Song <[email protected]>
mm/mglru: use the common routine for dirty/writeback reactivation
Wei Xu <[email protected]>
mm/mglru: reset page lru tier bits when activating
Jeff Layton <[email protected]>
lockd, nfsd: RCU-protect nlmsvc_ops dispatch
Jeff Layton <[email protected]>
nfsd: restore rq_status_counter to even on all nfsd_dispatch() exit paths
Jeff Layton <[email protected]>
nfsd: fix fcache_disposal UAF by inlining dispose state into nfsd_net
Xiubo Li <[email protected]>
ceph: fix UAF in check_new_map() on session freed during unlock
Michael Bommarito <[email protected]>
ceph: cap delegated inode count in ceph_parse_deleg_inos()
Frank Sorenson <[email protected]>
cifs: call pagecache_isize_extended() in cifs_setsize() when extending
Bryam Vargas <[email protected]>
smb: client: reject a tree connect response whose byte count is too small
Jan Kara <[email protected]>
ext2: Fix lost inode updates for IS_SYNC inodes
Chuck Lever <[email protected]>
SUNRPC: Reject short RFC 4121 MIC tokens in gss_krb5_verify_mic_v2
Chuck Lever <[email protected]>
svcrdma: Clear sc_cm_id when ADDR_CHANGE replacement fails
Chuck Lever <[email protected]>
svcrdma: wake sq waiters when the transport closes
Chuck Lever <[email protected]>
svcrdma: Add Write chunk WRs to the RPC's Send WR chain
Chuck Lever <[email protected]>
svcrdma: Reject Read lists that exceed the page budget
Dawei Feng <[email protected]>
wifi: iwlwifi: dvm: fix memory leak in iwl_op_mode_dvm_start()
Johannes Berg <[email protected]>
wifi: iwlwifi: dvm: pair transport op-mode enter/leave
Jens Axboe <[email protected]>
io_uring: defer eventfd signaling when queued from a wakeup handler
Wei Fang <[email protected]>
net: tap: fix wrong transport_header when sending VLAN-tagged frame
Akihiko Odaki <[email protected]>
tap: Keep hdr_len in tap_get_user()
Leon Romanovsky <[email protected]>
ntb: Store original DMA address for future release
Koichiro Den <[email protected]>
NTB: ntb_transport: Use ntb_get_dma_dev() for DMA buffers
Koichiro Den <[email protected]>
NTB: core: Add .get_dma_dev() callback to ntb_dev_ops
Eric Dumazet <[email protected]>
tipc: avoid busy looping in tipc_exit_net()
Thomas Zimmermann <[email protected]>
fbdev: Wrap user-invoked calls to fb_set_var() in helper
Ali Ahmet Memis <[email protected]>
Bluetooth: ISO: zero the sockaddr before returning it in getname
William Palacek <[email protected]>
drm/amdkfd: Add bounds check for CRAT subtype length
Yongqiang Sun <[email protected]>
drm/amdkfd: Fix infinite loop parsing CRAT with zero subtype length
Luxiao Xu <[email protected]>
bpf: Check sk_state before sk_protocol in bpf_tcp_*_syncookie
Qu Wenruo <[email protected]>
btrfs: initialize inode mapping flags for cached inodes
Alex Deucher <[email protected]>
drm/amd/display: check if dml21_add_phantom_plane() is successful
Yuho Choi <[email protected]>
dmaengine: idxd: fix double free of wq, engine, and group structs
Michael Bommarito <[email protected]>
idpf: bound interrupt-vector register fill to the allocated array
Pauli Virtanen <[email protected]>
Bluetooth: hci_sync: hold conn in hci_connect_acl/le_sync() callbacks
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use perf_env__get_cpu_topology() in machine__resolve()
Pablo Neira Ayuso <[email protected]>
netfilter: nf_conntrack_expect: use conntrack GC to reap expectations
Terry Bowman <[email protected]>
cxl: Fix CXL_HEADERLOG_SIZE to match RAS Capability size
Prasanna Kumar T S M <[email protected]>
soc: xilinx: Fix race condition in event registration
Yihang Li <[email protected]>
scsi: hisi_sas: Add slave_destroy interface for v3 hw
Qiuxu Zhuo <[email protected]>
EDAC/igen6: Fix call trace due to missing release()
Qiuxu Zhuo <[email protected]>
EDAC/igen6: Skip absent memory controllers
Orange Kao <[email protected]>
EDAC/igen6: Add polling support
Qiuxu Zhuo <[email protected]>
EDAC/igen6: Initialize edac_op_state according to the configuration data
David Carlier <[email protected]>
netfilter: flowtable: avoid num_encaps underflow on bridge VLAN untag
Weiming Shi <[email protected]>
btrfs: lzo: reject compressed segment that overflows the compressed input
Cen Zhang <[email protected]>
ALSA: seq: oss: Serialize readq reset state with q->lock
James Clark <[email protected]>
coresight: ete: Always save state on power down
Ivan Abramov <[email protected]>
ieee802154: Avoid calling WARN_ON() on -ENOMEM in cfg802154_switch_netns()
Rosen Penev <[email protected]>
net: emac: Fix NULL pointer dereference in emac_probe
Rosen Penev <[email protected]>
net: ibm: emac: use platform_get_irq
Rosen Penev <[email protected]>
net: ibm: emac: use devm_platform_ioremap_resource
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Remove WARN_ON_ONCE from parse_btf_arg
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc4-pcm: Continue the pipeline trigger in case of IPC timeout
Peter Ujfalusi <[email protected]>
ASoC: SOF: pcm: Add snd_sof_pcm specific wrappers for dev_dbg() and dev_err()
Peter Ujfalusi <[email protected]>
ASoC: SOF: pcm: Move period/buffer configuration print after platform open
Peter Ujfalusi <[email protected]>
ASoC: SOF: Relocate and rework functionality for PCM stream freeing
Hongjie Fang <[email protected]>
scsi: core: pair EH runtime PM get and put
Jérémy Jean <[email protected]>
sctp: validate cookie AUTH state before use
Julian Anastasov <[email protected]>
ipvs: revalidate ihl to prevent out-of-bounds access
Aleksandr Nogikh <[email protected]>
firewire: ohci: fix NULL pointer dereference in ar_context_release
Mark Tomlinson <[email protected]>
gpio: pca953x: fix pca953x_irq_bus_sync_unlock regmap lock
Karthikeyan KS <[email protected]>
soc: aspeed: lpc-snoop: Fix usercopy overflow in snoop_file_read
Yun Zhou <[email protected]>
xfs: handle NULL b_addr in xfs_buf_free
David Lee <[email protected]>
btrfs: lzo: reject inline extents without valid headers
Chengfeng Ye <[email protected]>
bpf: Fix netns reference imbalance in conntrack kfuncs
Linfeng Sun <[email protected]>
vhost_iotlb: bound map allocation in add_range
Guenter Roeck <[email protected]>
hwmon: (pmbus) Fix type confusion in notification logic
Michael Chan <[email protected]>
bnxt_en: Disable EOP for TPA on all chips to prevent data corruption
Eric Dumazet <[email protected]>
netfilter: nf_flow_table: drop existing skb dst before skb_dst_set_noref()
Alexandra Winter <[email protected]>
s390/ism: Fix UAF of sba and ieq during ism_dev_exit()
Hongyan Xu <[email protected]>
watchdog: at91sam9_wdt: prevent timer rearm during teardown
Jérémy Jean <[email protected]>
tls: rx: restore msg_iter before TLS 1.3 optimistic retry
Sabrina Dubroca <[email protected]>
selftests: tls: add rekey tests
Steven Rostedt <[email protected]>
eventfs: Use children field for rcu head and add memory barriers
Zhiling Zou <[email protected]>
mm/page_table_check: skip special zero mappings
Dongjiang Zhu <[email protected]>
btrfs: skip global block reserve accounting for rescue mounts
Maciej Fijalkowski <[email protected]>
xsk: reclaim invalid Tx descriptors in ZC batch path
Maciej Fijalkowski <[email protected]>
xsk: provide sufficient space in pool->tx_descs
Jason Xing <[email protected]>
xsk: drain continuation descs after overflow in xsk_build_skb()
Cen Zhang (Microsoft) <[email protected]>
net/sched: cls_u32: validate offshift to prevent shift-out-of-bounds
David Howells <[email protected]>
netfs: Fix folio_queue ENOMEM in writeback by adding a mempool
Pauli Virtanen <[email protected]>
Bluetooth: ISO: lock sk in iso_connect_ind
Pauli Virtanen <[email protected]>
Bluetooth: ISO: hold sk properly in iso_conn_ready
Pauli Virtanen <[email protected]>
Bluetooth: hci_sync: hold conn in hci_connect_big_sync() callback
Pauli Virtanen <[email protected]>
Bluetooth: hci_sync: hold conn in hci_connect_pa_sync() callback
Hariprasad Kelam <[email protected]>
octeontx2-af: Block VFs from clobbering special CGX PKIND state
Peiyang He <[email protected]>
iommu/iommufd: Fix IOPF group ownership UAF
Hidayath Khan <[email protected]>
dibs: fix use-after-free of dmb_node in loopback attach/detach/unregister
David Howells <[email protected]>
afs: Fix UAF when sending a message
Harald Freudenberger <[email protected]>
s390/zcrypt: Close speculative mem read possibility
Harald Freudenberger <[email protected]>
s390/zcrypt: Rework domain processing within zcrypt device driver
Harald Freudenberger <[email protected]>
s390/zcrypt: Move inline function rng_type6cprb_msgx from header to code
Harald Freudenberger <[email protected]>
s390/ap/zcrypt: New xflag parameter
Harald Freudenberger <[email protected]>
s390/ap: Introduce ap message buffer pool
Harald Freudenberger <[email protected]>
s390/ap/zcrypt: Rework AP message buffer allocation
Harald Freudenberger <[email protected]>
s390/ap: Move response_type struct into ap_msg struct
George Zhang <[email protected]>
drm/amd/display: Fix divide-by-zero in calculate_mcache_setting on zero viewport
Wei Zhang <[email protected]>
wifi: ath11k: cancel SSR work items during PCI shutdown
Di Shen <[email protected]>
OPP: Fix race between OPP addition and lookup
Takashi Iwai <[email protected]>
ALSA: seq: oss: Fix UAF at handling events with embedded SysEx data
Geliang Tang <[email protected]>
nvmet-tcp: check return value of nvmet_tcp_set_queue_sock
Abd-Alrhman Masalkhi <[email protected]>
md/raid1,raid10: fix error-path detection with md_cloned_bio()
Abd-Alrhman Masalkhi <[email protected]>
md/raid1,raid10: fix bio accounting for split md cloned bios
Abd-Alrhman Masalkhi <[email protected]>
md/raid1,raid10: fix deadlock in read error recovery path
Abd-Alrhman Masalkhi <[email protected]>
md: replace wait loop with wait_event() in md_handle_request()
Miaoqing Pan <[email protected]>
wifi: ath12k: fix memory leak in ath12k_wifi7_dp_rx_h_verify_tkip_mic()
Zhang Cen <[email protected]>
ocfs2: validate fast symlink target during inode read
David Windsor <[email protected]>
bpf: Reject sleepable BPF_LSM_CGROUP programs at load time
Larysa Zaremba <[email protected]>
ixgbe: do not configure xps for XDP queues
Dan Williams <[email protected]>
cxl/region: Block region delete during region creation
Joe Damato <[email protected]>
bnxt: fix head underflow on XDP head-grow
Eric Dumazet <[email protected]>
net: watchdog: fix refcount tracking races
Cen Zhang <[email protected]>
ALSA: seq: avoid stale FIFO cells during resize
Takashi Iwai <[email protected]>
ALSA: seq: Clean up fifo locking with guard
Kuniyuki Iwashima <[email protected]>
sockmap: Fix use-after-free in udp_bpf_recvmsg()
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Initialize dpi variable to zero
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Free SRQ toggle page after firmware teardown
Leon Romanovsky <[email protected]>
RDMA/bnxt_re: Remove unusable nq variable
Kashyap Desai <[email protected]>
RDMA/bnxt_re: Fix budget handling of notification queue
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Free CQ toggle page after firmware teardown
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Add a max slot check for SQ
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Avoid repeated requests to allocate WC pages
Jacob Moroni <[email protected]>
RDMA/irdma: Replace waitqueue and flag with completion
Eric Dumazet <[email protected]>
net: serialize netif_running() check in enqueue_to_backlog()
Baoli.Zhang <[email protected]>
soundwire: fix bug in sdw_add_element_group_count found by syzkaller
Abd-Alrhman Masalkhi <[email protected]>
md/raid1: fix writes_pending and barrier reference leaks on write failures
Abd-Alrhman Masalkhi <[email protected]>
md/raid10: fix writes_pending leak on write request failures
Yiyang Chen <[email protected]>
bpf: Guard conntrack opts error writes
Eric Dumazet <[email protected]>
tipc: fix UAF in cleanup_bearer() due to premature dst_cache_destroy()
Xin Long <[email protected]>
sctp: add INIT verification after cookie unpacking
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/core) honor vrm_version in pmbus_data2reg_vid()
Boris Brezillon <[email protected]>
drm/panthor: Always use the IRQ-safe variant when acquiring the fence lock
Xin Long <[email protected]>
sctp: fix addr_wq_timer race in sctp_free_addr_wq()
Michael Bommarito <[email protected]>
xen/pvcalls: bound backend response req_id before indexing rsp[]
David Howells <[email protected]>
afs: Fix reinitialisation of the inode, in particular ->lock_work
Morduan Zang <[email protected]>
iomap: guard io_size EOF trim against concurrent truncate underflow
David Howells <[email protected]>
netfs: Fix netfs_create_write_req() to handle async cache object creation
David Howells <[email protected]>
netfs: Drop the was_async arg from netfs_read_subreq_terminated()
David Howells <[email protected]>
netfs: Abstract out a rolling folio buffer implementation
David Howells <[email protected]>
netfs: Add a tracepoint to log the lifespan of folio_queue structs
David Howells <[email protected]>
netfs: Use a folio_queue allocation and free functions
David Howells <[email protected]>
netfs: Clean up some whitespace in trace header
Feng Liu <[email protected]>
net/mlx5e: Fix publication race for priv->channel_stats[]
Cen Zhang <[email protected]>
Bluetooth: 6lowpan: avoid untracked enable work
Yuho Choi <[email protected]>
net/liquidio: drop cached VF pci_dev LUT
Eric Dumazet <[email protected]>
ipv4: igmp: Fix potential memory leaks in igmp_mod_timer() and igmp_stop_timer()
Marc Zyngier <[email protected]>
KVM: arm64: vgic: Handle race between interrupt affinity change and LPI disabling
Ian Bridges <[email protected]>
ocfs2: fix UBSAN array-index-out-of-bounds in ocfs2_sum_rightmost_rec
Deepanshu Kartikey <[email protected]>
ocfs2: validate i_refcount_loc when refcount flag is set
Dmitry Antipov <[email protected]>
ocfs2: add extra consistency checks for chain allocator dinodes
Dmitry Antipov <[email protected]>
ocfs2: add suballoc slot check in ocfs2_validate_inode_block()
Julian Sun <[email protected]>
ocfs2: correct l_next_free_rec in online check
Mikulas Patocka <[email protected]>
dm-verity: fix buffer overflow in FEC calculation
Guangshuo Li <[email protected]>
mmc: vub300: fix use-after-free on probe failure
Johan Hovold <[email protected]>
mmc: vub300: rename probe error labels
Johan Hovold <[email protected]>
mmc: vub300: fix use-after-free on disconnect
Binbin Zhou <[email protected]>
mmc: vub300: Use devm_mmc_alloc_host() helper
Bryam Vargas <[email protected]>
ata: libata-core: Add NOLPM quirk for PNY CS900 1TB SSD
Niklas Cassel <[email protected]>
ata: libata-core: Disable LPM on Silicon Motion MD619{H,G}XCLDE3TC
Zhao Li <[email protected]>
wifi: ieee80211: validate MLE common info length
Zhao Li <[email protected]>
wifi: mac80211: validate extension-frame layout before RX
Harald Freudenberger <[email protected]>
s390/zcrypt: Fix buffer over-read in cca_cipher2protkey
Amir Goldstein <[email protected]>
ovl: check access to copy_file_range source with src mounter creds
Yongqiang Sun <[email protected]>
drm/amdkfd: clamp v9 CRIU control stack checkpoint copy to BO size
Jamal Hadi Salim <[email protected]>
net/sched: Handle TC_ACT_REDIRECT from qdisc filter chains
Honglei Huang <[email protected]>
drm/amd/display: use kvzalloc to allocate struct dc
George Guo <[email protected]>
LoongArch: Fix address space mismatch in kexec command line lookup
Petr Wozniak <[email protected]>
xfrm: fix stale skb->prev after async crypto steals a GSO segment
Tejun Heo <[email protected]>
sched_ext: Don't warn on core-sched forced idle in put_prev_task_scx()
Jacob Moroni <[email protected]>
RDMA/irdma: Prevent user-triggered null deref on QP create
Christophe JAILLET <[email protected]>
wifi: cfg80211: Fix an error handling path in cfg80211_wext_siwscan()
Maoyi Xie <[email protected]>
wifi: mac80211: defer link RX stats percpu free to RCU
Sarika Sharma <[email protected]>
wifi: cfg80211: add link_station_info structure to support MLO statistics
Sarika Sharma <[email protected]>
wifi: mac80211: refactor populating mesh related fields in sinfo
Cen Zhang <[email protected]>
wifi: cfg80211: use wiphy work for socket owner autodisconnect
Mostafa Saleh <[email protected]>
firmware: arm_ffa: Fix out-of-bound writes in ffa_setup_and_transmit()
Matt Bobrowski <[email protected]>
bpf: Fix UAF in sock clone early bailouts
Fushuai Wang <[email protected]>
bpf: Use rcu_read_lock_dont_migrate in bpf_sk_storage.c
Menglong Dong <[email protected]>
rcu: add rcu_read_lock_dont_migrate()
Hou Tao <[email protected]>
bpf: Disable migration when cloning sock storage
Hou Tao <[email protected]>
bpf: Disable migration when destroying sock storage
Pauli Virtanen <[email protected]>
Bluetooth: hci_sync: extend conn_hash lookup critical sections
Arvind Yadav <[email protected]>
drm/xe/guc: Keep scheduler timeline name alive
Ruoyu Wang <[email protected]>
bnxt_en: Handle partially initialized auxiliary devices
Pavan Chebbi <[email protected]>
fwctl/bnxt_en: Refactor aux bus functions to be more generic
Weiming Shi <[email protected]>
tipc: serialize udp bearer replicast list updates
Frank Sorenson <[email protected]>
cifs: fix cifsFileInfo leak on kmalloc failure in deferred close drain paths
Frank Sorenson <[email protected]>
cifs: prevent readdir from changing file size due to stale directory metadata
Nicholas Dudar <[email protected]>
LoongArch: BPF: Zero-extend signed ALU32 div/mod results
Emil Tantilov <[email protected]>
idpf: fix max_vport related crash on allocation error during init
David Francis <[email protected]>
drm/amdkfd: Check bounds on CRIU restore queue type and mqd size
Joonas Lahtinen <[email protected]>
drm/i915/gt: Fix NULL deref on sched_engine alloc failure
Jani Nikula <[email protected]>
drm/i915/mst: limit DP MST ESI service loop
Mario Limonciello <[email protected]>
drm/amdgpu: Release VFCT ACPI table reference
Lijo Lazar <[email protected]>
drm/amdgpu: Add wrapper for freeing vbios memory
Lijo Lazar <[email protected]>
drm/amdgpu: Use dbg level for VBIOS check messages
Linmao Li <[email protected]>
drm/vc4: Shut down BO cache timer before teardown
Valery Borovsky <[email protected]>
media: stm32-dcmipp: Return queued buffers on start_streaming() failure
Alain Volmat <[email protected]>
media: stm32: dcmipp: replace s_stream with enable/disable_streams
Alain Volmat <[email protected]>
media: stm32: dcmipp: use v4l2_subdev_is_streaming
Harish Kasiviswanathan <[email protected]>
drm/amdgpu: Fix kernel panic during driver load failure
Sean Christopherson <[email protected]>
KVM: nVMX: Put vmcs12 pages if nested VM-Enter fails due to invalid guest state
Carlos López <[email protected]>
KVM: x86: Unconditionally recompute CR8 intercept on PPR update
Sean Christopherson <[email protected]>
KVM: x86: Move update_cr8_intercept() to lapic.c
Sean Christopherson <[email protected]>
KVM: x86: Rename APIC base setters to better capture their relationship
Sean Christopherson <[email protected]>
KVM: x86: Move kvm_set_apic_base() implementation to lapic.c (from x86.c)
Sean Christopherson <[email protected]>
KVM: x86: Drop superfluous kvm_lapic_set_base() call when setting APIC state
Namjae Jeon <[email protected]>
ksmbd: prevent path traversal bypass by restricting caseless retry
Haofeng Li <[email protected]>
ksmbd: validate NTLMv2 response before updating session key
Ralph Boehme <[email protected]>
smb/client: fix chown/chgrp with SMB3 POSIX Extensions
Sean Christopherson <[email protected]>
KVM: guest_memfd: Treat memslot binding offset+size as unsigned values
Guenter Roeck <[email protected]>
hwmon: (lm90) Add lock protection to lm90_alert
David Howells <[email protected]>
netfs: Fix zeropoint update where i_size > remote_i_size
Felix Gu <[email protected]>
drm/msm/adreno: Fix a reference leak in a6xx_gpu_init()
Jia Zhu <[email protected]>
erofs: fix metabuf leak in inode xattr initialization
Zhao Li <[email protected]>
wifi: mac80211: capture fast-RX rate before mesh reuses skb->cb
Sarika Sharma <[email protected]>
wifi: mac80211: fix missing RX bitrate update for mesh forwarding path
Florian Westphal <[email protected]>
netfilter: x_tables: allocate hook ops while under mutex
Florian Westphal <[email protected]>
netfilter: x_tables: allow initial table replace without emitting audit log message
Florian Westphal <[email protected]>
netfilter: ebtables: move to two-stage removal scheme
Florian Westphal <[email protected]>
netfilter: bridge: eb_tables: close module init race
David Howells <[email protected]>
netfs: Fix missing locking around retry adding new subreqs
David Howells <[email protected]>
netfs: Fix leak of request in netfs_write_begin() error handling
Guenter Roeck <[email protected]>
hwmon: (lm90) Stop work before releasing hwmon device
Qing Ming <[email protected]>
cgroup/rstat: validate cpu before css_rstat_cpu() access
Eric Dumazet <[email protected]>
tcp: fix stale per-CPU tcp_tw_isn leak enabling ISN prediction
Kuniyuki Iwashima <[email protected]>
tcp: Remove sk->sk_prot->orphan_count.
Fernando Fernandez Mancera <[email protected]>
netfilter: nf_tables: fix dst corruption in same register operation
Jakub Kicinski <[email protected]>
ethtool: rss: fix indir_table and hkey leak on get_rxfh failure
Jakub Kicinski <[email protected]>
ethtool: module: call ethnl_ops_complete() on module flash errors
Chuck Lever <[email protected]>
net/handshake: hand off the pinned file reference to accept_doit
Christian König <[email protected]>
drm/amdgpu: fix amdgpu_hmm_range_get_pages
Lorenzo Bianconi <[email protected]>
net: airoha: Add missing bits in airoha_qdma_cleanup_tx_queue()
Lorenzo Bianconi <[email protected]>
net: airoha: Do not read uninitialized fragment address in airoha_dev_xmit()
Yinjie Yao <[email protected]>
drm/amdgpu/vcn: set no_user_fence for VCN v4.0 enc ring
Jiajia Liu <[email protected]>
wifi: mt76: add wcid publish check in mt76_sta_add
Konstantin Khorenko <[email protected]>
gcov: use atomic counter updates to fix concurrent access crashes
Mikhail Lobanov <[email protected]>
f2fs: read COW data with the original inode during atomic write
Hongling Zeng <[email protected]>
fbdev: omap2: fix use-after-free in omapfb_mmap
Hongling Zeng <[email protected]>
fbdev: omap2: fix inconsistent lock returns in omapfb_mmap
Anna Maniscalco <[email protected]>
drm/msm: always recover the gpu
Yongpeng Yang <[email protected]>
f2fs: fix fsck inconsistency caused by incorrect nat_entry flag usage
Harry Wentland <[email protected]>
drm/amd/display: Fix out-of-bounds read in dp_get_eq_aux_rd_interval()
Jens Axboe <[email protected]>
io_uring/napi: cap busy_poll_to 10 msec
Olivier Langlois <[email protected]>
io_uring/napi: clean up __io_napi_do_busy_loop
Olivier Langlois <[email protected]>
io_uring/napi: Use lock guards
Olivier Langlois <[email protected]>
io_uring/napi: improve __io_napi_add
Olivier Langlois <[email protected]>
io_uring/napi: protect concurrent io_napi_entry timeout accesses
Erni Sri Satya Vennela <[email protected]>
net: mana: Guard mana_remove against double invocation
Morduan Zang <[email protected]>
net: phonet: do not BUG_ON() in pn_socket_autobind() on failed bind
Mikhail Gavrilov <[email protected]>
drm/amd/display: Wrap DCN32 phantom-plane allocation in DC_RUN_WITH_PREEMPTION_ENABLED
Qu Wenruo <[email protected]>
btrfs: only release the dirty pages io tree after successful writes
Zhenzhong Duan <[email protected]>
iommu/vt-d: Avoid NULL pointer dereference or refcount corruption
Hyunwoo Kim <[email protected]>
KVM: arm64: Take the SRCU lock for page table walks in fault injection and AT emulation
Fedor Pchelkin <[email protected]>
wifi: fix leak if split 6 GHz scanning fails
Xin Long <[email protected]>
sctp: validate embedded INIT chunk and address list lengths in cookie
Salman Alghamdi <[email protected]>
staging: rtl8723bs: rtw_mlme: add bounds checks before ie_length subtraction
Danilo Krummrich <[email protected]>
vdpa: use generic driver_override infrastructure
Ritesh Harjani (IBM) <[email protected]>
powerpc/pgtable-frag: Fix bad page state in pte_frag_destroy
Ritesh Harjani (IBM) <[email protected]>
powerpc/64s: Fix unmap race with PMD migration entries
Lorenzo Bianconi <[email protected]>
wifi: mt76: Fix memory leak destroying device
Sean Wang <[email protected]>
wifi: mt76: mt7925: fix potential deadlock in mt7925_roc_abort_sync
Eric Dumazet <[email protected]>
net: pull headers in qdisc_pkt_len_segs_init()
Damien Riégel <[email protected]>
greybus: raw: fix use-after-free on cdev close
Jianan Huang <[email protected]>
f2fs: avoid reading already updated pages during GC
Yongpeng Yang <[email protected]>
f2fs: fix data loss caused by incorrect use of nat_entry flag
Michal Schmidt <[email protected]>
ice: fix double-free of tx_buf skb
Pablo Neira Ayuso <[email protected]>
netfilter: nat: use kfree_rcu to release ops
Edward Adam Davis <[email protected]>
sched/psi: fix race between file release and pressure write
Lorenzo Bianconi <[email protected]>
net: airoha: fix BQL imbalance in TX path
Raphael Zimmer <[email protected]>
libceph: Fix potential out-of-bounds access in __ceph_x_decrypt()
Weiming Shi <[email protected]>
tap: fix stack info leak in tap_ioctl() SIOCGIFHWADDR
D. Wythe <[email protected]>
Revert "net/smc: Introduce TCP ULP support"
Li Zhijian <[email protected]>
RDMA/rxe: Fix iova-to-va conversion for MR page sizes != PAGE_SIZE
Daisuke Matsuda <[email protected]>
RDMA/rxe: Move some code to rxe_loc.h in preparation for ODP
Florian Westphal <[email protected]>
netfilter: nf_tables: use list_del_rcu for netlink hooks
Stephen Smalley <[email protected]>
selinux: allow multiple opens of /sys/fs/selinux/policy
Yicong Yang <[email protected]>
coresight: tmc-etr: Fix race condition between sysfs and perf mode
Mike Snitzer <[email protected]>
NFS/localio: prevent direct reclaim recursion into NFS via nfs_writepages
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Fix dc_link NULL handling in HPD init
Johan Hovold <[email protected]>
spi: ch341: fix devres lifetime
Yang Yingliang <[email protected]>
spi: ch341: switch to use devm_spi_alloc_host()
Jason Gunthorpe <[email protected]>
RDMA/mlx4: Fix mis-use of RCU in mlx4_srq_event()
Suren Baghdasaryan <[email protected]>
refcount: provide ops for cases when object's memory can be reused
Yongpeng Yang <[email protected]>
f2fs: fix fsck inconsistency caused by FGGC of node block
Osama Abdelkader <[email protected]>
riscv: kvm: fix vector context allocation leak
Conor Dooley <[email protected]>
spi: microchip-core-qspi: control built-in cs manually
Conor Dooley <[email protected]>
spi: microchip-core-qspi: remove unused param from mchp_coreqspi_write_op()
Conor Dooley <[email protected]>
spi: microchip-core-qspi: set min_speed_hz during probe
Miquel Raynal <[email protected]>
spi: microchip-core-qspi: Support per spi-mem operation frequency switches
Eric Biggers <[email protected]>
dm-verity-fec: fix reading parity bytes split across blocks (take 3)
Yosry Ahmed <[email protected]>
KVM: nSVM: Avoid clearing VMCB_LBR in vmcb12
Sam Edwards <[email protected]>
ceph: fix num_ops off-by-one when crypto allocation fails
Matthew Wilcox (Oracle) <[email protected]>
ceph: Remove uses of page from ceph_process_folio_batch()
Viacheslav Dubeyko <[email protected]>
ceph: introduce ceph_process_folio_batch() method
Viacheslav Dubeyko <[email protected]>
ceph: extend ceph_writeback_ctl for ceph_writepages_start() refactoring
Matthew Wilcox (Oracle) <[email protected]>
ceph: Remove call to PagePrivate2()
Yosry Ahmed <[email protected]>
KVM: nSVM: Always use NextRIP as vmcb02's NextRIP after first L2 VMRUN
Sean Christopherson <[email protected]>
KVM: x86: Rename "governed features" helpers to use "guest_cpu_cap"
Corey Minyard <[email protected]>
ipmi:ssif: Clean up kthread on errors
Yosry Ahmed <[email protected]>
KVM: SVM: Add missing save/restore handling of LBR MSRs
Deepanshu Kartikey <[email protected]>
gfs2: fix memory leaks in gfs2_fill_super error path
Jeongjun Park <[email protected]>
drm/exynos: vidi: use priv->vidi_dev for ctx lookup in vidi_connection_ioctl()
Jie Zhang <[email protected]>
net: stmmac: fix oops when split header is enabled
Boris Burkov <[email protected]>
btrfs: fix EEXIST abort due to non-consecutive gaps in chunk allocation
Guillaume Gonnet <[email protected]>
bpf: Fix tcx/netkit detach permissions when prog fd isn't given
Dave Airlie <[email protected]>
nouveau/gsp: drop WARN_ON in ACPI probes
Dragos Tatulea <[email protected]>
net/mlx5e: RX, Fix XDP multi-buf frag counting for striding RQ
Dragos Tatulea <[email protected]>
net/mlx5e: RX, Fix XDP multi-buf frag counting for legacy RQ
Miaoqian Lin <[email protected]>
rxrpc, afs: Fix missing error pointer check after rxrpc_kernel_lookup_peer()
David Howells <[email protected]>
rxrpc: kdoc: Update function descriptions and add link from rxrpc.rst
Chen Ni <[email protected]>
ASoC: amd: acp-mach-common: Add missing error check for clock acquisition
Vladimir Riabchun <[email protected]>
scsi: qla2xxx: Completely fix fcport double free
Adrian Hunter <[email protected]>
i3c: mipi-i3c-hci: Fix race in DMA ring dequeue
Adrian Hunter <[email protected]>
i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue
Kohei Enju <[email protected]>
ice: ptp: don't WARN when controlling PF is unavailable
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Fix NULL pointer dereference in dcn401_init_hw()
Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: mvm: don't send a 6E related command when not supported
Prathamesh Shete <[email protected]>
soc/tegra: pmc: Fix unsafe generic_handle_irq() call
Thierry Reding <[email protected]>
syscore: Pass context data to callbacks
Kai Huang <[email protected]>
KVM: Export hardware virtualization enabling/disabling functions
Ming Qian <[email protected]>
media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC
Nicolas Dufresne <[email protected]>
media: v4l2-mem2mem: Add a kref to the v4l2_m2m_dev structure
Heinz Mauelshagen <[email protected]>
md raid: fix hang when stopping arrays with metadata through dm-raid
Filipe Manana <[email protected]>
btrfs: don't BUG() on unexpected delayed ref type in run_one_delayed_ref()
Filipe Manana <[email protected]>
btrfs: remove 'reserved' argument from btrfs_pin_extent()
Qu Wenruo <[email protected]>
btrfs: do not ASSERT() when the fs flips RO inside btrfs_repair_io_failure()
Lijo Lazar <[email protected]>
drm/amdgpu: Skip vcn poison irq release on VF
Hugo Villeneuve <[email protected]>
drm: renesas: rz-du: mipi_dsi: fix kernel panic when rebooting for some panels
Daniil Dulov <[email protected]>
ring-buffer: Fix possible dereference of uninitialized pointer
Jackson Lee <[email protected]>
media: chips-media: wave5: Fix Null reference while testing fluster
Tetsuo Handa <[email protected]>
team: avoid NETDEV_CHANGEMTU event when unregistering slave
Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: validate sequence number of TX release report
Cédric Bellegarde <[email protected]>
ASoC: qcom: q6asm: drop DSP responses for closed data streams
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6asm: handle the responses after closing
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS on DCN35
Nicholas Carlini <[email protected]>
ksmbd: fix signededness bug in smb_direct_prepare_negotiation()
Johannes Berg <[email protected]>
wifi: iwlwifi: fix 22000 series SMEM parsing
Szymon Wilczek <[email protected]>
ntfs3: fix circular locking dependency in run_unpack_ex
Konstantin Komarov <[email protected]>
fs/ntfs3: Accumulated refactoring changes
Filipe Manana <[email protected]>
btrfs: fix zero size inode with non-zero size after log replay
David Sterba <[email protected]>
btrfs: tree-log: don't use token set/get accessors in fill_inode_item()
Joel Fernandes <[email protected]>
srcu: Use irq_work to start GP in tiny SRCU
Eric Dumazet <[email protected]>
ipv6: ioam: fix potential NULL dereferences in __ioam6_fill_trace_data()
Justin Iurman <[email protected]>
net: ioam6: fix OOB and missing lock
Long Li <[email protected]>
xfs: close crash window in attr dabtree inactivation
Long Li <[email protected]>
xfs: factor out xfs_attr3_node_entry_remove
Long Li <[email protected]>
xfs: remove bp->b_error check in xfs_attr3_root_inactive
Lee Jones <[email protected]>
HID: core: Mitigate potential OOB by removing bogus memset()
Li Chen <[email protected]>
HID: rate-limit hid_warn to prevent log flooding
Tatsuya S <[email protected]>
HID: core: Add reserved item tag for main items
Sabrina Dubroca <[email protected]>
mpls: add seqcount to protect the platform_label{,s} pair
Kuniyuki Iwashima <[email protected]>
mpls: Protect net->mpls.platform_label with a per-netns mutex.
Kuniyuki Iwashima <[email protected]>
mpls: Convert mpls_dump_routes() to RCU.
Kuniyuki Iwashima <[email protected]>
mpls: Add mpls_route_input().
Kuniyuki Iwashima <[email protected]>
mpls: Pass net to mpls_dev_get().
Kuniyuki Iwashima <[email protected]>
mpls: Add mpls_dev_rcu().
Kuniyuki Iwashima <[email protected]>
mpls: Unify return paths in mpls_dev_notify().
Kuniyuki Iwashima <[email protected]>
mpls: Hold dev refcnt for mpls_nh.
Pengpeng Hou <[email protected]>
bnxt_en: set backing store type from query type
Michael Chan <[email protected]>
bnxt_en: Update firmware interface spec to 1.10.3.85
Li Xiasong <[email protected]>
mptcp: fix soft lockup in mptcp_recvmsg()
Geliang Tang <[email protected]>
mptcp: add eat_recv_skb helper
Paolo Abeni <[email protected]>
mptcp: leverage skb deferral free
Paolo Abeni <[email protected]>
mptcp: cleanup mem accounting
Paolo Abeni <[email protected]>
mptcp: move the whole rx path under msk socket lock protection
Pauli Virtanen <[email protected]>
Bluetooth: hci_sync: hci_cmd_sync_queue_once() return -EEXIST if exists
Daniel Borkmann <[email protected]>
bpf: Fix incorrect pruning due to atomic fetch precision tracking
Peilin Ye <[email protected]>
bpf: Factor out check_load_mem() and check_store_reg()
Peilin Ye <[email protected]>
bpf: Factor out check_atomic_rmw()
Peilin Ye <[email protected]>
bpf: Factor out atomic_ptr_type_ok()
Takashi Iwai <[email protected]>
ALSA: ctxfi: Check the error for index mapping
Harin Lee <[email protected]>
ALSA: ctxfi: Refactor resource alloc for sparse mappings
Harin Lee <[email protected]>
ALSA: ctxfi: Use explicit output flag for DAIO resources
Harin Lee <[email protected]>
ALSA: ctxfi: Add hw parameter to daio_mgr_dao_init()
Oleh Konko <[email protected]>
Bluetooth: hci_event: move wake reason storage into validated event handlers
Pengpeng Hou <[email protected]>
rxrpc: proc: size address buffers for %pISpc output
Sean Christopherson <[email protected]>
KVM: SEV: Protect *all* of sev_mem_enc_register_region() with kvm->lock
Ge Yang <[email protected]>
KVM: SEV: Use long-term pin when registering encrypted memory regions
Shardul Bankar <[email protected]>
wireguard: device: use exit_rtnl callback instead of manual rtnl_lock in pre_exit
Kuniyuki Iwashima <[email protected]>
net: Add ->exit_rtnl() hook to struct pernet_operations.
Kuniyuki Iwashima <[email protected]>
net: Add ops_undo_single for module load/unload.
Kuniyuki Iwashima <[email protected]>
net: Factorise setup_net() and cleanup_net().
Kory Maincent (TI.com) <[email protected]>
drm/tilcdc: Fix removal actions in case of failed probe
Benjamin Marzinski <[email protected]>
dm: limit swapping tables for devices with zone write plugs
Janosch Frank <[email protected]>
s390/mm: Add missing secure storage access fixups for donated memory
Luca Leonardo Scorcia <[email protected]>
drm/mediatek: dsi: Store driver data before invoking mipi_dsi_host_register
Ihor Solodrai <[email protected]>
bpf: Fix exception exit lock checking for subprogs
Yonatan Nachum <[email protected]>
RDMA/efa: Fix use of completion ctx after free
Jiayuan Chen <[email protected]>
serial: core: fix infinite loop in handle_tx() for PORT_UNKNOWN
Jiri Slaby (SUSE) <[email protected]>
serial: rename local uart_port_lock() -> uart_port_ref_lock()
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: clone set on flush only
Larysa Zaremba <[email protected]>
ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz
Juri Lelli <[email protected]>
sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting
Davidlohr Bueso <[email protected]>
cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed()
Jens Axboe <[email protected]>
io_uring/rw: free potentially allocated iovec on cache put failure
Martin Kaiser <[email protected]>
riscv: trace: fix snapshot deadlock with sbi ecall
Edward Adam Davis <[email protected]>
ALSA: usb-audio: Prevent excessive number of frames
Gustavo A. R. Silva <[email protected]>
virtio_net: Fix misalignment bug in struct virtnet_info
Gustavo A. R. Silva <[email protected]>
stddef: Introduce TRAILING_OVERLAP() helper macro
Emil Tantilov <[email protected]>
idpf: fix error handling in the init_task on load
Caleb Sander Mateos <[email protected]>
block: zero non-PI portion of auto integrity buffer
Jie Zhang <[email protected]>
drm/msm: Recover HW before retire hung submit
Cong Nguyen <[email protected]>
staging: rtl8723bs: fix xmit_frame/xmit_buf leaks on mgnt-frame error paths
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Mark bpf_refcount field as unique
Haotian Zhang <[email protected]>
PCI: endpoint: Add missing NULL check for alloc_workqueue()
Manivannan Sadhasivam <[email protected]>
net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels
Jeffrey Hugo <[email protected]>
accel/qaic: Add config structs for supported cards
Johannes Berg <[email protected]>
wifi: mac80211: don't WARN for connections on invalid channels
Benjamin Berg <[email protected]>
wifi: mac80211: log link information in ieee80211_determine_chan_mode
Benjamin Berg <[email protected]>
wifi: mac80211: fix typo in HE MCS check
Johan Hovold <[email protected]>
staging: most: remove broken i2c driver
Aleksei Nikiforov <[email protected]>
s390/fpu: Fix false-positive kmsan report in fpu_vstl()
Tony Battersby <[email protected]>
scsi: qla2xxx: Clear cmds after chip reset
Akash Goel <[email protected]>
drm/panthor: Prevent potential UAF in group creation
Jacek Lawrynowicz <[email protected]>
accel/ivpu: Fix page fault in ivpu_bo_unbind_all_bos_from_context()
Jacek Lawrynowicz <[email protected]>
accel/ivpu: Rework bind/unbind of imported buffers
Tomasz Rusinowicz <[email protected]>
accel/ivpu: Allow to import single buffer into multiple contexts
Sarika Sharma <[email protected]>
wifi: ath12k: Fix MSDU buffer types handling in RX error path
Xiaoqi Zhuang <[email protected]>
coresight: ETR: Fix ETR buffer use-after-free issue
Yeoreum Yun <[email protected]>
coresight-tmc: change tmc_drvdata spinlock's type to raw_spinlock_t
Li Nan <[email protected]>
md: init bioset in mddev_init
Lorenzo Bianconi <[email protected]>
wifi: mt76: wed: use proper wed reference in mt76 wed driver callabacks
Miquel Sabaté Solà <[email protected]>
btrfs: fix double free of qgroup record after failure to add delayed ref head
Antoine Tenart <[email protected]>
net: vxlan: prevent NULL deref in vxlan_xmit_one
Gustavo Luiz Duarte <[email protected]>
netconsole: Acquire su_mutex before navigating configs hierarchy
Icenowy Zheng <[email protected]>
clk: thead: th1520-ap: set all AXI clocks to CLK_IS_CRITICAL
Nitin Rawat <[email protected]>
scsi: ufs: ufs-qcom: Fix UFS OCP issue during UFS power down (PC=3)
Nitin Rawat <[email protected]>
scsi: ufs: qcom : Refactor phy_power_on/off calls
Akiva Goldberger <[email protected]>
mlx5: Fix default values in create CQ
Cosmin Ratiu <[email protected]>
net/mlx5e: Prepare for using different CQ doorbells
Cosmin Ratiu <[email protected]>
net/mlx5: Store the global doorbell in mlx5_priv
Cosmin Ratiu <[email protected]>
net/mlx5: Fix typo of MLX5_EQ_DOORBEL_OFFSET
Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, fix bad parameter in CQ creation
Yishai Hadas <[email protected]>
RDMA/mlx5: Remove the redundant MLX5_IB_STAGE_UAR stage
Satyanarayana K V P <[email protected]>
drm/xe/guc: Add devm release action to safely tear down CT
Yifan Zhang <[email protected]>
amd/amdkfd: enhance kfd process check in switch partition
Fernando Fernandez Mancera <[email protected]>
sysfs: check visibility before changing group attribute ownership
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Do not share the name pointer between components
Amadeusz Sławiński <[email protected]>
ASoC: Intel: avs: Use topology information for endpoint numbers
Weili Qian <[email protected]>
crypto: hisilicon/qm - request reserved interrupt for virtual function
Weili Qian <[email protected]>
crypto: hisilicon/hpre - enable all clusters clock gating
Zhongqiu Han <[email protected]>
scsi: ufs: core: Fix data race in CPU latency PM QoS request handling
Stephan Gerhold <[email protected]>
remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1E
Bjorn Andersson <[email protected]>
remoteproc: qcom: pas: Conclude the rename from adsp
Krzysztof Kozlowski <[email protected]>
remoteproc: qcom_q6v5_pas: Simplify with dev_err_probe()
Bjorn Andersson <[email protected]>
remoteproc: qcom: pas: Make remoteproc name human friendly
Uwe Kleine-König <[email protected]>
remoteproc: Switch back to struct platform_driver::remove()
Matthew Brost <[email protected]>
drm/xe: Don't allow evicting of BOs in same VM in array of VM binds
Fangyu Yu <[email protected]>
RISC-V: KVM: Write hgatp register with valid mode bits
Niklas Schnelle <[email protected]>
iommu/s390: Make attach succeed when the device was surprise removed
Matthew Rosato <[email protected]>
iommu/s390: set appropriate IOTA region type
Matthew Rosato <[email protected]>
iommu/s390: handle IOAT registration based on domain
Stefan Metzmacher <[email protected]>
smb: client: let recv_done verify data_offset, data_length and remaining_data_length
Uladzislau Rezki (Sony) <[email protected]>
mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc()
Felix Fietkau <[email protected]>
wifi: mt76: mt7915: fix list corruption after hardware restart
Duoming Zhou <[email protected]>
ptp: ocp: fix use-after-free bugs causing by ptp_ocp_watchdog
Lama Kayal <[email protected]>
net/mlx5: HWS, Fix memory leak in hws_action_get_shared_stc_nic error flow
Lama Kayal <[email protected]>
net/mlx5: HWS, Fix memory leak in hws_pool_buddy_init error path
Vlad Dogaru <[email protected]>
net/mlx5: HWS, Refactor pool implementation
Vlad Dogaru <[email protected]>
net/mlx5: HWS, Make pool single resource
Vlad Dogaru <[email protected]>
net/mlx5: HWS, Remove unused element array
Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, update flow - remove the use of dual RTCs
Vlad Dogaru <[email protected]>
net/mlx5: HWS, handle returned error value in pool alloc
Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, simplify allocations as we support only FDB
Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, denote how refcounts are protected
Eric Biggers <[email protected]>
crypto: x86/aegis - Add missing error checks
Eric Biggers <[email protected]>
crypto: x86/aegis - Fix sleeping when disallowed on PREEMPT_RT
Eric Biggers <[email protected]>
crypto: x86/aegis128 - improve assembly function prototypes
Eric Biggers <[email protected]>
crypto: x86/aegis128 - optimize length block preparation using SSE4.1
Eric Biggers <[email protected]>
crypto: x86/aegis128 - eliminate some indirect calls
David Hildenbrand <[email protected]>
mm/mremap: fix WARN with uffd that has remap events disabled
William Liu <[email protected]>
net/sched: Fix backlog accounting in qdisc_dequeue_internal
Dan Carpenter <[email protected]>
wifi: iwlwifi: Fix error code in iwl_op_mode_dvm_start()
Johannes Berg <[email protected]>
wifi: iwlwifi: return ERR_PTR from opmode start()
Gabriele Monaco <[email protected]>
rv: Use strings in da monitors tracepoints
Gabriele Monaco <[email protected]>
rv: Remove trailing whitespace from tracepoint string
Tamizh Chelvam Raja <[email protected]>
wifi: ath12k: Pass ab pointer directly to ath12k_dp_tx_get_encap_type()
Heiko Stuebner <[email protected]>
drm/rockchip: vop2: fail cleanly if missing a primary plane for a video-port
Andy Yan <[email protected]>
drm/rockchip: vop2: Register the primary plane and overlay plane separately
Cristian Ciocaltea <[email protected]>
drm/rockchip: vop2: Consistently use dev_err_probe()
Mario Limonciello <[email protected]>
platform/x86/amd: pmf: Use device managed allocations
Shyam Sundar S K <[email protected]>
platform/x86/amd/pmf: Switch to platform_get_resource() and devm_ioremap_resource()
Heiko Carstens <[email protected]>
s390/mm: Fix in_atomic() handling in do_secure_storage_access()
Heiko Carstens <[email protected]>
s390/mm: Get rid of fault type switch statements
Heiko Carstens <[email protected]>
s390/mm: Simplify get_fault_type()
Claudio Imbrenda <[email protected]>
s390/mm/fault: Handle guest-related program interrupts in KVM
Claudio Imbrenda <[email protected]>
s390/kvm: Remove kvm_arch_fault_in_page()
Claudio Imbrenda <[email protected]>
s390/entry: Remove __GMAP_ASCE and use _PIF_GUEST_FAULT again
Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: configure manual DAC mode via PCI config API only
Ben Dooks <[email protected]>
riscv: save the SR_SUM status over switches
Samuel Holland <[email protected]>
riscv: Add support for per-thread envcfg CSR values
Samuel Holland <[email protected]>
riscv: Enable cbo.zero only when all harts support Zicboz
Pu Lehui <[email protected]>
mm: fix uprobe pte be overwritten when expanding vma
Sidhanta Sahu <[email protected]>
wifi: ath12k: Fix memory leak due to multiple rx_stats allocation
Sriram R <[email protected]>
wifi: ath12k: prepare vif data structure for MLO handling
Kalle Valo <[email protected]>
wifi: ath12k: ath12k_mac_op_sta_state(): clean up update_wk cancellation
Kalle Valo <[email protected]>
wifi: ath12k: convert struct ath12k_sta::update_wk to use struct wiphy_work
Zhi Wang <[email protected]>
drm/nouveau: fix a use-after-free in r535_gsp_rpc_push()
Brian Norris <[email protected]>
PCI/pwrctrl: Cancel outstanding rescan work when unregistering
Manivannan Sadhasivam <[email protected]>
PCI/pwrctl: Create pwrctl device only if at least one power supply is present
Manivannan Sadhasivam <[email protected]>
PCI/pwrctl: Use of_platform_device_create() to create pwrctl devices
Yeoreum Yun <[email protected]>
coresight: holding cscfg_csdev_lock while removing cscfg from csdev
Michael S. Tsirkin <[email protected]>
virtio: break and reset virtio devices on device_shutdown()
Roger Quadros <[email protected]>
dmaengine: ti: k3-udma-glue: Drop skip_fdq argument from k3_udma_glue_reset_rx_chn
Roger Quadros <[email protected]>
net: ethernet: ti: am65-cpsw: streamline RX queue creation and cleanup
Philippe Simons <[email protected]>
clk: sunxi-ng: h616: Reparent GPU clock during frequency changes
Andre Przywara <[email protected]>
clk: sunxi-ng: h616: Reparent CPU clock during frequency changes
Alexander Gordeev <[email protected]>
kasan: avoid sleepable page allocation from atomic context
Ming Lei <[email protected]>
ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd
Yunhui Cui <[email protected]>
perf/dwc_pcie: fix duplicate pci_dev devices
Bjorn Helgaas <[email protected]>
perf/dwc_pcie: Qualify RAS DES VSEC Capability by Vendor, Revision
P Praneesh <[email protected]>
wifi: ath12k: Avoid memory leak while enabling statistics
Karthikeyan Periyasamy <[email protected]>
wifi: ath12k: Avoid explicit type cast in monitor status parse handler
Karthikeyan Periyasamy <[email protected]>
wifi: ath12k: fix incorrect TID updation in DP monitor status path
Kang Yang <[email protected]>
wifi: ath12k: fix struct hal_rx_phyrx_rssi_legacy_info
Atish Patra <[email protected]>
RISC-V: KVM: Teardown riscv specific bits after kvm_exit
Chao Yu <[email protected]>
f2fs: quota: fix to avoid warning in dquot_writeback_dquots()
Murad Masimov <[email protected]>
ax25: Remove broken autobind
Ville Syrjälä <[email protected]>
drm/i915: Grab intel_display from the encoder to avoid potential oopsies
Jani Nikula <[email protected]>
drm/i915/crt: convert to struct intel_display
Jani Nikula <[email protected]>
drm/i915/gmbus: convert to struct intel_display
Jani Nikula <[email protected]>
drm/i915/display: convert I915_STATE_WARN() to struct intel_display
Ville Syrjälä <[email protected]>
drm/i915/vga: Convert VGA code to intel_display
Jani Nikula <[email protected]>
drm/i915/display: pass display to intel_crtc_for_pipe()
Benjamin Berg <[email protected]>
um: work around sched_yield not yielding in time-travel mode
Paulo Alcantara <[email protected]>
smb: client: fix compound alignment with encryption
Paulo Alcantara <[email protected]>
smb: client: get rid of bounds check in SMB2_ioctl_init()
Paulo Alcantara <[email protected]>
smb: client: improve compound padding in encryption
Christian Brauner <[email protected]>
namespace: handle mount locking for automounts correctly
Christian Brauner <[email protected]>
fcntl: refuse F_SET_RW_HINT on an immutable inode
Christian Brauner <[email protected]>
namespace: check the target before walking it in do_mount_setattr()
Christian Brauner <[email protected]>
namespace: unhash a dentry before detaching the mounts on it
Wentao Liang <[email protected]>
drm/vc4: Fix firmware reference leak in vc4_drm_bind()
Thomas Zimmermann <[email protected]>
drm/vc4: Use video aperture helpers
Stanley Jhu <[email protected]>
scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()
Bart Van Assche <[email protected]>
scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
Peter Wang <[email protected]>
scsi: ufs: core: Add debug log for MCQ command timeout
Bart Van Assche <[email protected]>
scsi: ufs: core: Move an assignment in ufshcd_mcq_process_cqe()
Ahmed Abdelhaleem Ahmed <[email protected]>
scsi: ch: Do not keep references to data transfer element devices
Stanley Jhu <[email protected]>
scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ
Wei-Jie Hung <[email protected]>
riscv: patch: fix handling of bpf-jit execmem addresses
Vivian Wang <[email protected]>
riscv: patch: Avoid early phys_to_page()
Suraj Gupta <[email protected]>
net: xilinx: axienet: Free outstanding DMA buffers on dmaengine stop
Ben Cressey <[email protected]>
dm-integrity: fix buffer overflow in inline mode with large tag size
Mikulas Patocka <[email protected]>
dm-integrity: rename internal_hash
Mikulas Patocka <[email protected]>
dm-integrity: use internal variable for digestsize
Christian Brauner <[email protected]>
namespace: check the mounts before reading their parents in pivot_root()
Christian Brauner <[email protected]>
namespace: don't inherit MNT_UMOUNT in clone_mnt()
Zack Rusin <[email protected]>
drm/vmwgfx: validate pitch coming from userspace
Maaz Mombasawala <[email protected]>
drm/vmwgfx: Stop using dev_private to store driver data.
Mikhail Gavrilov <[email protected]>
Bluetooth: RFCOMM: connect the session socket without rfcomm_mutex
Chengfeng Ye <[email protected]>
Bluetooth: hci_sync: Fix command skb lifetime during scan setup
Tejun Heo <[email protected]>
sched_ext: Fix CPU hotplug hang when a dying CPU's tasks sit in the BPF scheduler
Weiming Shi <[email protected]>
net: team: stop reusing skb after queue override
Weiming Shi <[email protected]>
net: team: fix NULL pointer dereference in team_xmit during mode change
Marc Harvey <[email protected]>
net: team: Rename port_disabled team mode op to port_tx_disabled
Marc Harvey <[email protected]>
net: team: Remove unused team_mode_op, port_enabled
Sean Wang <[email protected]>
wifi: mt76: connac: tolerate inactive BSS deactivation
Lorenzo Stoakes (ARM) <[email protected]>
mm/mremap: fix locked_vm leak from MREMAP_DONTUNMAP self-merge
Lorenzo Stoakes (ARM) <[email protected]>
mm/mremap: fix locked_vm leak by splitting VMA for MREMAP_DONTUNMAP
Hengyu Liang <[email protected]>
ata: libata-scsi: do not lose CHECK CONDITION for failed ATAPI commands
Mario Limonciello <[email protected]>
drm/amd: Create a device link between APU display and XHCI devices
Dave Chinner <[email protected]>
xfs: fix unmount hang with unflushable inodes stuck in the AIL
Dave Chinner <[email protected]>
xfs: factor out stale buffer item completion
Dave Chinner <[email protected]>
xfs: rearrange code in xfs_buf_item.c
Dave Chinner <[email protected]>
xfs: avoid dquot buffer pin deadlock
Dave Chinner <[email protected]>
xfs: catch stale AGF/AGF metadata
Dave Chinner <[email protected]>
xfs: xfs_ifree_cluster vs xfs_iflush_shutdown_abort deadlock
Daehyeon Ko <[email protected]>
ip6_gre: remove obsolete ERSPAN PMTU update
Darrick J. Wong <[email protected]>
xfs: fix exchange-range-to-eof file size exchange
Norbert Szetei <[email protected]>
xfs: stop exchanging reflink flags when exchanging mappings
Xuanqiang Luo <[email protected]>
ice: fix use-after-free in dynamic port cleanup
Zhen Ni <[email protected]>
iommu/amd: Fix ivrs_base memleak in early_amd_iommu_init()
Suravee Suthikulpanit <[email protected]>
iommu/amd: Disable AMD IOMMU if CMPXCHG16B feature is not supported
Ethan Tidmore <[email protected]>
usb: gadget: f_hid: Add missing error code
Johan Hovold <[email protected]>
spi: mpc52xx: clean up interrupt handling
-------------
Diffstat:
Documentation/RCU/whatisRCU.rst | 10 + Documentation/admin-guide/device-mapper/dm-ima.rst | 7 +- .../admin-guide/device-mapper/dm-integrity.rst | 13 + Documentation/core-api/refcount-vs-atomic.rst | 37 +- Documentation/networking/af_xdp.rst | 54 +- .../networking/net_cachelines/net_device.rst | 2 +- Documentation/networking/rxrpc.rst | 11 + Documentation/networking/switchdev.rst | 2 +- Makefile | 33 +- arch/Kconfig | 26 +- arch/arm/Kconfig | 2 +- arch/arm/kernel/hw_breakpoint.c | 13 +- arch/arm/mach-exynos/mcpm-exynos.c | 12 +- arch/arm/mach-exynos/suspend.c | 48 +- arch/arm/mach-pxa/generic.h | 6 +- arch/arm/mach-pxa/irq.c | 10 +- arch/arm/mach-pxa/mfp-pxa2xx.c | 10 +- arch/arm/mach-pxa/mfp-pxa3xx.c | 10 +- arch/arm/mach-pxa/pxa25x.c | 4 +- arch/arm/mach-pxa/pxa27x.c | 4 +- arch/arm/mach-pxa/pxa3xx.c | 4 +- arch/arm/mach-pxa/smemc.c | 12 +- arch/arm/mach-s3c/irq-pm-s3c64xx.c | 12 +- arch/arm/mach-s5pv210/pm.c | 10 +- arch/arm/mach-versatile/integrator_ap.c | 12 +- arch/arm/mm/Makefile | 2 +- arch/arm/mm/cache-b15-rac.c | 12 +- arch/arm/mm/cache-fa.S | 2 +- arch/arm/mm/cache-v4.S | 2 +- arch/arm/mm/cache-v4wb.S | 4 +- arch/arm/mm/cache-v4wt.S | 2 +- arch/arm/mm/cache-v6.S | 2 +- arch/arm/mm/cache-v7.S | 2 +- arch/arm/mm/cache-v7m.S | 2 +- arch/arm/mm/proc-arm1020.S | 2 +- arch/arm/mm/proc-arm1020e.S | 2 +- arch/arm/mm/proc-arm1022.S | 2 +- arch/arm/mm/proc-arm1026.S | 2 +- arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm922.S | 2 +- arch/arm/mm/proc-arm925.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-arm940.S | 2 +- arch/arm/mm/proc-arm946.S | 2 +- arch/arm/mm/proc-feroceon.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/tlb-v4.S | 2 +- arch/arm64/Kconfig | 4 +- arch/arm64/kernel/debug-monitors.c | 2 +- arch/arm64/kernel/ptrace.c | 50 + arch/arm64/kernel/traps.c | 4 +- arch/arm64/kvm/at.c | 3 +- arch/arm64/kvm/handle_exit.c | 2 +- arch/arm64/kvm/vgic/vgic-v3.c | 12 +- arch/arm64/kvm/vgic/vgic.c | 9 +- arch/loongarch/kernel/machine_kexec.c | 5 +- arch/loongarch/kernel/smp.c | 12 +- arch/loongarch/net/bpf_jit.c | 20 +- arch/mips/alchemy/common/dbdma.c | 12 +- arch/mips/alchemy/common/irq.c | 24 +- arch/mips/alchemy/common/usb.c | 12 +- arch/mips/pci/pci-alchemy.c | 16 +- arch/powerpc/include/asm/book3s/64/pgtable.h | 15 + arch/powerpc/include/asm/xive.h | 4 +- arch/powerpc/mm/book3s64/pgtable.c | 13 +- arch/powerpc/mm/pgtable-frag.c | 1 + arch/powerpc/platforms/cell/spu_base.c | 10 +- arch/powerpc/platforms/powermac/pic.c | 12 +- arch/powerpc/platforms/powernv/smp.c | 8 +- arch/powerpc/platforms/pseries/smp.c | 8 +- arch/powerpc/sysdev/fsl_lbc.c | 12 +- arch/powerpc/sysdev/fsl_pci.c | 12 +- arch/powerpc/sysdev/ipic.c | 12 +- arch/powerpc/sysdev/mpic.c | 14 +- arch/powerpc/sysdev/mpic_timer.c | 10 +- arch/powerpc/sysdev/xive/common.c | 10 +- arch/riscv/Kconfig | 4 +- arch/riscv/include/asm/cfi.h | 4 +- arch/riscv/include/asm/processor.h | 2 + arch/riscv/include/asm/switch_to.h | 8 + arch/riscv/kernel/Makefile | 17 +- arch/riscv/kernel/asm-offsets.c | 5 + arch/riscv/kernel/cfi.c | 2 +- arch/riscv/kernel/cpufeature.c | 9 +- arch/riscv/kernel/entry.S | 9 + arch/riscv/kernel/patch.c | 21 +- arch/riscv/kernel/suspend.c | 4 +- arch/riscv/kvm/main.c | 4 +- arch/riscv/kvm/vcpu_vector.c | 5 +- arch/riscv/kvm/vmid.c | 2 +- arch/riscv/net/bpf_jit_comp64.c | 9 +- arch/riscv/purgatory/Makefile | 2 +- arch/s390/include/asm/fpu-insn.h | 3 + arch/s390/include/asm/gmap.h | 3 +- arch/s390/include/asm/kvm_host.h | 3 + arch/s390/include/asm/nmi.h | 3 + arch/s390/include/asm/pci.h | 2 + arch/s390/include/asm/pci_insn.h | 10 +- arch/s390/include/asm/processor.h | 5 +- arch/s390/include/asm/ptrace.h | 2 + arch/s390/include/asm/uv.h | 6 +- arch/s390/kernel/asm-offsets.c | 2 - arch/s390/kernel/entry.S | 44 +- arch/s390/kernel/nmi.c | 5 +- arch/s390/kernel/traps.c | 24 +- arch/s390/kernel/uv.c | 383 +++---- arch/s390/kvm/Makefile | 2 +- arch/s390/kvm/gaccess.c | 42 +- arch/s390/kvm/gmap.c | 121 +++ arch/s390/kvm/gmap.h | 19 + arch/s390/kvm/intercept.c | 7 +- arch/s390/kvm/interrupt.c | 24 +- arch/s390/kvm/kvm-s390.c | 222 +++- arch/s390/kvm/kvm-s390.h | 14 +- arch/s390/kvm/pci.c | 17 +- arch/s390/kvm/pv.c | 21 + arch/s390/kvm/vsie.c | 15 +- arch/s390/mm/fault.c | 189 +--- arch/s390/mm/gmap.c | 45 +- arch/s390/net/bpf_jit_comp.c | 11 + arch/s390/pci/pci.c | 35 +- arch/s390/pci/pci_sysfs.c | 11 +- arch/sh/mm/pmb.c | 10 +- arch/um/include/linux/time-internal.h | 2 + arch/um/kernel/skas/syscall.c | 11 + arch/x86/Kconfig | 12 +- arch/x86/crypto/Kconfig | 4 +- arch/x86/crypto/aegis128-aesni-asm.S | 110 +- arch/x86/crypto/aegis128-aesni-glue.c | 156 +-- arch/x86/events/amd/ibs.c | 12 +- arch/x86/events/intel/core.c | 32 +- arch/x86/events/intel/ds.c | 8 +- arch/x86/events/intel/uncore.c | 46 +- arch/x86/events/perf_event.h | 3 + arch/x86/hyperv/hv_init.c | 12 +- arch/x86/include/asm/cfi.h | 4 +- arch/x86/kernel/Makefile | 2 +- arch/x86/kernel/alternative.c | 4 +- arch/x86/kernel/amd_gart_64.c | 10 +- arch/x86/kernel/apic/apic.c | 12 +- arch/x86/kernel/apic/io_apic.c | 17 +- arch/x86/kernel/cpu/aperfmperf.c | 20 +- arch/x86/kernel/cpu/intel_epb.c | 16 +- arch/x86/kernel/cpu/mce/core.c | 14 +- arch/x86/kernel/cpu/microcode/core.c | 15 +- arch/x86/kernel/cpu/mtrr/legacy.c | 12 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 19 +- arch/x86/kernel/cpu/umwait.c | 10 +- arch/x86/kernel/i8237.c | 10 +- arch/x86/kernel/i8259.c | 14 +- arch/x86/kernel/kprobes/core.c | 2 +- arch/x86/kernel/kvm.c | 12 +- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/cpuid.h | 16 +- arch/x86/kvm/lapic.c | 61 +- arch/x86/kvm/lapic.h | 4 +- arch/x86/kvm/mmu.h | 2 +- arch/x86/kvm/mmu/mmu.c | 4 +- arch/x86/kvm/regs.c | 6 +- arch/x86/kvm/svm/nested.c | 64 +- arch/x86/kvm/svm/sev.c | 42 +- arch/x86/kvm/svm/svm.c | 70 +- arch/x86/kvm/svm/svm.h | 4 +- arch/x86/kvm/vmx/nested.c | 11 +- arch/x86/kvm/vmx/vmx.c | 16 +- arch/x86/kvm/x86.c | 60 +- arch/x86/kvm/x86.h | 1 - arch/x86/purgatory/Makefile | 2 +- block/bfq-cgroup.c | 9 +- block/bio-integrity.c | 6 +- block/blk-cgroup.c | 5 +- block/blk-cgroup.h | 2 + block/blk-iocost.c | 21 +- block/blk-iolatency.c | 19 +- block/blk-throttle.c | 15 +- drivers/accel/ivpu/ivpu_drv.c | 2 +- drivers/accel/ivpu/ivpu_gem.c | 111 +- drivers/accel/ivpu/ivpu_gem.h | 3 +- drivers/accel/ivpu/ivpu_job.c | 2 +- drivers/accel/qaic/mhi_controller.c | 24 - drivers/accel/qaic/qaic.h | 13 +- drivers/accel/qaic/qaic_drv.c | 76 +- drivers/accel/qaic/qaic_timesync.c | 2 +- drivers/acpi/acpi_platform.c | 16 +- drivers/acpi/bus.c | 54 +- drivers/acpi/device_pm.c | 4 +- drivers/acpi/pci_link.c | 10 +- drivers/acpi/sleep.c | 12 +- drivers/ata/libata-core.c | 7 + drivers/ata/libata-scsi.c | 10 +- drivers/base/core.c | 74 +- drivers/base/firmware_loader/main.c | 12 +- drivers/base/power/main.c | 67 +- drivers/base/power/runtime.c | 61 +- drivers/base/syscore.c | 82 +- drivers/block/ublk_drv.c | 37 +- drivers/bus/mhi/host/pci_generic.c | 20 +- drivers/bus/mvebu-mbus.c | 16 +- drivers/char/ipmi/ipmi_ssif.c | 20 + drivers/clk/at91/pmc.c | 12 +- drivers/clk/imx/clk-vf610.c | 12 +- drivers/clk/ingenic/jz4725b-cgu.c | 2 +- drivers/clk/ingenic/jz4740-cgu.c | 2 +- drivers/clk/ingenic/jz4755-cgu.c | 2 +- drivers/clk/ingenic/jz4760-cgu.c | 2 +- drivers/clk/ingenic/jz4770-cgu.c | 2 +- drivers/clk/ingenic/jz4780-cgu.c | 2 +- drivers/clk/ingenic/pm.c | 14 +- drivers/clk/ingenic/pm.h | 2 +- drivers/clk/ingenic/tcu.c | 12 +- drivers/clk/ingenic/x1000-cgu.c | 2 +- drivers/clk/ingenic/x1830-cgu.c | 2 +- drivers/clk/mediatek/clk-pllfh.c | 98 +- drivers/clk/mvebu/common.c | 12 +- drivers/clk/rockchip/clk-rk3288.c | 12 +- drivers/clk/samsung/clk-s5pv210-audss.c | 12 +- drivers/clk/samsung/clk.c | 12 +- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 64 +- drivers/clk/tegra/clk-tegra210.c | 12 +- drivers/clk/thead/clk-th1520-ap.c | 30 +- drivers/clocksource/samsung_pwm_timer.c | 22 +- drivers/clocksource/timer-armada-370-xp.c | 12 +- drivers/cpuidle/cpuidle-psci.c | 12 +- drivers/crypto/hisilicon/hpre/hpre_main.c | 36 +- drivers/crypto/hisilicon/qm.c | 38 +- drivers/cxl/core/core.h | 2 + drivers/cxl/core/mbox.c | 11 +- drivers/cxl/core/port.c | 7 +- drivers/cxl/core/ras.c | 10 +- drivers/cxl/core/region.c | 81 +- drivers/cxl/core/trace.h | 12 +- drivers/cxl/cxl.h | 22 +- drivers/dma/idxd/init.c | 36 +- drivers/dma/ti/k3-udma-glue.c | 15 +- drivers/dma/xilinx/xilinx_dma.c | 14 +- drivers/dpll/dpll_core.c | 12 +- drivers/dpll/dpll_netlink.c | 68 +- drivers/edac/igen6_edac.c | 148 ++- drivers/firewire/ohci.c | 4 +- drivers/firmware/arm_ffa/driver.c | 56 +- drivers/firmware/arm_scmi/bus.c | 36 +- drivers/gpio/gpio-latch.c | 2 +- drivers/gpio/gpio-mxc.c | 12 +- drivers/gpio/gpio-pca953x.c | 18 +- drivers/gpio/gpio-pxa.c | 12 +- drivers/gpio/gpio-sa1100.c | 12 +- drivers/gpio/gpiolib.c | 136 ++- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 25 +- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 63 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 52 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 23 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 16 +- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 25 +- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 32 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 25 +- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 131 ++- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 13 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 - drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 3 + drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 4 +- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 17 + drivers/gpu/drm/amd/amdkfd/kfd_device.c | 13 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 20 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 2 + drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 199 ++-- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 11 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 5 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 4 + .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 24 +- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 6 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 25 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 8 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 10 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h | 8 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 3 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 12 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c | 7 + drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 2 +- .../drm/amd/display/dc/dml2/dml21/dml21_utils.c | 15 +- .../dml21/src/dml2_core/dml2_core_dcn4_calcs.c | 31 +- .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 52 + .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 4 + .../gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c | 2 +- .../drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 13 +- .../amd/display/dc/resource/dcn32/dcn32_resource.c | 8 +- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 10 + .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 45 + drivers/gpu/drm/etnaviv/etnaviv_sched.c | 20 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 + drivers/gpu/drm/exynos/exynos_drm_vidi.c | 14 +- drivers/gpu/drm/gud/gud_drv.c | 2 + drivers/gpu/drm/i915/display/g4x_dp.c | 15 +- drivers/gpu/drm/i915/display/i9xx_wm.c | 15 +- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 4 +- drivers/gpu/drm/i915/display/intel_bios.c | 6 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 6 +- drivers/gpu/drm/i915/display/intel_crt.c | 216 ++-- drivers/gpu/drm/i915/display/intel_crt.h | 10 +- drivers/gpu/drm/i915/display/intel_crtc.c | 15 +- drivers/gpu/drm/i915/display/intel_crtc.h | 3 +- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 76 +- drivers/gpu/drm/i915/display/intel_display.c | 48 +- drivers/gpu/drm/i915/display/intel_display.h | 17 +- .../gpu/drm/i915/display/intel_display_driver.c | 18 +- drivers/gpu/drm/i915/display/intel_display_irq.c | 20 +- drivers/gpu/drm/i915/display/intel_display_power.c | 71 +- .../drm/i915/display/intel_display_power_well.c | 6 +- drivers/gpu/drm/i915/display/intel_display_trace.h | 15 +- drivers/gpu/drm/i915/display/intel_dp.c | 8 +- drivers/gpu/drm/i915/display/intel_dpll.c | 12 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 90 +- drivers/gpu/drm/i915/display/intel_dsb.c | 2 +- drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 5 +- drivers/gpu/drm/i915/display/intel_dvo.c | 8 +- drivers/gpu/drm/i915/display/intel_fbc.c | 7 +- drivers/gpu/drm/i915/display/intel_fdi.c | 52 +- drivers/gpu/drm/i915/display/intel_fifo_underrun.c | 15 +- drivers/gpu/drm/i915/display/intel_gmbus.c | 290 ++--- drivers/gpu/drm/i915/display/intel_gmbus.h | 15 +- drivers/gpu/drm/i915/display/intel_gmbus_regs.h | 16 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +- drivers/gpu/drm/i915/display/intel_hotplug_irq.c | 6 +- drivers/gpu/drm/i915/display/intel_link_bw.c | 3 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- drivers/gpu/drm/i915/display/intel_modeset_setup.c | 12 +- .../gpu/drm/i915/display/intel_modeset_verify.c | 89 +- drivers/gpu/drm/i915/display/intel_pch_display.c | 56 +- drivers/gpu/drm/i915/display/intel_pps.c | 26 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 9 +- drivers/gpu/drm/i915/display/intel_snps_phy.c | 11 +- drivers/gpu/drm/i915/display/intel_sprite_uapi.c | 3 +- drivers/gpu/drm/i915/display/intel_vga.c | 45 +- drivers/gpu/drm/i915/display/intel_vga.h | 14 +- drivers/gpu/drm/i915/display/skl_watermark.c | 7 +- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 7 +- .../gpu/drm/i915/gt/intel_execlists_submission.c | 19 +- drivers/gpu/drm/i915/gt/intel_rc6.c | 2 +- drivers/gpu/drm/i915/i915_suspend.c | 5 +- drivers/gpu/drm/i915/i915_utils.h | 24 - drivers/gpu/drm/imagination/pvr_queue.c | 18 +- drivers/gpu/drm/lima/lima_sched.c | 16 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 24 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 11 +- drivers/gpu/drm/msm/msm_gpu.c | 30 +- drivers/gpu/drm/msm/msm_ringbuffer.c | 24 +- drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + drivers/gpu/drm/nouveau/nouveau_sched.c | 16 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 29 +- drivers/gpu/drm/panfrost/panfrost_job.c | 20 +- drivers/gpu/drm/panthor/panthor_mmu.c | 25 +- drivers/gpu/drm/panthor/panthor_sched.c | 77 +- drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 8 + drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 182 ++-- drivers/gpu/drm/scheduler/sched_main.c | 50 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 53 +- drivers/gpu/drm/tilcdc/tilcdc_drv.h | 2 +- drivers/gpu/drm/v3d/v3d_sched.c | 65 +- drivers/gpu/drm/vc4/vc4_bo.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 9 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 25 + drivers/gpu/drm/virtio/virtgpu_object.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 + drivers/gpu/drm/virtio/virtgpu_prime.c | 42 + drivers/gpu/drm/virtio/virtgpu_vq.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 30 +- drivers/gpu/drm/xe/xe_execlist.c | 15 +- drivers/gpu/drm/xe/xe_gpu_scheduler.c | 17 +- drivers/gpu/drm/xe/xe_guc.c | 8 +- drivers/gpu/drm/xe/xe_guc_ct.c | 41 +- drivers/gpu/drm/xe/xe_guc_ct.h | 1 + drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 5 + drivers/gpu/drm/xe/xe_guc_submit.c | 4 +- drivers/gpu/drm/xe/xe_vm.c | 31 +- drivers/gpu/drm/xe/xe_vm_types.h | 3 + drivers/hid/hid-core.c | 12 +- drivers/hid/hid-logitech-hidpp.c | 23 +- drivers/hid/hid-steam.c | 33 +- drivers/hv/vmbus_drv.c | 29 +- drivers/hwmon/asus_rog_ryujin.c | 137 +-- drivers/hwmon/lm90.c | 26 +- drivers/hwmon/pmbus/pmbus_core.c | 82 +- drivers/hwtracing/coresight/coresight-etm4x-core.c | 90 +- drivers/hwtracing/coresight/coresight-syscfg.c | 2 + drivers/hwtracing/coresight/coresight-tmc-core.c | 6 +- drivers/hwtracing/coresight/coresight-tmc-etf.c | 48 +- drivers/hwtracing/coresight/coresight-tmc-etr.c | 60 +- drivers/hwtracing/coresight/coresight-tmc.h | 2 +- drivers/i3c/master.c | 39 +- drivers/i3c/master/mipi-i3c-hci/core.c | 1 + drivers/i3c/master/mipi-i3c-hci/dma.c | 27 +- drivers/i3c/master/mipi-i3c-hci/hci.h | 1 + drivers/i3c/master/svc-i3c-master.c | 108 +- drivers/infiniband/core/counters.c | 9 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 61 +- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 1 + drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + drivers/infiniband/hw/cxgb4/mem.c | 46 +- drivers/infiniband/hw/efa/efa_com.c | 28 +- drivers/infiniband/hw/irdma/hw.c | 7 +- drivers/infiniband/hw/irdma/main.h | 3 +- drivers/infiniband/hw/irdma/utils.c | 12 +- drivers/infiniband/hw/irdma/verbs.c | 22 +- drivers/infiniband/hw/mlx5/cq.c | 15 +- drivers/infiniband/hw/mlx5/main.c | 17 - drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rxe/rxe.h | 37 - drivers/infiniband/sw/rxe/rxe_loc.h | 1 + drivers/infiniband/sw/rxe/rxe_mr.c | 287 +++-- drivers/infiniband/sw/rxe/rxe_verbs.h | 47 +- drivers/iommu/amd/init.c | 45 +- drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 60 +- drivers/iommu/intel/iommu.c | 20 +- drivers/iommu/intel/iommu.h | 2 +- drivers/iommu/intel/pasid.c | 9 +- drivers/iommu/io-pgfault.c | 24 +- drivers/iommu/iommufd/fault.c | 2 + drivers/iommu/s390-iommu.c | 63 +- drivers/irqchip/exynos-combiner.c | 14 +- drivers/irqchip/irq-armada-370-xp.c | 12 +- drivers/irqchip/irq-bcm7038-l1.c | 12 +- drivers/irqchip/irq-gic-v3-its.c | 12 +- drivers/irqchip/irq-i8259.c | 12 +- drivers/irqchip/irq-imx-gpcv2.c | 16 +- drivers/irqchip/irq-loongson-eiointc.c | 12 +- drivers/irqchip/irq-loongson-htpic.c | 10 +- drivers/irqchip/irq-loongson-htvec.c | 12 +- drivers/irqchip/irq-loongson-pch-lpc.c | 12 +- drivers/irqchip/irq-loongson-pch-pic.c | 12 +- drivers/irqchip/irq-mchp-eic.c | 12 +- drivers/irqchip/irq-mst-intc.c | 12 +- drivers/irqchip/irq-mtk-cirq.c | 12 +- drivers/irqchip/irq-renesas-rzg2l.c | 12 +- drivers/irqchip/irq-sa11x0.c | 12 +- drivers/irqchip/irq-sifive-plic.c | 12 +- drivers/irqchip/irq-sun6i-r.c | 18 +- drivers/irqchip/irq-tegra.c | 12 +- drivers/irqchip/irq-vic.c | 12 +- drivers/leds/leds-aw200xx.c | 2 +- drivers/leds/trigger/ledtrig-cpu.c | 14 +- drivers/macintosh/via-pmu.c | 12 +- drivers/md/dm-integrity.c | 156 ++- drivers/md/dm-table.c | 41 +- drivers/md/dm-verity-fec.c | 102 +- drivers/md/dm-zone.c | 34 +- drivers/md/dm.c | 6 + drivers/md/dm.h | 5 + drivers/md/md.c | 111 +- drivers/md/md.h | 5 + drivers/md/raid1.c | 32 +- drivers/md/raid10.c | 51 +- .../platform/chips-media/wave5/wave5-helper.c | 30 +- .../platform/chips-media/wave5/wave5-helper.h | 1 + .../platform/chips-media/wave5/wave5-vpu-dec.c | 5 + .../platform/chips-media/wave5/wave5-vpu-enc.c | 5 + .../media/platform/chips-media/wave5/wave5-vpu.c | 99 +- .../platform/chips-media/wave5/wave5-vpuapi.h | 6 + .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 51 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 100 +- .../st/stm32/stm32-dcmipp/dcmipp-parallel.c | 108 +- drivers/media/platform/verisilicon/hantro.h | 2 + drivers/media/platform/verisilicon/hantro_drv.c | 42 +- drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 8 + drivers/media/v4l2-core/v4l2-mem2mem.c | 23 + drivers/mfd/intel-lpss.c | 2 +- drivers/misc/lkdtm/cfi.c | 2 +- drivers/mmc/host/vub300.c | 39 +- drivers/net/amt.c | 5 +- drivers/net/bonding/bond_main.c | 2 +- drivers/net/ethernet/adi/adin1110.c | 2 +- drivers/net/ethernet/airoha/airoha_eth.c | 32 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 76 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 20 +- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 173 ++- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 345 +++--- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 25 +- drivers/net/ethernet/cavium/liquidio/lio_main.c | 27 - .../net/ethernet/cavium/liquidio/octeon_device.h | 3 - .../net/ethernet/cavium/liquidio/octeon_mailbox.c | 33 +- .../chelsio/inline_crypto/chtls/chtls_cm.c | 4 +- .../chelsio/inline_crypto/chtls/chtls_cm.h | 1 - drivers/net/ethernet/ibm/emac/core.c | 18 +- .../net/ethernet/intel/ice/devlink/devlink_port.c | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 9 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 8 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 6 +- drivers/net/ethernet/intel/idpf/idpf_dev.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_lib.c | 15 +- drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 12 +- drivers/net/ethernet/intel/idpf/idpf_virtchnl.h | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 3 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 12 + drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 1 + drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 79 ++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 22 +- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 29 +- .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 20 +- .../net/ethernet/marvell/prestera/prestera_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/srq.c | 13 +- drivers/net/ethernet/mellanox/mlx5/core/cq.c | 24 +- drivers/net/ethernet/mellanox/mlx5/core/en.h | 13 + .../ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c | 10 +- .../net/ethernet/mellanox/mlx5/core/en/params.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h | 5 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/tx.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en_common.c | 11 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 37 +- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 54 +- drivers/net/ethernet/mellanox/mlx5/core/en_rep.h | 1 - drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 23 +- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 9 +- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 8 +- .../ethernet/mellanox/mlx5/core/esw/devlink_port.c | 36 + drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 1 + .../net/ethernet/mellanox/mlx5/core/fpga/conn.c | 16 +- .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 3 +- drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/main.c | 11 +- .../ethernet/mellanox/mlx5/core/steering/dr_send.c | 29 +- .../mlx5/core/steering/hws/mlx5hws_action.c | 135 ++- .../mlx5/core/steering/hws/mlx5hws_action.h | 6 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_cmd.c | 2 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_cmd.h | 2 +- .../mlx5/core/steering/hws/mlx5hws_context.c | 30 +- .../mlx5/core/steering/hws/mlx5hws_context.h | 4 +- .../mlx5/core/steering/hws/mlx5hws_debug.c | 56 +- .../mlx5/core/steering/hws/mlx5hws_definer.h | 2 +- .../mlx5/core/steering/hws/mlx5hws_internal.h | 1 - .../mlx5/core/steering/hws/mlx5hws_matcher.c | 237 ++--- .../mlx5/core/steering/hws/mlx5hws_matcher.h | 8 +- .../mlx5/core/steering/hws/mlx5hws_pat_arg.h | 2 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_pool.c | 513 +++------ .../mellanox/mlx5/core/steering/hws/mlx5hws_pool.h | 77 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_rule.c | 75 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_rule.h | 3 +- .../mellanox/mlx5/core/steering/hws/mlx5hws_send.c | 16 +- .../mlx5/core/steering/hws/mlx5hws_table.c | 16 +- drivers/net/ethernet/mellanox/mlx5/core/wc.c | 4 +- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +- drivers/net/ethernet/rocker/rocker_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 91 +- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 253 +++-- drivers/net/ethernet/ti/cpsw_new.c | 2 +- drivers/net/ethernet/ti/icssg/icssg_common.c | 2 +- drivers/net/ethernet/xilinx/xilinx_axienet.h | 7 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 53 +- drivers/net/loopback.c | 2 +- drivers/net/net_failover.c | 2 +- drivers/net/netconsole.c | 2 + drivers/net/tap.c | 33 +- drivers/net/team/team_core.c | 95 +- drivers/net/team/team_mode_loadbalance.c | 4 +- drivers/net/virtio_net.c | 26 +- drivers/net/vrf.c | 2 +- drivers/net/vxlan/vxlan_core.c | 36 +- drivers/net/wireguard/device.c | 8 +- drivers/net/wireless/ath/ath11k/mhi.c | 8 +- drivers/net/wireless/ath/ath11k/pci.c | 7 + drivers/net/wireless/ath/ath12k/core.h | 2 +- drivers/net/wireless/ath/ath12k/dp_mon.c | 217 ++-- drivers/net/wireless/ath/ath12k/dp_rx.c | 62 +- drivers/net/wireless/ath/ath12k/dp_tx.c | 5 +- drivers/net/wireless/ath/ath12k/hal_rx.c | 10 +- drivers/net/wireless/ath/ath12k/hal_rx.h | 12 +- drivers/net/wireless/ath/ath12k/mac.c | 25 +- drivers/net/wireless/ath/ath12k/mhi.c | 4 - drivers/net/wireless/ath/ath12k/wmi.c | 19 +- drivers/net/wireless/ath/ath9k/wmi.c | 16 +- drivers/net/wireless/ath/ath9k/wmi.h | 1 - .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 + drivers/net/wireless/intel/iwlwifi/dvm/main.c | 47 +- drivers/net/wireless/intel/iwlwifi/fw/smem.c | 5 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/binding.c | 10 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 +- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 24 +- .../net/wireless/intel/iwlwifi/mvm/time-event.c | 3 +- .../net/wireless/intel/iwlwifi/pcie/trans-gen2.c | 6 +- drivers/net/wireless/mediatek/mt76/dma.c | 10 +- drivers/net/wireless/mediatek/mt76/mac80211.c | 59 +- drivers/net/wireless/mediatek/mt76/mt76.h | 10 + .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 9 +- .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 23 + drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 + drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 12 +- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 14 +- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 2 + drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 5 +- drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 4 + drivers/net/wireless/mediatek/mt76/wed.c | 10 +- drivers/net/wireless/realtek/rtw89/pci.c | 41 +- drivers/ntb/ntb_transport.c | 18 +- drivers/nvme/target/admin-cmd.c | 8 +- drivers/nvme/target/core.c | 41 +- drivers/nvme/target/fabrics-cmd.c | 2 +- drivers/nvme/target/nvmet.h | 6 + drivers/nvme/target/tcp.c | 6 +- drivers/opp/core.c | 5 +- drivers/pci/bus.c | 23 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 5 + drivers/pci/endpoint/functions/pci-epf-vntb.c | 5 + drivers/pci/of.c | 27 + drivers/pci/pci-driver.c | 198 ++-- drivers/pci/pci.h | 46 +- drivers/pci/pwrctl/core.c | 2 + drivers/pci/search.c | 8 +- drivers/perf/dwc_pcie_pmu.c | 81 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 6 +- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 +- drivers/pinctrl/mediatek/pinctrl-paris.c | 33 +- drivers/platform/x86/amd/pmf/Kconfig | 1 + drivers/platform/x86/amd/pmf/acpi.c | 48 +- drivers/platform/x86/amd/pmf/core.c | 5 +- drivers/platform/x86/amd/pmf/pmf.h | 7 +- drivers/platform/x86/amd/pmf/tee-if.c | 64 +- drivers/platform/x86/asus-wmi.c | 6 +- drivers/platform/x86/dell/dell-wmi-base.c | 2 +- drivers/pmdomain/imx/imx93-blk-ctrl.c | 60 +- drivers/power/reset/sc27xx-poweroff.c | 10 +- drivers/ptp/ptp_ocp.c | 3 +- drivers/pwm/pwm-samsung.c | 22 +- drivers/remoteproc/Kconfig | 11 +- drivers/remoteproc/da8xx_remoteproc.c | 2 +- drivers/remoteproc/imx_dsp_rproc.c | 2 +- drivers/remoteproc/imx_rproc.c | 2 +- drivers/remoteproc/keystone_remoteproc.c | 2 +- drivers/remoteproc/meson_mx_ao_arc.c | 2 +- drivers/remoteproc/mtk_scp.c | 2 +- drivers/remoteproc/pru_rproc.c | 2 +- drivers/remoteproc/qcom_q6v5_adsp.c | 2 +- drivers/remoteproc/qcom_q6v5_mss.c | 2 +- drivers/remoteproc/qcom_q6v5_pas.c | 639 ++++++----- drivers/remoteproc/qcom_q6v5_wcss.c | 2 +- drivers/remoteproc/qcom_wcnss.c | 25 +- drivers/remoteproc/rcar_rproc.c | 2 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/remoteproc/st_remoteproc.c | 2 +- drivers/remoteproc/stm32_rproc.c | 2 +- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 2 +- drivers/remoteproc/wkup_m3_rproc.c | 2 +- drivers/s390/crypto/ap_bus.c | 74 ++ drivers/s390/crypto/ap_bus.h | 30 +- drivers/s390/crypto/pkey_cca.c | 11 +- drivers/s390/crypto/zcrypt_api.c | 122 ++- drivers/s390/crypto/zcrypt_api.h | 11 +- drivers/s390/crypto/zcrypt_ccamisc.c | 80 +- drivers/s390/crypto/zcrypt_ccamisc.h | 6 +- drivers/s390/crypto/zcrypt_ep11misc.c | 10 +- drivers/s390/crypto/zcrypt_msgtype50.c | 36 +- drivers/s390/crypto/zcrypt_msgtype6.c | 210 ++-- drivers/s390/crypto/zcrypt_msgtype6.h | 51 +- drivers/s390/net/ism_drv.c | 20 +- drivers/scsi/ch.c | 30 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 12 +- drivers/scsi/qla2xxx/qla_iocb.c | 2 - drivers/scsi/qla2xxx/qla_os.c | 20 +- drivers/scsi/qla2xxx/qla_target.c | 5 +- drivers/scsi/qla2xxx/qla_target.h | 1 + drivers/scsi/scsi_error.c | 6 +- drivers/scsi/sd.c | 141 +-- drivers/sh/clk/core.c | 10 +- drivers/sh/intc/core.c | 12 +- drivers/soc/aspeed/aspeed-lpc-snoop.c | 31 +- drivers/soc/bcm/brcmstb/biuctrl.c | 12 +- drivers/soc/tegra/pmc.c | 124 ++- drivers/soc/xilinx/zynqmp_power.c | 43 +- drivers/soundwire/generic_bandwidth_allocation.c | 35 +- drivers/soundwire/intel_auxdevice.c | 36 +- drivers/spi/spi-ch341.c | 7 +- drivers/spi/spi-microchip-core-qspi.c | 100 +- drivers/spi/spi-mpc52xx.c | 26 +- drivers/staging/greybus/raw.c | 90 +- drivers/staging/most/Kconfig | 2 - drivers/staging/most/Makefile | 1 - drivers/staging/most/i2c/Kconfig | 13 - drivers/staging/most/i2c/Makefile | 4 - drivers/staging/most/i2c/i2c.c | 374 ------- drivers/staging/rtl8723bs/core/rtw_mlme.c | 14 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 22 +- drivers/thermal/intel/intel_hfi.c | 12 +- drivers/thermal/thermal_hwmon.c | 89 +- drivers/tty/serial/8250/8250_core.c | 253 ++--- drivers/tty/serial/serial_core.c | 117 +- drivers/tty/tty_io.c | 2 +- drivers/ufs/core/ufs-mcq.c | 35 +- drivers/ufs/core/ufs-sysfs.c | 2 + drivers/ufs/core/ufshcd-priv.h | 14 +- drivers/ufs/core/ufshcd.c | 82 +- drivers/ufs/host/ufs-qcom.c | 71 +- drivers/usb/gadget/function/f_fs.c | 55 +- drivers/usb/gadget/function/f_hid.c | 4 +- drivers/usb/gadget/function/f_uac1.c | 13 +- drivers/usb/gadget/function/f_uac2.c | 13 +- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 2 + drivers/vdpa/mlx5/core/mr.c | 5 +- drivers/vdpa/mlx5/core/resources.c | 11 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 +- drivers/vdpa/vdpa.c | 48 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 10 +- drivers/vdpa/vdpa_user/iova_domain.c | 11 +- drivers/vdpa/vdpa_user/vduse_dev.c | 4 +- drivers/vhost/iotlb.c | 47 +- drivers/vhost/net.c | 2 + drivers/vhost/vdpa.c | 9 +- drivers/vhost/vhost.c | 65 +- drivers/vhost/vhost.h | 1 + drivers/vhost/vsock.c | 2 + drivers/video/fbdev/core/fb_chrdev.c | 6 +- drivers/video/fbdev/core/fbcon.c | 2 - drivers/video/fbdev/core/fbmem.c | 13 + drivers/video/fbdev/core/fbsysfs.c | 4 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 11 +- drivers/video/fbdev/ps3fb.c | 5 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +- drivers/virt/acrn/irqfd.c | 75 +- drivers/virtio/virtio.c | 29 + drivers/virtio/virtio_ring.c | 19 +- drivers/watchdog/at91sam9_wdt.c | 4 +- drivers/xen/pvcalls-front.c | 88 +- drivers/xen/xen-acpi-processor.c | 12 +- fs/9p/vfs_addr.c | 2 +- fs/afs/addr_list.c | 8 +- fs/afs/file.c | 6 +- fs/afs/fsclient.c | 2 +- fs/afs/inode.c | 1 + fs/afs/internal.h | 4 +- fs/afs/rxrpc.c | 4 +- fs/afs/super.c | 2 +- fs/afs/yfsclient.c | 2 +- fs/btrfs/acl.c | 4 + fs/btrfs/bio.c | 8 +- fs/btrfs/block-rsv.c | 19 +- fs/btrfs/defrag.c | 50 +- fs/btrfs/delayed-ref.c | 35 +- fs/btrfs/disk-io.c | 25 +- fs/btrfs/extent-tree.c | 35 +- fs/btrfs/extent-tree.h | 3 +- fs/btrfs/extent_io.c | 58 +- fs/btrfs/file.c | 103 +- fs/btrfs/fs.h | 9 + fs/btrfs/inode.c | 3 +- fs/btrfs/lzo.c | 13 +- fs/btrfs/qgroup.c | 18 +- fs/btrfs/transaction.c | 9 +- fs/btrfs/tree-log.c | 142 +-- fs/btrfs/volumes.c | 241 +++-- fs/btrfs/zstd.c | 11 +- fs/ceph/addr.c | 1115 +++++++++++++------- fs/ceph/mds_client.c | 65 +- fs/ceph/mds_client.h | 1 + fs/ceph/super.h | 9 + fs/erofs/decompressor.c | 61 +- fs/erofs/internal.h | 6 +- fs/erofs/xattr.c | 6 +- fs/erofs/zdata.c | 18 +- fs/erofs/zmap.c | 8 +- fs/ext2/inode.c | 3 +- fs/ext2/xattr.c | 4 +- fs/ext4/ext4.h | 3 +- fs/ext4/inode.c | 35 +- fs/ext4/xattr.c | 2 +- fs/f2fs/checkpoint.c | 15 +- fs/f2fs/data.c | 27 +- fs/f2fs/f2fs.h | 3 +- fs/f2fs/gc.c | 5 +- fs/f2fs/node.c | 50 +- fs/f2fs/super.c | 65 +- fs/fcntl.c | 3 + fs/gfs2/ops_fstype.c | 2 +- fs/gfs2/super.c | 4 +- fs/iomap/buffered-io.c | 8 +- fs/lockd/svc.c | 4 +- fs/lockd/svc4proc.c | 4 +- fs/lockd/svcproc.c | 4 +- fs/lockd/svcsubs.c | 45 +- fs/namespace.c | 40 +- fs/netfs/Makefile | 1 + fs/netfs/buffered_read.c | 129 +-- fs/netfs/direct_read.c | 16 +- fs/netfs/direct_write.c | 10 +- fs/netfs/internal.h | 11 +- fs/netfs/main.c | 7 + fs/netfs/misc.c | 110 +- fs/netfs/objects.c | 35 +- fs/netfs/read_collect.c | 61 +- fs/netfs/read_pgpriv2.c | 32 +- fs/netfs/read_retry.c | 4 +- fs/netfs/rolling_buffer.c | 230 ++++ fs/netfs/write_collect.c | 25 +- fs/netfs/write_issue.c | 32 +- fs/nfs/callback_xdr.c | 6 +- fs/nfs/delegation.c | 18 +- fs/nfs/flexfilelayout/flexfilelayout.c | 3 +- fs/nfs/fscache.c | 2 +- fs/nfs/fscache.h | 2 +- fs/nfs/localio.c | 15 + fs/nfs/nfs4session.c | 16 +- fs/nfsd/filecache.c | 75 +- fs/nfsd/lockd.c | 6 +- fs/nfsd/netns.h | 22 +- fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfs4recover.c | 12 +- fs/nfsd/nfs4state.c | 41 +- fs/nfsd/nfsctl.c | 4 +- fs/nfsd/nfssvc.c | 45 +- fs/ntfs3/bitmap.c | 62 +- fs/ntfs3/frecord.c | 1 - fs/ntfs3/fsntfs.c | 2 +- fs/ntfs3/run.c | 19 +- fs/ocfs2/cluster/heartbeat.c | 139 ++- fs/ocfs2/cluster/tcp.c | 105 +- fs/ocfs2/cluster/tcp.h | 1 + fs/ocfs2/inode.c | 133 +++ fs/ocfs2/xattr.c | 215 ++++ fs/ocfs2/xattr.h | 2 + fs/overlayfs/file.c | 17 +- fs/smb/client/cifsacl.c | 28 +- fs/smb/client/cifsfs.c | 1 + fs/smb/client/cifsglob.h | 5 +- fs/smb/client/connect.c | 5 + fs/smb/client/file.c | 72 +- fs/smb/client/inode.c | 22 +- fs/smb/client/misc.c | 72 +- fs/smb/client/readdir.c | 17 +- fs/smb/client/smb2ops.c | 46 +- fs/smb/client/smb2pdu.c | 9 - fs/smb/client/smbdirect.c | 20 +- fs/smb/client/transport.c | 40 +- fs/smb/server/auth.c | 14 +- fs/smb/server/connection.c | 37 +- fs/smb/server/connection.h | 7 +- fs/smb/server/mgmt/tree_connect.c | 26 +- fs/smb/server/mgmt/user_config.c | 11 + fs/smb/server/mgmt/user_session.c | 8 +- fs/smb/server/oplock.c | 81 +- fs/smb/server/oplock.h | 1 + fs/smb/server/smb2pdu.c | 115 +- fs/smb/server/smbacl.c | 88 +- fs/smb/server/smbacl.h | 2 +- fs/smb/server/transport_rdma.c | 4 +- fs/smb/server/vfs.c | 2 + fs/smb/server/vfs_cache.c | 8 +- fs/sysfs/group.c | 26 +- fs/tracefs/event_inode.c | 24 + fs/tracefs/internal.h | 4 +- fs/xfs/libxfs/xfs_alloc.c | 41 +- fs/xfs/libxfs/xfs_da_btree.c | 53 +- fs/xfs/libxfs/xfs_da_btree.h | 2 + fs/xfs/libxfs/xfs_exchmaps.c | 103 +- fs/xfs/libxfs/xfs_ialloc.c | 31 +- fs/xfs/libxfs/xfs_log_format.h | 4 +- fs/xfs/xfs_attr_inactive.c | 104 +- fs/xfs/xfs_bmap_util.c | 15 +- fs/xfs/xfs_buf.c | 65 +- fs/xfs/xfs_buf.h | 1 - fs/xfs/xfs_buf_item.c | 297 ++++-- fs/xfs/xfs_buf_item.h | 3 +- fs/xfs/xfs_dquot.c | 4 +- fs/xfs/xfs_exchrange.c | 51 +- fs/xfs/xfs_icache.c | 8 + fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_qm.c | 87 +- fs/xfs/xfs_trace.h | 2 - include/acpi/acpi_bus.h | 6 + include/asm-generic/vmlinux.lds.h | 2 +- include/clocksource/samsung_pwm.h | 2 +- include/drm/gpu_scheduler.h | 36 +- include/linux/arm_ffa.h | 24 +- include/linux/bpf.h | 10 +- include/linux/bpf_mprog.h | 10 + include/linux/bpf_verifier.h | 2 + include/linux/cfi.h | 4 +- include/linux/cfi_types.h | 6 +- include/linux/cgroup.h | 1 + include/linux/device.h | 14 + include/linux/dma/k3-udma-glue.h | 3 +- include/linux/fb.h | 2 + include/linux/folio_queue.h | 12 +- include/linux/gpio.h | 4 +- include/linux/gpio/consumer.h | 22 +- include/linux/gpio/driver.h | 10 + include/linux/gpu_buddy.h | 9 - include/linux/hid.h | 4 + include/linux/hugetlb.h | 6 + include/linux/i3c/master.h | 3 + include/linux/ieee80211.h | 12 +- include/linux/if_team.h | 3 +- include/linux/io_uring_types.h | 8 + include/linux/iommu.h | 5 + include/linux/irq_work.h | 9 +- include/linux/irq_work_types.h | 14 + include/linux/kasan.h | 6 +- include/linux/kvm_host.h | 8 + include/linux/lockd/bind.h | 12 +- include/linux/mlx5/cq.h | 2 +- include/linux/mlx5/driver.h | 3 +- include/linux/mm_inline.h | 15 +- include/linux/mmzone.h | 2 + include/linux/mount.h | 3 +- include/linux/net.h | 23 + include/linux/netdevice.h | 13 +- include/linux/netfilter.h | 2 + include/linux/netfilter/x_tables.h | 1 + include/linux/netfs.h | 22 +- include/linux/ntb.h | 24 + include/linux/overflow.h | 70 ++ include/linux/page-flags.h | 2 +- include/linux/pci.h | 1 + include/linux/pm.h | 2 + include/linux/pm_runtime.h | 21 +- include/linux/psi.h | 4 +- include/linux/rcupdate.h | 14 + include/linux/rcuwait.h | 13 +- include/linux/refcount.h | 106 ++ include/linux/ring_buffer.h | 5 +- include/linux/rolling_buffer.h | 61 ++ include/linux/skmsg.h | 14 - include/linux/slab.h | 9 + include/linux/soc/mediatek/mtk_wed.h | 1 + include/linux/srcutiny.h | 4 + include/linux/stddef.h | 20 + include/linux/sunrpc/svc_rdma.h | 14 +- include/linux/syscore_ops.h | 17 +- include/linux/types.h | 12 + include/linux/vdpa.h | 4 - include/media/v4l2-mem2mem.h | 21 + include/net/act_api.h | 2 +- include/net/ax25.h | 1 - include/net/bluetooth/hci_core.h | 2 + include/net/bluetooth/rfcomm.h | 1 + include/net/cfg80211.h | 103 +- include/net/dropreason-core.h | 21 + include/net/ip_vs.h | 2 +- include/net/net_namespace.h | 2 + include/net/netfilter/nf_conntrack_expect.h | 16 +- include/net/netfilter/nf_tables.h | 32 +- include/net/netns/mpls.h | 2 + include/net/pkt_cls.h | 14 +- include/net/sch_generic.h | 28 +- include/net/sctp/auth.h | 3 + include/net/tcp.h | 15 +- include/net/xdp_sock.h | 1 + include/net/xdp_sock_drv.h | 6 +- include/net/xsk_buff_pool.h | 9 +- include/scsi/scsi_host.h | 7 +- include/trace/events/netfs.h | 173 +-- include/trace/events/rv.h | 84 +- include/uapi/linux/netfilter/nf_conntrack_common.h | 1 + include/ufs/ufshcd.h | 7 +- init/Kconfig | 4 +- io_uring/eventfd.c | 6 +- io_uring/eventfd.h | 2 +- io_uring/futex.c | 4 +- io_uring/io_uring.c | 2 +- io_uring/napi.c | 72 +- io_uring/napi.h | 6 +- io_uring/poll.c | 23 +- io_uring/rw.c | 16 +- io_uring/waitid.c | 2 +- kernel/Makefile | 2 +- kernel/bpf/bpf_struct_ops.c | 12 + kernel/bpf/btf.c | 30 +- kernel/bpf/helpers.c | 15 +- kernel/bpf/mmap_unlock_work.h | 51 +- kernel/bpf/queue_stack_maps.c | 8 +- kernel/bpf/stackmap.c | 153 ++- kernel/bpf/syscall.c | 11 +- kernel/bpf/task_iter.c | 14 +- kernel/bpf/trampoline.c | 7 + kernel/bpf/verifier.c | 481 ++++++--- kernel/cgroup/cgroup.c | 47 +- kernel/cgroup/rstat.c | 19 +- kernel/configs/hardening.config | 4 +- kernel/cpu_pm.c | 12 +- kernel/irq/debugfs.c | 2 +- kernel/irq/generic-chip.c | 14 +- kernel/irq/pm.c | 11 +- kernel/irq/proc.c | 72 +- kernel/module/Kconfig | 2 +- kernel/printk/nbcon.c | 2 +- kernel/printk/printk.c | 13 +- kernel/rcu/srcutiny.c | 19 +- kernel/sched/ext.c | 40 +- kernel/sched/psi.c | 69 +- kernel/sched/syscalls.c | 17 + kernel/time/namespace.c | 5 + kernel/time/sched_clock.c | 22 +- kernel/time/timekeeping.c | 22 +- kernel/trace/ring_buffer.c | 139 ++- kernel/trace/ring_buffer_benchmark.c | 6 +- kernel/trace/trace.c | 110 +- kernel/trace/trace_probe.c | 2 +- lib/kunit_iov_iter.c | 4 +- lib/longest_symbol_kunit.c | 2 +- mm/huge_memory.c | 3 + mm/hugetlb.c | 9 +- mm/hugetlb_vmemmap.c | 232 ++-- mm/kasan/shadow.c | 111 +- mm/memcontrol.c | 2 +- mm/mm_init.c | 2 + mm/mremap.c | 68 +- mm/page_owner.c | 10 +- mm/page_table_check.c | 20 +- mm/vma.c | 39 +- mm/vma.h | 14 +- mm/vmalloc.c | 8 +- mm/vmscan.c | 47 +- net/ax25/af_ax25.c | 30 +- net/ax25/ax25_route.c | 74 -- net/batman-adv/soft-interface.c | 2 +- net/bluetooth/6lowpan.c | 27 +- net/bluetooth/hci_conn.c | 2 + net/bluetooth/hci_core.c | 4 + net/bluetooth/hci_event.c | 93 +- net/bluetooth/hci_sync.c | 145 ++- net/bluetooth/hci_sysfs.c | 17 +- net/bluetooth/iso.c | 46 +- net/bluetooth/l2cap_core.c | 23 +- net/bluetooth/l2cap_sock.c | 116 +- net/bluetooth/rfcomm/core.c | 134 ++- net/bridge/br_arp_nd_proxy.c | 24 +- net/bridge/br_device.c | 2 +- net/bridge/netfilter/ebtable_broute.c | 2 +- net/bridge/netfilter/ebtable_filter.c | 2 +- net/bridge/netfilter/ebtable_nat.c | 2 +- net/bridge/netfilter/ebtables.c | 71 +- net/ceph/auth_x.c | 5 + net/core/bpf_sk_storage.c | 17 +- net/core/dev.c | 190 +++- net/core/filter.c | 4 +- net/core/net_namespace.c | 175 +-- net/core/rtnetlink.c | 2 +- net/core/sock.c | 3 + net/ethtool/module.c | 3 +- net/ethtool/rss.c | 4 +- net/handshake/handshake-test.c | 8 + net/handshake/netlink.c | 6 +- net/handshake/request.c | 18 + net/hsr/hsr_device.c | 2 +- net/ieee802154/6lowpan/core.c | 2 +- net/ieee802154/core.c | 14 +- net/ife/ife.c | 14 +- net/ipv4/igmp.c | 14 +- net/ipv4/ip_tunnel.c | 2 +- net/ipv4/ipmr.c | 2 +- net/ipv4/netfilter/arp_tables.c | 35 +- net/ipv4/netfilter/ip_tables.c | 41 +- net/ipv4/netfilter/iptable_nat.c | 4 +- net/ipv4/tcp.c | 5 +- net/ipv4/tcp_bpf.c | 17 +- net/ipv4/tcp_input.c | 15 +- net/ipv4/tcp_ipv4.c | 3 +- net/ipv4/udp_bpf.c | 9 + net/ipv6/ioam6.c | 33 +- net/ipv6/ip6_gre.c | 9 +- net/ipv6/ip6_tunnel.c | 2 +- net/ipv6/ip6_vti.c | 2 +- net/ipv6/ip6mr.c | 5 +- net/ipv6/mcast.c | 20 +- net/ipv6/netfilter/ip6_tables.c | 38 +- net/ipv6/netfilter/ip6table_nat.c | 4 +- net/ipv6/sit.c | 2 +- net/ipv6/tcp_ipv6.c | 3 +- net/mac80211/debug.h | 10 +- net/mac80211/mlme.c | 35 +- net/mac80211/rx.c | 50 +- net/mac80211/sta_info.c | 79 +- net/mac80211/util.c | 3 + net/mpls/af_mpls.c | 232 ++-- net/mpls/internal.h | 16 +- net/mpls/mpls_iptunnel.c | 2 +- net/mptcp/fastopen.c | 3 +- net/mptcp/protocol.c | 256 ++--- net/mptcp/protocol.h | 6 +- net/netfilter/ipvs/ip_vs_core.c | 11 +- net/netfilter/ipvs/ip_vs_xmit.c | 3 +- net/netfilter/nf_conntrack_bpf.c | 111 +- net/netfilter/nf_conntrack_core.c | 33 +- net/netfilter/nf_conntrack_expect.c | 148 ++- net/netfilter/nf_conntrack_h323_main.c | 4 +- net/netfilter/nf_conntrack_helper.c | 10 +- net/netfilter/nf_conntrack_netlink.c | 24 +- net/netfilter/nf_conntrack_sip.c | 13 +- net/netfilter/nf_flow_table_ip.c | 3 + net/netfilter/nf_nat_core.c | 10 +- net/netfilter/nf_tables_api.c | 317 ++++-- net/netfilter/nft_bitwise.c | 15 +- net/netfilter/nft_byteorder.c | 13 +- net/netfilter/nft_ct.c | 3 +- net/netfilter/nft_dynset.c | 25 +- net/netfilter/nft_flow_offload.c | 3 +- net/netfilter/nft_set_pipapo.c | 11 +- net/netfilter/x_tables.c | 77 +- net/openvswitch/vport-internal_dev.c | 2 +- net/phonet/socket.c | 10 +- net/qrtr/mhi.c | 69 +- net/rxrpc/af_rxrpc.c | 25 +- net/rxrpc/key.c | 2 + net/rxrpc/peer_object.c | 22 +- net/rxrpc/proc.c | 32 +- net/rxrpc/recvmsg.c | 12 +- net/rxrpc/sendmsg.c | 7 +- net/rxrpc/server_key.c | 2 + net/sched/act_api.c | 2 +- net/sched/act_bpf.c | 2 +- net/sched/act_ife.c | 40 +- net/sched/act_mpls.c | 2 +- net/sched/act_police.c | 2 +- net/sched/act_skbedit.c | 2 +- net/sched/cls_api.c | 6 +- net/sched/cls_basic.c | 6 +- net/sched/cls_bpf.c | 6 +- net/sched/cls_cgroup.c | 2 +- net/sched/cls_flow.c | 2 +- net/sched/cls_flower.c | 4 +- net/sched/cls_fw.c | 4 +- net/sched/cls_matchall.c | 4 +- net/sched/cls_route.c | 4 +- net/sched/cls_u32.c | 18 +- net/sched/sch_cake.c | 4 +- net/sched/sch_codel.c | 12 +- net/sched/sch_drr.c | 2 +- net/sched/sch_ets.c | 2 +- net/sched/sch_fq.c | 26 +- net/sched/sch_fq_codel.c | 16 +- net/sched/sch_fq_pie.c | 14 +- net/sched/sch_generic.c | 45 +- net/sched/sch_gred.c | 2 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_hhf.c | 12 +- net/sched/sch_htb.c | 2 +- net/sched/sch_multiq.c | 2 +- net/sched/sch_pie.c | 12 +- net/sched/sch_prio.c | 2 +- net/sched/sch_qfq.c | 2 +- net/sched/sch_sfb.c | 2 +- net/sched/sch_sfq.c | 2 +- net/sctp/auth.c | 76 ++ net/sctp/bind_addr.c | 11 +- net/sctp/protocol.c | 3 +- net/sctp/sm_make_chunk.c | 20 +- net/sctp/sm_statefuns.c | 36 +- net/smc/af_smc.c | 90 +- net/smc/smc_loopback.c | 45 +- net/sunrpc/auth_gss/gss_krb5_unseal.c | 3 + net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 17 +- net/sunrpc/xprtrdma/svc_rdma_rw.c | 100 +- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 16 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 30 +- net/tipc/core.c | 4 +- net/tipc/udp_media.c | 75 +- net/tls/tls_sw.c | 2 + net/wireless/core.c | 20 +- net/wireless/core.h | 2 +- net/wireless/nl80211.c | 16 +- net/wireless/scan.c | 15 +- net/wireless/sme.c | 6 +- net/xdp/xsk.c | 253 ++++- net/xdp/xsk_buff_pool.c | 14 +- net/xdp/xsk_queue.h | 65 +- net/xfrm/xfrm_device.c | 8 + security/apparmor/domain.c | 105 +- security/apparmor/include/policy.h | 3 + security/apparmor/policy.c | 22 +- security/selinux/selinuxfs.c | 27 +- sound/core/seq/oss/seq_oss_event.c | 6 +- sound/core/seq/oss/seq_oss_event.h | 3 +- sound/core/seq/oss/seq_oss_ioctl.c | 5 +- sound/core/seq/oss/seq_oss_midi.c | 6 +- sound/core/seq/oss/seq_oss_midi.h | 2 +- sound/core/seq/oss/seq_oss_readq.c | 85 +- sound/core/seq/oss/seq_oss_rw.c | 5 +- sound/core/seq/seq_clientmgr.c | 3 +- sound/core/seq/seq_fifo.c | 67 +- sound/core/seq/seq_fifo.h | 1 + sound/drivers/mtpav.c | 6 +- sound/pci/ctxfi/ctatc.c | 63 +- sound/pci/ctxfi/ctatc.h | 4 - sound/pci/ctxfi/ctdaio.c | 91 +- sound/pci/ctxfi/ctdaio.h | 2 + sound/pci/ctxfi/cthardware.h | 2 +- sound/pci/ctxfi/cthw20k1.c | 2 +- sound/pci/ctxfi/cthw20k2.c | 2 +- sound/soc/amd/acp/acp-mach-common.c | 18 +- sound/soc/intel/avs/avs.h | 2 +- sound/soc/intel/avs/path.c | 11 +- sound/soc/intel/avs/pcm.c | 23 +- sound/soc/intel/avs/probes.c | 2 +- sound/soc/intel/avs/topology.c | 47 +- sound/soc/intel/avs/topology.h | 4 +- sound/soc/qcom/qdsp6/q6asm.c | 5 + sound/soc/sof/ipc3-pcm.c | 13 +- sound/soc/sof/ipc3-topology.c | 20 +- sound/soc/sof/ipc4-pcm.c | 41 +- sound/soc/sof/ipc4-topology.c | 18 +- sound/soc/sof/pcm.c | 169 ++- sound/soc/sof/sof-audio.c | 49 - sound/soc/sof/sof-audio.h | 17 +- sound/usb/pcm.c | 2 +- tools/perf/util/event.c | 15 +- tools/perf/util/include/linux/linkage.h | 2 +- .../testing/selftests/bpf/progs/exceptions_fail.c | 9 +- .../bpf/progs/verifier_subprog_precision.c | 12 +- tools/testing/selftests/net/forwarding/README | 2 +- tools/testing/selftests/net/tls.c | 515 +++++++++ tools/testing/vma/vma.c | 4 +- virt/kvm/guest_memfd.c | 8 +- virt/kvm/kvm_main.c | 36 +- virt/kvm/kvm_mm.h | 7 +- 1236 files changed, 21709 insertions(+), 13348 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 19/869 wifi: mt76: connac: tolerate inactive BSS deactivation
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Wang <[email protected]>
[ Upstream commit 04222f980301561edd77917edac570b1393ec45d ]
Firmware may return wlan_failure when deactivating a BSS that is already inactive. This is a valid teardown case and should not fail the remove path.
Keep activation failures unchanged since they still indicate that firmware failed to create or activate the BSS state.
--- .../wireless/mediatek/mt76/mt76_connac_mcu.c | 9 +++++++- .../wireless/mediatek/mt76/mt76_connac_mcu.h | 23 +++++++++++++++++++ .../net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +++-- 3 files changed, 35 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +8 -1
@@ -1220,6 +1220,9 @@ int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, len = enable ?sizeof (dev_req) :sizeof (basic_req); err =mt76_mcu_send_msg (dev, cmd, data, len, true); +if (err && cmd ==MCU_UNI_CMD (BSS_INFO_UPDATE )) + err =mt76_connac_mcu_bss_deact_err (dev, err, enable); +if (err <0 )return err;
@@ -1227,7 +1230,11 @@ int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, data = enable ? (void *)&basic_req : (void *)&dev_req; len = enable ?sizeof (basic_req) :sizeof (dev_req); -return mt76_mcu_send_msg (dev, cmd, data, len, true); + err =mt76_mcu_send_msg (dev, cmd, data, len, true); +if (err && cmd ==MCU_UNI_CMD (BSS_INFO_UPDATE )) + err =mt76_connac_mcu_bss_deact_err (dev, err, enable); + +return err; }EXPORT_SYMBOL_GPL (mt76_connac_mcu_uni_add_dev);
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +23 -0
@@ -1876,6 +1876,29 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid, } } +#define MT76_CONNAC_MCU_STATUS_WLAN_FAILURE 0xc0000001 + +static inline int +mt76_connac_mcu_bss_deact_err (struct mt76_dev *mdev,int err,bool enable) +{ +if (err != (int )MT76_CONNAC_MCU_STATUS_WLAN_FAILURE ) +return err; + +/* Ignore wlan_failure state false alarm when deactivating an +* inactive network. It does not harm the firmware state. +*/ +if (!enable) { +dev_dbg (mdev->dev, +"ignore wlan_failure when bss is deactivated\n" ); +return 0 ; + } + +dev_warn (mdev->dev, +"wlan_failure when bss is activated\n" ); + +return err; +} +struct sk_buff *__mt76_connac_mcu_alloc_sta_req (struct mt76_dev *dev,struct mt76_vif *mvif,struct mt76_wcid *wcid,int len);
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +4 -2
@@ -2788,6 +2788,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,struct mt792x_dev *dev = phy->dev;struct mt792x_link_sta *mlink_bc;struct sk_buff *skb; +int err; skb =__mt7925_mcu_alloc_bss_req (&dev->mt76, &mconf->mt76,MT7925_BSS_UPDATE_MAX_SIZE );
@@ -2813,8 +2814,9 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,if (enable)mt7925_mcu_bss_rlm_tlv (skb, phy->mt76, link_conf, ctx); -return mt76_mcu_skb_send_msg (&dev->mt76, skb, -MCU_UNI_CMD (BSS_INFO_UPDATE ), true); + err =mt76_mcu_skb_send_msg (&dev->mt76, skb, +MCU_UNI_CMD (BSS_INFO_UPDATE ), true); +return mt76_connac_mcu_bss_deact_err (&dev->mt76, err, enable); }int mt7925_mcu_set_dbdc (struct mt76_phy *phy,bool enable)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 28/869 drm/vmwgfx: validate pitch coming from userspace
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
[ Upstream commit 21bc51cb89ced74d6645a138cc2f21184bc75094 ]
Validate the pitch, alongside the box dimensions before trying to copy data from the underlying surface. Fixes possible out of bounds reads with cursor snooping.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +21 -5
@@ -382,6 +382,7 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,unsigned long kmap_num;SVGA3dCopyBox *box;unsigned box_count; +u64 src_extent;void *virtual;bool is_iomem;struct vmw_dma_cmd {
@@ -393,6 +394,8 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,vmw_surface_get_desc (VMW_CURSOR_SNOOP_FORMAT );const u32 image_pitch =VMW_CURSOR_SNOOP_WIDTH * desc->pitchBytesPerBlock; +BUILD_BUG_ON (sizeof (*srf->snooper.image) != desc->pitchBytesPerBlock); + cmd = container_of(header, struct vmw_dma_cmd, header);/* No snooper installed, nothing to copy */
@@ -430,8 +433,19 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,return ; } +if (box->w ==0 || box->h ==0 ) +return ; + + src_extent = (u64)(box->h -1 ) * cmd->dma.guest.pitch + + (u64 )box->w * desc->pitchBytesPerBlock; +if (src_extent > bo->base.size) { +DRM_ERROR ("Cursor snoop source of %llu bytes exceeds the %zu byte buffer\n" , + src_extent, bo->base.size); +return ; + } + kmap_offset = cmd->dma.guest.ptr.offset >>PAGE_SHIFT ; - kmap_num = (VMW_CURSOR_SNOOP_HEIGHT *image_pitch) >>PAGE_SHIFT ; + kmap_num =PFN_UP (src_extent); ret =ttm_bo_reserve (bo, true, false,NULL );if (unlikely (ret !=0 )) {
@@ -445,14 +459,16 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf, virtual =ttm_kmap_obj_virtual (&map, &is_iomem); -if (box->w ==VMW_CURSOR_SNOOP_WIDTH && cmd->dma.guest.pitch == image_pitch) { +if (box->w ==VMW_CURSOR_SNOOP_WIDTH && + box->h ==VMW_CURSOR_SNOOP_HEIGHT && + cmd->dma.guest.pitch == image_pitch) {memcpy (srf->snooper.image, virtual,VMW_CURSOR_SNOOP_HEIGHT *image_pitch); }else { -/* Image is unsigned pointer. */ +/* The destination stride is in pixels. */ for (i =0 ; i < box->h; i++) -memcpy (srf->snooper.image + i * image_pitch, - virtual + i * cmd->dma.guest.pitch, +memcpy (srf->snooper.image + i *VMW_CURSOR_SNOOP_WIDTH , + virtual + (size_t )i * cmd->dma.guest.pitch, box->w * desc->pitchBytesPerBlock); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 29/869 namespace: dont inherit MNT_UMOUNT in clone_mnt()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit e2c6d326216642011da318b9edfd5d57ebd5a56f ]
MNT_UMOUNT gets raised on a mount that umount_tree() or umount_one() has taken out of its namespace. It's never cleared. __detach_mounts() unhooks a mount that carries it instead of unmounting it.
disconnect_mount() lets an unmounted child stay attached only if its parent carries it. propagate_umount() takes it as the sign that a mount is going to be unmounted when it decides what else can be unmounted, where a chain of locked mounts ends and where a for reparenting an overmount.
clone_mnt() copies the flags of the source and only masks MNT_INTERNAL_FLAGS which doesn't include MNT_UMOUNT. A mount that was lazily unmounted but is kept alive by a file descriptor can still be copied when its root is an nsfs or pidfs file because may_copy_tree() accepts those before checking whether the source is mounted at all:
mount --bind /proc/self/ns/net /tmp/x exec 3< /tmp/x umount -l /tmp/x mount --bind /proc/self/fd/3 /tmp/y
The mount on /tmp/y is attached to the caller's namespace with MNT_UMOUNT already set and every copy of it inherits the flag again.
That causes a number of bugs:
- Unlink its mountpoint from a mount namespace where it isn't one. __detach_mounts() takes it for a mount that was unmounted earlier, unhooks it from its parent and drops the reference the namespace holds on it. It stays in the namespace with one reference too few and as its own parent, so it can't be unmounted through the file descriptor anymore and the namespace never finds it again. When the namespace goes away it's leaked and points to a freed struct mnt_namespace that may_change_propagation() and anon_ns_root() read on the next propagation change or mount_setattr() through the file descriptor.
- Make it shared and unmount a peer. trace_transfers() follows the flag from the peer into it and strips it from its peer group.
- Let a propagated umount reach it. gather_candidates() marks it with T_UMOUNT_CANDIDATE but never puts it on the candidate list, so the mark is never cleared and every later propagated umount skips it. If it's the parent of a locked mount handle_locked() takes it as the cutoff and commits the locked child that should have stayed and disconnect_mount() leaves that child attached to it, unmounted under a mounted parent, which is what disconnect_mount() exists to prevent. When the namespace goes away umount_tree() visits the child a second time. And once __detach_mounts() has made it its own parent reparent() never finds the end of the chain of unmounted parents.
A clone is a new mount that has never been unmounted. Add MNT_UMOUNT to MNT_INTERNAL_FLAGS so clone_mnt() never copies it. And warn when umount_tree() reaches a mount that already has it set.
--- fs/namespace.c | 4 +++- include/linux/mount.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
fs/namespace.c +3 -1
@@ -1311,7 +1311,7 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root, } mnt->mnt.mnt_flags = old->mnt.mnt_flags; - mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD |MNT_MARKED |MNT_INTERNAL ); + mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD |MNT_MARKED |MNT_INTERNAL |MNT_UMOUNT );atomic_inc (&sb->s_active); mnt->mnt.mnt_idmap =mnt_idmap_get (mnt_idmap (&old->mnt));
@@ -1778,6 +1778,8 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)/* Gather the mounts to umount */ for (p = mnt; p; p =next_mnt (p, mnt)) { +/* A mount is unmounted once. */ +WARN_ON_ONCE (p->mnt.mnt_flags &MNT_UMOUNT ); p->mnt.mnt_flags |=MNT_UMOUNT ;if (mnt_ns_attached (p))move_from_ns (p, &tmp_list);
include/linux/mount.h +2 -1
@@ -50,7 +50,8 @@ struct path;#define MNT_ATIME_MASK (MNT_NOATIME | MNT_NODIRATIME | MNT_RELATIME )#define MNT_INTERNAL_FLAGS (MNT_SHARED | MNT_WRITE_HOLD | MNT_INTERNAL | \ - MNT_DOOMED | MNT_SYNC_UMOUNT | MNT_MARKED) + MNT_DOOMED | MNT_SYNC_UMOUNT | MNT_MARKED | \ + MNT_UMOUNT)#define MNT_INTERNAL 0x4000
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 30/869 namespace: check the mounts before reading their parents in pivot_root()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 6b7c001eb5857fa09041f47673666060a2e5fc1c ]
path_pivot_root() reads the parents of new_root and of the caller's root and checks whether they are shared before it checks that either mount is in the caller's mount namespace. Only namespace_sem is held. That's fine for a mount that is in the caller's mount namespace.
But new_root can be a file descriptor to a mount that has been unmounted and that only the file descriptor keeps alive. If that mount stayed attached to its parent when it was unmounted nothing pins the parent for it. The final mntput() of the parent unhooks the children under mount_lock alone and frees the parent afterwards:
pivot_root() close(fd), last ref on the parent
------------ ---------------------------------
ex_parent = new_mnt->mnt_parent
mntput_no_expire_slowpath()
__umount_mnt(new_mnt)
cleanup_mnt()
call_rcu() IS_MNT_SHARED(ex_parent)
BUG: KASAN: slab-use-after-free in path_pivot_root+0xf1a/0x1840 Read of size 4 at addr ffff8881047382f8 by task pivot_widen/157 path_pivot_root+0xf1a/0x1840 __x64_sys_pivot_root+0x165/0x190
The same goes for the caller's root via chroot(). Both outcomes of the check end in EINVAL so nothing but the read itself goes wrong. It's the same thing commit bb4609405752 ("statmount: read the parent of an unmounted mount under mount_lock") fixed for statmount().
Check that both mounts are in the caller's namespace before their parents are read. Every path returns EINVAL either way.
--- fs/namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/namespace.c +3 -2
@@ -4469,14 +4469,15 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, new_mnt =real_mount (new.mnt); root_mnt =real_mount (root.mnt); old_mnt =real_mount (old.mnt); +/* only a mounted mount has a parent that namespace_sem pins */ +if (!check_mnt (root_mnt) || !check_mnt (new_mnt)) + goto out4; ex_parent = new_mnt->mnt_parent; root_parent = root_mnt->mnt_parent;if (IS_MNT_SHARED (old_mnt) ||IS_MNT_SHARED (ex_parent) ||IS_MNT_SHARED (root_parent)) goto out4; -if (!check_mnt (root_mnt) || !check_mnt (new_mnt)) - goto out4;if (new_mnt->mnt.mnt_flags &MNT_LOCKED ) goto out4; error = -ENOENT ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 31/869 dm-integrity: use internal variable for digestsize
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
[ Upstream commit e4cc9deca3da48986072327ae2eeb18e6fd0165d ]
Instead of calling digestsize() each time the digestsize for the internal hash is needed, store the digestsize in a new field internal_hash_digestsize within struct dm_integrity_c once and use this value when needed.
Stable-dep-of: 764b683a6180 ("dm-integrity: fix buffer overflow in inline mode with large tag size")
--- drivers/md/dm-integrity.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/md/dm-integrity.c +14 -11
@@ -223,6 +223,7 @@ struct dm_integrity_c {int failed;struct crypto_shash *internal_hash; +unsigned int internal_hash_digestsize;struct dm_target *ti;
@@ -1672,7 +1673,7 @@ static void integrity_sector_checksum(struct dm_integrity_c *ic, sector_t sector goto failed; } - digest_size =crypto_shash_digestsize (ic->internal_hash); + digest_size = ic->internal_hash_digestsize;if (unlikely (digest_size < ic->tag_size))memset (result + digest_size,0 , ic->tag_size - digest_size);
@@ -1772,7 +1773,7 @@ static void integrity_metadata(struct work_struct *w)if (ic->internal_hash) {struct bvec_iter iter;struct bio_vec bv; -unsigned int digest_size =crypto_shash_digestsize (ic->internal_hash); +unsigned int digest_size = ic->internal_hash_digestsize;struct bio *bio =dm_bio_from_per_bio_data (dio,sizeof (struct dm_integrity_io ));char *checksums;unsigned int extra_space =unlikely (digest_size > ic->tag_size) ? digest_size - ic->tag_size :0 ;
@@ -2120,7 +2121,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio, }while (++s < ic->sectors_per_block);if (ic->internal_hash) { -unsigned int digest_size =crypto_shash_digestsize (ic->internal_hash); +unsigned int digest_size = ic->internal_hash_digestsize;if (unlikely (digest_size > ic->tag_size)) {char checksums_onstack[HASH_MAX_DIGESTSIZE ];
@@ -2427,7 +2428,7 @@ static int dm_integrity_map_inline(struct dm_integrity_io *dio, bool from_map)if (!dio->integrity_payload) {unsigned digest_size, extra_size; dio->payload_len = ic->tuple_size * (bio_sectors (bio) >> ic->sb->log2_sectors_per_block); - digest_size =crypto_shash_digestsize (ic->internal_hash); + digest_size = ic->internal_hash_digestsize; extra_size =unlikely (digest_size > ic->tag_size) ? digest_size - ic->tag_size :0 ; dio->payload_len += extra_size; dio->integrity_payload =kmalloc (dio->payload_len,GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
@@ -2590,7 +2591,7 @@ static void dm_integrity_inline_recheck(struct work_struct *w)bio_put (outgoing_bio);integrity_sector_checksum (ic, dio->bio_details.bi_iter.bi_sector, outgoing_data, digest); -if (unlikely (crypto_memneq (digest, dio->integrity_payload,min (crypto_shash_digestsize (ic->internal_hash), ic->tag_size)))) { +if (unlikely (crypto_memneq (digest, dio->integrity_payload,min (ic->internal_hash_digestsize, ic->tag_size)))) {DMERR_LIMIT ("%pg: Checksum failed at sector 0x%llx" , ic->dev->bdev, dio->bio_details.bi_iter.bi_sector);atomic64_inc (&ic->number_of_mismatches);
@@ -2630,7 +2631,7 @@ static int dm_integrity_end_io(struct dm_target *ti, struct bio *bio, blk_status//memset(mem, 0xff, ic->sectors_per_block << SECTOR_SHIFT); integrity_sector_checksum (ic, dio->bio_details.bi_iter.bi_sector, mem, digest);if (unlikely (crypto_memneq (digest, dio->integrity_payload + pos, -min (crypto_shash_digestsize (ic->internal_hash), ic->tag_size)))) { +min (ic->internal_hash_digestsize, ic->tag_size)))) {kunmap_local (mem);dm_integrity_free_payload (dio);INIT_WORK (&dio->work, dm_integrity_inline_recheck);
@@ -3012,8 +3013,8 @@ static void integrity_recalc(struct work_struct *w) goto free_ret; } recalc_tags_size = (recalc_sectors >> ic->sb->log2_sectors_per_block) * ic->tag_size; -if (crypto_shash_digestsize (ic->internal_hash) > ic->tag_size) - recalc_tags_size +=crypto_shash_digestsize (ic->internal_hash) - ic->tag_size; +if (ic->internal_hash_digestsize > ic->tag_size) + recalc_tags_size += ic->internal_hash_digestsize - ic->tag_size; recalc_tags =kvmalloc (recalc_tags_size,GFP_NOIO );if (!recalc_tags) {vfree (recalc_buffer);
@@ -3172,8 +3173,8 @@ static void integrity_recalc_inline(struct work_struct *w) } recalc_tags_size = (recalc_sectors >> ic->sb->log2_sectors_per_block) * ic->tuple_size; -if (crypto_shash_digestsize (ic->internal_hash) > ic->tuple_size) - recalc_tags_size +=crypto_shash_digestsize (ic->internal_hash) - ic->tuple_size; +if (ic->internal_hash_digestsize > ic->tuple_size) + recalc_tags_size += ic->internal_hash_digestsize - ic->tuple_size; recalc_tags =kmalloc (recalc_tags_size,GFP_NOIO | __GFP_NOWARN);if (!recalc_tags) {kfree (recalc_buffer);
@@ -4703,6 +4704,8 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv "Invalid internal hash", "Error setting internal hash key");if (r) goto bad; +if (ic->internal_hash) + ic->internal_hash_digestsize =crypto_shash_digestsize (ic->internal_hash); r =get_mac (&ic->journal_mac, &ic->journal_mac_alg, &ti->error,"Invalid journal mac" ,"Error setting journal mac key" );
@@ -4715,7 +4718,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv r = -EINVAL ; goto bad; } - ic->tag_size =crypto_shash_digestsize (ic->internal_hash); + ic->tag_size = ic->internal_hash_digestsize; }if (ic->tag_size >MAX_TAG_SIZE ) { ti->error ="Too big tag size" ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 32/869 dm-integrity: rename internal_hash
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
[ Upstream commit e8a052ee1fb570b8e07f05f65752646eaac74355 ]
Rename "internal_hash" to "internal_shash" and introduce a boolean value "internal_hash".
Stable-dep-of: 764b683a6180 ("dm-integrity: fix buffer overflow in inline mode with large tag size")
--- drivers/md/dm-integrity.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/md/dm-integrity.c +11 -8
@@ -219,10 +219,11 @@ struct dm_integrity_c {__u8 log2_blocks_per_bitmap_bit;unsigned char mode; +bool internal_hash;int failed; -struct crypto_shash *internal_hash; +struct crypto_shash *internal_shash;unsigned int internal_hash_digestsize;struct dm_target *ti;
@@ -1635,11 +1636,11 @@ static void integrity_sector_checksum(struct dm_integrity_c *ic, sector_t sector const char *data, char *result) { __le64 sector_le = cpu_to_le64(sector); -SHASH_DESC_ON_STACK (req, ic->internal_hash); +SHASH_DESC_ON_STACK (req, ic->internal_shash);int r;unsigned int digest_size; - req->tfm = ic->internal_hash; + req->tfm = ic->internal_shash; r =crypto_shash_init (req);if (unlikely (r <0 )) {
@@ -4700,12 +4701,14 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv buffer_sectors =1 ; ic->log2_buffer_sectors =min ((int )__fls (buffer_sectors),31 -SECTOR_SHIFT ); - r =get_mac (&ic->internal_hash, &ic->internal_hash_alg, &ti->error, + r =get_mac (&ic->internal_shash, &ic->internal_hash_alg, &ti->error,"Invalid internal hash" ,"Error setting internal hash key" );if (r) goto bad; -if (ic->internal_hash) - ic->internal_hash_digestsize =crypto_shash_digestsize (ic->internal_hash); +if (ic->internal_shash) { + ic->internal_hash = true; + ic->internal_hash_digestsize =crypto_shash_digestsize (ic->internal_shash); + } r =get_mac (&ic->journal_mac, &ic->journal_mac_alg, &ti->error,"Invalid journal mac" ,"Error setting journal mac key" );
@@ -5239,8 +5242,8 @@ static void dm_integrity_dtr(struct dm_target *ti)if (ic->sb)free_pages_exact (ic->sb,SB_SECTORS <<SECTOR_SHIFT ); -if (ic->internal_hash) -crypto_free_shash (ic->internal_hash); +if (ic->internal_shash) +crypto_free_shash (ic->internal_shash);free_alg (&ic->internal_hash_alg);if (ic->journal_crypt)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 33/869 dm-integrity: fix buffer overflow in inline mode with large tag size
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <[email protected]>
[ Upstream commit 764b683a6180fd72c931c13fea98d383506a3475 ]
In inline mode, dm_integrity_check and dm_integrity_inline_recheck compute the checksum of each block into an on-stack buffer of HASH_MAX_DIGESTSIZE bytes. integrity_sector_checksum pads its result with zeroes up to the tag size, so if the tag size is larger than HASH_MAX_DIGESTSIZE, the padding runs past the end of the buffer. With CONFIG_STACKPROTECTOR the kernel panics in dm_integrity_check on the first read.
Enlarge both buffers to hold MAX_TAG_SIZE bytes, as commit b93b6643e9b5 ("dm integrity: fix a crash with unusually large tag size") did for integrity_metadata.
Note that this is not a security bug because the buffer overflow can only be triggered by root.
--- drivers/md/dm-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-integrity.c +2 -2
@@ -2548,7 +2548,7 @@ static void dm_integrity_inline_recheck(struct work_struct *w) outgoing_data = dio->integrity_payload +PAGE_SIZE ;while (dio->bio_details.bi_iter.bi_size) { -char digest[HASH_MAX_DIGESTSIZE ]; +char digest[MAX_T (size_t,HASH_MAX_DIGESTSIZE ,MAX_TAG_SIZE )];int r;struct bio_integrity_payload *bip;struct bio_vec bv;
@@ -2626,7 +2626,7 @@ static int dm_integrity_end_io(struct dm_target *ti, struct bio *bio, blk_status unlikely(dio->integrity_range_locked)) goto skip_check;while (dio->bio_details.bi_iter.bi_size) { -char digest[HASH_MAX_DIGESTSIZE ]; +char digest[MAX_T (size_t,HASH_MAX_DIGESTSIZE ,MAX_TAG_SIZE )];struct bio_vec bv =bio_iter_iovec (bio, dio->bio_details.bi_iter);char *mem =bvec_kmap_local (&bv);//memset(mem, 0xff, ic->sectors_per_block << SECTOR_SHIFT);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 34/869 net: xilinx: axienet: Free outstanding DMA buffers on dmaengine stop
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suraj Gupta <[email protected]>
[ Upstream commit bcf2573a68a808a5b54cadafa72b6672e662c2bf ]
In the dmaengine path the driver pre-submits RX buffers and holds in-flight TX buffers whose SKBs are DMA-mapped by the driver and freed only in the completion callbacks. On ndo_stop() dmaengine_terminate_sync() aborts these descriptors without running their callbacks, and the driver then frees only the ring shells, leaking every SKB still owned by the engine and its DMA mapping on each ifdown. With 128 RX buffers pre-posted per channel, the mapping leak can eventually exhaust a limited IOMMU aperture.
Clear the slot's skb in the TX and RX callbacks so a non-NULL skb marks a slot that still owns a live, DMA-mapped buffer, and on stop unmap and free every such buffer.
axienet_dma_rx_cb() runs from the DMA tasklet and re-arms the RX ring on each completion, so it can race axienet_stop(): a completion may submit a fresh buffer after dmaengine_terminate_sync() has returned, leaving the channel armed with a buffer the teardown then frees while the engine may still write into it (dma_release_channel() does not stop it either). Add a lock that axienet_dma_rx_cb() holds across the @stopping check and the resubmit, and axienet_stop() holds to set @stopping before terminating. Once @stopping is set no callback can arm a new buffer, and any armed just before is aborted by the terminate, so teardown only frees buffers the engine no longer owns.
--- drivers/net/ethernet/xilinx/xilinx_axienet.h | 7 ++- .../net/ethernet/xilinx/xilinx_axienet_main.c | 51 +++++++++++++++---- 2 files changed, 47 insertions(+), 11 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet.h +5 -2
@@ -516,8 +516,9 @@ struct skbuf_dma_descriptor {* @stats_work: Work for reading the hardware statistics counters often enough * to catch overflows. * @dma_err_task: Work structure to process Axi DMA errors -* @stopping: Set when @dma_err_task shouldn't do anything because we are -* about to stop the device. +* @stopping: Set when we are about to stop the device: makes @dma_err_task +* a no-op (legacy DMA path) and fences RX descriptor +* resubmission in axienet_dma_rx_cb() (dmaengine path). * @tx_irq: Axidma TX IRQ number * @rx_irq: Axidma RX IRQ number * @eth_irq: Ethernet core IRQ number
@@ -542,6 +543,7 @@ struct skbuf_dma_descriptor {* @tx_ring_tail: TX skb ring buffer tail index. * @rx_ring_head: RX skb ring buffer head index. * @rx_ring_tail: RX skb ring buffer tail index. +* @rx_submit_lock: Protects RX ring resubmission vs teardown in dmaengine path. */ struct axienet_local {struct net_device *ndev;
@@ -620,6 +622,7 @@ struct axienet_local {int tx_ring_tail;int rx_ring_head;int rx_ring_tail; +spinlock_t rx_submit_lock; };/**
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +42 -9
96 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 35/869 riscv: patch: Avoid early phys_to_page()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vivian Wang <[email protected]>
[ Upstream commit 6b60a128c2f43180664a614830f3c529497e0394 ]
Similarly to commit 8d09e2d569f6 ("arm64: patching: avoid early page_to_phys()"), avoid using phys_to_page() for the kernel address case in patch_map().
Since this is called from apply_boot_alternatives() in setup_arch(), and commit 4267739cabb8 ("arch, mm: consolidate initialization of SPARSE memory model") has moved sparse_init() to after setup_arch(), phys_to_page() is not available there yet, and it panics on boot with SPARSEMEM on RV32, which does not use SPARSEMEM_VMEMMAP.
Stable-dep-of: a510e1ae8c90 ("riscv: patch: fix handling of bpf-jit execmem addresses")
--- arch/riscv/kernel/patch.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
arch/riscv/kernel/patch.c +11 -10
@@ -42,19 +42,20 @@ static inline bool is_kernel_exittext(uintptr_t addr) static __always_inline void *patch_map(void *addr, const unsigned int fixmap) {uintptr_t uintaddr = (uintptr_t ) addr; -struct page *page; +phys_addr_t phys; -if (core_kernel_text (uintaddr) ||is_kernel_exittext (uintaddr)) - page =phys_to_page (__pa_symbol (addr)); -else if (IS_ENABLED (CONFIG_STRICT_MODULE_RWX )) - page =vmalloc_to_page (addr); -else -return addr; +if (core_kernel_text (uintaddr) ||is_kernel_exittext (uintaddr)) { + phys =__pa_symbol (addr); + }else if (IS_ENABLED (CONFIG_STRICT_MODULE_RWX )) { +struct page *page =vmalloc_to_page (addr); -BUG_ON (!page); +BUG_ON (!page); + phys =page_to_phys (page) +offset_in_page (addr); + }else { +return addr; + } -return (void *)set_fixmap_offset (fixmap,page_to_phys (page) + -offset_in_page (addr)); +return (void *)set_fixmap_offset (fixmap, phys); }static void patch_unmap (int fixmap)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 36/869 riscv: patch: fix handling of bpf-jit execmem addresses
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei-Jie Hung <[email protected]>
[ Upstream commit a510e1ae8c9030750c2edf7b0bc9b186cd8c7a06 ]
Commit 8718e5a3090b ("riscv: patch: skip fixmap mapping when kernel text is already writable") gated the core_kernel_text() branch of patch_map() on CONFIG_STRICT_KERNEL_RWX, and explicitly left the vmalloc branch unchanged. That branch has a separate problem.
That branch only creates a temporary writable fixmap alias when CONFIG_STRICT_MODULE_RWX is enabled, and otherwise assumes the target is directly writable and returns the address unchanged. That assumption no longer holds: bpf_prog_pack_alloc calls set_memory_rox() on every pack unconditionally in alloc_new_pack(), independently of any CONFIG_STRICT_*_RWX option, so BPF text in the vmalloc area is read-only regardless of what CONFIG_STRICT_MODULE_RWX says.
With CONFIG_STRICT_MODULE_RWX=n, patch_map() returns the read-only address directly, the subsequent copy_to_kernel_nofault() takes a page fault and returns -EFAULT. bpf_arch_text_copy() turns that into -EINVAL, which propagates through bpf_jit_binary_pack_finalize() to the WARN_ON() in bpf_int_jit_compile() and leaves the program un-JITed.
Note that BPF cannot be fixed the way kprobes was in
commit bdc46e507b59 ("riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX"). EXECMEM_BPF is already PAGE_KERNEL, i.e. writable at allocation time; the read-only mapping is established afterwards by generic code in alloc_new_pack(), which arch code cannot influence. The only place this can be handled is patch_map().
This is the same problem that was fixed on arm64 by commit b1480ed230ac ("arm64: patching: fix handling of execmem addresses"), and the fix is the same: CONFIG_EXECMEM is what actually tracks whether the vmalloc area can hold executable memory that needs a temporary alias to be written. CONFIG_BPF_JIT, CONFIG_KPROBES and CONFIG_MODULES all select it.
Note that this is not limited to CONFIG_MODULES=n. Unlike arm64, riscv selects CONFIG_ARCH_OPTIONAL_KERNEL_RWX, so CONFIG_STRICT_MODULE_RWX can be disabled with CONFIG_MODULES=y as well, and the bug is reachable in that configuration too.
The !CONFIG_MMU build is unaffected: it has its own __patch_insn_set() and __patch_insn_write() implementations and never calls patch_map().
--- arch/riscv/kernel/patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/patch.c +1 -1
@@ -46,7 +46,7 @@ static __always_inline void *patch_map(void *addr, const unsigned int fixmap)if (core_kernel_text (uintaddr) ||is_kernel_exittext (uintaddr)) { phys =__pa_symbol (addr); - }else if (IS_ENABLED (CONFIG_STRICT_MODULE_RWX )) { + }else if (IS_ENABLED (CONFIG_EXECMEM )) {struct page *page =vmalloc_to_page (addr);BUG_ON (!page);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 37/869 scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Jhu <[email protected]>
[ Upstream commit 469fa055664bfd8717b087a80d59c03055789c17 ]
In MCQ mode, ufshcd_mcq_compl_pending_transfer() uses blk_mq_tagset_busy_iter() to iterate over busy requests during error recovery and host reset. However, both iterator callbacks perform whole-queue operations redundantly for each visited request:
- force_compl == true: ufshcd_mcq_force_compl_one() calls ufshcd_mcq_compl_all_cqes_lock() on every busy request, sweeping the entire completion ring (hwq->max_entries slots) once per active request under spin_lock_irqsave even though the first sweep already cleared all completion entries.
- force_compl == false: ufshcd_mcq_compl_one() acquires cq_lock and polls CQTPy over MMIO via ufshcd_mcq_poll_cqe_lock() for every busy request without doing any per-request work.
Sweep or poll each hardware queue (hba->uhq[i]) once at the start of ufshcd_mcq_compl_pending_transfer(). When force_compl is true, run blk_mq_tagset_busy_iter() afterward to complete residual in-flight requests with DID_REQUEUE, and remove the now-unused ufshcd_mcq_compl_one() callback.
--- drivers/ufs/core/ufshcd.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-)
drivers/ufs/core/ufshcd.c +21 -16
@@ -5685,7 +5685,17 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,struct ufshcd_lrb *lrbp;struct scsi_cmnd *cmd;unsigned long flags; -int tag; +int tag, i; + +for (i =0 ; i < hba->nr_hw_queues; i++) { +if (force_compl) +ufshcd_mcq_compl_all_cqes_lock (hba, &hba->uhq[i]); +else +ufshcd_mcq_poll_cqe_lock (hba, &hba->uhq[i]); + } + +if (!force_compl) +return ;for (tag =0 ; tag < hba->nutrs; tag++) { lrbp = &hba->lrb[tag];
@@ -5698,22 +5708,17 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,if (!hwq)continue ; -if (force_compl) { -ufshcd_mcq_compl_all_cqes_lock (hba, hwq); -/* -* For those cmds of which the cqes are not present -* in the cq, complete them explicitly. -*/ -spin_lock_irqsave (&hwq->cq_lock, flags); -if (cmd && !test_bit (SCMD_STATE_COMPLETE , &cmd->state)) { -set_host_byte (cmd,DID_REQUEUE ); -ufshcd_release_scsi_cmd (hba, lrbp); -scsi_done (cmd); - } -spin_unlock_irqrestore (&hwq->cq_lock, flags); - }else { -ufshcd_mcq_poll_cqe_lock (hba, hwq); +/* +* For those cmds of which the cqes are not present +* in the cq, complete them explicitly. +*/ +spin_lock_irqsave (&hwq->cq_lock, flags); +if (cmd && !test_bit (SCMD_STATE_COMPLETE , &cmd->state)) { +set_host_byte (cmd,DID_REQUEUE ); +ufshcd_release_scsi_cmd (hba, lrbp); +scsi_done (cmd); } +spin_unlock_irqrestore (&hwq->cq_lock, flags); } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 20/869 net: team: Remove unused team_mode_op, port_enabled
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Harvey <[email protected]>
[ Upstream commit 014f249121d73909528df320818fba7693d0ec92 ]
This team_mode_op wasn't used by any of the team modes, so remove it.
Stable-dep-of: b7454f1940c5 ("net: team: stop reusing skb after queue override")
--- drivers/net/team/team_core.c | 2 -- include/linux/if_team.h | 1 - 2 files changed, 3 deletions(-)
drivers/net/team/team_core.c +0 -2
@@ -944,8 +944,6 @@ static void team_port_enable(struct team *team, team_port_index_hash(team, port->index));team_adjust_ops (team);team_queue_override_port_add (team, port); -if (team->ops.port_enabled) - team->ops.port_enabled (team, port);team_notify_peers (team);team_mcast_rejoin (team);team_lower_state_changed (port);
include/linux/if_team.h +0 -1
@@ -121,7 +121,6 @@ struct team_mode_ops {int (*port_enter)(struct team *team,struct team_port *port);void (*port_leave)(struct team *team,struct team_port *port);void (*port_change_dev_addr)(struct team *team,struct team_port *port); -void (*port_enabled)(struct team *team,struct team_port *port);void (*port_disabled)(struct team *team,struct team_port *port); };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 38/869 scsi: ch: Do not keep references to data transfer element devices
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed Abdelhaleem Ahmed <[email protected]>
[ Upstream commit 27c0f718d3b3c99e6d315308e95d987d0382a8a8 ]
ch_readconfig() looks up the scsi_device of every data transfer element whose SCSI id the changer reports in READ ELEMENT STATUS, and stores it in ch->dt[]. scsi_device_lookup() takes a reference, and nothing ever drops
it: ch_destroy() frees the array with kfree(). ch->dt[] is read nowhere else - it only supplies the vendor, model and revision printed in the same loop.
Once such a drive is removed, its scsi_device can never be released. It stays on the host's device list at its address, so a new device there is refused by anything that walks the list - target_core_pscsi reports "scsi_device_get() failed for H:C:T:L" - and the low-level driver's module can no longer be unloaded. Only a reboot recovers.
It shows with any changer that reports its drives' ids; with the mhvtl virtual library (IBM 3573-TL personality), each create and remove of a library with four drives leaves four references behind, counted by the module's use count in lsmod. With ch not bound the count is unchanged, and with this patch applied it is unchanged too.
Drop the reference as soon as the name has been printed, and remove the now unused dt[] array. That also removes the array leaked when ch_probe() fails after ch_readconfig().
The same leak was reported with an RFC patch in 2022, which was not merged.
--- drivers/scsi/ch.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-)
drivers/scsi/ch.c +9 -21
@@ -112,7 +112,6 @@ typedef struct {int minor;char name[8 ];struct scsi_device *device; -struct scsi_device **dt;/* ptrs to data transfer elements */ u_int firsts[CH_TYPES ];u_int counts[CH_TYPES ];u_int voltags;
@@ -363,16 +362,10 @@ ch_readconfig(scsi_changer *ch) vendor_labels[i]); } -/* look up the devices of the data transfer elements */ - ch->dt =kcalloc (ch->counts[CHET_DT ],sizeof (*ch->dt), -GFP_KERNEL ); - -if (!ch->dt) { -kfree (buffer); -return -ENOMEM ; - } - +/* report the devices of the data transfer elements */ for (elem =0 ; elem < ch->counts[CHET_DT ]; elem++) { +struct scsi_device *sdev; + id =-1 ; lun =0 ;if (elem <CH_DT_MAX &&-1 != dt_id[elem]) {
@@ -388,10 +381,8 @@ ch_readconfig(scsi_changer *ch)VPRINTK (KERN_INFO ,"dt 0x%x: " ,elem+ch->firsts[CHET_DT ]);if (data[6 ] &0x80 ) {VPRINTK (KERN_CONT ,"not this SCSI bus\n" ); - ch->dt[elem] =NULL ; }else if (0 == (data[6 ] &0x30 )) {VPRINTK (KERN_CONT ,"ID/LUN unknown\n" ); - ch->dt[elem] =NULL ; }else { id = ch->device->id; lun =0 ;
@@ -401,18 +392,16 @@ ch_readconfig(scsi_changer *ch) }if (-1 != id) {VPRINTK (KERN_CONT ,"ID %i, LUN %i, " ,id,lun); - ch->dt[elem] = -scsi_device_lookup (ch->device->host, - ch->device->channel, - id,lun); -if (!ch->dt[elem]) { + sdev =scsi_device_lookup (ch->device->host, + ch->device->channel, + id, lun); +if (!sdev) {/* should not happen */ VPRINTK (KERN_CONT ,"Huh? device not found!\n" ); }else {VPRINTK (KERN_CONT ,"name: %8.8s %16.16s %4.4s\n" , - ch->dt[elem]->vendor, - ch->dt[elem]->model, - ch->dt[elem]->rev); + sdev->vendor, sdev->model, sdev->rev); +scsi_device_put (sdev); } } }
@@ -576,7 +565,6 @@ static void ch_destroy(struct kref *ref)scsi_changer *ch =container_of (ref, scsi_changer, ref); ch->device =NULL ; -kfree (ch->dt);kfree (ch); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 39/869 scsi: ufs: core: Move an assignment in ufshcd_mcq_process_cqe()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit dd4299af9b049c0dcb28699327ebc1386aab4b2a ]
Since 'tag' is only used inside the if-statement, move the 'tag' assignment into the if-statement. This patch prepares for introducing a WARN_ON_ONCE() call in ufshcd_mcq_get_tag() if the tag lookup fails.
Stable-dep-of: 375f3a5691dd ("scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()")
--- drivers/ufs/core/ufs-mcq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-mcq.c +2 -1
@@ -303,9 +303,10 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba, struct ufs_hw_queue *hwq) {struct cq_entry *cqe =ufshcd_mcq_cur_cqe (hwq); -int tag =ufshcd_mcq_get_tag (hba, cqe);if (cqe->command_desc_base_addr) { +int tag =ufshcd_mcq_get_tag (hba, cqe); +ufshcd_compl_one_cqe (hba, tag, cqe);/* After processed the cqe, mark it empty (invalid) entry */ cqe->command_desc_base_addr =0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 40/869 scsi: ufs: core: Add debug log for MCQ command timeout
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
[ Upstream commit 3abe4113e784b4a1135fe0e89828afecbfebf862 ]
It is difficult to debug situations where an MCQ command timeout occurs, the corresponding CQ tag response is received, but the request is not completed. Add a one-line log to indicate when the CQ entry is abnormal.
Stable-dep-of: 375f3a5691dd ("scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()")
--- drivers/ufs/core/ufs-mcq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/ufs/core/ufs-mcq.c +2 -0
@@ -310,6 +310,8 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,ufshcd_compl_one_cqe (hba, tag, cqe);/* After processed the cqe, mark it empty (invalid) entry */ cqe->command_desc_base_addr =0 ; + }else { +dev_err (hba->dev,"Abnormal CQ entry!\n" ); } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 41/869 scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit 1373df88d53594a32534fd8960c51d1d09be8ecb ]
Document the aspects of ufshcd_mcq_compl_all_cqes_lock() that are nontrivial in a comment block above this function.
Stable-dep-of: 375f3a5691dd ("scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()")
--- drivers/ufs/core/ufs-mcq.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/ufs/core/ufs-mcq.c +8 -0
@@ -315,6 +315,14 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba, } } +/* +* This function is called from the UFS error handler with the UFS host +* controller disabled (HCE = 0). Reading host controller registers, e.g. the +* CQ tail pointer (CQTPy), may not be safe with the host controller disabled. +* Hence, iterate over all completion queue entries. This won't result in +* double completions because ufshcd_mcq_process_cqe() clears a CQE after it +* has been processed. +*/ void ufshcd_mcq_compl_all_cqes_lock (struct ufs_hba *hba,struct ufs_hw_queue *hwq) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 42/869 scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Jhu <[email protected]>
[ Upstream commit 375f3a5691dd46b5d05b90a8968872ec8b2248c5 ]
During MCQ host reset, ufshcd_host_reset_and_restore() stops the host controller via ufshcd_hba_stop() (HCE = 0) before calling ufshcd_complete_requests(hba, true) -> ufshcd_mcq_compl_pending_transfer(hba, true) -> ufshcd_mcq_force_compl_one() -> ufshcd_mcq_compl_all_cqes_lock(). Because ufshcd_mcq_force_compl_one() is its sole caller, ufshcd_mcq_compl_all_cqes_lock() always runs with HCE = 0.
Despite the comment above ufshcd_mcq_compl_all_cqes_lock() stating that reading CQTPy may not be safe with the controller disabled, the function still calls ufshcd_mcq_update_cq_tail_slot() at the end of its sweep:
1. Unsafe CQTPy MMIO read:
Calling ufshcd_mcq_update_cq_tail_slot() at the end of the sweep reads CQTPy over MMIO while HCE = 0, directly contradicting the function's documented contract (commit 1373df88d535 ("scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()")) that reading CQTPy may not be safe with the controller disabled.
2. Spurious error logs on empty slots:
Sweeping all max_entries slots visits empty entries where command_desc_base_addr is 0, causing ufshcd_mcq_process_cqe() to log unguarded dev_err(hba->dev, "Abnormal CQ entry!\n") messages.
Fix both issues in ufshcd_mcq_compl_all_cqes_lock():
- Remove the ufshcd_mcq_update_cq_tail_slot() call and the redundant hwq->cq_head_slot = hwq->cq_tail_slot assignment without replacement. The two indices are already equal after the sweep: they are equal when the sweep starts, since ufshcd_mcq_poll_cqe_lock() consumes entries until cq_head_slot reaches cq_tail_slot, and the sweep advances cq_head_slot by exactly one full ring. Both indices are also reinitialized before the queue is reused.
- Extract ufshcd_mcq_compl_cqe() and invoke it only on non-empty slots during full-ring sweeps, keeping "Abnormal CQ entry!" logging strictly for unexpected empty entries in ufshcd_mcq_poll_cqe_lock().
--- drivers/ufs/core/ufs-mcq.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/ufs/core/ufs-mcq.c +17 -13
@@ -299,20 +299,24 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba, struct cq_entry *cqe)return div_u64 (addr,ufshcd_get_ucd_size (hba)); } +static void ufshcd_mcq_compl_cqe (struct ufs_hba *hba,struct cq_entry *cqe) +{ +int tag =ufshcd_mcq_get_tag (hba, cqe); + +ufshcd_compl_one_cqe (hba, tag, cqe); +/* After processing the CQE, mark it as an empty (invalid) entry. */ + cqe->command_desc_base_addr =0 ; +} +static void ufshcd_mcq_process_cqe (struct ufs_hba *hba,struct ufs_hw_queue *hwq) {struct cq_entry *cqe =ufshcd_mcq_cur_cqe (hwq); -if (cqe->command_desc_base_addr) { -int tag =ufshcd_mcq_get_tag (hba, cqe); - -ufshcd_compl_one_cqe (hba, tag, cqe); -/* After processed the cqe, mark it empty (invalid) entry */ - cqe->command_desc_base_addr =0 ; - }else { +if (cqe->command_desc_base_addr) +ufshcd_mcq_compl_cqe (hba, cqe); +else dev_err (hba->dev,"Abnormal CQ entry!\n" ); - } }/*
@@ -320,7 +324,7 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,* controller disabled (HCE = 0). Reading host controller registers, e.g. the * CQ tail pointer (CQTPy), may not be safe with the host controller disabled. * Hence, iterate over all completion queue entries. This won't result in -* double completions because ufshcd_mcq_process_cqe() clears a CQE after it +* double completions because ufshcd_mcq_compl_cqe() clears a CQE after it * has been processed. */ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
@@ -331,13 +335,13 @@ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,spin_lock_irqsave (&hwq->cq_lock, flags);while (entries >0 ) { -ufshcd_mcq_process_cqe (hba, hwq); +struct cq_entry *cqe =ufshcd_mcq_cur_cqe (hwq); + +if (cqe->command_desc_base_addr) +ufshcd_mcq_compl_cqe (hba, cqe);ufshcd_mcq_inc_cq_head_slot (hwq); entries--; } - -ufshcd_mcq_update_cq_tail_slot (hwq); - hwq->cq_head_slot = hwq->cq_tail_slot;spin_unlock_irqrestore (&hwq->cq_lock, flags); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 43/869 drm/vc4: Use video aperture helpers
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 7e89e4365fd36ca006670788ec2c1527bfd0c61c ]
DRM's aperture functions have long been implemented as helpers under drivers/video/ for use with fbdev. Avoid the DRM wrappers by calling the video functions directly.
Stable-dep-of: b816da5d5df1 ("drm/vc4: Fix firmware reference leak in vc4_drm_bind()")
--- drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +2 -2
@@ -20,6 +20,7 @@* driver. */ +#include <linux/aperture.h> #include <linux/clk.h> #include <linux/component.h> #include <linux/device.h>
@@ -30,7 +31,6 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> -#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -356,7 +356,7 @@ static int vc4_drm_bind(struct device *dev) } } - ret =drm_aperture_remove_framebuffers (driver); + ret =aperture_remove_all_conflicting_devices (driver->name);if (ret) goto err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 44/869 drm/vc4: Fix firmware reference leak in vc4_drm_bind()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit b816da5d5df1461446a0a5f3fe2b4948a659a790 ]
The firmware reference obtained via rpi_firmware_get() is leaked when aperture_remove_all_conflicting_devices() fails, as the error label returns without putting it. This happens before the firmware is consumed and put further down in the function.
Put the firmware reference before jumping to err.
--- drivers/gpu/drm/vc4/vc4_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_drv.c +4 -1
@@ -357,8 +357,11 @@ static int vc4_drm_bind(struct device *dev) } ret =aperture_remove_all_conflicting_devices (driver->name); -if (ret) +if (ret) { +if (firmware) +rpi_firmware_put (firmware); goto err; + }if (firmware) { ret = rpi_firmware_property(firmware,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 45/869 namespace: unhash a dentry before detaching the mounts on it
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 528b383dc35d1e5caf64ddf5d35f983ae543b0d0 ]
unlink(), rmdir() and rename() remove the entry from the filesystem, call detach_mounts() on the entry with the inode locked and then call d_delete() once the inode is unlocked.
The thing is that between detach_mounts() and d_delete() the dentry is still hashed and positive. But after detach_mounts() nothing covers the dentry anymore. A lookup that finds this dentry in the dcache can uncover what the mounts hid.
That's a problem when unlinking files or directories that are mountpoints in other mount namespaces. Everybody who had the underlying entry covered can race the detach_mount() call until d_delete() has run.
The race window isn't all that small. It encompasses namespace_unlock() with a full synchronize_rcu_expedited() grace period and the inode_unlock() of the entry.
In my experiments three walkers that kept trying read an overmounted file in 11938 of the 16140 unlinks that removed its mountpoint from a bind mount of the filesystem within a minute.
Fun fact, d_invalidate() has the same ordering problem but gets it right. It unhashes the dentry first and detaches the mounts afterwards. Let's do the same in __detach_mounts():
- A lookup that hasn't found the dentry yet misses it in the dcache and waits for the directory lock that the caller holds until the name is gone for good.
- A lockless lookup that found it already fails the mount_lock check while the dentry still counts as a mountpoint and the d_seq check once it doesn't, and retries.
This fixes the lockless path. We still need to fix the reference count lookup in a follow-up patch.
So d_drop() the dentry. The dentry stays positive and held but can't be found anymore. Then proceed with the detach and unlink.
Reproducer:
The reads were counted with the program below, three walkers for 60 s in a VM with 4 CPUs. The race window is stretched with the debug patch pasted here. fs.detach_race_walk_us sleeps in lookup_fast() once it found a mountpoint dentry and before its mounts are crossed. fs.detach_race_unlink_us sleeps in vfs_unlink() between detach_mounts() and d_delete().
// SPDX-License-Identifier: GPL-2.0 /* * unlink_covered: unlink a file that is a mountpoint in a detached copy of * its mount, against lookups that open it through that copy. * * A is a tmpfs with the file f1 (content SECRET_F) and the plain file * MARK_A. A' is an open_tree(OPEN_TREE_CLONE) copy of A with MARK_A bound * on A'/f1, held through an O_PATH fd on its root once the tree fd is * closed. Walkers open f1 through that fd while the driver unlinks A/f1, * where nothing is mounted on it. A walker may read MARK_A or get ENOENT. * A read of SECRET_F is a hit: the name was found after its mount was * gone. The lockless walks use openat2(RESOLVE_CACHED). * * usage: unlink_covered [-t seconds] [-w walkers] */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include <errno.h> #include <fcntl.h> #include <pthread.h> #include <stdatomic.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/mount.h> #include <sys/stat.h> #include <sys/syscall.h> #include <linux/openat2.h> #ifndef __NR_open_tree #define __NR_open_tree 428 #endif #ifndef __NR_move_mount #define __NR_move_mount 429 #endif #ifndef __NR_openat2 #define __NR_openat2 437 #endif #ifndef OPEN_TREE_CLONE #define OPEN_TREE_CLONE 1 #endif #ifndef OPEN_TREE_CLOEXEC #define OPEN_TREE_CLOEXEC O_CLOEXEC #endif #ifndef MOVE_MOUNT_F_EMPTY_PATH #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 #endif #define WORK "/tmp/uc" #define ADIR WORK "/A"
static int duration = 60, nwalkers = 3;
static atomic_int stop, writer_waiting;
static pthread_rwlock_t cur_lock = PTHREAD_RWLOCK_INITIALIZER;
static int cur_fd = -1; /* the root of A', -1 while there is none */
static atomic_long n_unlink, n_walk, n_mark, n_enoent, n_other, n_secret,
n_secret_cached;
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
} static void put_file(int dfd, const char *name, const char *content) {
int fd = openat(dfd, name, O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC,
0644);
if (fd < 0 || write(fd, content, strlen(content)) < 0)
die(name);
close(fd);
}
/* "plain/../" @n times, then f1: a longer walk that checks nothing on its way */
static char *longpath(int n)
{
char *p = malloc(n * 9 + 3), *q = p;
for (int i = 0; i < n; i++, q += 9)
memcpy(q, "plain/../", 9);
strcpy(q, "f1");
return p;
}
static void try_read(int dfd, const char *path, int cached)
{
struct open_how how = { .flags = O_RDONLY | O_CLOEXEC,
.resolve = RESOLVE_CACHED };
char buf[32] = "";
long n;
int fd;
if (cached)
fd = syscall(__NR_openat2, dfd, path, &how, sizeof(how));
else
fd = openat(dfd, path, O_RDONLY | O_CLOEXEC);
atomic_fetch_add(&n_walk, 1);
if (fd < 0) {
if (errno == ENOENT)
atomic_fetch_add(&n_enoent, 1);
else if (!cached || errno != EAGAIN)
atomic_fetch_add(&n_other, 1);
return;
}
n = read(fd, buf, sizeof(buf) - 1);
close(fd);
if (n >= 6 && !strncmp(buf, "SECRET", 6)) {
if (cached)
atomic_fetch_add(&n_secret_cached, 1);
if (!atomic_fetch_add(&n_secret, 1))
printf("HIT: read \"%s\" through %s (%s walk)\n", buf,
path, cached ? "lockless" : "any");
} else {
atomic_fetch_add(&n_mark, 1);
}
}
static void *walker(void *arg)
{
unsigned int r = (long)arg * 2654435761u;
while (!atomic_load(&stop)) {
char *p_long, *p_short;
int dfd;
while (atomic_load(&writer_waiting) && !atomic_load(&stop))
usleep(20);
pthread_rwlock_rdlock(&cur_lock);
dfd = cur_fd;
if (dfd < 0) {
pthread_rwlock_unlock(&cur_lock);
usleep(100);
continue;
}
r = r * 1103515245u + 12345u;
p_long = longpath(1 + (r >> 8) % 400);
p_short = longpath(0);
try_read(dfd, p_long, 0);
try_read(dfd, p_short, 0);
try_read(dfd, p_long, 1);
pthread_rwlock_unlock(&cur_lock);
free(p_long);
free(p_short);
}
return NULL;
} /* hand the walkers a new A' (or none), close the old one */ static void publish(int fd)
{
int old;
atomic_fetch_add(&writer_waiting, 1);
pthread_rwlock_wrlock(&cur_lock);
old = cur_fd;
cur_fd = fd;
pthread_rwlock_unlock(&cur_lock);
atomic_fetch_sub(&writer_waiting, 1);
if (old >= 0)
close(old);
}
static void *driver(void *arg __attribute__((unused)))
{
int a;
if (mkdir(ADIR, 0755) && errno != EEXIST)
die("mkdir A");
if (mount("A", ADIR, "tmpfs", 0, "size=4M"))
die("mount A");
a = open(ADIR, O_PATH | O_DIRECTORY | O_CLOEXEC);
if (a < 0 || mkdirat(a, "plain", 0755))
die("A/plain");
put_file(a, "MARK_A", "MARK_A");
while (!atomic_load(&stop)) {
int t, m, fd_a;
put_file(a, "f1", "SECRET_F");
t = syscall(__NR_open_tree, a, "",
OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC | AT_EMPTY_PATH);
if (t < 0)
die("open_tree A");
m = syscall(__NR_open_tree, a, "MARK_A",
OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC);
if (m < 0)
die("open_tree MARK_A");
if (syscall(__NR_move_mount, m, "", t, "f1",
MOVE_MOUNT_F_EMPTY_PATH))
die("move_mount");
close(m);
fd_a = openat(t, ".", O_PATH | O_DIRECTORY | O_CLOEXEC);
if (fd_a < 0)
die("open A'");
publish(fd_a);
usleep(200 + rand() % 1000);
close(t); /* A' is unmounted, fd_a holds it */
usleep(200 + rand() % 1000);
if (unlinkat(a, "f1", 0)) /* through A, a plain file there */
die("unlink f1");
atomic_fetch_add(&n_unlink, 1);
usleep(rand() % 300);
publish(-1);
}
close(a);
umount2(ADIR, MNT_DETACH);
return NULL;
}
int main(int argc, char **argv)
{
pthread_t d, *w;
int c, i;
setvbuf(stdout, NULL, _IOLBF, 0);
while ((c = getopt(argc, argv, "t:w:")) != -1) {
switch (c) {
case 't':
duration = atoi(optarg);
break;
case 'w':
nwalkers = atoi(optarg);
break;
default:
fprintf(stderr, "usage: unlink_covered [-t seconds] [-w walkers]\n");
return 2;
}
}
if (unshare(CLONE_NEWNS) ||
mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL))
die("unshare");
if (mkdir(WORK, 0755) && errno != EEXIST)
die("mkdir");
w = calloc(nwalkers, sizeof(*w));
for (i = 0; i < nwalkers; i++)
if (pthread_create(&w[i], NULL, walker, (void *)(long)i))
die("pthread_create");
if (pthread_create(&d, NULL, driver, NULL))
die("pthread_create");
sleep(duration);
atomic_store(&stop, 1);
pthread_join(d, NULL);
for (i = 0; i < nwalkers; i++)
pthread_join(w[i], NULL);
printf("unlink_covered: %d s, %d walkers: unlinks %ld walks %ld mark %ld enoent %ld other %ld SECRET %ld (lockless %ld)\n",
duration, nwalkers, atomic_load(&n_unlink), atomic_load(&n_walk),
atomic_load(&n_mark), atomic_load(&n_enoent),
atomic_load(&n_other), atomic_load(&n_secret),
atomic_load(&n_secret_cached));
return atomic_load(&n_secret) ? 1 : 0;
}# diff --git a/fs/namei.c b/fs/namei.c
# --- a/fs/namei.c
# +++ b/fs/namei.c
# @@ -35,6 +35,7 @@
# #include <linux/fcntl.h>
# #include <linux/device_cgroup.h>
# #include <linux/fs_struct.h>
# +#include <linux/delay.h>
# #include <linux/posix_acl.h>
# #include <linux/hash.h>
# #include <linux/bitops.h>
# @@ -1205,9 +1206,26 @@ static int sysctl_protected_symlinks __read_mostly;
# static int sysctl_protected_hardlinks __read_mostly;
# static int sysctl_protected_fifos __read_mostly;
# static int sysctl_protected_regular __read_mostly;
# +/* debug: widen the two windows of the detach_mounts() race */
# +static int sysctl_detach_race_walk_us __read_mostly;
# +static int sysctl_detach_race_unlink_us __read_mostly;
#
# #ifdef CONFIG_SYSCTL
# static const struct ctl_table namei_sysctls[] = {
# + {
# + .procname = "detach_race_walk_us",
# + .data = &sysctl_detach_race_walk_us,
# + .maxlen = sizeof(int),
# + .mode = 0644,
# + .proc_handler = proc_dointvec,
# + },
# + {
# + .procname = "detach_race_unlink_us",
# + .data = &sysctl_detach_race_unlink_us,
# + .maxlen = sizeof(int),
# + .mode = 0644,
# + .proc_handler = proc_dointvec,
# + },
# {
# .procname = "protected_symlinks",
# .data = &sysctl_protected_symlinks,
# @@ -1878,6 +1896,10 @@ static struct dentry *lookup_fast(struct nameidata *nd)
# dentry = __d_lookup(parent, &nd->last);
# if (unlikely(!dentry))
# return NULL;
# + /* debug: between finding a mountpoint and crossing its mounts */
# + if (unlikely(sysctl_detach_race_walk_us) && d_mountpoint(dentry))
# + usleep_range(sysctl_detach_race_walk_us,
# + sysctl_detach_race_walk_us + 10);
# status = d_revalidate(nd->inode, &nd->last, dentry, nd->flags);
# }
# if (unlikely(status <= 0)) {
# @@ -5693,6 +5715,10 @@ int vfs_unlink(struct mnt_idmap *idmap, struct inode *dir,
# if (!error) {
# dont_mount(dentry);
# detach_mounts(dentry);
# + /* debug: the mounts are gone, d_delete() is still to come */
# + if (unlikely(sysctl_detach_race_unlink_us))
# + usleep_range(sysctl_detach_race_unlink_us,
# + sysctl_detach_race_unlink_us + 10);
# }
# }
# }--- fs/namespace.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/namespace.c +5 -0
@@ -1957,6 +1957,9 @@ static int do_umount(struct mount *mnt, int flags)* detach_mounts allows lazily unmounting those mounts instead of * leaking them. * +* The dentry is unhashed before the mounts go so that no lookup finds +* what they covered. The caller removes it for good afterwards. +* * The caller may hold dentry->d_inode->i_mutex. */ void __detach_mounts (struct dentry *dentry)
@@ -1970,6 +1973,8 @@ void __detach_mounts(struct dentry *dentry)if (!mp) goto out_unlock; +/* the name goes first, what covered it goes second */ +d_drop (dentry); event++;while (!hlist_empty (&mp->m_list)) { mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 46/869 namespace: check the target before walking it in do_mount_setattr()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 08f4288a37ef4b3d19b4a9599ec3048219cac828 ]
When mount_setattr() changes the propagation type to MS_SHARED do_mount_setattr() takes namespace_sem and calls invent_group_ids() which walks the whole target tree with next_mnt() and allocates a peer group id for every mount that doesn't have one.
Whether the caller may touch the target at all is only checked afterwards under mount_lock. If it may not, cleanup_group_ids() walks the tree a second time on the way out to free the ids again.
A detached tree that a file descriptor keeps alive, a mount in another mount namespace or a mount below the root of an anonymous mount namespace does a bunch of allocation work that is completely useless because it will fail and revert right after.
Do the right thing and check the target right after taking namespace_sem instead. A mount leaves its namespace only under namespace_sem so the mount stays stable. The check under mount_lock stays for the case where no propagation change is requested and namespace_sem isn't taken. Callers get the same EINVAL as before.
--- fs/namespace.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/namespace.c +8 -0
@@ -4721,6 +4721,13 @@ static int do_mount_setattr(struct path *path, struct mount_kattr *kattr)* propagation. */ namespace_lock (); +/* invent_group_ids() walks the tree, only walk a mounted one */ +if (!is_mounted (&mnt->mnt) || + ((mnt_has_parent (mnt) || !is_anon_ns (mnt->mnt_ns)) && + !check_mnt (mnt))) { +namespace_unlock (); +return -EINVAL ; + }if (kattr->propagation ==MS_SHARED ) { err =invent_group_ids (mnt, kattr->recurse);if (err) {
@@ -4733,6 +4740,7 @@ static int do_mount_setattr(struct path *path, struct mount_kattr *kattr) err = -EINVAL ;lock_mount_hash (); +/* Checked under namespace_sem already if the propagation changes. */ /* Ensure that this isn't anything purely vfs internal. */ if (!is_mounted (&mnt->mnt)) goto out;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 47/869 fcntl: refuse F_SET_RW_HINT on an immutable inode
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit b0d1022b9bdb1e98aa7fb3244fdd50a58c61766c ]
An immutable inode is never written to so write hints are pointless. Refuse the hint on an immutable inode the way setattr(), fallocate() and etxattr() refuse their changes.
--- fs/fcntl.c | 3 +++ 1 file changed, 3 insertions(+)
fs/fcntl.c +3 -0
@@ -374,6 +374,9 @@ static long fcntl_set_rw_hint(struct file *file, unsigned int cmd,u64 __user *argp = (u64 __user *)arg;u64 hint; +/* nothing is ever written to it */ +if (IS_IMMUTABLE (inode)) +return -EPERM ;if (copy_from_user (&hint, argp,sizeof (hint)))return -EFAULT ;if (!rw_hint_valid (hint))
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 21/869 net: team: Rename port_disabled team mode op to port_tx_disabled
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Harvey <[email protected]>
[ Upstream commit cfa477df2cc62ba53cb936669886361152b594a7 ]
This team mode op is only used by the load balance mode, and it only uses it in the tx path.
Stable-dep-of: b7454f1940c5 ("net: team: stop reusing skb after queue override")
--- drivers/net/team/team_core.c | 4 ++-- drivers/net/team/team_mode_loadbalance.c | 4 ++-- include/linux/if_team.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/team/team_core.c +2 -2
@@ -968,8 +968,8 @@ static void team_port_disable(struct team *team, {if (!team_port_enabled (port))return ; -if (team->ops.port_disabled) - team->ops.port_disabled (team, port); +if (team->ops.port_tx_disabled) + team->ops.port_tx_disabled (team, port);hlist_del_rcu (&port->hlist);__reconstruct_port_hlist (team, port->index); port->index =-1 ;
drivers/net/team/team_mode_loadbalance.c +2 -2
@@ -658,7 +658,7 @@ static void lb_port_leave(struct team *team, struct team_port *port)free_percpu (lb_port_priv->pcpu_stats); } -static void lb_port_disabled (struct team *team,struct team_port *port) +static void lb_port_tx_disabled (struct team *team,struct team_port *port) {lb_tx_hash_to_port_mapping_null_port (team, port); }
@@ -668,7 +668,7 @@ static const struct team_mode_ops lb_mode_ops = { .exit = lb_exit, .port_enter = lb_port_enter, .port_leave = lb_port_leave, - .port_disabled = lb_port_disabled, + .port_tx_disabled = lb_port_tx_disabled, .receive = lb_receive, .transmit = lb_transmit, };
include/linux/if_team.h +1 -1
@@ -121,7 +121,7 @@ struct team_mode_ops {int (*port_enter)(struct team *team,struct team_port *port);void (*port_leave)(struct team *team,struct team_port *port);void (*port_change_dev_addr)(struct team *team,struct team_port *port); -void (*port_disabled)(struct team *team,struct team_port *port); +void (*port_tx_disabled)(struct team *team,struct team_port *port); };extern int team_modeop_port_enter (struct team *team,struct team_port *port);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 48/869 namespace: handle mount locking for automounts correctly
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 33aadc7c72055fca93cb5a3691d836ebf8b31c9b ]
If mounts are propagated across user namespaces, attach_recursive_mnt() locks every copy of the source mount to protect overmounts from vanishing and revealing the underlying files or directories.
The user namespace is taken from the caller's mount namespaces since this is where the mounts end up. Except, that's not always true. Automounts may legitimately get popped in by tasks located in a different mount and user namespace during path lookup.
Then check doesn't make sense at that point. The copy in the namespace of the parent - which may be the host's - is now locked and the host cannot change the flags of its own mounts anymore.
Here's the reproducer:
- host has debugfs mounted nosuid,nodev,noexec and shared
- tracefs automount below it is not yet active
- hand a child process a directory descriptor on that mount
- child process enters auser and mount namespace
- child process' namespace now holds a locked copy of the host's debugfs mount that receives propagation from it
- child process stats "tracing/." through the descriptor
- lookup runs on the host's mount so the automount lands below the host's mount
- propagation puts a copy below the child's copy
- both try to clear the flags on the mount they got, with a bind remount:
host, on its own automount: MS_REMOUNT|MS_BIND = EPERM
child, on the copy in its namespace: MS_REMOUNT|MS_BIND = 0So the lock landed on the host's mount instead of the child's copy. Congrats. So we need to compare with the owner of the namespace the mount actually gets mounted on. For all regular cases that is the caller's mount namespace and so nothing changes.
Detached trees in anonymous mount namespaces by be handed over via SCM_RIGHTS or inherited in other ways on purpose so the attaching task's mount namespace is authoritative, not the creator of the detached tree.
--- fs/namespace.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
fs/namespace.c +17 -1
@@ -2494,15 +2494,31 @@ static int attach_recursive_mnt(struct mount *source_mnt,struct mountpoint *dest_mp, enum mnt_tree_flags_t flags) { - struct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns;HLIST_HEAD (tree_list );struct mnt_namespace *ns = top_mnt->mnt_ns; +struct user_namespace *user_ns = ns->user_ns;struct mountpoint *smp;struct mount *child, *dest_mnt, *p;struct hlist_node *n;int err =0 ;bool moving = flags &MNT_TREE_MOVE , beneath = flags &MNT_TREE_BENEATH ; +/* +* A caller in an unprivileged mount namespaces may trigger an +* automount and propagate locked mounts into privileged mount +* namespaces. Take ownership from the target mount namespace. +* It's equivalent for everything but the automount case. +* +* Detached trees in anonymous mount namespaces by be handed +* over via SCM_RIGHTS or inherited in other ways on purpose +* the attaching task's mount namespace is authoritative, not +* the creator of the detached tree. +*/ +if (is_anon_ns (ns)) + user_ns = current->nsproxy->mnt_ns->user_ns; +else + user_ns = ns->user_ns; +/* * Preallocate a mountpoint in case the new mounts need to be * mounted beneath mounts on the same mountpoint.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 49/869 smb: client: improve compound padding in encryption
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit bc925c1216f0848da96ac642fba3cb92ae1f4e06 upstream.
After commit f7f291e14dde ("cifs: fix oops during encryption"), the encryption layer can handle vmalloc'd buffers as well as kmalloc'd buffers, so there is no need to inefficiently squash request iovs into a single one to handle padding in compound requests.
--- fs/smb/client/cifsglob.h | 4 ++-- fs/smb/client/smb2ops.c | 37 +++---------------------------------- fs/smb/client/transport.c | 40 +++++++++++++--------------------------- 3 files changed, 18 insertions(+), 63 deletions(-)
fs/smb/client/cifsglob.h +2 -2
@@ -2195,7 +2195,7 @@ static inline int cifs_get_num_sgs(conststruct kvec *iov = &rqst[i].rq_iov[j]; addr = (unsigned long )iov->iov_base + skip; -if (unlikely (is_vmalloc_addr ((void *)addr))) { +if (is_vmalloc_or_module_addr ((void *)addr)) { len = iov->iov_len - skip; nents +=DIV_ROUND_UP (offset_in_page (addr) + len,PAGE_SIZE );
@@ -2222,7 +2222,7 @@ static inline void cifs_sg_set_buf(strucunsigned int off =offset_in_page (addr); addr &=PAGE_MASK ; -if (unlikely (is_vmalloc_addr ((void *)addr))) { +if (is_vmalloc_or_module_addr ((void *)addr)) { do { unsigned int len = min_t(unsigned int, buflen, PAGE_SIZE - off);
fs/smb/client/smb2ops.c +3 -34
@@ -2842,7 +2842,7 @@ smb2_set_next_command(struct cifs_tcon *struct cifs_ses *ses = tcon->ses;struct TCP_Server_Info *server = ses->server;unsigned long len =smb_rqst_len (server, rqst); -int i, num_padding; +int num_padding; shdr = (struct smb2_hdr *)(rqst->rq_iov[0 ].iov_base);if (shdr ==NULL ) {
@@ -2851,44 +2851,13 @@ smb2_set_next_command(struct cifs_tcon * }/* SMB headers in a compound are 8 byte aligned. */ - -/* No padding needed */ -if (!(len &7 )) - goto finished; - - num_padding =8 - (len &7 ); -if (!smb3_encryption_required (tcon)) { -/* -* If we do not have encryption then we can just add an extra -* iov for the padding. -*/ +if (!IS_ALIGNED (len,8 )) { + num_padding =8 - (len &7 ); rqst->rq_iov[rqst->rq_nvec].iov_base = smb2_padding; rqst->rq_iov[rqst->rq_nvec].iov_len = num_padding; rqst->rq_nvec++; len += num_padding; - }else { -/* -* We can not add a small padding iov for the encryption case -* because the encryption framework can not handle the padding -* iovs. -* We have to flatten this into a single buffer and add -* the padding to it. -*/ -for (i =1 ; i < rqst->rq_nvec; i++) { -memcpy (rqst->rq_iov[0 ].iov_base + - rqst->rq_iov[0 ].iov_len, - rqst->rq_iov[i].iov_base, - rqst->rq_iov[i].iov_len); - rqst->rq_iov[0 ].iov_len += rqst->rq_iov[i].iov_len; - } -memset (rqst->rq_iov[0 ].iov_base + rqst->rq_iov[0 ].iov_len, -0 , num_padding); - rqst->rq_iov[0 ].iov_len += num_padding; - len += num_padding; - rqst->rq_nvec =1 ; } - - finished: shdr->NextCommand =cpu_to_le32 (len); }
fs/smb/client/transport.c +13 -27
@@ -425,19 +425,16 @@ out:return rc; } -struct send_req_vars { -struct smb2_transform_hdr tr_hdr; -struct smb_rqst rqst[MAX_COMPOUND ]; -struct kvec iov; -}; -static int smb_send_rqst (struct TCP_Server_Info *server,int num_rqst,struct smb_rqst *rqst,int flags) { -struct send_req_vars *vars; -struct smb_rqst *cur_rqst; -struct kvec *iov; +struct smb2_transform_hdr tr_hdr; +struct smb_rqst new_rqst[MAX_COMPOUND ] = {}; +struct kvec iov = { + .iov_base = &tr_hdr, + .iov_len =sizeof (tr_hdr), + };int rc;if (flags &CIFS_COMPRESS_REQ )
@@ -454,26 +451,15 @@ smb_send_rqst(struct TCP_Server_Info *sereturn -EIO ; } - vars =kzalloc (sizeof (*vars),GFP_NOFS ); -if (!vars) -return -ENOMEM ; - cur_rqst = vars->rqst; - iov = &vars->iov; - - iov->iov_base = &vars->tr_hdr; - iov->iov_len =sizeof (vars->tr_hdr); - cur_rqst[0 ].rq_iov = iov; - cur_rqst[0 ].rq_nvec =1 ; + new_rqst[0 ].rq_iov = &iov; + new_rqst[0 ].rq_nvec =1 ; rc = server->ops->init_transform_rq (server, num_rqst +1 , - &cur_rqst[0 ], rqst); -if (rc) - goto out; - - rc =__smb_send_rqst (server, num_rqst +1 , &cur_rqst[0 ]); -smb3_free_compound_rqst (num_rqst, &cur_rqst[1 ]); -out: -kfree (vars); + new_rqst, rqst); +if (!rc) { + rc =__smb_send_rqst (server, num_rqst +1 , new_rqst); +smb3_free_compound_rqst (num_rqst, &new_rqst[1 ]); + }return rc; }
Greg Kroah-Hartman
maintainerPATCH 50/869 smb: client: get rid of bounds check in SMB2_ioctl_init()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit 9f544d26b15bfc52cf3a6e6a655f759e76c1a01a upstream.
smb2_set_next_command() no longer squashes request iovs into a single iov, so the bounds check can be dropped.
--- fs/smb/client/smb2pdu.c | 9 --------- 1 file changed, 9 deletions(-)
fs/smb/client/smb2pdu.c +0 -9
@@ -3357,15 +3357,6 @@ SMB2_ioctl_init(struct cifs_tcon *tcon,return rc;if (indatalen) { -unsigned int len; - -if (WARN_ON_ONCE (smb3_encryption_required (tcon) && - (check_add_overflow (total_len -1 , -ALIGN (indatalen,8 ), &len) || - len >MAX_CIFS_SMALL_BUFFER_SIZE ))) { -cifs_small_buf_release (req); -return -EIO ; - }/* * indatalen is usually small at a couple of bytes max, so * just allocate through generic pool
Greg Kroah-Hartman
maintainerPATCH 51/869 smb: client: fix compound alignment with encryption
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit 90f7c100d2dd99d5cd5be950d553edd2647e6cc8 upstream.
The encryption layer can't handle the padding iovs, so flatten the compound request into a single buffer with required padding to prevent the server from dropping the connection when finding unaligned compound requests.
--- fs/smb/client/smb2ops.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
fs/smb/client/smb2ops.c +25 -3
@@ -2851,13 +2851,35 @@ smb2_set_next_command(struct cifs_tcon * }/* SMB headers in a compound are 8 byte aligned. */ -if (!IS_ALIGNED (len,8 )) { - num_padding =8 - (len &7 ); +if (IS_ALIGNED (len,8 )) + goto out; + + num_padding =8 - (len &7 ); +if (smb3_encryption_required (tcon)) { +int i; + +/* +* Flatten request into a single buffer with required padding as +* the encryption layer can't handle the padding iovs. +*/ +for (i =1 ; i < rqst->rq_nvec; i++) { +memcpy (rqst->rq_iov[0 ].iov_base + + rqst->rq_iov[0 ].iov_len, + rqst->rq_iov[i].iov_base, + rqst->rq_iov[i].iov_len); + rqst->rq_iov[0 ].iov_len += rqst->rq_iov[i].iov_len; + } +memset (rqst->rq_iov[0 ].iov_base + rqst->rq_iov[0 ].iov_len, +0 , num_padding); + rqst->rq_iov[0 ].iov_len += num_padding; + rqst->rq_nvec =1 ; + }else { rqst->rq_iov[rqst->rq_nvec].iov_base = smb2_padding; rqst->rq_iov[rqst->rq_nvec].iov_len = num_padding; rqst->rq_nvec++; - len += num_padding; } + len += num_padding; +out: shdr->NextCommand =cpu_to_le32 (len); }
Greg Kroah-Hartman
maintainerPATCH 52/869 um: work around sched_yield not yielding in time-travel mode
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Berg <[email protected]>
[ Upstream commit 887c5c12e80c8424bd471122d2e8b6b462e12874 ]
sched_yield by a userspace may not actually cause scheduling in time-travel mode as no time has passed. In the case seen it appears to be a badly implemented userspace spinlock in ASAN. Unfortunately, with time-travel it causes an extreme slowdown or even deadlock depending on the kernel configuration (CONFIG_UML_MAX_USERSPACE_ITERATIONS).
Work around it by accounting time to the process whenever it executes a sched_yield syscall.
--- arch/um/include/linux/time-internal.h | 2 ++ arch/um/kernel/skas/syscall.c | 11 +++++++++++ 2 files changed, 13 insertions(+)
arch/um/include/linux/time-internal.h +2 -0
@@ -83,6 +83,8 @@ extern void time_travel_not_configured(void);#define time_travel_del_event (...) time_travel_not_configured()#endif /* CONFIG_UML_TIME_TRAVEL_SUPPORT */ +extern unsigned long tt_extra_sched_jiffies; +/* * Without CONFIG_UML_TIME_TRAVEL_SUPPORT this is a linker error if used, * which is intentional since we really shouldn't link it in that case.
arch/um/kernel/skas/syscall.c +11 -0
@@ -31,6 +31,17 @@ void handle_syscall(struct uml_pt_regs *r) goto out; syscall =UPT_SYSCALL_NR (r); + +/* +* If no time passes, then sched_yield may not actually yield, causing +* broken spinlock implementations in userspace (ASAN) to hang for long +* periods of time. +*/ +if ((time_travel_mode ==TT_MODE_INFCPU || + time_travel_mode ==TT_MODE_EXTERNAL ) && + syscall == __NR_sched_yield) + tt_extra_sched_jiffies +=1 ; +if (syscall >=0 && syscall < __NR_syscalls) {unsigned long ret =EXECUTE_SYSCALL (syscall, regs);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 53/869 drm/i915/display: pass display to intel_crtc_for_pipe()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 138d2bda4eafc40066d913222e90a443764dc535 ]
Convert the intel_crtc_for_pipe() struct drm_i915_private parameter to struct intel_display.
Stable-dep-of: dc3806d9eb66 ("drm/i915: Grab intel_display from the encoder to avoid potential oopsies")
--- drivers/gpu/drm/i915/display/i9xx_wm.c | 15 ++++++++++----- .../gpu/drm/i915/display/intel_atomic_plane.c | 4 ++-- drivers/gpu/drm/i915/display/intel_cdclk.c | 6 ++++-- drivers/gpu/drm/i915/display/intel_crt.c | 3 ++- drivers/gpu/drm/i915/display/intel_crtc.c | 7 ++++--- drivers/gpu/drm/i915/display/intel_crtc.h | 3 ++- drivers/gpu/drm/i915/display/intel_display.c | 17 ++++++++++------- .../gpu/drm/i915/display/intel_display_driver.c | 3 ++- .../gpu/drm/i915/display/intel_display_irq.c | 9 ++++++--- .../gpu/drm/i915/display/intel_display_trace.h | 15 ++++++++++----- drivers/gpu/drm/i915/display/intel_dpll.c | 3 ++- drivers/gpu/drm/i915/display/intel_dsb.c | 2 +- drivers/gpu/drm/i915/display/intel_fbc.c | 3 +-- drivers/gpu/drm/i915/display/intel_fdi.c | 10 ++++++---- .../gpu/drm/i915/display/intel_fifo_underrun.c | 15 ++++++++++----- drivers/gpu/drm/i915/display/intel_link_bw.c | 3 +-- .../gpu/drm/i915/display/intel_modeset_setup.c | 12 ++++++++---- .../gpu/drm/i915/display/intel_sprite_uapi.c | 3 ++- drivers/gpu/drm/i915/display/skl_watermark.c | 7 ++++--- 19 files changed, 87 insertions(+), 53 deletions(-)
drivers/gpu/drm/i915/display/i9xx_wm.c +10 -5
@@ -715,10 +715,11 @@ static unsigned int g4x_tlb_miss_wa(int fifo_size, int width, int cpp)static void g4x_write_wm_values (struct drm_i915_private *dev_priv,const struct g4x_wm_values *wm) { +struct intel_display *display = &dev_priv->display;enum pipe pipe;for_each_pipe (dev_priv, pipe) -trace_g4x_wm (intel_crtc_for_pipe (dev_priv, pipe), wm); +trace_g4x_wm (intel_crtc_for_pipe (display, pipe), wm); intel_uncore_write(&dev_priv->uncore, DSPFW1(dev_priv), FW_WM(wm->sr.plane, SR) |
@@ -747,10 +748,11 @@ static void g4x_write_wm_values(struct drm_i915_private *dev_priv,static void vlv_write_wm_values (struct drm_i915_private *dev_priv,const struct vlv_wm_values *wm) { +struct intel_display *display = &dev_priv->display;enum pipe pipe;for_each_pipe (dev_priv, pipe) { -trace_vlv_wm (intel_crtc_for_pipe (dev_priv, pipe), wm); +trace_vlv_wm (intel_crtc_for_pipe (display, pipe), wm); intel_uncore_write(&dev_priv->uncore, VLV_DDL(pipe), (wm->ddl[pipe].plane[PLANE_CURSOR] << DDL_CURSOR_SHIFT) |
@@ -2088,12 +2090,13 @@ static void i965_update_wm(struct drm_i915_private *dev_priv)static struct intel_crtc *intel_crtc_for_plane (struct drm_i915_private *i915,enum i9xx_plane_id i9xx_plane) { +struct intel_display *display = &i915->display;struct intel_plane *plane;for_each_intel_plane (&i915->drm, plane) {if (plane->id ==PLANE_PRIMARY && plane->i9xx_plane == i9xx_plane) -return intel_crtc_for_pipe (i915, plane->pipe); +return intel_crtc_for_pipe (display, plane->pipe); }return NULL ;
@@ -3716,6 +3719,7 @@ static void g4x_wm_get_hw_state(struct drm_i915_private *dev_priv)static void g4x_wm_sanitize (struct drm_i915_private *dev_priv) { +struct intel_display *display = &dev_priv->display;struct intel_plane *plane;struct intel_crtc *crtc;
@@ -3723,7 +3727,7 @@ static void g4x_wm_sanitize(struct drm_i915_private *dev_priv)for_each_intel_plane (&dev_priv->drm, plane) {struct intel_crtc *crtc = -intel_crtc_for_pipe (dev_priv, plane->pipe); +intel_crtc_for_pipe (display, plane->pipe);struct intel_crtc_state *crtc_state =to_intel_crtc_state (crtc->base.state); struct intel_plane_state *plane_state =
@@ -3871,6 +3875,7 @@ static void vlv_wm_get_hw_state(struct drm_i915_private *dev_priv)static void vlv_wm_sanitize (struct drm_i915_private *dev_priv) { +struct intel_display *display = &dev_priv->display;struct intel_plane *plane;struct intel_crtc *crtc;
@@ -3878,7 +3883,7 @@ static void vlv_wm_sanitize(struct drm_i915_private *dev_priv)for_each_intel_plane (&dev_priv->drm, plane) {struct intel_crtc *crtc = -intel_crtc_for_pipe (dev_priv, plane->pipe); +intel_crtc_for_pipe (display, plane->pipe);struct intel_crtc_state *crtc_state =to_intel_crtc_state (crtc->base.state); struct intel_plane_state *plane_state =
drivers/gpu/drm/i915/display/intel_atomic_plane.c +2 -2
@@ -710,13 +710,13 @@ intel_crtc_get_plane(struct intel_crtc *crtc, enum plane_id plane_id)int intel_plane_atomic_check (struct intel_atomic_state *state,struct intel_plane *plane) { -struct drm_i915_private *i915 =to_i915 (state->base.dev); +struct intel_display *display =to_intel_display (state);struct intel_plane_state *new_plane_state =intel_atomic_get_new_plane_state (state, plane);const struct intel_plane_state *old_plane_state =intel_atomic_get_old_plane_state (state, plane);const struct intel_plane_state *new_primary_crtc_plane_state; -struct intel_crtc *crtc =intel_crtc_for_pipe (i915, plane->pipe); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, plane->pipe);const struct intel_crtc_state *old_crtc_state =intel_atomic_get_old_crtc_state (state, crtc); struct intel_crtc_state *new_crtc_state =
drivers/gpu/drm/i915/display/intel_cdclk.c +4 -2
@@ -2038,6 +2038,7 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv, const struct intel_cdclk_config *cdclk_config, enum pipe pipe) { +struct intel_display *display = &dev_priv->display;int cdclk = cdclk_config->cdclk;int vco = cdclk_config->vco;
@@ -2063,7 +2064,7 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv,intel_de_write (dev_priv,CDCLK_CTL ,bxt_cdclk_ctl (dev_priv, cdclk_config, pipe));if (pipe !=INVALID_PIPE ) -intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (dev_priv, pipe)); +intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (display, pipe)); } static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
@@ -3262,6 +3263,7 @@ static bool intel_cdclk_need_serialize(struct drm_i915_private *i915,int intel_modeset_calc_cdclk (struct intel_atomic_state *state) { +struct intel_display *display =to_intel_display (state);struct drm_i915_private *dev_priv =to_i915 (state->base.dev);const struct intel_cdclk_state *old_cdclk_state;struct intel_cdclk_state *new_cdclk_state;
@@ -3308,7 +3310,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)struct intel_crtc_state *crtc_state; pipe =ilog2 (new_cdclk_state->active_pipes); - crtc =intel_crtc_for_pipe (dev_priv, pipe); + crtc =intel_crtc_for_pipe (display, pipe); crtc_state =intel_atomic_get_crtc_state (&state->base, crtc);if (IS_ERR (crtc_state))
drivers/gpu/drm/i915/display/intel_crt.c +2 -1
@@ -694,6 +694,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)static enum drm_connector_status intel_crt_load_detect (struct intel_crt *crt,enum pipe pipe) { +struct intel_display *display =to_intel_display (&crt->base);struct drm_device *dev = crt->base.base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);enum transcoder cpu_transcoder = (enum transcoder )pipe;
@@ -734,7 +735,7 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe) TRANSCONF(dev_priv, cpu_transcoder));/* Wait for next Vblank to substitue * border color for Color info */ -intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (dev_priv, pipe)); +intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (display, pipe)); st00 =intel_de_read8 (dev_priv, _VGA_MSR_WRITE); status = ((st00 & (1 <<4 )) !=0 ) ? connector_status_connected :
drivers/gpu/drm/i915/display/intel_crtc.c +4 -3
@@ -48,12 +48,12 @@ struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915)return to_intel_crtc (drm_crtc_from_index (&i915->drm,0 )); } -struct intel_crtc *intel_crtc_for_pipe (struct drm_i915_private *i915, +struct intel_crtc *intel_crtc_for_pipe (struct intel_display *display,enum pipe pipe) {struct intel_crtc *crtc; -for_each_intel_crtc (&i915->drm, crtc) { +for_each_intel_crtc (display->drm, crtc) {if (crtc->pipe == pipe)return crtc; }
@@ -69,7 +69,8 @@ void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc)void intel_wait_for_vblank_if_active (struct drm_i915_private *i915,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (i915, pipe); +struct intel_display *display = &i915->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);if (crtc->active)intel_crtc_wait_for_next_vblank (crtc);
drivers/gpu/drm/i915/display/intel_crtc.h +2 -1
@@ -15,6 +15,7 @@ struct drm_i915_private;struct intel_atomic_state ;struct intel_crtc ;struct intel_crtc_state ; +struct intel_display ;/* * FIXME: We should instead only take spinlocks once for the entire update
@@ -43,7 +44,7 @@ void intel_pipe_update_end(struct intel_atomic_state *state, struct intel_crtc *crtc);void intel_wait_for_vblank_workers (struct intel_atomic_state *state);struct intel_crtc *intel_first_crtc (struct drm_i915_private *i915); -struct intel_crtc *intel_crtc_for_pipe (struct drm_i915_private *i915, +struct intel_crtc *intel_crtc_for_pipe (struct intel_display *display,enum pipe pipe);void intel_wait_for_vblank_if_active (struct drm_i915_private *i915,enum pipe pipe);
drivers/gpu/drm/i915/display/intel_display.c +10 -7
@@ -292,10 +292,10 @@ u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)struct intel_crtc *intel_primary_crtc (const struct intel_crtc_state *crtc_state) { -struct drm_i915_private *i915 =to_i915 (crtc_state->uapi.crtc->dev); +struct intel_display *display =to_intel_display (crtc_state);if (intel_crtc_is_joiner_secondary (crtc_state)) -return intel_crtc_for_pipe (i915,joiner_primary_pipe (crtc_state)); +return intel_crtc_for_pipe (display,joiner_primary_pipe (crtc_state));else return to_intel_crtc (crtc_state->uapi.crtc); }
@@ -1668,6 +1668,7 @@ static void hsw_configure_cpu_transcoder(const struct intel_crtc_state *crtc_stastatic void hsw_crtc_enable (struct intel_atomic_state *state,struct intel_crtc *crtc) { +struct intel_display *display =to_intel_display (state);const struct intel_crtc_state *new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);
@@ -1762,7 +1763,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, hsw_workaround_pipe = pipe_crtc_state->hsw_workaround_pipe;if (IS_HASWELL (dev_priv) && hsw_workaround_pipe !=INVALID_PIPE ) {struct intel_crtc *wa_crtc = -intel_crtc_for_pipe (dev_priv, hsw_workaround_pipe); +intel_crtc_for_pipe (display, hsw_workaround_pipe);intel_crtc_wait_for_next_vblank (wa_crtc);intel_crtc_wait_for_next_vblank (wa_crtc);
@@ -3966,7 +3967,7 @@ int intel_crtc_dotclock(const struct intel_crtc_state *pipe_config)struct drm_display_mode *intel_encoder_current_mode (struct intel_encoder *encoder) { -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct intel_display *display =to_intel_display (encoder);struct intel_crtc_state *crtc_state;struct drm_display_mode *mode;struct intel_crtc *crtc;
@@ -3975,7 +3976,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)if (!encoder->get_hw_state (encoder, &pipe))return NULL ; - crtc =intel_crtc_for_pipe (dev_priv, pipe); + crtc =intel_crtc_for_pipe (display, pipe); mode =kzalloc (sizeof (*mode),GFP_KERNEL );if (!mode)
@@ -8260,7 +8261,8 @@ int intel_initial_commit(struct drm_device *dev)void i830_enable_pipe (struct drm_i915_private *dev_priv,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);enum transcoder cpu_transcoder = (enum transcoder )pipe;/* 640x480@60Hz, ~25175 kHz */ struct dpll clock = {
@@ -8341,7 +8343,8 @@ void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)void i830_disable_pipe (struct drm_i915_private *dev_priv,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);drm_dbg_kms (&dev_priv->drm,"disabling pipe %c due to force quirk\n" ,pipe_name (pipe));
drivers/gpu/drm/i915/display/intel_display_driver.c +2 -1
@@ -168,10 +168,11 @@ static void intel_mode_config_cleanup(struct drm_i915_private *i915)static void intel_plane_possible_crtcs_init (struct drm_i915_private *dev_priv) { +struct intel_display *display = &dev_priv->display;struct intel_plane *plane;for_each_intel_plane (&dev_priv->drm, plane) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, +struct intel_crtc *crtc =intel_crtc_for_pipe (display, plane->pipe); plane->base.possible_crtcs =drm_crtc_mask (&crtc->base);
drivers/gpu/drm/i915/display/intel_display_irq.c +6 -3
@@ -27,7 +27,8 @@static void intel_handle_vblank (struct drm_i915_private *dev_priv,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);drm_crtc_handle_vblank (&crtc->base); }
@@ -305,7 +306,8 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv, u32 crc2, u32 crc3, u32 crc4) { - struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe); + struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc;u32 crcs[5 ] = { crc0, crc1, crc2, crc3, crc4 };
@@ -344,7 +346,8 @@ display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,static void flip_done_handler (struct drm_i915_private *i915,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (i915, pipe); +struct intel_display *display = &i915->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);spin_lock (&i915->drm.event_lock);
drivers/gpu/drm/i915/display/intel_display_trace.h +10 -5
@@ -141,7 +141,8 @@ TRACE_EVENT(intel_cpu_fifo_underrun, ),TP_fast_assign ( - struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe); + struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);__assign_str (dev); __entry->pipe = pipe; __entry->frame =intel_crtc_get_vblank_counter (crtc);
@@ -165,8 +166,9 @@ TRACE_EVENT(intel_pch_fifo_underrun, ),TP_fast_assign ( + struct intel_display *display = &dev_priv->display;enum pipe pipe = pch_transcoder; -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);__assign_str (dev); __entry->pipe = pipe; __entry->frame =intel_crtc_get_vblank_counter (crtc);
@@ -458,7 +460,8 @@ TRACE_EVENT(intel_fbc_activate, ),TP_fast_assign ( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_display *display = to_intel_display(plane->base.dev); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, plane->pipe);__assign_str (dev);__assign_str (name);
@@ -485,7 +488,8 @@ TRACE_EVENT(intel_fbc_deactivate, ),TP_fast_assign ( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_display *display = to_intel_display(plane->base.dev); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, plane->pipe);__assign_str (dev);__assign_str (name);
@@ -512,7 +516,8 @@ TRACE_EVENT(intel_fbc_nuke, ),TP_fast_assign ( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_display *display = to_intel_display(plane->base.dev); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, plane->pipe);__assign_str (dev);__assign_str (name);
drivers/gpu/drm/i915/display/intel_dpll.c +2 -1
@@ -2212,7 +2212,8 @@ void chv_enable_pll(const struct intel_crtc_state *crtc_state)int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe,const struct dpll *dpll) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);struct intel_crtc_state *crtc_state; crtc_state =intel_crtc_state_alloc (crtc);
drivers/gpu/drm/i915/display/intel_dsb.c +1 -1
@@ -763,7 +763,7 @@ void intel_dsb_cleanup(struct intel_dsb *dsb)void intel_dsb_irq_handler (struct intel_display *display,enum pipe pipe,enum intel_dsb_id dsb_id) { -struct intel_crtc *crtc =intel_crtc_for_pipe (to_i915 (display->drm), pipe); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);u32 tmp, errors; tmp =intel_de_read_fw (display,DSB_INTERRUPT (pipe, dsb_id));
drivers/gpu/drm/i915/display/intel_fbc.c +1 -2
@@ -1792,7 +1792,6 @@ static void intel_fbc_underrun_work_fn(struct work_struct *work) {struct intel_fbc *fbc =container_of (work,typeof (*fbc), underrun_work);struct intel_display *display = fbc->display; -struct drm_i915_private *i915 =to_i915 (display->drm);mutex_lock (&fbc->lock);
@@ -1805,7 +1804,7 @@ static void intel_fbc_underrun_work_fn(struct work_struct *work)intel_fbc_deactivate (fbc,"FIFO underrun" );if (!fbc->flip_pending) -intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (i915, fbc->state.plane->pipe)); +intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (display, fbc->state.plane->pipe));__intel_fbc_disable (fbc); out:mutex_unlock (&fbc->lock);
drivers/gpu/drm/i915/display/intel_fdi.c +6 -4
@@ -137,6 +137,7 @@ void intel_fdi_link_train(struct intel_crtc *crtc,*/ int intel_fdi_add_affected_crtcs (struct intel_atomic_state *state) { +struct intel_display *display =to_intel_display (state);struct drm_i915_private *i915 =to_i915 (state->base.dev);const struct intel_crtc_state *old_crtc_state;const struct intel_crtc_state *new_crtc_state;
@@ -145,7 +146,7 @@ int intel_fdi_add_affected_crtcs(struct intel_atomic_state *state)if (!IS_IVYBRIDGE (i915) ||INTEL_NUM_PIPES (i915) !=3 )return 0 ; - crtc =intel_crtc_for_pipe (i915,PIPE_C ); + crtc =intel_crtc_for_pipe (display,PIPE_C ); new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc);if (!new_crtc_state)return 0 ;
@@ -157,7 +158,7 @@ int intel_fdi_add_affected_crtcs(struct intel_atomic_state *state)if (!old_crtc_state->fdi_lanes)return 0 ; - crtc =intel_crtc_for_pipe (i915,PIPE_B ); + crtc =intel_crtc_for_pipe (display,PIPE_B ); new_crtc_state =intel_atomic_get_crtc_state (&state->base, crtc);if (IS_ERR (new_crtc_state))return PTR_ERR (new_crtc_state);
@@ -184,6 +185,7 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,struct intel_crtc_state *pipe_config, enum pipe *pipe_to_reduce) { + struct intel_display *display = to_intel_display(dev);struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *state = pipe_config->uapi.state;struct intel_crtc *other_crtc;
@@ -223,7 +225,7 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,if (pipe_config->fdi_lanes <=2 )return 0 ; - other_crtc =intel_crtc_for_pipe (dev_priv,PIPE_C ); + other_crtc =intel_crtc_for_pipe (display,PIPE_C ); other_crtc_state =intel_atomic_get_crtc_state (state, other_crtc);if (IS_ERR (other_crtc_state))
@@ -244,7 +246,7 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,return -EINVAL ; } - other_crtc =intel_crtc_for_pipe (dev_priv,PIPE_B ); + other_crtc =intel_crtc_for_pipe (display,PIPE_B ); other_crtc_state =intel_atomic_get_crtc_state (state, other_crtc);if (IS_ERR (other_crtc_state))
drivers/gpu/drm/i915/display/intel_fifo_underrun.c +10 -5
@@ -57,6 +57,7 @@static bool ivb_can_enable_err_int (struct drm_device *dev) { +struct intel_display *display =to_intel_display (dev);struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *crtc;enum pipe pipe;
@@ -64,7 +65,7 @@ static bool ivb_can_enable_err_int(struct drm_device *dev)lockdep_assert_held (&dev_priv->irq_lock);for_each_pipe (dev_priv, pipe) { - crtc =intel_crtc_for_pipe (dev_priv, pipe); + crtc =intel_crtc_for_pipe (display, pipe);if (crtc->cpu_fifo_underrun_disabled)return false;
@@ -75,6 +76,7 @@ static bool ivb_can_enable_err_int(struct drm_device *dev)static bool cpt_can_enable_serr_int (struct drm_device *dev) { +struct intel_display *display =to_intel_display (dev);struct drm_i915_private *dev_priv =to_i915 (dev);enum pipe pipe;struct intel_crtc *crtc;
@@ -82,7 +84,7 @@ static bool cpt_can_enable_serr_int(struct drm_device *dev)lockdep_assert_held (&dev_priv->irq_lock);for_each_pipe (dev_priv, pipe) { - crtc =intel_crtc_for_pipe (dev_priv, pipe); + crtc =intel_crtc_for_pipe (display, pipe);if (crtc->pch_fifo_underrun_disabled)return false;
@@ -282,8 +284,9 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,static bool __intel_set_cpu_fifo_underrun_reporting (struct drm_device *dev,enum pipe pipe,bool enable) { +struct intel_display *display =to_intel_display (dev);struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);bool old;lockdep_assert_held (&dev_priv->irq_lock);
@@ -351,8 +354,9 @@ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv, enum pipe pch_transcoder, bool enable) { +struct intel_display *display = &dev_priv->display;struct intel_crtc *crtc = -intel_crtc_for_pipe (dev_priv, pch_transcoder); +intel_crtc_for_pipe (display, pch_transcoder);unsigned long flags;bool old;
@@ -395,7 +399,8 @@ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,void intel_cpu_fifo_underrun_irq_handler (struct drm_i915_private *dev_priv,enum pipe pipe) { -struct intel_crtc *crtc =intel_crtc_for_pipe (dev_priv, pipe); +struct intel_display *display = &dev_priv->display; +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);u32 underruns =0 ;/* We may be called too early in init, thanks BIOS! */
drivers/gpu/drm/i915/display/intel_link_bw.c +1 -2
@@ -26,7 +26,6 @@ void intel_link_bw_init_limits(struct intel_atomic_state *state, struct intel_link_bw_limits *limits) {struct intel_display *display =to_intel_display (state); -struct drm_i915_private *i915 =to_i915 (state->base.dev);enum pipe pipe; limits->force_fec_pipes =0 ;
@@ -34,7 +33,7 @@ void intel_link_bw_init_limits(struct intel_atomic_state *state,for_each_pipe (display, pipe) {const struct intel_crtc_state *crtc_state =intel_atomic_get_new_crtc_state (state, -intel_crtc_for_pipe (i915, pipe)); +intel_crtc_for_pipe (display, pipe));if (state->base.duplicated && crtc_state) { limits->max_bpp_x16[pipe] = crtc_state->max_link_bpp_x16;
drivers/gpu/drm/i915/display/intel_modeset_setup.c +8 -4
@@ -221,6 +221,7 @@ static u8 get_transcoder_pipes(struct drm_i915_private *i915,static void get_portsync_pipes (struct intel_crtc *crtc,u8 *master_pipe_mask,u8 *slave_pipes_mask) { +struct intel_display *display =to_intel_display (crtc);struct drm_i915_private *i915 =to_i915 (crtc->base.dev);struct intel_crtc_state *crtc_state =to_intel_crtc_state (crtc->base.state);
@@ -243,7 +244,7 @@ static void get_portsync_pipes(struct intel_crtc *crtc, *master_pipe_mask =get_transcoder_pipes (i915,BIT (master_transcoder));drm_WARN_ON (&i915->drm, !is_power_of_2 (*master_pipe_mask)); - master_crtc =intel_crtc_for_pipe (i915,ffs (*master_pipe_mask) -1 ); + master_crtc =intel_crtc_for_pipe (display,ffs (*master_pipe_mask) -1 ); master_crtc_state =to_intel_crtc_state (master_crtc->base.state); *slave_pipes_mask =get_transcoder_pipes (i915, master_crtc_state->sync_mode_slaves_mask); }
@@ -375,6 +376,7 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_statestatic void intel_sanitize_plane_mapping (struct drm_i915_private *i915) { +struct intel_display *display = &i915->display;struct intel_crtc *crtc;if (DISPLAY_VER (i915) >=4 )
@@ -396,7 +398,7 @@ intel_sanitize_plane_mapping(struct drm_i915_private *i915)"[PLANE:%d:%s] attached to the wrong pipe, disabling plane\n" , plane->base.base.id, plane->base.name); - plane_crtc =intel_crtc_for_pipe (i915, pipe); + plane_crtc =intel_crtc_for_pipe (display, pipe);intel_plane_disable_noatomic (plane_crtc, plane); } }
@@ -662,6 +664,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)/* FIXME read out full plane state for all planes */ static void readout_plane_state (struct drm_i915_private *i915) { +struct intel_display *display = &i915->display;struct intel_plane *plane;struct intel_crtc *crtc;
@@ -674,7 +677,7 @@ static void readout_plane_state(struct drm_i915_private *i915) visible = plane->get_hw_state (plane, &pipe); - crtc =intel_crtc_for_pipe (i915, pipe); + crtc =intel_crtc_for_pipe (display, pipe); crtc_state =to_intel_crtc_state (crtc->base.state);intel_set_plane_visible (crtc_state, plane_state, visible);
@@ -695,6 +698,7 @@ static void readout_plane_state(struct drm_i915_private *i915)static void intel_modeset_readout_hw_state (struct drm_i915_private *i915) { +struct intel_display *display = &i915->display;struct intel_cdclk_state *cdclk_state =to_intel_cdclk_state (i915->display.cdclk.obj.state); struct intel_dbuf_state *dbuf_state =
@@ -743,7 +747,7 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915) pipe =0 ;if (encoder->get_hw_state (encoder, &pipe)) { - crtc =intel_crtc_for_pipe (i915, pipe); + crtc =intel_crtc_for_pipe (display, pipe); crtc_state =to_intel_crtc_state (crtc->base.state); encoder->base.crtc = &crtc->base;
drivers/gpu/drm/i915/display/intel_sprite_uapi.c +2 -1
@@ -42,6 +42,7 @@ static void intel_plane_set_ckey(struct intel_plane_state *plane_state,int intel_sprite_set_colorkey_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv) { +struct intel_display *display =to_intel_display (dev);struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_intel_sprite_colorkey *set = data;struct drm_plane *plane;
@@ -100,7 +101,7 @@ int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,*/ if (!ret &&has_dst_key_in_primary_plane (dev_priv)) {struct intel_crtc *crtc = -intel_crtc_for_pipe (dev_priv, +intel_crtc_for_pipe (display,to_intel_plane (plane)->pipe); plane_state = drm_atomic_get_plane_state(state,
drivers/gpu/drm/i915/display/skl_watermark.c +4 -3
@@ -3388,6 +3388,7 @@ static void intel_dbuf_mdclk_min_tracker_update(struct intel_atomic_state *statestatic enum pipe intel_mbus_joined_pipe (struct intel_atomic_state *state,const struct intel_dbuf_state *dbuf_state) { +struct intel_display *display =to_intel_display (state);struct drm_i915_private *i915 =to_i915 (state->base.dev);enum pipe pipe =ffs (dbuf_state->active_pipes) -1 ;const struct intel_crtc_state *new_crtc_state;
@@ -3396,7 +3397,7 @@ static enum pipe intel_mbus_joined_pipe(struct intel_atomic_state *state,drm_WARN_ON (&i915->drm, !dbuf_state->joined_mbus);drm_WARN_ON (&i915->drm, !is_power_of_2 (dbuf_state->active_pipes)); - crtc =intel_crtc_for_pipe (i915, pipe); + crtc =intel_crtc_for_pipe (display, pipe); new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc);if (new_crtc_state && !intel_crtc_needs_modeset (new_crtc_state))
@@ -3458,7 +3459,7 @@ void intel_dbuf_mbus_pre_ddb_update(struct intel_atomic_state *state)void intel_dbuf_mbus_post_ddb_update (struct intel_atomic_state *state) { -struct drm_i915_private *i915 =to_i915 (state->base.dev); +struct intel_display *display =to_intel_display (state);const struct intel_dbuf_state *new_dbuf_state =intel_atomic_get_new_dbuf_state (state); const struct intel_dbuf_state *old_dbuf_state =
@@ -3477,7 +3478,7 @@ void intel_dbuf_mbus_post_ddb_update(struct intel_atomic_state *state)intel_dbuf_mbus_join_update (state, pipe);if (pipe !=INVALID_PIPE ) { -struct intel_crtc *crtc =intel_crtc_for_pipe (i915, pipe); +struct intel_crtc *crtc =intel_crtc_for_pipe (display, pipe);intel_crtc_wait_for_next_vblank (crtc); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 54/869 drm/i915/vga: Convert VGA code to intel_display
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
[ Upstream commit 4b6e05c43b7542e9baaf70a0064b9198fe495fd2 ]
struct intel_display will replace struct drm_i915_private as the main thing for display code. Convert the VGA code to use it (as much as possible at this stage).
Stable-dep-of: dc3806d9eb66 ("drm/i915: Grab intel_display from the encoder to avoid potential oopsies")
--- .../drm/i915/display/intel_display_driver.c | 11 ++--- .../i915/display/intel_display_power_well.c | 6 ++- drivers/gpu/drm/i915/display/intel_vga.c | 45 ++++++++++--------- drivers/gpu/drm/i915/display/intel_vga.h | 14 +++--- drivers/gpu/drm/i915/i915_suspend.c | 3 +- 5 files changed, 43 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/display/intel_display_driver.c +6 -5
@@ -220,7 +220,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915)intel_bios_init (display); - ret =intel_vga_register (i915); + ret =intel_vga_register (display);if (ret) goto cleanup_bios;
@@ -274,7 +274,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915)intel_dmc_fini (i915);intel_power_domains_driver_remove (i915); cleanup_vga: -intel_vga_unregister (i915); +intel_vga_unregister (display); cleanup_bios:intel_bios_driver_remove (display);
@@ -457,7 +457,7 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915)intel_hti_init (display);/* Just disable it once at startup */ -intel_vga_disable (i915); +intel_vga_disable (display);intel_setup_outputs (i915); ret =intel_dp_tunnel_mgr_init (display);
@@ -624,7 +624,7 @@ void intel_display_driver_remove_nogem(struct drm_i915_private *i915)intel_power_domains_driver_remove (i915); -intel_vga_unregister (i915); +intel_vga_unregister (display);intel_bios_driver_remove (display); }
@@ -682,12 +682,13 @@ __intel_display_driver_resume(struct drm_i915_private *i915,struct drm_atomic_state *state, struct drm_modeset_acquire_ctx *ctx) { + struct intel_display *display = &i915->display;struct drm_crtc_state *crtc_state;struct drm_crtc *crtc;int ret, i;intel_modeset_setup_hw_state (i915, ctx); -intel_vga_redisable (i915); +intel_vga_redisable (display);if (!state)return 0 ;
drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -2
@@ -187,8 +187,10 @@ int intel_power_well_refcount(struct i915_power_well *power_well)static void hsw_power_well_post_enable (struct drm_i915_private *dev_priv,u8 irq_pipe_mask,bool has_vga) { +struct intel_display *display = &dev_priv->display; +if (has_vga) -intel_vga_reset_io_mem (dev_priv); +intel_vga_reset_io_mem (display);if (irq_pipe_mask)gen8_irq_power_well_post_enable (dev_priv, irq_pipe_mask);
@@ -1232,7 +1234,7 @@ static void vlv_display_power_well_init(struct drm_i915_private *dev_priv)intel_crt_reset (&encoder->base); } -intel_vga_redisable_power_on (dev_priv); +intel_vga_redisable_power_on (display);intel_pps_unlock_regs_wa (display); }
drivers/gpu/drm/i915/display/intel_vga.c +24 -21
104 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_vga.h +7 -7
@@ -6,13 +6,13 @@#ifndef __INTEL_VGA_H__#define __INTEL_VGA_H__ -struct drm_i915_private ; +struct intel_display ; -void intel_vga_reset_io_mem (struct drm_i915_private *i915); -void intel_vga_disable (struct drm_i915_private *i915); -void intel_vga_redisable (struct drm_i915_private *i915); -void intel_vga_redisable_power_on (struct drm_i915_private *i915); -int intel_vga_register (struct drm_i915_private *i915); -void intel_vga_unregister (struct drm_i915_private *i915); +void intel_vga_reset_io_mem (struct intel_display *display); +void intel_vga_disable (struct intel_display *display); +void intel_vga_redisable (struct intel_display *display); +void intel_vga_redisable_power_on (struct intel_display *display); +int intel_vga_register (struct intel_display *display); +void intel_vga_unregister (struct intel_display *display);#endif /* __INTEL_VGA_H__ */
drivers/gpu/drm/i915/i915_suspend.c +2 -1
@@ -118,6 +118,7 @@ void i915_save_display(struct drm_i915_private *dev_priv)void i915_restore_display (struct drm_i915_private *dev_priv) { +struct intel_display *display = &dev_priv->display;struct pci_dev *pdev =to_pci_dev (dev_priv->drm.dev);if (!HAS_DISPLAY (dev_priv))
@@ -134,7 +135,7 @@ void i915_restore_display(struct drm_i915_private *dev_priv)intel_de_write (dev_priv,DSPARB (dev_priv), dev_priv->regfile.saveDSPARB); -intel_vga_redisable (dev_priv); +intel_vga_redisable (display);intel_gmbus_reset (dev_priv); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 55/869 drm/i915/display: convert I915_STATE_WARN() to struct intel_display
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 0f4869b1636cddbb14826e148500dfa01f4088e0 ]
Convert I915_STATE_WARN() to struct intel_display *, and rename to INTEL_DISPLAY_STATE_WARN(). Do some minor opportunistic struct drm_i915_private to struct intel_display conversions while at it.
v2: crtc_state may be NULL in intel_connector_verify_state()
Stable-dep-of: dc3806d9eb66 ("drm/i915: Grab intel_display from the encoder to avoid potential oopsies")
--- drivers/gpu/drm/i915/display/g4x_dp.c | 15 ++-- drivers/gpu/drm/i915/display/intel_crtc.c | 8 +- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 76 ++++++++-------- drivers/gpu/drm/i915/display/intel_display.c | 19 ++-- drivers/gpu/drm/i915/display/intel_display.h | 17 ++-- .../drm/i915/display/intel_display_power.c | 73 +++++++-------- drivers/gpu/drm/i915/display/intel_dpll.c | 9 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 90 ++++++++++--------- drivers/gpu/drm/i915/display/intel_fdi.c | 42 +++++---- .../drm/i915/display/intel_modeset_verify.c | 89 +++++++++--------- .../gpu/drm/i915/display/intel_pch_display.c | 56 ++++++------ drivers/gpu/drm/i915/display/intel_pps.c | 26 +++--- drivers/gpu/drm/i915/display/intel_snps_phy.c | 11 +-- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 7 +- 14 files changed, 277 insertions(+), 261 deletions(-)
drivers/gpu/drm/i915/display/g4x_dp.c +7 -8
@@ -169,13 +169,12 @@ static void assert_dp_port(struct intel_dp *intel_dp, bool state) {struct intel_display *display =to_intel_display (intel_dp);struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct drm_i915_private *dev_priv =to_i915 (dig_port->base.base.dev);bool cur_state =intel_de_read (display, intel_dp->output_reg) &DP_PORT_EN ; -I915_STATE_WARN (dev_priv, cur_state != state, -"[ENCODER:%d:%s] state assertion failure (expected %s, current %s)\n" , - dig_port->base.base.base.id, dig_port->base.base.name, -str_on_off (state),str_on_off (cur_state)); +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"[ENCODER:%d:%s] state assertion failure (expected %s, current %s)\n" , + dig_port->base.base.base.id, dig_port->base.base.name, +str_on_off (state),str_on_off (cur_state)); }#define assert_dp_port_disabled (d) assert_dp_port((d), false)
@@ -184,9 +183,9 @@ static void assert_edp_pll(struct drm_i915_private *dev_priv, bool state)struct intel_display *display = &dev_priv->display;bool cur_state =intel_de_read (display,DP_A ) &DP_PLL_ENABLE ; -I915_STATE_WARN (dev_priv, cur_state != state, -"eDP PLL state assertion failure (expected %s, current %s)\n" , -str_on_off (state),str_on_off (cur_state)); +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"eDP PLL state assertion failure (expected %s, current %s)\n" , +str_on_off (state),str_on_off (cur_state)); }#define assert_edp_pll_enabled (d) assert_edp_pll((d), true)#define assert_edp_pll_disabled (d) assert_edp_pll((d), false)
drivers/gpu/drm/i915/display/intel_crtc.c +4 -4
@@ -35,11 +35,11 @@static void assert_vblank_disabled (struct drm_crtc *crtc) { -struct drm_i915_private *i915 =to_i915 (crtc->dev); +struct intel_display *display =to_intel_display (crtc->dev); -if (I915_STATE_WARN (i915,drm_crtc_vblank_get (crtc) ==0 , -"[CRTC:%d:%s] vblank assertion failure (expected off, current on)\n" , - crtc->base.id, crtc->name)) +if (INTEL_DISPLAY_STATE_WARN (display,drm_crtc_vblank_get (crtc) ==0 , +"[CRTC:%d:%s] vblank assertion failure (expected off, current on)\n" , + crtc->base.id, crtc->name))drm_crtc_vblank_put (crtc); }
drivers/gpu/drm/i915/display/intel_cx0_phy.c +38 -38
117 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display.c +10 -9
@@ -321,6 +321,7 @@ intel_wait_for_pipe_off(const struct intel_crtc_state *old_crtc_state)void assert_transcoder (struct drm_i915_private *dev_priv,enum transcoder cpu_transcoder,bool state) { +struct intel_display *display = &dev_priv->display;bool cur_state;enum intel_display_power_domain power_domain;intel_wakeref_t wakeref;
@@ -341,24 +342,24 @@ void assert_transcoder(struct drm_i915_private *dev_priv, cur_state = false; } -I915_STATE_WARN (dev_priv, cur_state != state, -"transcoder %s assertion failure (expected %s, current %s)\n" , -transcoder_name (cpu_transcoder),str_on_off (state), -str_on_off (cur_state)); +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"transcoder %s assertion failure (expected %s, current %s)\n" , +transcoder_name (cpu_transcoder),str_on_off (state), +str_on_off (cur_state)); }static void assert_plane (struct intel_plane *plane,bool state) { -struct drm_i915_private *i915 =to_i915 (plane->base.dev); +struct intel_display *display =to_intel_display (plane->base.dev);enum pipe pipe;bool cur_state; cur_state = plane->get_hw_state (plane, &pipe); -I915_STATE_WARN (i915, cur_state != state, -"%s assertion failure (expected %s, current %s)\n" , - plane->base.name,str_on_off (state), -str_on_off (cur_state)); +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"%s assertion failure (expected %s, current %s)\n" , + plane->base.name,str_on_off (state), +str_on_off (cur_state)); }#define assert_plane_enabled (p) assert_plane(p, true)
drivers/gpu/drm/i915/display/intel_display.h +8 -9
@@ -570,18 +570,17 @@ void assert_transcoder(struct drm_i915_private *dev_priv,bool assert_port_valid (struct drm_i915_private *i915,enum port port);/* -* Use I915_STATE_WARN(x) (rather than WARN() and WARN_ON()) for hw state sanity -* checks to check for unexpected conditions which may not necessarily be a user -* visible problem. This will either WARN() or DRM_ERROR() depending on the -* verbose_state_checks module param, to enable distros and users to tailor -* their preferred amount of i915 abrt spam. +* Use INTEL_DISPLAY_STATE_WARN(x) (rather than WARN() and WARN_ON()) for hw +* state sanity checks to check for unexpected conditions which may not +* necessarily be a user visible problem. This will either drm_WARN() or +* drm_err() depending on the verbose_state_checks module param, to enable +* distros and users to tailor their preferred amount of i915 abrt spam. */ -#define I915_STATE_WARN(__i915, condition, format...) ({ \ - struct drm_device *drm = &(__i915)->drm; \ +#define INTEL_DISPLAY_STATE_WARN(__display, condition, format...) ({ \ int __ret_warn_on = !!(condition); \ if (unlikely(__ret_warn_on)) \ - if (!drm_WARN(drm, __i915->display.params.verbose_state_checks, format)) \ - drm_err(drm, format); \ + if (!drm_WARN((__display)->drm, (__display)->params.verbose_state_checks, format)) \ + drm_err((__display)->drm, format); \ unlikely(__ret_warn_on); \ })
drivers/gpu/drm/i915/display/intel_display_power.c +37 -36
88 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dpll.c +5 -4
@@ -2319,12 +2319,13 @@ void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe)static void assert_pll (struct drm_i915_private *dev_priv,enum pipe pipe,bool state) { +struct intel_display *display = &dev_priv->display;bool cur_state; - cur_state =intel_de_read (dev_priv,DPLL (dev_priv, pipe)) &DPLL_VCO_ENABLE ; -I915_STATE_WARN (dev_priv, cur_state != state, -"PLL state assertion failure (expected %s, current %s)\n" , -str_on_off (state),str_on_off (cur_state)); + cur_state =intel_de_read (display,DPLL (display, pipe)) &DPLL_VCO_ENABLE ; +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"PLL state assertion failure (expected %s, current %s)\n" , +str_on_off (state),str_on_off (cur_state)); }void assert_pll_enabled (struct drm_i915_private *i915,enum pipe pipe)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +47 -43
152 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_fdi.c +23 -19
87 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_modeset_verify.c +46 -43
178 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_pch_display.c +30 -26
102 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_pps.c +12 -14
@@ -800,7 +800,6 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)void intel_pps_vdd_on (struct intel_dp *intel_dp) {struct intel_display *display =to_intel_display (intel_dp); -struct drm_i915_private *i915 =to_i915 (display->drm);intel_wakeref_t wakeref;bool vdd;
@@ -810,10 +809,10 @@ void intel_pps_vdd_on(struct intel_dp *intel_dp) vdd = false;with_intel_pps_lock (intel_dp, wakeref) vdd = intel_pps_vdd_on_unlocked(intel_dp); -I915_STATE_WARN (i915, !vdd,"[ENCODER:%d:%s] %s VDD already requested on\n" , -dp_to_dig_port (intel_dp)->base.base.base.id, -dp_to_dig_port (intel_dp)->base.base.name, -pps_name (intel_dp)); +INTEL_DISPLAY_STATE_WARN (display, !vdd,"[ENCODER:%d:%s] %s VDD already requested on\n" , +dp_to_dig_port (intel_dp)->base.base.base.id, +dp_to_dig_port (intel_dp)->base.base.name, +pps_name (intel_dp)); }static void intel_pps_vdd_off_sync_unlocked (struct intel_dp *intel_dp)
@@ -920,18 +919,17 @@ static void edp_panel_vdd_schedule_off(struct intel_dp *intel_dp)void intel_pps_vdd_off_unlocked (struct intel_dp *intel_dp,bool sync) {struct intel_display *display =to_intel_display (intel_dp); -struct drm_i915_private *dev_priv =to_i915 (display->drm);lockdep_assert_held (&display->pps.mutex);if (!intel_dp_is_edp (intel_dp))return ; -I915_STATE_WARN (dev_priv, !intel_dp->pps.want_panel_vdd, -"[ENCODER:%d:%s] %s VDD not forced on" , -dp_to_dig_port (intel_dp)->base.base.base.id, -dp_to_dig_port (intel_dp)->base.base.name, -pps_name (intel_dp)); +INTEL_DISPLAY_STATE_WARN (display, !intel_dp->pps.want_panel_vdd, +"[ENCODER:%d:%s] %s VDD not forced on" , +dp_to_dig_port (intel_dp)->base.base.base.id, +dp_to_dig_port (intel_dp)->base.base.name, +pps_name (intel_dp)); intel_dp->pps.want_panel_vdd = false;
@@ -1806,7 +1804,7 @@ void assert_pps_unlocked(struct intel_display *display, enum pipe pipe) ((val & PANEL_UNLOCK_MASK) == PANEL_UNLOCK_REGS)) locked = false; -I915_STATE_WARN (dev_priv, panel_pipe == pipe && locked, -"panel assertion failure, pipe %c regs locked\n" , -pipe_name (pipe)); +INTEL_DISPLAY_STATE_WARN (display, panel_pipe == pipe && locked, +"panel assertion failure, pipe %c regs locked\n" , +pipe_name (pipe)); }
drivers/gpu/drm/i915/display/intel_snps_phy.c +6 -5
@@ -1997,6 +1997,7 @@ int intel_snps_phy_check_hdmi_link_rate(int clock)void intel_mpllb_state_verify (struct intel_atomic_state *state,struct intel_crtc *crtc) { +struct intel_display *display =to_intel_display (state);struct drm_i915_private *i915 =to_i915 (state->base.dev);const struct intel_crtc_state *new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc);
@@ -2019,11 +2020,11 @@ void intel_mpllb_state_verify(struct intel_atomic_state *state,intel_mpllb_readout_hw_state (encoder, &mpllb_hw_state);#define MPLLB_CHECK (__name) \ - I915_STATE_WARN(i915, mpllb_sw_state->__name != mpllb_hw_state.__name, \ - "[CRTC:%d:%s] mismatch in MPLLB: %s (expected 0x%08x, found 0x%08x)", \ - crtc->base.base.id, crtc->base.name, \ - __stringify(__name), \ - mpllb_sw_state->__name, mpllb_hw_state.__name) + INTEL_DISPLAY_STATE_WARN(display, mpllb_sw_state->__name != mpllb_hw_state.__name, \ + "[CRTC:%d:%s] mismatch in MPLLB: %s (expected 0x%08x, found 0x%08x)", \ + crtc->base.base.id, crtc->base.name, \ + __stringify(__name), \ + mpllb_sw_state->__name, mpllb_hw_state.__name)MPLLB_CHECK (mpllb_cp);MPLLB_CHECK (mpllb_div);
drivers/gpu/drm/i915/display/vlv_dsi_pll.c +4 -3
@@ -592,15 +592,16 @@ void bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port)static void assert_dsi_pll (struct drm_i915_private *i915,bool state) { +struct intel_display *display = &i915->display;bool cur_state;vlv_cck_get (i915); cur_state =vlv_cck_read (i915,CCK_REG_DSI_PLL_CONTROL ) &DSI_PLL_VCO_EN ;vlv_cck_put (i915); -I915_STATE_WARN (i915, cur_state != state, -"DSI PLL state assertion failure (expected %s, current %s)\n" , -str_on_off (state),str_on_off (cur_state)); +INTEL_DISPLAY_STATE_WARN (display, cur_state != state, +"DSI PLL state assertion failure (expected %s, current %s)\n" , +str_on_off (state),str_on_off (cur_state)); }void assert_dsi_pll_enabled (struct drm_i915_private *i915)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 56/869 drm/i915/gmbus: convert to struct intel_display
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit fdc387383ebd0d88dda9c40bcb81023a70b4408e ]
struct intel_display will replace struct drm_i915_private as the main device pointer for display code. Switch gmbus code over to it.
Stable-dep-of: dc3806d9eb66 ("drm/i915: Grab intel_display from the encoder to avoid potential oopsies")
--- drivers/gpu/drm/i915/display/intel_bios.c | 6 +- drivers/gpu/drm/i915/display/intel_crt.c | 6 +- .../drm/i915/display/intel_display_driver.c | 4 +- .../gpu/drm/i915/display/intel_display_irq.c | 11 +- drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 5 +- drivers/gpu/drm/i915/display/intel_dvo.c | 8 +- drivers/gpu/drm/i915/display/intel_gmbus.c | 290 +++++++++--------- drivers/gpu/drm/i915/display/intel_gmbus.h | 15 +- .../gpu/drm/i915/display/intel_gmbus_regs.h | 16 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +- .../gpu/drm/i915/display/intel_hotplug_irq.c | 6 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 9 +- drivers/gpu/drm/i915/i915_suspend.c | 2 +- 14 files changed, 202 insertions(+), 186 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +2 -4
@@ -2815,7 +2815,6 @@ static bool child_device_size_valid(struct intel_display *display, int size)static void parse_general_definitions (struct intel_display *display) { -struct drm_i915_private *i915 =to_i915 (display->drm);const struct bdb_general_definitions *defs;struct intel_bios_encoder_data *devdata;const struct child_device_config *child;
@@ -2840,7 +2839,7 @@ parse_general_definitions(struct intel_display *display) bus_pin = defs->crt_ddc_gmbus_pin;drm_dbg_kms (display->drm,"crt_ddc_bus_pin: %d\n" , bus_pin); -if (intel_gmbus_is_valid_pin (i915, bus_pin)) +if (intel_gmbus_is_valid_pin (display, bus_pin)) display->vbt.crt_ddc_pin = bus_pin;if (!child_device_size_valid (display, defs->child_dev_size))
@@ -3426,7 +3425,6 @@ bool intel_bios_is_tv_present(struct intel_display *display)*/ bool intel_bios_is_lvds_present (struct intel_display *display,u8 *i2c_pin) { -struct drm_i915_private *i915 =to_i915 (display->drm);const struct intel_bios_encoder_data *devdata;if (list_empty (&display->vbt.display_devices))
@@ -3443,7 +3441,7 @@ bool intel_bios_is_lvds_present(struct intel_display *display, u8 *i2c_pin) child->device_type != DEVICE_TYPE_LFP)continue ; -if (intel_gmbus_is_valid_pin (i915, child->i2c_pin)) +if (intel_gmbus_is_valid_pin (display, child->i2c_pin)) *i2c_pin = child->i2c_pin;/* However, we cannot trust the BIOS writers to populate
drivers/gpu/drm/i915/display/intel_crt.c +4 -2
@@ -935,6 +935,7 @@ intel_crt_detect(struct drm_connector *connector,static int intel_crt_get_modes (struct drm_connector *connector) { +struct intel_display *display =to_intel_display (connector->dev);struct drm_device *dev = connector->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crt *crt =intel_attached_crt (to_intel_connector (connector));
@@ -954,7 +955,7 @@ static int intel_crt_get_modes(struct drm_connector *connector) goto out;/* Try to probe digital port for output in DVI-I -> VGA mode. */ - ddc =intel_gmbus_get_adapter (dev_priv,GMBUS_PIN_DPB ); + ddc =intel_gmbus_get_adapter (display,GMBUS_PIN_DPB ); ret =intel_crt_ddc_get_modes (connector, ddc); out:
@@ -1009,6 +1010,7 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {void intel_crt_init (struct drm_i915_private *dev_priv) { +struct intel_display *display = &dev_priv->display;struct drm_connector *connector;struct intel_crt *crt;struct intel_connector *intel_connector;
@@ -1057,7 +1059,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)drm_connector_init_with_ddc (&dev_priv->drm, connector, &intel_crt_connector_funcs,DRM_MODE_CONNECTOR_VGA , -intel_gmbus_get_adapter (dev_priv, ddc_pin)); +intel_gmbus_get_adapter (display, ddc_pin));drm_encoder_init (&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs,DRM_MODE_ENCODER_DAC ,"CRT" );
drivers/gpu/drm/i915/display/intel_display_driver.c +2 -2
@@ -431,7 +431,7 @@ int intel_display_driver_probe_nogem(struct drm_i915_private *i915)intel_pps_setup (display); -intel_gmbus_setup (i915); +intel_gmbus_setup (display); drm_dbg_kms(&i915->drm, "%d display pipe%s available.\n", INTEL_NUM_PIPES(i915),
@@ -607,7 +607,7 @@ void intel_display_driver_remove_noirq(struct drm_i915_private *i915)intel_overlay_cleanup (i915); -intel_gmbus_teardown (i915); +intel_gmbus_teardown (display);destroy_workqueue (i915->display.wq.flip);destroy_workqueue (i915->display.wq.modeset);
drivers/gpu/drm/i915/display/intel_display_irq.c +6 -5
@@ -551,12 +551,13 @@ void i965_pipestat_irq_handler(struct drm_i915_private *dev_priv,intel_opregion_asle_intr (display);if (pipe_stats[0 ] &PIPE_GMBUS_INTERRUPT_STATUS ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display); }void valleyview_pipestat_irq_handler (struct drm_i915_private *dev_priv,u32 pipe_stats[I915_MAX_PIPES ]) { +struct intel_display *display = &dev_priv->display;enum pipe pipe;for_each_pipe (dev_priv, pipe) {
@@ -574,7 +575,7 @@ void valleyview_pipestat_irq_handler(struct drm_i915_private *dev_priv, }if (pipe_stats[0 ] &PIPE_GMBUS_INTERRUPT_STATUS ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display); }static void ibx_irq_handler (struct drm_i915_private *dev_priv,u32 pch_iir)
@@ -596,7 +597,7 @@ static void ibx_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)intel_dp_aux_irq_handler (display);if (pch_iir &SDE_GMBUS ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display);if (pch_iir &SDE_AUDIO_HDCP_MASK )drm_dbg (&dev_priv->drm,"PCH HDCP audio interrupt\n" );
@@ -685,7 +686,7 @@ static void cpt_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)intel_dp_aux_irq_handler (display);if (pch_iir &SDE_GMBUS_CPT ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display);if (pch_iir &SDE_AUDIO_CP_REQ_CPT )drm_dbg (&dev_priv->drm,"Audio CP request interrupt\n" );
@@ -1128,7 +1129,7 @@ void gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)if ((IS_GEMINILAKE (dev_priv) ||IS_BROXTON (dev_priv)) && (iir &BXT_DE_PORT_GMBUS )) { -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display); found = true; }
drivers/gpu/drm/i915/display/intel_dsi_vbt.c +3 -2
@@ -323,6 +323,7 @@ enum {static void icl_native_gpio_set_value (struct drm_i915_private *dev_priv,int gpio,bool value) { +struct intel_display *display = &dev_priv->display;int index;if (drm_WARN_ON (&dev_priv->drm,DISPLAY_VER (dev_priv) ==11 && gpio >=MIPI_RESET_2 ))
@@ -367,7 +368,7 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,case MIPI_AVEE_EN_2 : index = gpio ==MIPI_AVEE_EN_1 ?1 :2 ; -intel_de_rmw (dev_priv,GPIO (dev_priv, index), +intel_de_rmw (display,GPIO (display, index),GPIO_CLOCK_VAL_OUT ,GPIO_CLOCK_DIR_MASK |GPIO_CLOCK_DIR_OUT |GPIO_CLOCK_VAL_MASK | (value ?GPIO_CLOCK_VAL_OUT :0 ));
@@ -376,7 +377,7 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,case MIPI_VIO_EN_2 : index = gpio ==MIPI_VIO_EN_1 ?1 :2 ; -intel_de_rmw (dev_priv,GPIO (dev_priv, index), +intel_de_rmw (display,GPIO (display, index),GPIO_DATA_VAL_OUT ,GPIO_DATA_DIR_MASK |GPIO_DATA_DIR_OUT |GPIO_DATA_VAL_MASK | (value ?GPIO_DATA_VAL_OUT :0 ));
drivers/gpu/drm/i915/display/intel_dvo.c +5 -3
@@ -416,6 +416,7 @@ static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,struct intel_dvo *intel_dvo, const struct intel_dvo_device *dvo) { + struct intel_display *display = &dev_priv->display;struct i2c_adapter *i2c;u32 dpll[I915_MAX_PIPES ];enum pipe pipe;
@@ -427,7 +428,7 @@ static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,* special cases, but otherwise default to what's defined * in the spec. */ -if (intel_gmbus_is_valid_pin (dev_priv, dvo->gpio)) +if (intel_gmbus_is_valid_pin (display, dvo->gpio)) gpio = dvo->gpio;else if (dvo->type ==INTEL_DVO_CHIP_LVDS ) gpio =GMBUS_PIN_SSC ;
@@ -439,7 +440,7 @@ static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,* It appears that everything is on GPIOE except for panels * on i830 laptops, which are on GPIOB (DVOA). */ - i2c =intel_gmbus_get_adapter (dev_priv, gpio); + i2c =intel_gmbus_get_adapter (display, gpio); intel_dvo->dev = *dvo;
@@ -488,6 +489,7 @@ static bool intel_dvo_probe(struct drm_i915_private *i915,void intel_dvo_init (struct drm_i915_private *i915) { +struct intel_display *display = &i915->display;struct intel_connector *connector;struct intel_encoder *encoder;struct intel_dvo *intel_dvo;
@@ -548,7 +550,7 @@ void intel_dvo_init(struct drm_i915_private *i915)drm_connector_init_with_ddc (&i915->drm, &connector->base, &intel_dvo_connector_funcs,intel_dvo_connector_type (&intel_dvo->dev), -intel_gmbus_get_adapter (i915,GMBUS_PIN_DPC )); +intel_gmbus_get_adapter (display,GMBUS_PIN_DPC ));drm_connector_helper_add (&connector->base, &intel_dvo_connector_helper_funcs);
drivers/gpu/drm/i915/display/intel_gmbus.c +151 -139
756 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_gmbus.h +7 -8
@@ -8,8 +8,8 @@#include <linux/types.h> -struct drm_i915_private ;struct i2c_adapter ; +struct intel_display ;#define GMBUS_PIN_DISABLED 0#define GMBUS_PIN_SSC 1
@@ -34,18 +34,17 @@ struct i2c_adapter;#define GMBUS_NUM_PINS 15/* including 0 */ -int intel_gmbus_setup (struct drm_i915_private *dev_priv); -void intel_gmbus_teardown (struct drm_i915_private *dev_priv); -bool intel_gmbus_is_valid_pin (struct drm_i915_private *dev_priv, -unsigned int pin); +int intel_gmbus_setup (struct intel_display *display); +void intel_gmbus_teardown (struct intel_display *display); +bool intel_gmbus_is_valid_pin (struct intel_display *display,unsigned int pin);int intel_gmbus_output_aksv (struct i2c_adapter *adapter);struct i2c_adapter * -intel_gmbus_get_adapter (struct drm_i915_private *dev_priv,unsigned int pin); +intel_gmbus_get_adapter (struct intel_display *display,unsigned int pin);void intel_gmbus_force_bit (struct i2c_adapter *adapter,bool force_bit);bool intel_gmbus_is_forced_bit (struct i2c_adapter *adapter); -void intel_gmbus_reset (struct drm_i915_private *dev_priv); +void intel_gmbus_reset (struct intel_display *display); -void intel_gmbus_irq_handler (struct drm_i915_private *i915); +void intel_gmbus_irq_handler (struct intel_display *display);#endif /* __INTEL_GMBUS_H__ */
drivers/gpu/drm/i915/display/intel_gmbus_regs.h +8 -8
@@ -8,9 +8,9 @@#include "i915_reg_defs.h" -#define GMBUS_MMIO_BASE (__i915) ((__i915)->display.gmbus.mmio_base) +#define __GMBUS_MMIO_BASE (__display) ((__display)->gmbus.mmio_base) -#define GPIO (__i915, gpio) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5010 + 4 * (gpio)) +#define GPIO (__display, gpio) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5010 + 4 * (gpio))#define GPIO_CLOCK_DIR_MASK (1 << 0)#define GPIO_CLOCK_DIR_IN (0 << 1)#define GPIO_CLOCK_DIR_OUT (1 << 1)
@@ -27,7 +27,7 @@#define GPIO_DATA_PULLUP_DISABLE (1 << 13)/* clock/port select */ -#define GMBUS0 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5100) +#define GMBUS0 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5100)#define GMBUS_AKSV_SELECT (1 << 11)#define GMBUS_RATE_100KHZ (0 << 8)#define GMBUS_RATE_50KHZ (1 << 8)
@@ -37,7 +37,7 @@#define GMBUS_BYTE_CNT_OVERRIDE (1 << 6)/* command/status */ -#define GMBUS1 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5104) +#define GMBUS1 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5104)#define GMBUS_SW_CLR_INT (1 << 31)#define GMBUS_SW_RDY (1 << 30)#define GMBUS_ENT (1 << 29)/* enable timeout */
@@ -54,7 +54,7 @@#define GMBUS_SLAVE_WRITE (0 << 0)/* status */ -#define GMBUS2 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5108) +#define GMBUS2 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5108)#define GMBUS_INUSE (1 << 15)#define GMBUS_HW_WAIT_PHASE (1 << 14)#define GMBUS_STALL_TIMEOUT (1 << 13)
@@ -64,10 +64,10 @@#define GMBUS_ACTIVE (1 << 9)/* data buffer bytes 3-0 */ -#define GMBUS3 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x510c) +#define GMBUS3 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x510c)/* interrupt mask (Pineview+) */ -#define GMBUS4 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5110) +#define GMBUS4 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5110)#define GMBUS_SLAVE_TIMEOUT_EN (1 << 4)#define GMBUS_NAK_EN (1 << 3)#define GMBUS_IDLE_EN (1 << 2)
@@ -75,7 +75,7 @@#define GMBUS_HW_RDY_EN (1 << 0)/* byte index */ -#define GMBUS5 (__i915) _MMIO(GMBUS_MMIO_BASE(__i915) + 0x5120) +#define GMBUS5 (__display) _MMIO(__GMBUS_MMIO_BASE(__display) + 0x5120)#define GMBUS_2BYTE_INDEX_EN (1 << 31)#endif /* __INTEL_GMBUS_REGS_H__ */
drivers/gpu/drm/i915/display/intel_hdmi.c +3 -5
@@ -2913,7 +2913,6 @@ static struct intel_encoder * get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin) {struct intel_display *display =to_intel_display (encoder); -struct drm_i915_private *i915 =to_i915 (encoder->base.dev);struct intel_encoder *other;for_each_intel_encoder (display->drm, other) {
@@ -2927,7 +2926,7 @@ get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin) connector =enc_to_dig_port (other)->hdmi.attached_connector; -if (connector && connector->base.ddc ==intel_gmbus_get_adapter (i915, ddc_pin)) +if (connector && connector->base.ddc ==intel_gmbus_get_adapter (display, ddc_pin))return other; }
@@ -2937,7 +2936,6 @@ get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin)static u8 intel_hdmi_ddc_pin (struct intel_encoder *encoder) {struct intel_display *display =to_intel_display (encoder); -struct drm_i915_private *i915 =to_i915 (encoder->base.dev);struct intel_encoder *other;const char *source;u8 ddc_pin;
@@ -2950,7 +2948,7 @@ static u8 intel_hdmi_ddc_pin(struct intel_encoder *encoder) source ="platform default" ; } -if (!intel_gmbus_is_valid_pin (i915, ddc_pin)) { +if (!intel_gmbus_is_valid_pin (display, ddc_pin)) {drm_dbg_kms (display->drm,"[ENCODER:%d:%s] Invalid DDC pin %d\n" , encoder->base.base.id, encoder->base.name, ddc_pin);
@@ -3048,7 +3046,7 @@ bool intel_hdmi_init_connector(struct intel_digital_port *dig_port,drm_connector_init_with_ddc (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA , -intel_gmbus_get_adapter (dev_priv, ddc_pin)); +intel_gmbus_get_adapter (display, ddc_pin));drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);
drivers/gpu/drm/i915/display/intel_hotplug_irq.c +4 -2
@@ -556,6 +556,7 @@ void xelpdp_pica_irq_handler(struct drm_i915_private *i915, u32 iir)void icp_irq_handler (struct drm_i915_private *dev_priv,u32 pch_iir) { +struct intel_display *display = &dev_priv->display;u32 ddi_hotplug_trigger = pch_iir &SDE_DDI_HOTPLUG_MASK_ICP ;u32 tc_hotplug_trigger = pch_iir &SDE_TC_HOTPLUG_MASK_ICP ;u32 pin_mask =0 , long_mask =0 ;
@@ -589,11 +590,12 @@ void icp_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)intel_hpd_irq_handler (dev_priv, pin_mask, long_mask);if (pch_iir &SDE_GMBUS_ICP ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display); }void spt_irq_handler (struct drm_i915_private *dev_priv,u32 pch_iir) { +struct intel_display *display = &dev_priv->display;u32 hotplug_trigger = pch_iir &SDE_HOTPLUG_MASK_SPT & ~SDE_PORTE_HOTPLUG_SPT ;u32 hotplug2_trigger = pch_iir &SDE_PORTE_HOTPLUG_SPT ;
@@ -625,7 +627,7 @@ void spt_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)intel_hpd_irq_handler (dev_priv, pin_mask, long_mask);if (pch_iir &SDE_GMBUS_CPT ) -intel_gmbus_irq_handler (dev_priv); +intel_gmbus_irq_handler (display); }void ilk_hpd_irq_handler (struct drm_i915_private *dev_priv,u32 hotplug_trigger)
drivers/gpu/drm/i915/display/intel_lvds.c +1 -1
@@ -899,7 +899,7 @@ void intel_lvds_init(struct drm_i915_private *i915)drm_connector_init_with_ddc (&i915->drm, &connector->base, &intel_lvds_connector_funcs,DRM_MODE_CONNECTOR_LVDS , -intel_gmbus_get_adapter (i915, ddc_pin)); +intel_gmbus_get_adapter (display, ddc_pin));drm_encoder_init (&i915->drm, &encoder->base, &intel_lvds_enc_funcs,DRM_MODE_ENCODER_LVDS ,"LVDS" );
drivers/gpu/drm/i915/display/intel_sdvo.c +5 -4
@@ -2081,10 +2081,10 @@ intel_sdvo_get_edid(struct drm_connector *connector)static const struct drm_edid *intel_sdvo_get_analog_edid (struct drm_connector *connector) { -struct drm_i915_private *i915 =to_i915 (connector->dev); +struct intel_display *display =to_intel_display (connector->dev);struct i2c_adapter *ddc; - ddc =intel_gmbus_get_adapter (i915, i915->display.vbt.crt_ddc_pin); + ddc =intel_gmbus_get_adapter (display, display->vbt.crt_ddc_pin);if (!ddc)return NULL ;
@@ -2637,6 +2637,7 @@ intel_sdvo_select_ddc_bus(struct intel_sdvo *sdvo,static void intel_sdvo_select_i2c_bus (struct intel_sdvo *sdvo) { +struct intel_display *display =to_intel_display (&sdvo->base);struct drm_i915_private *dev_priv =to_i915 (sdvo->base.base.dev);const struct sdvo_device_mapping *mapping;u8 pin;
@@ -2647,7 +2648,7 @@ intel_sdvo_select_i2c_bus(struct intel_sdvo *sdvo) mapping = &dev_priv->display.vbt.sdvo_mappings[1 ];if (mapping->initialized && -intel_gmbus_is_valid_pin (dev_priv, mapping->i2c_pin)) +intel_gmbus_is_valid_pin (display, mapping->i2c_pin)) pin = mapping->i2c_pin;else pin =GMBUS_PIN_DPB ;
@@ -2656,7 +2657,7 @@ intel_sdvo_select_i2c_bus(struct intel_sdvo *sdvo) sdvo->base.base.base.id, sdvo->base.base.name, pin, sdvo->target_addr); - sdvo->i2c =intel_gmbus_get_adapter (dev_priv, pin); + sdvo->i2c =intel_gmbus_get_adapter (display, pin);/* * With gmbus we should be able to drive sdvo i2c at 2MHz, but somehow
drivers/gpu/drm/i915/i915_suspend.c +1 -1
@@ -137,5 +137,5 @@ void i915_restore_display(struct drm_i915_private *dev_priv)intel_vga_redisable (display); -intel_gmbus_reset (dev_priv); +intel_gmbus_reset (display); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 57/869 drm/i915/crt: convert to struct intel_display
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 40eb34c3f49170cf79a953ecf8f89ae4659bb527 ]
struct intel_display will replace struct drm_i915_private as the main device pointer for display code. Switch CRT code over to it.
v2: Rebase
Stable-dep-of: dc3806d9eb66 ("drm/i915: Grab intel_display from the encoder to avoid potential oopsies")
--- drivers/gpu/drm/i915/display/intel_crt.c | 209 +++++++++--------- drivers/gpu/drm/i915/display/intel_crt.h | 10 +- drivers/gpu/drm/i915/display/intel_display.c | 12 +- .../gpu/drm/i915/display/intel_pch_display.c | 2 +- 4 files changed, 122 insertions(+), 111 deletions(-)
drivers/gpu/drm/i915/display/intel_crt.c +110 -99
@@ -81,12 +81,13 @@ static struct intel_crt *intel_attached_crt(struct intel_connector *connector)return intel_encoder_to_crt (intel_attached_encoder (connector)); } -bool intel_crt_port_enabled (struct drm_i915_private *dev_priv, +bool intel_crt_port_enabled (struct intel_display *display,i915_reg_t adpa_reg,enum pipe *pipe) { +struct drm_i915_private *dev_priv =to_i915 (display->drm);u32 val; - val =intel_de_read (dev_priv, adpa_reg); + val =intel_de_read (display, adpa_reg);/* asserts want to know the pipe even if the port is disabled */ if (HAS_PCH_CPT (dev_priv))
@@ -100,6 +101,7 @@ bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,static bool intel_crt_get_hw_state (struct intel_encoder *encoder,enum pipe *pipe) { +struct intel_display *display =to_intel_display (encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crt *crt =intel_encoder_to_crt (encoder);intel_wakeref_t wakeref;
@@ -110,7 +112,7 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder,if (!wakeref)return false; - ret =intel_crt_port_enabled (dev_priv, crt->adpa_reg, pipe); + ret =intel_crt_port_enabled (display, crt->adpa_reg, pipe);intel_display_power_put (dev_priv, encoder->power_domain, wakeref);
@@ -119,11 +121,11 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder,static unsigned int intel_crt_get_flags (struct intel_encoder *encoder) { -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct intel_display *display =to_intel_display (encoder);struct intel_crt *crt =intel_encoder_to_crt (encoder);u32 tmp, flags =0 ; - tmp =intel_de_read (dev_priv, crt->adpa_reg); + tmp =intel_de_read (display, crt->adpa_reg);if (tmp &ADPA_HSYNC_ACTIVE_HIGH ) flags |=DRM_MODE_FLAG_PHSYNC ;
@@ -168,13 +170,14 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, int mode) { +struct intel_display *display =to_intel_display (encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crt *crt =intel_encoder_to_crt (encoder);struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;u32 adpa; -if (DISPLAY_VER (dev_priv) >=5 ) +if (DISPLAY_VER (display) >=5 ) adpa =ADPA_HOTPLUG_BITS ;else adpa =0 ;
@@ -193,7 +196,7 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, adpa |=ADPA_PIPE_SEL (crtc->pipe);if (!HAS_PCH_SPLIT (dev_priv)) -intel_de_write (dev_priv,BCLRPAT (dev_priv, crtc->pipe),0 ); +intel_de_write (display,BCLRPAT (display, crtc->pipe),0 );switch (mode) {case DRM_MODE_DPMS_ON :
@@ -210,7 +213,7 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder,break ; } -intel_de_write (dev_priv, crt->adpa_reg, adpa); +intel_de_write (display, crt->adpa_reg, adpa); } static void intel_disable_crt(struct intel_atomic_state *state,
@@ -241,9 +244,10 @@ static void hsw_disable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct intel_display *display = to_intel_display(state);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -drm_WARN_ON (&dev_priv->drm, !old_crtc_state->has_pch_encoder); +drm_WARN_ON (display->drm, !old_crtc_state->has_pch_encoder);intel_set_pch_fifo_underrun_reporting (dev_priv,PIPE_A , false); }
@@ -253,6 +257,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct intel_display *display = to_intel_display(state);struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);
@@ -272,7 +277,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state,hsw_fdi_disable (encoder); -drm_WARN_ON (&dev_priv->drm, !old_crtc_state->has_pch_encoder); +drm_WARN_ON (display->drm, !old_crtc_state->has_pch_encoder);intel_set_pch_fifo_underrun_reporting (dev_priv,PIPE_A , true); }
@@ -282,9 +287,10 @@ static void hsw_pre_pll_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { + struct intel_display *display = to_intel_display(state);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -drm_WARN_ON (&dev_priv->drm, !crtc_state->has_pch_encoder); +drm_WARN_ON (display->drm, !crtc_state->has_pch_encoder);intel_set_pch_fifo_underrun_reporting (dev_priv,PIPE_A , false); }
@@ -294,11 +300,12 @@ static void hsw_pre_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { + struct intel_display *display = to_intel_display(state);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe; -drm_WARN_ON (&dev_priv->drm, !crtc_state->has_pch_encoder); +drm_WARN_ON (display->drm, !crtc_state->has_pch_encoder);intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);
@@ -312,11 +319,12 @@ static void hsw_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { + struct intel_display *display = to_intel_display(state);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe; -drm_WARN_ON (&dev_priv->drm, !crtc_state->has_pch_encoder); +drm_WARN_ON (display->drm, !crtc_state->has_pch_encoder);intel_ddi_enable_transcoder_func (encoder, crtc_state);
@@ -346,9 +354,10 @@ static enum drm_mode_status intel_crt_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct intel_display *display = to_intel_display(connector->dev);struct drm_device *dev = connector->dev;struct drm_i915_private *dev_priv =to_i915 (dev); -int max_dotclk = dev_priv->display.cdclk.max_dotclk_freq; +int max_dotclk = display->cdclk.max_dotclk_freq;enum drm_mode_status status;int max_clock;
@@ -367,7 +376,7 @@ intel_crt_mode_valid(struct drm_connector *connector,* DAC limit supposedly 355 MHz. */ max_clock =270000 ; - else if (IS_DISPLAY_VER(dev_priv, 3, 4)) + else if (IS_DISPLAY_VER(display, 3, 4)) max_clock =400000 ; else max_clock =350000 ;
@@ -428,6 +437,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { + struct intel_display *display = to_intel_display(encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
@@ -450,7 +460,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder,if (HAS_PCH_LPT (dev_priv)) {/* TODO: Check crtc_state->max_link_bpp_x16 instead of bw_constrained */ if (pipe_config->bw_constrained && pipe_config->pipe_bpp <24 ) { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"LPT only supports 24bpp\n" );return -EINVAL ; }
@@ -470,6 +480,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder,static bool ilk_crt_detect_hotplug (struct drm_connector *connector) { +struct intel_display *display =to_intel_display (connector->dev);struct drm_device *dev = connector->dev;struct intel_crt *crt =intel_attached_crt (to_intel_connector (connector));struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -483,36 +494,36 @@ static bool ilk_crt_detect_hotplug(struct drm_connector *connector) crt->force_hotplug_required = false; - save_adpa = adpa =intel_de_read (dev_priv, crt->adpa_reg); -drm_dbg_kms (&dev_priv->drm, + save_adpa = adpa =intel_de_read (display, crt->adpa_reg); +drm_dbg_kms (display->drm,"trigger hotplug detect cycle: adpa=0x%x\n" , adpa); adpa |=ADPA_CRT_HOTPLUG_FORCE_TRIGGER ;if (turn_off_dac) adpa &= ~ADPA_DAC_ENABLE ; -intel_de_write (dev_priv, crt->adpa_reg, adpa); +intel_de_write (display, crt->adpa_reg, adpa); -if (intel_de_wait_for_clear (dev_priv, +if (intel_de_wait_for_clear (display, crt->adpa_reg,ADPA_CRT_HOTPLUG_FORCE_TRIGGER ,1000 )) -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"timed out waiting for FORCE_TRIGGER" );if (turn_off_dac) { -intel_de_write (dev_priv, crt->adpa_reg, save_adpa); -intel_de_posting_read (dev_priv, crt->adpa_reg); +intel_de_write (display, crt->adpa_reg, save_adpa); +intel_de_posting_read (display, crt->adpa_reg); } }/* Check the status to see if both blue and green are on now */ - adpa =intel_de_read (dev_priv, crt->adpa_reg); + adpa =intel_de_read (display, crt->adpa_reg);if ((adpa &ADPA_CRT_HOTPLUG_MONITOR_MASK ) !=0 ) ret = true;else ret = false; -drm_dbg_kms (&dev_priv->drm,"ironlake hotplug adpa=0x%x, result %d\n" , +drm_dbg_kms (display->drm,"ironlake hotplug adpa=0x%x, result %d\n" , adpa, ret);return ret;
@@ -520,6 +531,7 @@ static bool ilk_crt_detect_hotplug(struct drm_connector *connector)static bool valleyview_crt_detect_hotplug (struct drm_connector *connector) { +struct intel_display *display =to_intel_display (connector->dev);struct drm_device *dev = connector->dev;struct intel_crt *crt =intel_attached_crt (to_intel_connector (connector));struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -542,29 +554,29 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)*/ reenable_hpd =intel_hpd_disable (dev_priv, crt->base.hpd_pin); - save_adpa = adpa =intel_de_read (dev_priv, crt->adpa_reg); -drm_dbg_kms (&dev_priv->drm, + save_adpa = adpa =intel_de_read (display, crt->adpa_reg); +drm_dbg_kms (display->drm,"trigger hotplug detect cycle: adpa=0x%x\n" , adpa); adpa |=ADPA_CRT_HOTPLUG_FORCE_TRIGGER ; -intel_de_write (dev_priv, crt->adpa_reg, adpa); +intel_de_write (display, crt->adpa_reg, adpa); -if (intel_de_wait_for_clear (dev_priv, crt->adpa_reg, +if (intel_de_wait_for_clear (display, crt->adpa_reg,ADPA_CRT_HOTPLUG_FORCE_TRIGGER ,1000 )) { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"timed out waiting for FORCE_TRIGGER" ); -intel_de_write (dev_priv, crt->adpa_reg, save_adpa); +intel_de_write (display, crt->adpa_reg, save_adpa); }/* Check the status to see if both blue and green are on now */ - adpa =intel_de_read (dev_priv, crt->adpa_reg); + adpa =intel_de_read (display, crt->adpa_reg);if ((adpa &ADPA_CRT_HOTPLUG_MONITOR_MASK ) !=0 ) ret = true;else ret = false; -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"valleyview hotplug adpa=0x%x, result %d\n" , adpa, ret);if (reenable_hpd)
@@ -575,6 +587,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)static bool intel_crt_detect_hotplug (struct drm_connector *connector) { +struct intel_display *display =to_intel_display (connector->dev);struct drm_device *dev = connector->dev;struct drm_i915_private *dev_priv =to_i915 (dev);u32 stat;
@@ -603,18 +616,18 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)CRT_HOTPLUG_FORCE_DETECT , CRT_HOTPLUG_FORCE_DETECT);/* wait for FORCE_DETECT to go off */ -if (intel_de_wait_for_clear (dev_priv,PORT_HOTPLUG_EN (dev_priv), +if (intel_de_wait_for_clear (display,PORT_HOTPLUG_EN (display),CRT_HOTPLUG_FORCE_DETECT ,1000 )) -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"timed out waiting for FORCE_DETECT to go off" ); } - stat =intel_de_read (dev_priv,PORT_HOTPLUG_STAT (dev_priv)); + stat =intel_de_read (display,PORT_HOTPLUG_STAT (display));if ((stat &CRT_HOTPLUG_MONITOR_MASK ) !=CRT_HOTPLUG_MONITOR_NONE ) ret = true;/* clear the interrupt we just generated, if any */ -intel_de_write (dev_priv,PORT_HOTPLUG_STAT (dev_priv), +intel_de_write (display,PORT_HOTPLUG_STAT (display),CRT_HOTPLUG_INT_STATUS );i915_hotplug_interrupt_update (dev_priv,CRT_HOTPLUG_FORCE_DETECT ,0 );
@@ -660,8 +673,7 @@ static int intel_crt_ddc_get_modes(struct drm_connector *connector,static bool intel_crt_detect_ddc (struct drm_connector *connector) { -struct intel_crt *crt =intel_attached_crt (to_intel_connector (connector)); -struct drm_i915_private *dev_priv =to_i915 (crt->base.base.dev); +struct intel_display *display =to_intel_display (connector->dev);const struct drm_edid *drm_edid;bool ret = false;
@@ -674,15 +686,15 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)* have to check the EDID input spec of the attached device. */ if (drm_edid_is_digital (drm_edid)) { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"CRT not detected via DDC:0x50 [EDID reports a digital panel]\n" ); }else { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"CRT detected via DDC:0x50 [EDID]\n" ); ret = true; } }else { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"CRT not detected via DDC:0x50 [no valid EDID found]\n" ); }
@@ -695,8 +707,6 @@ static enum drm_connector_status intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe) {struct intel_display *display =to_intel_display (&crt->base); -struct drm_device *dev = crt->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev);enum transcoder cpu_transcoder = (enum transcoder )pipe;u32 save_bclrpat;u32 save_vtotal;
@@ -707,14 +717,14 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe)u8 st00;enum drm_connector_status status; -drm_dbg_kms (&dev_priv->drm,"starting load-detect on CRT\n" ); +drm_dbg_kms (display->drm,"starting load-detect on CRT\n" ); - save_bclrpat =intel_de_read (dev_priv, -BCLRPAT (dev_priv, cpu_transcoder)); - save_vtotal =intel_de_read (dev_priv, -TRANS_VTOTAL (dev_priv, cpu_transcoder)); - vblank =intel_de_read (dev_priv, -TRANS_VBLANK (dev_priv, cpu_transcoder)); + save_bclrpat =intel_de_read (display, +BCLRPAT (display, cpu_transcoder)); + save_vtotal =intel_de_read (display, +TRANS_VTOTAL (display, cpu_transcoder)); + vblank =intel_de_read (display, +TRANS_VBLANK (display, cpu_transcoder)); vtotal =REG_FIELD_GET (VTOTAL_MASK , save_vtotal) +1 ; vactive =REG_FIELD_GET (VACTIVE_MASK , save_vtotal) +1 ;
@@ -723,25 +733,25 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe) vblank_end =REG_FIELD_GET (VBLANK_END_MASK , vblank) +1 ;/* Set the border color to purple. */ -intel_de_write (dev_priv,BCLRPAT (dev_priv, cpu_transcoder),0x500050 ); +intel_de_write (display,BCLRPAT (display, cpu_transcoder),0x500050 ); -if (DISPLAY_VER (dev_priv) !=2 ) { -u32 transconf =intel_de_read (dev_priv, -TRANSCONF (dev_priv, cpu_transcoder)); +if (DISPLAY_VER (display) !=2 ) { +u32 transconf =intel_de_read (display, +TRANSCONF (display, cpu_transcoder)); -intel_de_write (dev_priv,TRANSCONF (dev_priv, cpu_transcoder), +intel_de_write (display,TRANSCONF (display, cpu_transcoder), transconf |TRANSCONF_FORCE_BORDER ); -intel_de_posting_read (dev_priv, -TRANSCONF (dev_priv, cpu_transcoder)); +intel_de_posting_read (display, +TRANSCONF (display, cpu_transcoder));/* Wait for next Vblank to substitue * border color for Color info */ intel_crtc_wait_for_next_vblank (intel_crtc_for_pipe (display, pipe)); - st00 =intel_de_read8 (dev_priv, _VGA_MSR_WRITE); + st00 =intel_de_read8 (display, _VGA_MSR_WRITE); status = ((st00 & (1 <<4 )) !=0 ) ? connector_status_connected : connector_status_disconnected; -intel_de_write (dev_priv,TRANSCONF (dev_priv, cpu_transcoder), +intel_de_write (display,TRANSCONF (display, cpu_transcoder), transconf); }else {bool restore_vblank = false;
@@ -752,13 +762,13 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe)* Yes, this will flicker */ if (vblank_start <= vactive && vblank_end >= vtotal) { -u32 vsync =intel_de_read (dev_priv, -TRANS_VSYNC (dev_priv, cpu_transcoder)); +u32 vsync =intel_de_read (display, +TRANS_VSYNC (display, cpu_transcoder));u32 vsync_start =REG_FIELD_GET (VSYNC_START_MASK , vsync) +1 ; vblank_start = vsync_start; -intel_de_write (dev_priv, -TRANS_VBLANK (dev_priv, cpu_transcoder), +intel_de_write (display, +TRANS_VBLANK (display, cpu_transcoder),VBLANK_START (vblank_start -1 ) |VBLANK_END (vblank_end -1 )); restore_vblank = true;
@@ -772,9 +782,9 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe)/* * Wait for the border to be displayed */ -while (intel_de_read (dev_priv,PIPEDSL (dev_priv, pipe)) >= vactive) +while (intel_de_read (display,PIPEDSL (display, pipe)) >= vactive) ; -while ((dsl =intel_de_read (dev_priv,PIPEDSL (dev_priv, pipe))) <= vsample) +while ((dsl =intel_de_read (display,PIPEDSL (display, pipe))) <= vsample) ;/* * Watch ST00 for an entire scanline
@@ -784,15 +794,15 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe)do { count++;/* Read the ST00 VGA status register */ - st00 =intel_de_read8 (dev_priv, _VGA_MSR_WRITE); + st00 =intel_de_read8 (display, _VGA_MSR_WRITE);if (st00 & (1 <<4 )) detect++; - }while ((intel_de_read (dev_priv,PIPEDSL (dev_priv, pipe)) == dsl)); + }while ((intel_de_read (display,PIPEDSL (display, pipe)) == dsl));/* restore vblank if necessary */ if (restore_vblank) -intel_de_write (dev_priv, -TRANS_VBLANK (dev_priv, cpu_transcoder), +intel_de_write (display, +TRANS_VBLANK (display, cpu_transcoder), vblank);/* * If more than 3/4 of the scanline detected a monitor,
@@ -806,7 +816,7 @@ intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe) }/* Restore previous settings */ -intel_de_write (dev_priv,BCLRPAT (dev_priv, cpu_transcoder), +intel_de_write (display,BCLRPAT (display, cpu_transcoder), save_bclrpat);return status;
@@ -843,6 +853,7 @@ intel_crt_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { +struct intel_display *display =to_intel_display (connector->dev);struct drm_i915_private *dev_priv =to_i915 (connector->dev);struct intel_crt *crt =intel_attached_crt (to_intel_connector (connector));struct intel_encoder *intel_encoder = &crt->base;
@@ -850,7 +861,7 @@ intel_crt_detect(struct drm_connector *connector,intel_wakeref_t wakeref;int status; -drm_dbg_kms (&dev_priv->drm,"[CONNECTOR:%d:%s] force=%d\n" , +drm_dbg_kms (display->drm,"[CONNECTOR:%d:%s] force=%d\n" , connector->base.id, connector->name, force);
@@ -860,7 +871,7 @@ intel_crt_detect(struct drm_connector *connector,if (!intel_display_driver_check_access (dev_priv))return connector->status; -if (dev_priv->display.params.load_detect_test) { +if (display->params.load_detect_test) { wakeref =intel_display_power_get (dev_priv, intel_encoder->power_domain); goto load_detect;
@@ -873,18 +884,18 @@ intel_crt_detect(struct drm_connector *connector, wakeref =intel_display_power_get (dev_priv, intel_encoder->power_domain); -if (I915_HAS_HOTPLUG (dev_priv)) { +if (I915_HAS_HOTPLUG (display)) {/* We can not rely on the HPD pin always being correctly wired * up, for example many KVM do not pass it through, and so * only trust an assertion that the monitor is connected. */ if (intel_crt_detect_hotplug (connector)) { -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"CRT detected via hotplug\n" ); status = connector_status_connected; goto out; }else -drm_dbg_kms (&dev_priv->drm, +drm_dbg_kms (display->drm,"CRT not detected via hotplug\n" ); }
@@ -897,7 +908,7 @@ intel_crt_detect(struct drm_connector *connector,* broken monitor (without edid) to work behind a broken kvm (that fails * to have the right resistors for HP detection) needs to fix this up. * For now just bail out. */ -if (I915_HAS_HOTPLUG (dev_priv)) { +if (I915_HAS_HOTPLUG (display)) { status = connector_status_disconnected; goto out; }
@@ -917,10 +928,10 @@ intel_crt_detect(struct drm_connector *connector, }else {if (intel_crt_detect_ddc (connector)) status = connector_status_connected; -else if (DISPLAY_VER (dev_priv) <4 ) +else if (DISPLAY_VER (display) <4 ) status =intel_crt_load_detect (crt,to_intel_crtc (connector->state->crtc)->pipe); -else if (dev_priv->display.params.load_detect_test) +else if (display->params.load_detect_test) status = connector_status_disconnected;else status = connector_status_unknown;
@@ -966,19 +977,19 @@ static int intel_crt_get_modes(struct drm_connector *connector)void intel_crt_reset (struct drm_encoder *encoder) { -struct drm_i915_private *dev_priv =to_i915 (encoder->dev); +struct intel_display *display =to_intel_display (encoder->dev);struct intel_crt *crt =intel_encoder_to_crt (to_intel_encoder (encoder)); -if (DISPLAY_VER (dev_priv) >=5 ) { +if (DISPLAY_VER (display) >=5 ) {u32 adpa; - adpa =intel_de_read (dev_priv, crt->adpa_reg); + adpa =intel_de_read (display, crt->adpa_reg); adpa &= ~ADPA_CRT_HOTPLUG_MASK ; adpa |=ADPA_HOTPLUG_BITS ; -intel_de_write (dev_priv, crt->adpa_reg, adpa); -intel_de_posting_read (dev_priv, crt->adpa_reg); +intel_de_write (display, crt->adpa_reg, adpa); +intel_de_posting_read (display, crt->adpa_reg); -drm_dbg_kms (&dev_priv->drm,"crt adpa set to 0x%x\n" , adpa); +drm_dbg_kms (display->drm,"crt adpa set to 0x%x\n" , adpa); crt->force_hotplug_required = true; }
@@ -1008,9 +1019,9 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = { .destroy = intel_encoder_destroy, }; -void intel_crt_init (struct drm_i915_private *dev_priv) +void intel_crt_init (struct intel_display *display) { -struct intel_display *display = &dev_priv->display; +struct drm_i915_private *dev_priv =to_i915 (display->drm);struct drm_connector *connector;struct intel_crt *crt;struct intel_connector *intel_connector;
@@ -1025,7 +1036,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)else adpa_reg =ADPA ; - adpa =intel_de_read (dev_priv, adpa_reg); + adpa =intel_de_read (display, adpa_reg);if ((adpa &ADPA_DAC_ENABLE ) ==0 ) {/* * On some machines (some IVB at least) CRT can be
@@ -1035,11 +1046,11 @@ void intel_crt_init(struct drm_i915_private *dev_priv)* take. So the only way to tell is attempt to enable * it and see what happens. */ -intel_de_write (dev_priv, adpa_reg, +intel_de_write (display, adpa_reg, adpa |ADPA_DAC_ENABLE |ADPA_HSYNC_CNTL_DISABLE |ADPA_VSYNC_CNTL_DISABLE ); -if ((intel_de_read (dev_priv, adpa_reg) &ADPA_DAC_ENABLE ) ==0 ) +if ((intel_de_read (display, adpa_reg) &ADPA_DAC_ENABLE ) ==0 )return ; -intel_de_write (dev_priv, adpa_reg, adpa); +intel_de_write (display, adpa_reg, adpa); } crt =kzalloc (sizeof (struct intel_crt ),GFP_KERNEL );
@@ -1052,16 +1063,16 @@ void intel_crt_init(struct drm_i915_private *dev_priv)return ; } - ddc_pin = dev_priv->display.vbt.crt_ddc_pin; + ddc_pin = display->vbt.crt_ddc_pin; connector = &intel_connector->base; crt->connector = intel_connector; -drm_connector_init_with_ddc (&dev_priv->drm, connector, +drm_connector_init_with_ddc (display->drm, connector, &intel_crt_connector_funcs,DRM_MODE_CONNECTOR_VGA ,intel_gmbus_get_adapter (display, ddc_pin)); -drm_encoder_init (&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs, +drm_encoder_init (display->drm, &crt->base.base, &intel_crt_enc_funcs,DRM_MODE_ENCODER_DAC ,"CRT" );intel_connector_attach_encoder (intel_connector, &crt->base);
@@ -1073,14 +1084,14 @@ void intel_crt_init(struct drm_i915_private *dev_priv)else crt->base.pipe_mask = ~0 ; -if (DISPLAY_VER (dev_priv) !=2 ) +if (DISPLAY_VER (display) !=2 ) connector->interlace_allowed = true; crt->adpa_reg = adpa_reg; crt->base.power_domain =POWER_DOMAIN_PORT_CRT ; -if (I915_HAS_HOTPLUG (dev_priv) && +if (I915_HAS_HOTPLUG (display) && !dmi_check_system (intel_spurious_crt_detect)) { crt->base.hpd_pin =HPD_CRT ; crt->base.hotplug = intel_encoder_hotplug;
@@ -1090,7 +1101,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv) } intel_connector->base.polled = intel_connector->polled; -if (HAS_DDI (dev_priv)) { +if (HAS_DDI (display)) {assert_port_valid (dev_priv,PORT_E ); crt->base.port =PORT_E ;
@@ -1134,8 +1145,8 @@ void intel_crt_init(struct drm_i915_private *dev_priv)u32 fdi_config =FDI_RX_POLARITY_REVERSED_LPT |FDI_RX_LINK_REVERSAL_OVERRIDE ; - dev_priv->display.fdi.rx_config =intel_de_read (dev_priv, -FDI_RX_CTL (PIPE_A )) & fdi_config; + display->fdi.rx_config =intel_de_read (display, +FDI_RX_CTL (PIPE_A )) & fdi_config; }intel_crt_reset (&crt->base.base);
drivers/gpu/drm/i915/display/intel_crt.h +5 -5
@@ -10,20 +10,20 @@enum pipe ;struct drm_encoder ; -struct drm_i915_private ; +struct intel_display ;#ifdef I915 -bool intel_crt_port_enabled (struct drm_i915_private *dev_priv, +bool intel_crt_port_enabled (struct intel_display *display,i915_reg_t adpa_reg,enum pipe *pipe); -void intel_crt_init (struct drm_i915_private *dev_priv); +void intel_crt_init (struct intel_display *display);void intel_crt_reset (struct drm_encoder *encoder);#else -static inline bool intel_crt_port_enabled (struct drm_i915_private *dev_priv, +static inline bool intel_crt_port_enabled (struct intel_display *display,i915_reg_t adpa_reg,enum pipe *pipe) {return false; } -static inline void intel_crt_init (struct drm_i915_private *dev_priv) +static inline void intel_crt_init (struct intel_display *display) { }static inline void intel_crt_reset (struct drm_encoder *encoder)
drivers/gpu/drm/i915/display/intel_display.c +6 -6
@@ -7805,7 +7805,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)if (HAS_DDI (dev_priv)) {if (intel_ddi_crt_present (dev_priv)) -intel_crt_init (dev_priv); +intel_crt_init (display);intel_bios_for_each_encoder (display, intel_ddi_init);
@@ -7820,7 +7820,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)* incorrect sharing of the PPS. */ intel_lvds_init (dev_priv); -intel_crt_init (dev_priv); +intel_crt_init (display); dpd_is_edp =intel_dp_is_port_edp (dev_priv,PORT_D );
@@ -7851,7 +7851,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)bool has_edp, has_port;if (IS_VALLEYVIEW (dev_priv) && dev_priv->display.vbt.int_crt_support) -intel_crt_init (dev_priv); +intel_crt_init (display);/* * The DP_DETECTED bit is the latched state of the DDC
@@ -7897,14 +7897,14 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)vlv_dsi_init (dev_priv); }else if (IS_PINEVIEW (dev_priv)) {intel_lvds_init (dev_priv); -intel_crt_init (dev_priv); +intel_crt_init (display); }else if (IS_DISPLAY_VER (dev_priv,3 ,4 )) {bool found = false;if (IS_MOBILE (dev_priv))intel_lvds_init (dev_priv); -intel_crt_init (dev_priv); +intel_crt_init (display);if (intel_de_read (dev_priv,GEN3_SDVOB ) &SDVO_DETECTED ) {drm_dbg_kms (&dev_priv->drm,"probing SDVOB\n" );
@@ -7946,7 +7946,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)if (IS_I85X (dev_priv))intel_lvds_init (dev_priv); -intel_crt_init (dev_priv); +intel_crt_init (display);intel_dvo_init (dev_priv); }
drivers/gpu/drm/i915/display/intel_pch_display.c +1 -1
@@ -86,7 +86,7 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,assert_pch_dp_disabled (dev_priv, pipe,PORT_D ,PCH_DP_D );INTEL_DISPLAY_STATE_WARN (display, -intel_crt_port_enabled (dev_priv,PCH_ADPA , &port_pipe) && port_pipe == pipe, +intel_crt_port_enabled (display,PCH_ADPA , &port_pipe) && port_pipe == pipe,"PCH VGA enabled on transcoder %c, should be disabled\n" ,pipe_name (pipe));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 22/869 net: team: fix NULL pointer dereference in team_xmit during mode change
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <[email protected]>
[ Upstream commit 25fe708bbc59289d3d1ea4b126fbc1b460a072a5 ]
__team_change_mode() clears team->ops with memset() before restoring safe dummy handlers via team_adjust_ops(). A concurrent team_xmit() running under RCU on another CPU can read team->ops.transmit during this window and call a NULL function pointer, crashing the kernel.
The race requires a mode change (CAP_NET_ADMIN) concurrent with transmit on the team device.
BUG: kernel NULL pointer dereference, address: 0000000000000000 Oops: 0010 [#1] SMP KASAN NOPTI RIP: 0010:0x0 Call Trace: team_xmit (drivers/net/team/team_core.c:1853) dev_hard_start_xmit (net/core/dev.c:3904) __dev_queue_xmit (net/core/dev.c:4871) packet_sendmsg (net/packet/af_packet.c:3109) __sys_sendto (net/socket.c:2265)
The original code assumed that no ports means no traffic, so mode changes could freely memset()/memcpy() the ops. AF_PACKET with forced carrier breaks that assumption.
Prevent the race instead of making it safe: replace memset()/memcpy() with per-field updates that never touch transmit or receive. Those two handlers are managed solely by team_adjust_ops(), which already installs dummies when tx_en_port_count == 0 (always true during mode change since no ports are present). WRITE_ONCE/READ_ONCE prevent store/load tearing on the handler pointers.
synchronize_net() before exit_op() drains in-flight readers that may still reference old mode state from before port removal switched the handlers to dummies.
Stable-dep-of: b7454f1940c5 ("net: team: stop reusing skb after queue override")
--- drivers/net/team/team_core.c | 45 +++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-)
drivers/net/team/team_core.c +32 -13
@@ -534,21 +534,23 @@ static void team_adjust_ops(struct team *team)if (!team->en_port_count || !team_is_mode_set (team) || !team->mode->ops->transmit) - team->ops.transmit = team_dummy_transmit; +WRITE_ONCE (team->ops.transmit, team_dummy_transmit);else - team->ops.transmit = team->mode->ops->transmit; +WRITE_ONCE (team->ops.transmit, team->mode->ops->transmit);if (!team->en_port_count || !team_is_mode_set (team) || !team->mode->ops->receive) - team->ops.receive = team_dummy_receive; +WRITE_ONCE (team->ops.receive, team_dummy_receive);else - team->ops.receive = team->mode->ops->receive; +WRITE_ONCE (team->ops.receive, team->mode->ops->receive); }/* -* We can benefit from the fact that it's ensured no port is present -* at the time of mode change. Therefore no packets are in fly so there's no -* need to set mode operations in any special way. +* team_change_mode() ensures no ports are present during mode change, +* but lockless readers can still reach team_xmit(). Avoid touching +* transmit/receive -- they are already set to dummies by +* team_adjust_ops() since no ports are enabled. synchronize_net() +* drains in-flight readers before destroying old mode state. */ static int __team_change_mode (struct team *team,const struct team_mode *new_mode)
@@ -557,9 +559,21 @@ static int __team_change_mode(struct team *team,if (team_is_mode_set (team)) {void (*exit_op)(struct team *team) = team->ops.exit; -/* Clear ops area so no callback is called any longer */ -memset (&team->ops,0 ,sizeof (struct team_mode_ops )); -team_adjust_ops (team); +/* Clear cold-path ops used only under RTNL. transmit and +* receive are already dummies (no ports) so leave them +* alone -- overwriting them is the source of the race. +*/ + team->ops.init =NULL ; + team->ops.exit =NULL ; + team->ops.port_enter =NULL ; + team->ops.port_leave =NULL ; + team->ops.port_change_dev_addr =NULL ; + team->ops.port_tx_disabled =NULL ; + +/* Wait for in-flight readers before tearing down mode +* state they may reference. +*/ +synchronize_net ();if (exit_op)exit_op (team);
@@ -582,7 +596,12 @@ static int __team_change_mode(struct team *team, } team->mode = new_mode; -memcpy (&team->ops, new_mode->ops,sizeof (struct team_mode_ops )); + team->ops.init = new_mode->ops->init; + team->ops.exit = new_mode->ops->exit; + team->ops.port_enter = new_mode->ops->port_enter; + team->ops.port_leave = new_mode->ops->port_leave; + team->ops.port_change_dev_addr = new_mode->ops->port_change_dev_addr; + team->ops.port_tx_disabled = new_mode->ops->port_tx_disabled;team_adjust_ops (team);return 0 ;
@@ -743,7 +762,7 @@ static rx_handler_result_t team_handle_frame(struct sk_buff **pskb)/* allow exact match delivery for disabled ports */ res =RX_HANDLER_EXACT ; }else { - res = team->ops.receive (team, port, skb); + res =READ_ONCE (team->ops.receive)(team, port, skb); }if (res ==RX_HANDLER_ANOTHER ) {struct team_pcpu_stats *pcpu_stats;
@@ -1736,7 +1755,7 @@ static netdev_tx_t team_xmit(struct sk_buff *skb, struct net_device *dev) tx_success =team_queue_override_transmit (team, skb);if (!tx_success) - tx_success = team->ops.transmit (team, skb); + tx_success =READ_ONCE (team->ops.transmit)(team, skb);if (tx_success) {struct team_pcpu_stats *pcpu_stats;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 58/869 drm/i915: Grab intel_display from the encoder to avoid potential oopsies
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
[ Upstream commit dc3806d9eb66d0105f8d55d462d4ef681d9eac59 ]
Grab the intel_display from 'encoder' rather than 'state' in the encoder hooks to avoid the massive footgun that is intel_sanitize_encoder(), which passes NULL as the 'state' argument to encoder .disable() and .post_disable().
TODO: figure out how to actually fix intel_sanitize_encoder()...
--- drivers/gpu/drm/i915/display/intel_crt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_crt.c +5 -5
@@ -244,7 +244,7 @@ static void hsw_disable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct intel_display *display = to_intel_display(state); + struct intel_display *display = to_intel_display(encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);drm_WARN_ON (display->drm, !old_crtc_state->has_pch_encoder);
@@ -257,7 +257,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct intel_display *display = to_intel_display(state); + struct intel_display *display = to_intel_display(encoder);struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);
@@ -287,7 +287,7 @@ static void hsw_pre_pll_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct intel_display *display = to_intel_display(state); + struct intel_display *display = to_intel_display(encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);drm_WARN_ON (display->drm, !crtc_state->has_pch_encoder);
@@ -300,7 +300,7 @@ static void hsw_pre_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct intel_display *display = to_intel_display(state); + struct intel_display *display = to_intel_display(encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;
@@ -319,7 +319,7 @@ static void hsw_enable_crt(struct intel_atomic_state *state,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct intel_display *display = to_intel_display(state); + struct intel_display *display = to_intel_display(encoder);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 59/869 ax25: Remove broken autobind
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
[ Upstream commit 2f6efbabceb6b2914ee9bafb86d9a51feae9cce8 ]
Binding AX25 socket by using the autobind feature leads to memory leaks in ax25_connect() and also refcount leaks in ax25_release(). Memory leak was detected with kmemleak:
================================================================
unreferenced object 0xffff8880253cd680 (size 96):
backtrace:__kmalloc_node_track_caller_noprof (./include/linux/kmemleak.h:43) kmemdup_noprof (mm/util.c:136)ax25_rt_autobind (net/ax25/ax25_route.c:428)ax25_connect (net/ax25/af_ax25.c:1282)__sys_connect_file (net/socket.c:2045)__sys_connect (net/socket.c:2064)__x64_sys_connect (net/socket.c:2067)do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
================================================================
When socket is bound, refcounts must be incremented the way it is done in ax25_bind() and ax25_setsockopt() (SO_BINDTODEVICE). In case of autobind, the refcounts are not incremented.
This bug leads to the following issue reported by Syzkaller:
================================================================ax25_connect(): syz-executor318 uses autobind, please contact [email protected]
------------[ cut here ]------------ refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 0 PID: 5317 at lib/refcount.c:31 refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:31 Modules linked in: CPU: 0 UID: 0 PID: 5317 Comm: syz-executor318 Not tainted 6.14.0-rc4-syzkaller-00278-gece144f151ac #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:31 ... Call Trace: <TASK> __refcount_dec include/linux/refcount.h:336 [inline] refcount_dec include/linux/refcount.h:351 [inline] ref_tracker_free+0x6af/0x7e0 lib/ref_tracker.c:236 netdev_tracker_free include/linux/netdevice.h:4302 [inline] netdev_put include/linux/netdevice.h:4319 [inline] ax25_release+0x368/0x960 net/ax25/af_ax25.c:1080 __sock_release net/socket.c:647 [inline] sock_close+0xbc/0x240 net/socket.c:1398 __fput+0x3e9/0x9f0 fs/file_table.c:464 __do_sys_close fs/open.c:1580 [inline] __se_sys_close fs/open.c:1565 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1565 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... </TASK> ================================================================
Considering the issues above and the comments left in the code that say:
"check if we can remove this feature. It is broken."; "autobinding in this may or may not work"; - it is better to completely remove this feature than to fix it because it is broken and leads to various kinds of memory bugs.
Now calling connect() without first binding socket will result in an error (-EINVAL). Userspace software that relies on the autobind feature might get broken. However, this feature does not seem widely used with this specific driver as it was not reliable at any point of time, and it is already broken anyway. E.g. ax25-tools and ax25-apps packages for popular distributions do not use the autobind feature for AF_AX25.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- include/net/ax25.h | 1 - net/ax25/af_ax25.c | 30 ++++++------------ net/ax25/ax25_route.c | 74 ------------------------------------------- 3 files changed, 10 insertions(+), 95 deletions(-)
include/net/ax25.h +0 -1
@@ -418,7 +418,6 @@ void ax25_rt_device_down(struct net_device *);int ax25_rt_ioctl (unsigned int ,void __user *);extern const struct seq_operations ax25_rt_seqops;ax25_route *ax25_get_route (ax25_address *addr,struct net_device *dev); -int ax25_rt_autobind (ax25_cb *,ax25_address *);struct sk_buff *ax25_rt_build_path (struct sk_buff *,ax25_address *,ax25_address *,ax25_digi *);void ax25_rt_free (void );
net/ax25/af_ax25.c +10 -20
@@ -1270,28 +1270,18 @@ static int __must_check ax25_connect(struct socket *sock, } } -/* -* Must bind first - autobinding in this may or may not work. If -* the socket is already bound, check to see if the device has -* been filled in, error if it hasn't. -*/ +/* Must bind first - autobinding does not work. */ if (sock_flag (sk,SOCK_ZAPPED )) { -/* check if we can remove this feature. It is broken. */ -printk (KERN_WARNING "ax25_connect(): %s uses autobind, please contact [email protected]\n" , - current->comm); -if ((err =ax25_rt_autobind (ax25, &fsa->fsa_ax25.sax25_call)) <0 ) { -kfree (digi); - goto out_release; - } +kfree (digi); + err = -EINVAL ; + goto out_release; + } -ax25_fillin_cb (ax25, ax25->ax25_dev); -ax25_cb_add (ax25); - }else { -if (ax25->ax25_dev ==NULL ) { -kfree (digi); - err = -EHOSTUNREACH ; - goto out_release; - } +/* Check to see if the device has been filled in, error if it hasn't. */ +if (ax25->ax25_dev ==NULL ) { +kfree (digi); + err = -EHOSTUNREACH ; + goto out_release; } if (sk->sk_type == SOCK_SEQPACKET &&
net/ax25/ax25_route.c +0 -74
80 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 60/869 f2fs: quota: fix to avoid warning in dquot_writeback_dquots()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit eb85c2410d6f581e957cd03a644ff6ddbe592af9 ]
F2FS-fs (dm-59): checkpoint=enable has some unwritten data.
------------[ cut here ]------------ WARNING: CPU: 6 PID: 8013 at fs/quota/dquot.c:691 dquot_writeback_dquots+0x2fc/0x308 pc : dquot_writeback_dquots+0x2fc/0x308 lr : f2fs_quota_sync+0xcc/0x1c4 Call trace: dquot_writeback_dquots+0x2fc/0x308 f2fs_quota_sync+0xcc/0x1c4 f2fs_write_checkpoint+0x3d4/0x9b0 f2fs_issue_checkpoint+0x1bc/0x2c0 f2fs_sync_fs+0x54/0x150 f2fs_do_sync_file+0x2f8/0x814 __f2fs_ioctl+0x1960/0x3244 f2fs_ioctl+0x54/0xe0 __arm64_sys_ioctl+0xa8/0xe4 invoke_syscall+0x58/0x114
checkpoint and f2fs_remount may race as below, resulting triggering warning in dquot_writeback_dquots().
atomic write remount
- do_remount
- down_write(&sb->s_umount);
- f2fs_remount
- ioctl
- f2fs_do_sync_file
- f2fs_sync_fs
- f2fs_write_checkpoint
- block_operations
- locked = down_read_trylock(&sbi->sb->s_umount)
: fail to lock due to the write lock was held by remount
- up_write(&sb->s_umount);
- f2fs_quota_sync
- dquot_writeback_dquots
- WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount))
: trigger warning because s_umount lock was unlocked by remount
If checkpoint comes from mount/umount/remount/freeze/quotactl, caller of checkpoint has already held s_umount lock, calling dquot_writeback_dquots() in the context should be safe.
So let's record task to sbi->umount_lock_holder, so that checkpoint can know whether the lock has held in the context or not by checking current w/ it.
In addition, in order to not misrepresent caller of checkpoint, we should not allow to trigger async checkpoint for those callers: mount/umount/remount/ freeze/quotactl.
--- fs/f2fs/checkpoint.c | 15 ++++++---- fs/f2fs/f2fs.h | 3 +- fs/f2fs/super.c | 65 ++++++++++++++++++++++++++++++++++---------- 3 files changed, 61 insertions(+), 22 deletions(-)
fs/f2fs/checkpoint.c +9 -6
@@ -1249,7 +1249,7 @@ static int block_operations(struct f2fs_sb_info *sbi) retry_flush_quotas:f2fs_lock_all (sbi);if (__need_flush_quota (sbi)) { -int locked; +bool need_lock = sbi->umount_lock_holder != current;if (++cnt >DEFAULT_RETRY_QUOTA_FLUSH_COUNT ) {set_sbi_flag (sbi,SBI_QUOTA_SKIP_FLUSH );
@@ -1258,11 +1258,13 @@ static int block_operations(struct f2fs_sb_info *sbi) }f2fs_unlock_all (sbi); -/* only failed during mount/umount/freeze/quotactl */ - locked =down_read_trylock (&sbi->sb->s_umount); -f2fs_quota_sync (sbi->sb,-1 ); -if (locked) +/* don't grab s_umount lock during mount/umount/remount/freeze/quotactl */ +if (!need_lock) { +f2fs_do_quota_sync (sbi->sb,-1 ); + }else if (down_read_trylock (&sbi->sb->s_umount)) { +f2fs_do_quota_sync (sbi->sb,-1 );up_read (&sbi->sb->s_umount); + }cond_resched (); goto retry_flush_quotas; }
@@ -1870,7 +1872,8 @@ int f2fs_issue_checkpoint(struct f2fs_sb_info *sbi)struct cp_control cpc; cpc.reason =__get_cp_reason (sbi); -if (!test_opt (sbi,MERGE_CHECKPOINT ) || cpc.reason !=CP_SYNC ) { +if (!test_opt (sbi,MERGE_CHECKPOINT ) || cpc.reason !=CP_SYNC || + sbi->umount_lock_holder == current) {int ret;f2fs_down_write (&sbi->gc_lock);
fs/f2fs/f2fs.h +2 -1
@@ -1708,6 +1708,7 @@ struct f2fs_sb_info {unsigned int nquota_files;/* # of quota sysfile */ struct f2fs_rwsem quota_sem;/* blocking cp for flags */ +struct task_struct *umount_lock_holder;/* s_umount lock holder */ /* # of pages, see count_type */ atomic_t nr_pages[NR_COUNT_TYPE ];
@@ -3728,7 +3729,7 @@ int f2fs_inode_dirtied(struct inode *inode, bool sync);void f2fs_inode_synced (struct inode *inode);int f2fs_dquot_initialize (struct inode *inode);int f2fs_enable_quota_files (struct f2fs_sb_info *sbi,bool rdonly); -int f2fs_quota_sync (struct super_block *sb,int type); +int f2fs_do_quota_sync (struct super_block *sb,int type);loff_t max_file_blocks (struct inode *inode);void f2fs_quota_off_umount (struct super_block *sb);void f2fs_save_errors (struct f2fs_sb_info *sbi,unsigned char flag);
fs/f2fs/super.c +50 -15
183 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 61/869 RISC-V: KVM: Teardown riscv specific bits after kvm_exit
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Atish Patra <[email protected]>
[ Upstream commit 2d117e67f318303f6ab699a5511d1fac3f170545 ]
During a module removal, kvm_exit invokes arch specific disable call which disables AIA. However, we invoke aia_exit before kvm_exit resulting in the following warning. KVM kernel module can't be inserted afterwards due to inconsistent state of IRQ.
[25469.031389] percpu IRQ 31 still enabled on CPU0! [25469.031732] WARNING: CPU: 3 PID: 943 at kernel/irq/manage.c:2476 __free_percpu_irq+0xa2/0x150 [25469.031804] Modules linked in: kvm(-) [25469.031848] CPU: 3 UID: 0 PID: 943 Comm: rmmod Not tainted 6.14.0-rc5-06947-g91c763118f47-dirty #2 [25469.031905] Hardware name: riscv-virtio,qemu (DT) [25469.031928] epc : __free_percpu_irq+0xa2/0x150 [25469.031976] ra : __free_percpu_irq+0xa2/0x150 [25469.032197] epc : ffffffff8007db1e ra : ffffffff8007db1e sp : ff2000000088bd50 [25469.032241] gp : ffffffff8131cef8 tp : ff60000080b96400 t0 : ff2000000088baf8 [25469.032285] t1 : fffffffffffffffc t2 : 5249207570637265 s0 : ff2000000088bd90 [25469.032329] s1 : ff60000098b21080 a0 : 037d527a15eb4f00 a1 : 037d527a15eb4f00 [25469.032372] a2 : 0000000000000023 a3 : 0000000000000001 a4 : ffffffff8122dbf8 [25469.032410] a5 : 0000000000000fff a6 : 0000000000000000 a7 : ffffffff8122dc10 [25469.032448] s2 : ff60000080c22eb0 s3 : 0000000200000022 s4 : 000000000000001f [25469.032488] s5 : ff60000080c22e00 s6 : ffffffff80c351c0 s7 : 0000000000000000 [25469.032582] s8 : 0000000000000003 s9 : 000055556b7fb490 s10: 00007ffff0e12fa0 [25469.032621] s11: 00007ffff0e13e9a t3 : ffffffff81354ac7 t4 : ffffffff81354ac7 [25469.032664] t5 : ffffffff81354ac8 t6 : ffffffff81354ac7 [25469.032698] status: 0000000200000100 badaddr: ffffffff8007db1e cause: 0000000000000003 [25469.032738] [<ffffffff8007db1e>] __free_percpu_irq+0xa2/0x150 [25469.032797] [<ffffffff8007dbfc>] free_percpu_irq+0x30/0x5e [25469.032856] [<ffffffff013a57dc>] kvm_riscv_aia_exit+0x40/0x42 [kvm] [25469.033947] [<ffffffff013b4e82>] cleanup_module+0x10/0x32 [kvm] [25469.035300] [<ffffffff8009b150>] __riscv_sys_delete_module+0x18e/0x1fc [25469.035374] [<ffffffff8000c1ca>] syscall_handler+0x3a/0x46 [25469.035456] [<ffffffff809ec9a4>] do_trap_ecall_u+0x72/0x134 [25469.035536] [<ffffffff809f5e18>] handle_exception+0x148/0x156
Invoke aia_exit and other arch specific cleanup functions after kvm_exit so that disable gets a chance to be called first before exit.
--- arch/riscv/kvm/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kvm/main.c +2 -2
@@ -117,8 +117,8 @@ module_init(riscv_kvm_init); static void __exit riscv_kvm_exit(void) { -kvm_riscv_aia_exit (); -kvm_exit (); + +kvm_riscv_aia_exit (); }module_exit (riscv_kvm_exit);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 62/869 wifi: ath12k: fix struct hal_rx_phyrx_rssi_legacy_info
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kang Yang <[email protected]>
[ Upstream commit 04f33114af00317dc3c494e60a7c42292e0ffd7e ]
Current struct hal_rx_phyrx_rssi_legacy_info in hal_rx.h is not matched with hardware descriptor definition. This hardware descriptor definition is determined by hardware. Host shall follow it.
So update struct hal_rx_phyrx_rssi_legacy_info and related code.
Both QCN9274 and WCN7850 need this modification.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
Stable-dep-of: ecfc13138992 ("wifi: ath12k: Avoid memory leak while enabling statistics")
--- drivers/net/wireless/ath/ath12k/dp_mon.c | 25 ++++++------------------ drivers/net/wireless/ath/ath12k/hal_rx.h | 9 ++++++--- 2 files changed, 12 insertions(+), 22 deletions(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +6 -19
@@ -731,33 +731,20 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,case HAL_PHYRX_RSSI_LEGACY : {struct hal_rx_phyrx_rssi_legacy_info *rssi = (struct hal_rx_phyrx_rssi_legacy_info *)tlv_data; -u32 reception_type =0 ; -u32 rssi_legacy_info =__le32_to_cpu (rssi->rsvd[0 ]); info[0 ] =__le32_to_cpu (rssi->info0); + info[1 ] =__le32_to_cpu (rssi->info1);/* TODO: Please note that the combined rssi will not be accurate * in MU case. Rssi in MU needs to be retrieved from * PHYRX_OTHER_RECEIVE_INFO TLV. */ ppdu_info->rssi_comb = -u32_get_bits (info[0 ], -HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB ); - reception_type = -u32_get_bits (rssi_legacy_info, -HAL_RX_PHYRX_RSSI_LEGACY_INFO_RSVD1_RECEPTION ); - -switch (reception_type) { -case HAL_RECEPTION_TYPE_ULOFMDA : - ppdu_info->reception_type =HAL_RX_RECEPTION_TYPE_MU_OFDMA ; -break ; -case HAL_RECEPTION_TYPE_ULMIMO : - ppdu_info->reception_type =HAL_RX_RECEPTION_TYPE_MU_MIMO ; -break ; -default : - ppdu_info->reception_type =HAL_RX_RECEPTION_TYPE_SU ; -break ; - } +u32_get_bits (info[1 ], +HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO1_RSSI_COMB ); + + ppdu_info->bw =u32_get_bits (info[0 ], +HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RX_BW );break ; }case HAL_RXPCU_PPDU_END_INFO : {
drivers/net/wireless/ath/ath12k/hal_rx.h +6 -3
@@ -437,12 +437,15 @@ enum hal_rx_ul_reception_type { HAL_RECEPTION_TYPE_FRAMELESS }; -#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB GENMASK(15, 8) -#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_RSVD1_RECEPTION GENMASK(3, 0) +#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RECEPTION GENMASK(3, 0) +#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RX_BW GENMASK(7, 5) +#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO1_RSSI_COMB GENMASK(15, 8)struct hal_rx_phyrx_rssi_legacy_info { -__le32 rsvd[35 ];__le32 info0; +__le32 rsvd0[39 ]; +__le32 info1; +__le32 rsvd1; } __packed;#define HAL_RX_MPDU_START_INFO0_PPDU_ID GENMASK(31, 16)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 63/869 wifi: ath12k: fix incorrect TID updation in DP monitor status path
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthikeyan Periyasamy <[email protected]>
[ Upstream commit ebee84cc961cd3947015efbf4a5dbea63b11c5d3 ]
Currently, an incorrect TID value gets populated in the monitor status Rx path due to an incorrect bitmap value given to the ffs() built-in helper function. Therefore, avoid the decrement and directly provide the TID bitmap to the ffs() built-in helper function for the correct TID update in the monitor status Rx path.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Stable-dep-of: ecfc13138992 ("wifi: ath12k: Avoid memory leak while enabling statistics")
--- drivers/net/wireless/ath/ath12k/dp_mon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +4 -4
@@ -612,6 +612,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,case HAL_RX_PPDU_END_USER_STATS : {struct hal_rx_ppdu_end_user_stats *eu_stats = (struct hal_rx_ppdu_end_user_stats *)tlv_data; +u32 tid_bitmap; info[0 ] =__le32_to_cpu (eu_stats->info0); info[1 ] =__le32_to_cpu (eu_stats->info1);
@@ -624,10 +625,9 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,u32_get_bits (info[2 ],HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX ); ppdu_info->fc_valid =u32_get_bits (info[1 ],HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID ); - ppdu_info->tid = -ffs (u32_get_bits (info[6 ], -HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP ) - -1 ); + tid_bitmap =u32_get_bits (info[6 ], +HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP ); + ppdu_info->tid =ffs (tid_bitmap) -1 ; ppdu_info->tcp_msdu_count =u32_get_bits (info[4 ],HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 23/869 net: team: stop reusing skb after queue override
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <[email protected]>
[ Upstream commit b7454f1940c5e6d92e753853c476a769e452f30a ]
A nonzero dev_queue_xmit() result does not return ownership of the skb. When an override port's qdisc drops it, the queue override helper used to try another port or the mode transmit op with the freed skb.
Return the handoff decision separately from transmit success. Select only the first override port under RCU and stop after handing it the skb, regardless of the lower transmit result. Keep the existing success and drop accounting.
BUG: KASAN: slab-use-after-free in sk_skb_reason_drop Write of size 4 by task poc/5040 sk_skb_reason_drop (net/core/skbuff.c:1240) dev_kfree_skb_any_reason (net/core/dev.c:3470) ab_transmit (drivers/net/team/team_mode_activebackup.c:49) team_xmit (drivers/net/team/team_core.c:1849) __dev_direct_xmit (net/core/dev.c:4934) Freed by task 5040: __tcf_kfree_skb_list (net/sched/sch_generic.c:43) __dev_queue_xmit (net/core/dev.c:4831) team_xmit (drivers/net/team/team_core.c:1846) Kernel panic - not syncing: KASAN: panic_on_warn set ...
--- drivers/net/team/team_core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/team/team_core.c +8 -8
@@ -821,7 +821,8 @@ static struct list_head *__team_get_qom_list(struct team *team, u16 queue_id)/* * note: already called with rcu_read_lock */ -static bool team_queue_override_transmit (struct team *team,struct sk_buff *skb) +static bool team_queue_override_transmit (struct team *team,struct sk_buff *skb, +bool *tx_success) {struct list_head *qom_list;struct team_port *port;
@@ -829,11 +830,11 @@ static bool team_queue_override_transmit(struct team *team, struct sk_buff *skb)if (!team->queue_override_enabled || !skb->queue_mapping)return false; qom_list =__team_get_qom_list (team, skb->queue_mapping); -list_for_each_entry_rcu (port, qom_list, qom_list) { -if (!team_dev_queue_xmit (team, port, skb)) -return true; - } -return false; + port = list_first_or_null_rcu(qom_list, struct team_port, qom_list); +if (!port) +return false; + *tx_success = !team_dev_queue_xmit (team, port, skb); +return true; } static void __team_queue_override_port_del(struct team *team,
@@ -1753,8 +1754,7 @@ static netdev_tx_t team_xmit(struct sk_buff *skb, struct net_device *dev)bool tx_success;unsigned int len = skb->len; - tx_success =team_queue_override_transmit (team, skb); -if (!tx_success) +if (!team_queue_override_transmit (team, skb, &tx_success)) tx_success =READ_ONCE (team->ops.transmit)(team, skb);if (tx_success) {struct team_pcpu_stats *pcpu_stats;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 24/869 sched_ext: Fix CPU hotplug hang when a dying CPUs tasks sit in the BPF scheduler
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
[ Upstream commit d35a535d3e3e71f92a051d94e415f43612c4edfc ]
A CPU going down has to empty its own rq. Its hotplug thread waits in sched_cpu_wait_empty() until nothing else is left, and the only thing that wakes it is balance_push(), which runs from __schedule() on the dying CPU and pushes off the migratable tasks the CPU picks.
sched_ext breaks this. A task sitting on a user DSQ or held by the BPF scheduler is still counted on its rq, but an inactive CPU no longer calls ops.dispatch() and can't pull the task back. The dying CPU goes idle with the task still counted, and one of two things happens:
- Another CPU consumes the task. The rq empties without a __schedule() on the dying CPU, so the hotplug thread is never woken and cpu_down() hangs holding cpu_hotplug_lock.
- The task is affine only to the dying CPU. Nothing can move it, and the offline stalls until the watchdog ejects the BPF scheduler.
When the rq goes offline, re-enqueue every task on it that isn't already on the local DSQ. An enqueue on an offline rq lands on the local DSQ, so the dying CPU itself picks the tasks and balance_push() pushes them off, the same as for the other sched classes. From then on no sched_ext path on another CPU can pull a task off the rq.
ops.dispatch() currently stops as soon as the CPU goes inactive, and CPU hotplug then waits for an RCU grace period before taking the rq offline. A BPF-held task affine only to the dying CPU and preempted inside an RCU read-side critical section would block that grace period, and the rq would never go offline. Test SCX_RQ_ONLINE directly so that ops.dispatch() keeps running until the rq goes offline. Only the dying CPU's own hotplug thread clears the flag during teardown, and task_can_run_on_remote_rq() still keeps other rqs' tasks off the CPU.
--- kernel/sched/ext.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-)
kernel/sched/ext.c +30 -3
@@ -2113,8 +2113,8 @@ static void set_task_runnable(struct rq *rq, struct task_struct *p) }/* -* list_add_tail() must be used. scx_ops_bypass() depends on tasks being -* appened to the runnable_list. +* list_add_tail() must be used. scx_ops_bypass() and rq_offline_scx() +* depend on tasks being appended to the runnable_list. */ list_add_tail (&p->scx.runnable_node, &rq->scx.runnable_list); }
@@ -2823,7 +2823,14 @@ static int balance_one(struct rq *rq, struct task_struct *prev)if (consume_global_dsq (rq)) goto has_tasks; -if (!SCX_HAS_OP (dispatch) ||scx_rq_bypassing (rq) || !scx_rq_online (rq)) +/* +* scx_rq_online() can't be used. Its cpu_active() test goes false +* before CPU hotplug waits for an RCU grace period, and +* rq_offline_scx() moves this CPU's tasks to the local DSQ only after +* the wait. The grace period can depend on those tasks running. +*/ +if (!SCX_HAS_OP (dispatch) ||scx_rq_bypassing (rq) || + !(rq->scx.flags &SCX_RQ_ONLINE )) goto no_tasks; dspc->rq = rq;
@@ -3514,7 +3521,27 @@ static void rq_online_scx(struct rq *rq)static void rq_offline_scx (struct rq *rq) { +struct task_struct *p, *n; + rq->scx.flags &= ~SCX_RQ_ONLINE ; + +/* sched domain rebuilds call rq_offline with the CPU staying alive */ +if (cpu_active (cpu_of (rq))) +return ; + +/* +* An offline CPU no longer calls ops.dispatch(). Re-enqueue its tasks +* onto the local DSQ so that they run here and balance_push() moves +* them off. +*/ +list_for_each_entry_safe_reverse (p, n, &rq->scx.runnable_list, scx.runnable_node) { +struct sched_enq_and_set_ctx ctx; + +if (p->scx.dsq == &rq->scx.local_dsq) +continue ; +sched_deq_and_put_task (p,DEQUEUE_SAVE |DEQUEUE_MOVE |DEQUEUE_NOCLOCK , &ctx); +sched_enq_and_set_task (&ctx); + } }#else /* CONFIG_SMP */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 25/869 Bluetooth: hci_sync: Fix command skb lifetime during scan setup
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <[email protected]>
[ Upstream commit 9af12272061d206af8bc3e40215cb694421ab73a ]
During PA sync scan setup, hci_le_set_ext_scan_param_sync() gets the address used for the PA_LINK lookup from hci_sent_cmd_data(). The returned pointer borrows storage from sent_cmd or req_skb, without holding a reference to either skb.
The scan worker runs on req_workqueue while hci_cmd_work() runs on the separate device workqueue. After the scan worker loads sent_cmd, the command worker can free and replace it before hci_sent_cmd_data() dereferences the skb. The command payload can also be freed between returning from the helper and comparing the address. The connection lookup's RCU critical section does not protect the command skb.
KASAN reported:
BUG: KASAN: slab-use-after-free in hci_sent_cmd_data+0x27c/0x2f0 Workqueue: hci0 hci_cmd_sync_work Call Trace: hci_sent_cmd_data+0x27c/0x2f0 hci_le_set_scan_param_sync+0x43a/0x850 hci_passive_scan_sync+0xb09/0x1460 hci_update_passive_scan_sync+0x47c/0x6e0 hci_le_pa_create_sync+0x200/0xa70 hci_cmd_sync_work+0x13c/0x290 Allocated by task 95: skb_clone+0x13f/0x340 hci_cmd_work+0x2a9/0x7e0 Freed by task 95: kmem_cache_free+0xba/0x3a0 hci_cmd_work+0x29c/0x7e0
Use hdev->lock to serialize the address snapshot with sent_cmd replacement. Protect req_skb replacement and completion cleanup with the same lock because the helper falls back to that skb. Copy the address before releasing the lock and use the copy for the existing RCU-protected connection lookup. Release the mutex before sending or waiting for commands, preserving the lookup and completion ordering.
--- net/bluetooth/hci_core.c | 4 ++++ net/bluetooth/hci_sync.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)
net/bluetooth/hci_core.c +4 -0
@@ -4155,9 +4155,11 @@ static int hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb)bt_dev_dbg (hdev,"skb %p" , skb); +hci_dev_lock (hdev);kfree_skb (hdev->sent_cmd); hdev->sent_cmd =skb_clone (skb,GFP_KERNEL ); +hci_dev_unlock (hdev);if (!hdev->sent_cmd) {skb_queue_head (&hdev->cmd_q, skb);queue_work (hdev->workqueue, &hdev->cmd_work);
@@ -4178,8 +4180,10 @@ static int hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb)if (READ_ONCE (hdev->req_status) ==HCI_REQ_PEND && !hci_dev_test_and_set_flag (hdev,HCI_CMD_PENDING )) { +hci_dev_lock (hdev);kfree_skb (hdev->req_skb); hdev->req_skb =skb_get (hdev->sent_cmd); +hci_dev_unlock (hdev); }return err;
net/bluetooth/hci_sync.c +9 -1
@@ -32,8 +32,10 @@ static void hci_cmd_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode,WRITE_ONCE (hdev->req_status,HCI_REQ_DONE );/* Free the request command so it is not used as response */ +hci_dev_lock (hdev);kfree_skb (hdev->req_skb); hdev->req_skb =NULL ; +hci_dev_unlock (hdev);if (skb) {struct sock *sk =hci_skb_sk (skb);
@@ -3058,13 +3060,19 @@ static int hci_le_set_ext_scan_param_sync(struct hci_dev *hdev, u8 type,*/ if (hci_dev_test_flag (hdev,HCI_PA_SYNC )) {struct hci_cp_le_add_to_accept_list *sent; +bdaddr_t bdaddr; +hci_dev_lock (hdev); sent =hci_sent_cmd_data (hdev,HCI_OP_LE_ADD_TO_ACCEPT_LIST ); +if (sent) +bacpy (&bdaddr, &sent->bdaddr); +hci_dev_unlock (hdev); +if (sent) {struct hci_conn *conn; conn =hci_conn_hash_lookup_ba (hdev,PA_LINK , - &sent->bdaddr); + &bdaddr);if (conn) {struct bt_iso_qos *qos = &conn->iso_qos;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 26/869 Bluetooth: RFCOMM: connect the session socket without rfcomm_mutex
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Gavrilov <[email protected]>
[ Upstream commit ac022970e9fb0a5f7e7d1f6c8e104c1ed924dd1c ]
An RFCOMM connect() issued while a BR/EDR link is being authenticated makes lockdep report a circular dependency, and the reported cycle is a real AB/BA between rfcomm_mutex and hdev->lock.
rfcomm_security_cfm() is called from the HCI event path, which already holds hdev->lock:
hci_rx_work()
hci_event_packet()
hci_cc_read_enc_key_size() [hdev->lock]
hci_encrypt_cfm() [hci_cb_list_lock]
rfcomm_security_cfm() [rfcomm_mutex]while an RFCOMM connect() from userspace takes the same two locks the other way round:
rfcomm_sock_connect()
rfcomm_dlc_open() [rfcomm_mutex]
__rfcomm_dlc_open()
rfcomm_session_create()
kernel_connect()
l2cap_sock_connect()
l2cap_chan_connect() [hdev->lock] WARNING: possible circular locking dependency detected kworker/u131:1/1128 is trying to acquire lock:
rfcomm_mutex, at: rfcomm_security_cfm+0x31/0x3e0 [rfcomm] but task is already holding lock:
hci_cb_list_lock, at: hci_cc_read_enc_key_size+0x1d2/0xcc0
Chain exists of:
rfcomm_mutex --> &hdev->lock --> hci_cb_list_lockhci_auth_complete_evt() and hci_encrypt_change_evt() reach the callback the same way.
Both orders have to be seen in the same boot, which is why a BR/EDR connection alone is not enough to show it: a session set up by the remote side is created by rfcomm_accept_connection() in krfcommd, which calls kernel_accept() and never takes hdev->lock under rfcomm_mutex. Connecting a device that authenticates and encrypts the link and then calling connect() on an RFCOMM socket towards any address - the connect does not have to succeed, the order is recorded before the page timeout
- reports it every time.
Only the session socket has to be connected with the lock held, and it does not: nothing else can see the socket before it is put on the session list. So connect it first and take rfcomm_mutex afterwards, which removes the rfcomm_mutex -> hdev->lock order for good, rather than keeping the HCI event path out of rfcomm_mutex.
rfcomm_session_create() becomes rfcomm_session_connect(), which returns the connected socket without touching the session list, and rfcomm_dlc_open() adds the session once it holds the lock again. If another opener added a session for the same pair while this socket was connecting, that session is used and this socket is dropped. __rfcomm_dlc_open() now takes the session it should use, and its state check runs after the lock is re-acquired, so a DLC that was opened or closed in the meantime is still handled.
Over an existing ACL link the connection can complete before the session reaches the list, and the wakeup from the socket callback is then lost, so krfcommd is woken once the session is visible.
Connecting without the lock opens a window in which the socket can be closed. The DLC is not on a session yet, so rfcomm_dlc_close() finds nothing to do and returns without touching it, and rfcomm_dlc_open() would then attach a DLC whose owner is gone. rfcomm_dlc_close() now marks such a DLC with RFCOMM_CLOSED, and rfcomm_dlc_open() checks the mark once it holds rfcomm_mutex again and drops the socket instead of attaching the DLC. The mark is cleared when an open starts, so a DLC that is reused is not affected. This covers both callers of rfcomm_dlc_open(), the socket and the tty layer.
--- include/net/bluetooth/rfcomm.h | 1 + net/bluetooth/rfcomm/core.c | 134 +++++++++++++++++++++++---------- 2 files changed, 96 insertions(+), 39 deletions(-)
include/net/bluetooth/rfcomm.h +1 -0
@@ -210,6 +210,7 @@ struct rfcomm_dlc {#define RFCOMM_AUTH_REJECT 7#define RFCOMM_DEFER_SETUP 8#define RFCOMM_ENC_DROP 9 +#define RFCOMM_CLOSED 10/* Scheduling flags and events */ #define RFCOMM_SCHED_WAKEUP 31
net/bluetooth/rfcomm/core.c +95 -39
191 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 27/869 drm/vmwgfx: Stop using dev_private to store driver data.
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maaz Mombasawala <[email protected]>
[ Upstream commit 1b1d5fe66ca591d34c5501aab8f5f09f347e8a3e ]
Currently vmwgfx uses the dev_private opaque pointer in drm_device to store driver data in vmw_private struct. Using dev_private is deprecated, and the recommendation is to embed struct drm_device in the larger per-device structure.
The vmwgfx driver already embeds struct drm_device in its struct vmw_private, so switch to using that exclusively and stop using dev_private.
Stable-dep-of: 21bc51cb89ce ("drm/vmwgfx: validate pitch coming from userspace")
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 -- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0 -2
@@ -856,8 +856,6 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id)bool refuse_dma = false;struct pci_dev *pdev =to_pci_dev (dev_priv->drm.dev); - dev_priv->drm.dev_private = dev_priv; -vmw_sw_context_init (dev_priv);mutex_init (&dev_priv->cmdbuf_mutex);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +1 -1
@@ -639,7 +639,7 @@ static inline struct vmw_surface *vmw_res_to_srf(struct vmw_resource *res)static inline struct vmw_private *vmw_priv (struct drm_device *dev) { -return (struct vmw_private *)dev->dev_private; + return container_of(dev, struct vmw_private, drm); }static inline struct vmw_private *vmw_priv_from_ttm (struct ttm_device *bdev)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -2
@@ -280,7 +280,7 @@ static void vmw_du_put_cursor_mob(struct vmw_cursor_plane *vcp,static int vmw_du_get_cursor_mob (struct vmw_cursor_plane *vcp,struct vmw_plane_state *vps) { -struct vmw_private *dev_priv = vcp->base.dev->dev_private; +struct vmw_private *dev_priv =vmw_priv (vcp->base.dev);u32 size =vmw_du_cursor_mob_size (vps->base.crtc_w, vps->base.crtc_h);u32 i;u32 cursor_max_dim, mob_max_size;
@@ -519,7 +519,7 @@ void vmw_du_cursor_plane_destroy(struct drm_plane *plane)struct vmw_cursor_plane *vcp =vmw_plane_to_vcp (plane);u32 i; -vmw_cursor_update_position (plane->dev->dev_private, false,0 ,0 ); +vmw_cursor_update_position (vmw_priv (plane->dev), false,0 ,0 );for (i =0 ; i <ARRAY_SIZE (vcp->cursor_mobs); i++)vmw_du_destroy_cursor_mob (&vcp->cursor_mobs[i]);
Signature · 1 line
2.53.0