Bart Van Assche
13daafe1e2
scsi: core: Remove the /proc/scsi/${proc_name} directory earlier
...
[ Upstream commit fc663711b94468f4e1427ebe289c9f05669699c9 ]
Remove the /proc/scsi/${proc_name} directory earlier to fix a race
condition between unloading and reloading kernel modules. This fixes a bug
introduced in 2009 by commit 77c019768f06 ("[SCSI] fix /proc memory leak in
the SCSI core").
Fix the following kernel warning:
proc_dir_entry 'scsi/scsi_debug' already registered
WARNING: CPU: 19 PID: 27986 at fs/proc/generic.c:376 proc_register+0x27d/0x2e0
Call Trace:
proc_mkdir+0xb5/0xe0
scsi_proc_hostdir_add+0xb5/0x170
scsi_host_alloc+0x683/0x6c0
sdebug_driver_probe+0x6b/0x2d0 [scsi_debug]
really_probe+0x159/0x540
__driver_probe_device+0xdc/0x230
driver_probe_device+0x4f/0x120
__device_attach_driver+0xef/0x180
bus_for_each_drv+0xe5/0x130
__device_attach+0x127/0x290
device_initial_probe+0x17/0x20
bus_probe_device+0x110/0x130
device_add+0x673/0xc80
device_register+0x1e/0x30
sdebug_add_host_helper+0x1a7/0x3b0 [scsi_debug]
scsi_debug_init+0x64f/0x1000 [scsi_debug]
do_one_initcall+0xd7/0x470
do_init_module+0xe7/0x330
load_module+0x122a/0x12c0
__do_sys_finit_module+0x124/0x1a0
__x64_sys_finit_module+0x46/0x50
do_syscall_64+0x38/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
Link: https://lore.kernel.org/r/20230210205200.36973-3-bvanassche@acm.org
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Yi Zhang <yi.zhang@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 77c019768f06 ("[SCSI] fix /proc memory leak in the SCSI core")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-17 08:31:43 +01:00
..
2020-10-01 13:14:42 +02:00
2021-07-28 11:13:44 +02:00
2023-03-11 16:31:41 +01:00
2019-11-24 08:20:59 +01:00
2020-08-19 08:14:55 +02:00
2021-07-20 16:16:15 +02:00
2022-04-15 14:15:01 +02:00
2022-02-08 18:23:18 +01:00
2021-07-20 16:16:08 +02:00
2021-11-26 11:36:13 +01:00
2021-07-20 16:16:08 +02:00
2020-10-01 13:14:45 +02:00
2021-08-26 08:36:44 -04:00
2020-01-23 08:21:38 +01:00
2023-01-18 11:30:23 +01:00
2020-12-30 11:26:01 +01:00
2021-07-28 11:13:44 +02:00
2021-05-22 10:59:34 +02:00
2022-04-20 09:12:49 +02:00
2021-07-28 11:13:44 +02:00
2022-04-15 14:15:02 +02:00
2022-04-15 14:14:40 +02:00
2022-06-25 11:49:14 +02:00
2021-08-26 08:36:44 -04:00
2022-09-15 12:17:05 +02:00
2022-04-20 09:12:50 +02:00
2018-08-21 23:54:17 -04:00
2018-03-19 22:54:47 -04:00
2022-04-15 14:15:02 +02:00
2022-10-26 13:19:17 +02:00
2021-09-22 11:48:01 +02:00
2023-03-11 16:31:54 +01:00
2020-10-29 09:55:07 +01:00
2022-08-25 11:15:17 +02:00
2023-01-18 11:30:23 +01:00
2019-11-20 18:46:29 +01:00
2022-08-11 12:48:39 +02:00
2017-10-25 05:40:22 -04:00
2022-10-26 13:19:40 +02:00
2017-12-04 20:32:53 -05:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2019-03-13 14:02:31 -07:00
2017-11-02 11:10:55 +01:00
2018-07-30 23:17:53 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-11-26 11:36:20 +01:00
2022-04-15 14:15:02 +02:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-05-01 23:29:41 -04:00
2020-01-04 19:12:56 +01:00
2018-07-30 23:17:53 -04:00
2017-11-02 11:10:55 +01:00
2021-09-22 11:48:09 +02:00
2021-06-03 08:38:10 +02:00
2019-10-29 09:19:50 +01:00
2017-11-02 11:10:55 +01:00
2022-06-14 16:59:28 +02:00
2017-11-02 11:10:55 +01:00
2018-05-18 12:03:51 -04:00
2018-03-15 00:25:37 -04:00
2018-11-13 11:08:32 -08:00
2018-11-13 11:08:32 -08:00
2021-07-20 16:15:55 +02:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2023-03-17 08:31:43 +01:00
2019-07-10 09:53:37 +02:00
2023-02-06 07:49:41 +01:00
2023-01-18 11:30:22 +01:00
2018-06-26 12:27:07 -04:00
2017-11-02 11:10:55 +01:00
2023-03-11 16:31:59 +01:00
2020-04-02 15:28:15 +02:00
2019-12-01 09:16:26 +01:00
2018-04-20 19:40:17 -04:00
2020-06-25 15:33:01 +02:00
2023-02-22 12:47:12 +01:00
2021-05-22 10:59:33 +02:00
2020-07-22 09:32:04 +02:00
2018-06-19 22:02:25 -04:00
2022-01-11 13:58:50 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:08:32 -08:00
2020-01-04 19:12:56 +01:00
2018-08-15 22:06:26 -07:00
2022-06-14 16:59:15 +02:00
2018-06-19 22:02:25 -04:00
2020-08-19 08:14:59 +02:00
2017-11-02 11:10:55 +01:00
2018-03-19 22:54:47 -04:00
2017-11-02 11:10:55 +01:00
2020-10-30 10:38:28 +01:00
2018-07-10 22:42:47 -04:00
2020-01-04 19:13:04 +01:00
2019-11-20 18:47:49 +01:00
2018-06-19 22:02:25 -04:00
2017-10-16 22:38:44 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2022-06-25 11:49:14 +02:00
2018-02-13 21:49:15 -05:00
2017-12-04 20:32:52 -05:00
2017-11-02 11:10:55 +01:00
2017-10-05 15:01:17 +02:00
2017-10-05 15:01:17 +02:00
2017-11-02 11:10:55 +01:00
2018-06-26 12:53:26 -04:00
2017-11-02 11:10:55 +01:00
2018-12-19 19:19:49 +01:00
2017-12-11 21:39:39 -05:00
2023-01-18 11:30:21 +01:00
2018-04-20 19:14:28 -04:00
2021-06-30 08:48:12 -04:00
2019-05-08 07:21:49 +02:00
2019-10-29 09:19:49 +01:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2022-08-11 12:48:41 +02:00
2019-10-07 18:57:04 +02:00
2017-11-14 16:23:44 -08:00
2019-01-22 21:40:32 +01:00
2017-12-07 21:13:45 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-08-26 08:36:44 -04:00
2021-11-06 13:58:45 +01:00
2020-01-23 08:21:38 +01:00
2017-11-02 11:10:55 +01:00
2018-08-15 22:06:26 -07:00
2021-12-08 08:50:12 +01:00
2018-06-10 13:01:12 -07:00
2021-01-12 20:10:16 +01:00
2021-04-28 13:16:49 +02:00
2021-11-06 13:58:45 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 08:27:02 -06:00
2018-08-15 22:06:26 -07:00
2021-10-09 14:11:03 +02:00
2018-07-30 08:27:02 -06:00
2017-11-02 11:10:55 +01:00
2023-03-11 16:31:55 +01:00
2022-08-25 11:15:32 +02:00
2021-05-22 10:59:34 +02:00
2018-08-02 15:22:13 -06:00
2022-01-27 09:04:30 +01:00
2022-01-27 09:04:30 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-04-07 12:48:48 +02:00
2017-11-02 11:10:55 +01:00
2022-10-26 13:19:18 +02:00
2022-09-05 10:26:32 +02:00
2020-01-04 19:12:56 +01:00
2021-05-22 10:59:34 +02:00
2021-10-17 10:19:49 +02:00
2022-01-05 12:34:59 +01:00
2022-06-25 11:49:14 +02:00
2018-05-01 23:30:12 -04:00
2017-11-02 11:10:55 +01:00
2022-03-11 10:15:13 +01:00
2022-04-15 14:15:04 +02:00
2019-12-17 20:36:03 +01:00