freebsd-dev/sys
Hans Petter Selasky 55d1833671 ibcore: Fix sysfs registration error flow
The kernel commit cited below restructured ib device management
so that the device kobject is initialized in ib_alloc_device.

As part of the restructuring, the kobject is now initialized in
procedure ib_alloc_device, and is later added to the device hierarchy
in the ib_register_device call stack, in procedure
ib_device_register_sysfs (which calls device_add).

However, in the ib_device_register_sysfs error flow, if an error
occurs following the call to device_add, the cleanup procedure
device_unregister is called. This call results in the device object
being deleted -- which results in various use-after-free crashes.

The correct cleanup call is device_del -- which undoes device_add
without deleting the device object.

The device object will then (correctly) be deleted in the
ib_register_device caller's error cleanup flow, when the caller invokes
ib_dealloc_device.

Linux commit:
b312be3d87e4c80872cbea869e569175c5eb0f9a

PR:		264472
MFC after:	3 days
Sponsored by:	NVIDIA Networking
2022-06-21 11:33:27 +02:00
..
amd64 amd64: Stop using REP MOVSB for backward memmove()s. 2022-06-16 13:46:34 -04:00
arm am335x: Fix a typo in a source code comment 2022-06-04 13:28:10 +02:00
arm64 Fix the test used to wait for AP startup on x86, arm64, riscv 2022-06-15 11:38:04 -04:00
bsm
cam CTL: Fix double command completions on HA failover. 2022-06-14 00:24:39 -04:00
cddl loader: add support for gzip compression 2022-06-09 20:54:30 +03:00
compat net80211 / LinuxKPI: 802.11: add Control Trigger Subframe information 2022-06-17 22:55:13 +00:00
conf newvers.sh: Don't use return to exit. 2022-06-14 10:51:39 -07:00
contrib ACPICA: Revert an upstream patch to appease useless warnings 2022-06-13 21:40:30 -04:00
crypto crypto: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
ddb ddb: namespacing of struct command 2022-06-14 13:10:08 -03:00
dev iommu_gas: Add a missing error-case unlock 2022-06-20 23:48:31 -05:00
dts sys/dts: Remove MIPS files 2022-05-20 17:11:27 +01:00
fs nfscl: Clean up the code by removing vfs_flags() macro 2022-06-20 13:23:04 -07:00
gdb
geom geom(4): Fix a common typo in a source code comment 2022-06-05 09:51:10 +02:00
gnu bwn: eliminate dead writes in BWN_GPL_PHY 2022-05-04 09:32:59 -04:00
i386 x86: cleanup in machine/cpufunc.h 2022-06-13 18:35:38 +01:00
isa isa: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:59 -07:00
kern aio: Improve UMA usage 2022-06-20 12:48:13 -04:00
kgssapi kgssapi krb5: Remove unused variables. 2022-04-06 16:45:29 -07:00
libkern libkern: Fix a typo in a source code comment 2022-06-05 08:57:26 +02:00
modules modules: Only build MAC modules if options MAC is set 2022-06-14 13:10:08 -03:00
net bpf: Zero pad bytes preceding BPF headers 2022-06-20 12:48:13 -04:00
net80211 net80211 / LinuxKPI: 802.11: add Control Trigger Subframe information 2022-06-17 22:55:13 +00:00
netgraph ng_ubt(4): Probe USB Bluetooth per USB interface and not per USB device. 2022-06-03 10:49:17 +02:00
netinet tcp: fix TCPPCAP for kernels enabling VNET 2022-06-15 23:28:54 +02:00
netinet6 rip6: Fix a lock order reversal in rip6_bind() 2022-06-14 12:00:59 -04:00
netipsec ipsec_encap: setdf is only used for INET. 2022-04-13 16:08:21 -07:00
netpfil pf: support matching on tags for Ethernet rules 2022-06-20 10:16:20 +02:00
netsmb smb_smb_treedisconnect: eliminate write only variable mbp 2022-04-04 22:30:57 -06:00
nfs nfs: skip bootpc when vfs.root.mountfrom is other than nfs 2022-05-31 16:07:27 -03:00
nfsclient
nfsserver
nlm
ofed ibcore: Fix sysfs registration error flow 2022-06-21 11:33:27 +02:00
opencrypto crypto: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
powerpc powerpc: Fix a typo in a comment 2022-06-04 19:55:03 +02:00
riscv Fix the test used to wait for AP startup on x86, arm64, riscv 2022-06-15 11:38:04 -04:00
rpc krpc: Fix NFS-over-TLS for KTLS1.3 2022-05-15 11:51:56 -07:00
security sysent: Get rid of bogus sys/sysent.h include. 2022-05-28 20:52:17 +03:00
sys struct kinfo_file changes needed for lsof to work using only usermode APIs` 2022-06-18 12:34:25 +03:00
teken teken: color #3 is yellow not brown - use TC_YELLOW as the name 2022-03-12 09:17:29 -05:00
tests
tools firmware: Map '@' in filenames to '_' in symbols. 2022-06-14 10:50:51 -07:00
ufs Bug fix to UFS/FFS superblock integrity checks when reading a superblock. 2022-06-11 11:05:14 -07:00
vm vm: Fix racy checks for swap objects 2022-06-20 12:48:14 -04:00
x86 Fix the test used to wait for AP startup on x86, arm64, riscv 2022-06-15 11:38:04 -04:00
xdr
xen xenbus: improve device tracking 2022-06-07 12:29:53 +02:00
Makefile