linux/arch/um/drivers
Tiwei Bie 51b39d7419 um: vector: Do not use drvdata in release
The drvdata is not available in release. Let's just use container_of()
to get the vector_device instance. Otherwise, removing a vector device
will result in a crash:

RIP: 0033:vector_device_release+0xf/0x50
RSP: 00000000e187bc40  EFLAGS: 00010202
RAX: 0000000060028f61 RBX: 00000000600f1baf RCX: 00000000620074e0
RDX: 000000006220b9c0 RSI: 0000000060551c80 RDI: 0000000000000000
RBP: 00000000e187bc50 R08: 00000000603ad594 R09: 00000000e187bb70
R10: 000000000000135a R11: 00000000603ad422 R12: 00000000623ae028
R13: 000000006287a200 R14: 0000000062006d30 R15: 00000000623700b6
Kernel panic - not syncing: Segfault with no mm
CPU: 0 UID: 0 PID: 16 Comm: kworker/0:1 Not tainted 6.12.0-rc6-g59b723cd2adb #1
Workqueue: events mc_work_proc
Stack:
 60028f61 623ae028 e187bc80 60276fcd
 6220b9c0 603f5820 623ae028 00000000
 e187bcb0 603a2bcd 623ae000 62370010
Call Trace:
 [<60028f61>] ? vector_device_release+0x0/0x50
 [<60276fcd>] device_release+0x70/0xba
 [<603a2bcd>] kobject_put+0xba/0xe7
 [<60277265>] put_device+0x19/0x1c
 [<60281266>] platform_device_put+0x26/0x29
 [<60281e5f>] platform_device_unregister+0x2c/0x2e
 [<60029422>] vector_remove+0x52/0x58
 [<60031316>] ? mconsole_reply+0x0/0x50
 [<600310c8>] mconsole_remove+0x160/0x1cc
 [<603b19f4>] ? strlen+0x0/0x15
 [<60066611>] ? __dequeue_entity+0x1a9/0x206
 [<600666a7>] ? set_next_entity+0x39/0x63
 [<6006666e>] ? set_next_entity+0x0/0x63
 [<60038fa6>] ? um_set_signals+0x0/0x43
 [<6003070c>] mc_work_proc+0x77/0x91
 [<60057664>] process_scheduled_works+0x1b3/0x2dd
 [<60055f32>] ? assign_work+0x0/0x58
 [<60057f0a>] worker_thread+0x1e9/0x293
 [<6005406f>] ? set_pf_worker+0x0/0x64
 [<6005d65d>] ? arch_local_irq_save+0x0/0x2d
 [<6005d748>] ? kthread_exit+0x0/0x3a
 [<60057d21>] ? worker_thread+0x0/0x293
 [<6005dbf1>] kthread+0x126/0x12b
 [<600219c5>] new_thread_handler+0x85/0xb6

Cc: stable@vger.kernel.org
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Link: https://patch.msgid.link/20241104163203.435515-5-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-11-07 18:05:22 +01:00
..
chan_kern.c um: chan: use blocking IO for console output for time-travel 2024-07-03 12:18:02 +02:00
chan_user.c um: Use os_set_pdeathsig helper in winch thread/process 2024-10-25 11:34:55 +02:00
chan_user.h tty: um: convert to u8/__u8 and size_t 2023-12-08 12:02:38 +01:00
chan.h um: chan: use blocking IO for console output for time-travel 2024-07-03 12:18:02 +02:00
cow_sys.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cow_user.c um: ubd: use 64-bit time_t where possible 2019-12-18 18:07:31 +01:00
cow.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
daemon_kern.c um: daemon: Make default socket configurable 2022-05-27 09:00:40 +02:00
daemon_user.c um: Some fixes to build UML with musl 2020-10-11 23:13:06 +02:00
daemon.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
fd.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
harddog_kern.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
harddog_user_exp.c um: harddog: fix modular build 2023-05-10 00:21:30 +02:00
harddog_user.c um: harddog: fix modular build 2023-05-10 00:21:30 +02:00
harddog.h um: harddog: fix modular build 2023-05-10 00:21:30 +02:00
hostaudio_kern.c um: hostaudio: Do not propagate mixer parameter to kernel 2024-10-23 09:52:49 +02:00
Kconfig um: Remove obsolete pcap driver 2024-07-03 12:19:25 +02:00
line.c um: line: always fill *error_out in setup_one_line() 2024-07-04 12:03:14 +02:00
line.h tty: um: convert to u8/__u8 and size_t 2023-12-08 12:02:38 +01:00
Makefile um: Remove obsolete pcap driver 2024-07-03 12:19:25 +02:00
mconsole_kern.c um: Refactor deprecated strncpy to memcpy 2023-08-26 22:48:38 +02:00
mconsole_kern.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
mconsole_user.c minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
mconsole.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
mmapper_kern.c um: mmaper: add __exit annotations to module exit funcs 2022-09-19 23:01:50 +02:00
net_kern.c um: net: Do not use drvdata in release 2024-11-07 18:05:22 +01:00
net_user.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
null.c tty: um: convert to u8/__u8 and size_t 2023-12-08 12:02:38 +01:00
port_kern.c um: generalize os_rcv_fd 2024-07-03 12:24:25 +02:00
port_user.c um: port_user: Improve error handling when port-helper is not found 2022-03-11 10:55:55 +01:00
port.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
pty.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
random.c hwrng: core - treat default_quality as a maximum and default to 1024 2022-11-18 16:59:34 +08:00
rtc_kern.c um: rtc: Convert to platform remove callback returning void 2024-04-30 14:18:49 +02:00
rtc_user.c isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
rtc.h um: add a pseudo RTC 2021-02-12 21:38:52 +01:00
slip_common.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
slip_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
slip_kern.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
slip_user.c um: fix error return code in slip_open() 2021-06-17 22:10:05 +02:00
slip.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
slirp_kern.c um: fix 3 instances of -Wmissing-prototypes 2023-08-26 22:45:05 +02:00
slirp_user.c um: slirp: remove set but unused variable 'pid' 2024-04-22 22:26:41 +02:00
slirp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ssl.c um: Do not initialise statics to 0. 2022-09-19 23:10:07 +02:00
stderr_console.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stdio_console.c um: Do not initialise statics to 0. 2022-09-19 23:10:07 +02:00
stdio_console.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
tty.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
ubd_kern.c um: ubd: Do not use drvdata in release 2024-11-07 18:05:22 +01:00
ubd_user.c um: Make local functions and variables static 2024-04-22 21:43:03 +02:00
ubd.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
umcast_kern.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
umcast_user.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
umcast.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
vde_kern.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
vde_user.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
vde.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
vector_kern.c um: vector: Do not use drvdata in release 2024-11-07 18:05:22 +01:00
vector_kern.h um: vector: Replace locks guarding queue depth with atomics 2024-09-12 19:56:05 +02:00
vector_transports.c um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00
vector_user.c vector_user: add VDE support 2024-09-12 20:16:42 +02:00
vector_user.h uml: vector: Remove unused definitions VECTOR_{WRITE,HEADERS} 2023-02-13 10:14:32 +01:00
vhost_user.h um: virtio_uml: query the number of vqs if supported 2024-11-07 18:05:07 +01:00
virt-pci.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
virtio_uml.c um: virtio_uml: query the number of vqs if supported 2024-11-07 18:05:07 +01:00
xterm_kern.c um: generalize os_rcv_fd 2024-07-03 12:24:25 +02:00
xterm.c um: generalize os_rcv_fd 2024-07-03 12:24:25 +02:00
xterm.h um: Add SPDX headers for files in arch/um/drivers 2019-09-15 21:37:16 +02:00