Mike Marciniszyn
b6d57e24ce
IB/hfi1: Insure use of smp_processor_id() is preempt disabled
...
The following BUG has just surfaced with our 5.16 testing:
BUG: using smp_processor_id() in preemptible [00000000] code: mpicheck/1581081
caller is sdma_select_user_engine+0x72/0x210 [hfi1]
CPU: 0 PID: 1581081 Comm: mpicheck Tainted: G S 5.16.0-rc1+ #1
Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0016.033120161139 03/31/2016
Call Trace:
<TASK>
dump_stack_lvl+0x33/0x42
check_preemption_disabled+0xbf/0xe0
sdma_select_user_engine+0x72/0x210 [hfi1]
? _raw_spin_unlock_irqrestore+0x1f/0x31
? hfi1_mmu_rb_insert+0x6b/0x200 [hfi1]
hfi1_user_sdma_process_request+0xa02/0x1120 [hfi1]
? hfi1_write_iter+0xb8/0x200 [hfi1]
hfi1_write_iter+0xb8/0x200 [hfi1]
do_iter_readv_writev+0x163/0x1c0
do_iter_write+0x80/0x1c0
vfs_writev+0x88/0x1a0
? recalibrate_cpu_khz+0x10/0x10
? ktime_get+0x3e/0xa0
? __fget_files+0x66/0xa0
do_writev+0x65/0x100
do_syscall_64+0x3a/0x80
Fix this long standing bug by moving the smp_processor_id() to after the
rcu_read_lock().
The rcu_read_lock() implicitly disables preemption.
Link: https://lore.kernel.org/r/20211129191958.101968.87329.stgit@awfm-01.cornelisnetworks.com
Cc: stable@vger.kernel.org
Fixes: 0cb2aa690c7e ("IB/hfi1: Add sysfs interface for affinity setup")
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-12-07 13:22:54 -04:00
..
2021-11-17 17:05:41 +01:00
2021-11-04 08:21:47 -07:00
2021-11-18 14:34:25 +09:00
2021-10-22 00:13:16 +02:00
2021-11-11 13:09:33 +01:00
2021-11-06 14:36:12 -07:00
2021-11-09 11:24:08 -08:00
2021-11-04 09:09:37 -07:00
2021-11-13 09:11:33 -08:00
2021-11-01 10:09:14 -07:00
2021-11-04 08:21:47 -07:00
2021-11-14 11:11:51 -08:00
2021-11-02 11:24:14 -07:00
2021-10-30 10:54:47 +02:00
2021-11-04 19:48:47 +01:00
2021-11-03 17:00:52 -07:00
2021-11-06 14:36:12 -07:00
2021-11-08 11:49:48 -08:00
2021-11-10 14:06:51 +01:00
2021-11-10 11:47:55 -08:00
2021-11-12 12:11:07 -08:00
2021-11-01 15:02:49 -07:00
2021-10-27 14:13:39 +09:00
2021-11-05 08:42:02 -07:00
2021-11-10 16:15:54 -08:00
2021-10-22 09:54:33 +10:30
2021-11-16 09:41:44 +01:00
2021-11-19 14:23:14 +10:00
2021-11-05 08:31:51 -07:00
2021-11-04 13:56:55 -07:00
2021-11-15 12:35:56 +00:00
2021-11-06 14:08:17 -07:00
2021-10-27 11:46:01 -06:00
2021-11-10 11:52:40 -08:00
2021-11-10 11:36:43 -08:00
2021-12-07 13:22:54 -04:00
2021-11-12 11:53:16 -08:00
2021-11-06 14:36:12 -07:00
2021-11-12 16:09:51 +00:00
2021-11-06 14:08:17 -07:00
2021-10-29 23:03:09 -05:00
2021-11-09 11:24:08 -08:00
2021-11-10 11:52:40 -08:00
2021-10-21 21:34:21 +02:00
2021-11-06 14:36:12 -07:00
2021-11-10 11:36:43 -08:00
2021-11-10 11:52:40 -08:00
2021-11-06 14:08:17 -07:00
2021-10-26 19:12:01 +02:00
2021-11-09 11:24:08 -08:00
2021-10-21 20:02:42 +01:00
2021-11-18 12:03:17 +00:00
2021-11-07 19:37:04 +00:00
2021-11-10 10:56:02 -08:00
2021-11-09 11:20:07 -08:00
2021-11-14 11:11:51 -08:00
2021-11-14 10:38:27 -08:00
2021-11-02 06:20:58 -07:00
2021-11-02 15:58:39 -07:00
2021-11-04 08:21:47 -07:00
2021-11-16 02:19:15 +01:00
2021-11-16 10:56:53 +01:00
2021-11-02 16:48:47 +01:00
2021-11-10 21:18:14 +01:00
2021-11-18 12:12:55 +00:00
2021-11-05 11:57:13 +01:00
2021-11-06 13:30:33 -07:00
2021-11-08 12:07:52 -08:00
2021-11-03 17:00:52 -07:00
2021-11-10 09:07:26 -08:00
2021-11-12 11:44:31 -08:00
2021-11-16 12:29:19 +01:00
2021-11-16 19:42:32 -05:00
2021-11-10 16:15:54 -08:00
2021-11-18 14:35:41 -08:00
2021-11-10 16:15:54 -08:00
2021-11-12 12:25:50 -08:00
2021-11-04 08:21:47 -07:00
2021-11-18 20:40:28 +01:00
2021-10-25 13:17:29 +02:00
2021-11-04 09:09:37 -07:00
2021-10-28 11:22:23 +00:00
2021-11-11 09:40:15 -08:00
2021-11-03 15:00:39 -07:00
2021-11-01 05:26:49 -04:00
2021-11-19 10:50:11 -08:00
2021-11-10 15:32:38 +01:00
2021-11-10 09:41:22 -08:00
2021-11-10 11:14:21 -08:00