can: bcm: Remove proc entry when dev is unregistered.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ffd980f976e7fd666c2e61bf8ab35107efd11828 · < 4377b79323df62eb5d310354f19b4d130ff58d50| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: Remove proc entry when dev is unregistered.
syzkaller reported a warning in bcm_connect() below. [0]
The repro calls connect() to vxcan1, removes vxcan1, and calls connect() with ifindex == 0.
Calling connect() for a BCM socket allocates a proc entry. Then, bcm_sk(sk)->bound is set to 1 to prevent further connect().
However, removing the bound device resets bcm_sk(sk)->bound to 0 in bcm_notify().
The 2nd connect() tries to allocate a proc entry with the same name and sets NULL to bcm_sk(sk)->bcm_proc_read, leaking the original proc entry.
Since the proc entry is available only for connect()ed sockets, let's clean up the entry when the bound netdev is unregistered.
From the CVE record · Linux
The Linux kernel's CAN BCM socket handling can leak a proc entry when a bound network device is unregistered. A local actor able to connect a BCM socket, unregister its bound device, and connect again can trigger a kernel warning. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with CAN BCM support should check their installations; affected versions are not specified.