opnsense-src/sys/geom
Fabian Keil f7856fe81d g_dev_orphan(): Return early if the device is already gone
The following panic was the result of running "cdcontrol eject" after
using the physical ejection key on the device before the tray was
actually ejected. So we have hardware racing software.

The device was loaded with a DVD.

Resulted in a NULL pointer dereference

g_dev_orphan() at g_dev_orphan+0x2e/frame 0xfffffe01eba0a9f0
g_resize_provider_event() at g_resize_provider_event+0x71/frame 0xfffffe01eba0aa20
g_run_events() at g_run_events+0x20e/frame 0xfffffe01eba0aa70
fork_exit() at fork_exit+0x85/frame 0xfffffe01eba0aab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01eba0aab0

Avoid this possibility and return early of dev is NULL already.

PR:  215856
Reviewed by: imp (I've triggered this once or twice over the years too)
Sponsored by: Netflix
2025-03-13 17:20:00 -06:00
..
cache sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
concat sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
eli geli: Fix signature mismatch in mountroot callback 2025-03-04 20:19:10 -05:00
gate ggate: Avoid dropping the GEOM topology lock in dumpconf 2024-10-04 15:56:34 +00:00
journal gjournal(8): Fix a typo in a sysctl description 2024-01-20 20:58:08 +01:00
label glabel: Add support for Linux swap 2024-04-28 22:39:47 -06:00
linux_lvm geom_linux_lvm: Avoid removing from vg_list before inserting 2023-10-17 11:19:05 -04:00
mirror g_eli: update comment for bool return type 2024-11-13 15:13:35 -05:00
mountver geom: sort includes for some files 2023-11-23 12:07:42 -04:00
multipath sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
nop sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
part geom: Allow BSD type '!0' partitions 2024-11-20 22:28:57 +00:00
raid graid: unbreak Promise RAID1 with 4+ providers 2024-02-12 14:33:43 +07:00
raid3 graid3: Fix teardown in g_raid3_try_destroy() 2024-04-20 12:04:57 -04:00
shsec sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
stripe geom_stripe: Cascade cantrim just like we do for gmirror 2024-05-03 09:03:31 -06:00
union spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
uzip sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
virstor sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
zero sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_bsd_enc.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom_ccd.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom_ctl.c geom: Report copyout() errors in g_ctl_ioctl_ctl() 2023-12-25 21:04:01 -05:00
geom_ctl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dbg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dev.c g_dev_orphan(): Return early if the device is already gone 2025-03-13 17:20:00 -06:00
geom_disk.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
geom_disk.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_dump.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom_event.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom_flashmap.c geom_flashmap: Rename the kernel module 2024-10-29 15:11:12 +00:00
geom_flashmap.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_int.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_io.c geom_io: Shift to pause_sbt to eliminate bogus min and update comment. 2024-05-24 08:31:55 -06:00
geom_kern.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
geom_slice.c geom: Remove sysctl.h 2024-05-22 16:24:11 -06:00
geom_slice.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
geom_subr.c geom: Remove sysctl.h 2024-05-22 16:24:11 -06:00
geom_vfs.c Stop treating size 0 as unknown size in vnode_create_vobject(). 2024-05-23 06:08:14 +00:00
geom_vfs.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
notes Remove final cross-reference to GBDE 2024-05-07 07:40:20 +00:00