CVE-2022-49847: net: ethernet: ti: am65-cpsw: Fix segmentation fault at module unload
In the Linux kernel, the following vulnerability has been resolved:
net: ethernet: ti: am65-cpsw: Fix segmentation fault at module unload
Move am65cpswnussphylinkcleanup() call to after am65cpswnusscleanupndev() so phylink is still valid to prevent the below Segmentation fault on module remove when first slave link is up.
[ 31.652944] Unable to handle kernel paging request at virtual address 00040008000005f4 [ 31.684627] Mem abort info: [ 31.687446] ESR = 0x0000000096000004 [ 31.704614] EC = 0x25: DABT (current EL), IL = 32 bits [ 31.720663] SET = 0, FnV = 0 [ 31.723729] EA = 0, S1PTW = 0 [ 31.740617] FSC = 0x04: level 0 translation fault [ 31.756624] Data abort info: [ 31.759508] ISV = 0, ISS = 0x00000004 [ 31.776705] CM = 0, WnR = 0 [ 31.779695] [00040008000005f4] address between user and kernel address ranges [ 31.808644] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 31.814928] Modules linked in: wlcoresdio wl18xx wlcore mac80211 libarc4 cfg80211 rfkill crct10difce phygmiisel tiam65cpswnuss(-) schfqcodel ipv6 [ 31.828776] CPU: 0 PID: 1026 Comm: modprobe Not tainted 6.1.0-rc2-00012-gfabfcf7dafdb-dirty #160 [ 31.837547] Hardware name: Texas Instruments AM625 (DT) [ 31.842760] pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 31.849709] pc : phystop+0x18/0xf8 [ 31.853202] lr : phylinkstop+0x38/0xf8 [ 31.857031] sp : ffff80000a0839f0 [ 31.860335] x29: ffff80000a0839f0 x28: ffff000000de1c80 x27: 0000000000000000 [ 31.867462] x26: 0000000000000000 x25: 0000000000000000 x24: ffff80000a083b98 [ 31.874589] x23: 0000000000000800 x22: 0000000000000001 x21: ffff000001bfba90 [ 31.881715] x20: ffff0000015ee000 x19: 0004000800000200 x18: 0000000000000000 [ 31.888842] x17: ffff800076c45000 x16: ffff800008004000 x15: 000058e39660b106 [ 31.895969] x14: 0000000000000144 x13: 0000000000000144 x12: 0000000000000000 [ 31.903095] x11: 000000000000275f x10: 00000000000009e0 x9 : ffff80000a0837d0 [ 31.910222] x8 : ffff000000de26c0 x7 : ffff00007fbd6540 x6 : ffff00007fbd64c0 [ 31.917349] x5 : ffff00007fbd0b10 x4 : ffff00007fbd0b10 x3 : ffff00007fbd3920 [ 31.924476] x2 : d0a07fcff8b8d500 x1 : 0000000000000000 x0 : 0004000800000200 [ 31.931603] Call trace: [ 31.934042] phystop+0x18/0xf8 [ 31.937177] phylinkstop+0x38/0xf8 [ 31.940657] am65cpswnussndoslavestop+0x28/0x1e0 [tiam65cpswnuss] [ 31.947452] devclosemany+0xa4/0x140 [ 31.951371] devclosemany+0x84/0x128 [ 31.955115] unregisternetdevicemany+0x130/0x6d0 [ 31.959897] unregisternetdevicequeue+0x94/0xd8 [ 31.964591] unregisternetdev+0x24/0x38 [ 31.968504] am65cpswnusscleanupndev.isra.0+0x48/0x70 [tiam65cpswnuss] [ 31.975637] am65cpswnussremove+0x58/0xf8 [tiam65cpswnuss]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.0.9 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.0.10-1 - Compensating control
In the am65-cpsw driver module-unload path, move the am65_cpsw_nuss_phylink_cleanup() call to after am65_cpsw_nuss_cleanup_ndev() so phylink remains valid while network devices are cleaned up.
Event History
Frequently Asked Questions
What conditions trigger the crash?
The segmentation fault occurs when the AM65 CPSW NUSS module is removed while the first slave link is up. The failure is caused by cleaning up phylink before network-device cleanup, leaving phylink invalid when it is still needed.
What access would an attacker need to cause the availability impact?
The CVSS vector specifies local access and low privileges, with no user interaction required. The documented impact is a high availability impact; confidentiality and integrity impacts are listed as none.
How can I tell whether a system has encountered this issue?
Affected systems may log a kernel paging request, a data abort, and an "Oops" during module removal. The example identifies the ti_am65_cpsw_nuss module and shows the removal operation occurring through modprobe.
What remediation is available?
A patch is available. The fix changes cleanup ordering so am65_cpsw_nuss_phylink_cleanup() runs after am65_cpsw_nuss_cleanup_ndev(), keeping phylink valid during module removal.