In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: Fix peer devlink set for SF representor devlink port
The cited patch change register devlink flow, and neglect to reflect the changes for peer devlink set logic. Peer devlink set is triggering a call trace if done after devl_register.[1]
Hence, align peer devlink set logic with register devlink flow.
[1] WARNING: CPU: 4 PID: 3394 at net/devlink/core.c:155 devlinkrelnestedinadd+0x177/0x180 CPU: 4 PID: 3394 Comm: kworker/u40:1 Not tainted 6.9.0-rc4forlinustmindebug202404161408 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5vhcaevent0 mlx5vhcastateworkhandler [mlx5core] RIP: 0010:devlinkrelnestedinadd+0x177/0x180 Call Trace: <TASK> ? _warn+0x78/0x120 ? devlinkrelnestedinadd+0x177/0x180 ? reportbug+0x16d/0x180 ? handlebug+0x3c/0x60 ? excinvalidop+0x14/0x70 ? asmexcinvalidop+0x16/0x20 ? devlinkportinit+0x30/0x30 ? devlinkporttypeclear+0x50/0x50 ? devlinkrelnestedinadd+0x177/0x180 ? devlinkrelnestedinadd+0xdd/0x180 mlx5sfmdevevent+0x74/0xb0 [mlx5core] notifiercallchain+0x35/0xb0 blockingnotifiercallchain+0x3d/0x60 mlx5blockingnotifiercallchain+0x22/0x30 [mlx5core] mlx5sfdevprobe+0x185/0x3e0 [mlx5core] auxiliarybusprobe+0x38/0x80 ? driversysfsadd+0x51/0x80 reallyprobe+0xc5/0x3a0 ? driverprobedevice+0x90/0x90 _driverprobedevice+0x80/0x160 driverprobedevice+0x1e/0x90 _deviceattachdriver+0x7d/0x100 busforeachdrv+0x80/0xd0 _deviceattach+0xbc/0x1f0 busprobedevice+0x86/0xa0 deviceadd+0x64f/0x860 _auxiliarydeviceadd+0x3b/0xa0 mlx5sfdevadd+0x139/0x330 [mlx5core] mlx5sfdevstatechangehandler+0x1e4/0x250 [mlx5core] notifiercallchain+0x35/0xb0 blockingnotifiercallchain+0x3d/0x60 mlx5vhcastateworkhandler+0x151/0x200 [mlx5core] processonework+0x13f/0x2e0 workerthread+0x2bd/0x3c0 ? rescuerthread+0x410/0x410 kthread+0xc4/0xf0 ? kthreadcompleteandexit+0x20/0x20 retfromfork+0x2d/0x50 ? kthreadcompleteandexit+0x20/0x20 retfromforkasm+0x11/0x20 </TASK>