In the Linux kernel, the following vulnerability has been resolved:
net: ena: fix shift-out-of-bounds in exponential backoff
The ENA adapters on our instances occasionally reset. Once recently logged a UBSAN failure to console in the process:
UBSAN: shift-out-of-bounds in build/linux/drivers/net/ethernet/amazon/ena/enacom.c:540:13 shift exponent 32 is too large for 32-bit type 'unsigned int' CPU: 28 PID: 70012 Comm: kworker/u72:2 Kdump: loaded not tainted 5.15.117 Hardware name: Amazon EC2 c5d.9xlarge/, BIOS 1.0 10/16/2017 Workqueue: ena enafwresetdevice [ena] Call Trace: <TASK> dumpstacklvl+0x4a/0x63 dumpstack+0x10/0x16 ubsanepilogue+0x9/0x36 _ubsanhandleshiftoutofbounds.cold+0x61/0x10e ? _constudelay+0x43/0x50 enadelayexponentialbackoffus.cold+0x16/0x1e [ena] waitforresetstate+0x54/0xa0 [ena] enacomdevreset+0xc8/0x110 [ena] enadown+0x3fe/0x480 [ena] enadestroydevice+0xeb/0xf0 [ena] enafwresetdevice+0x30/0x50 [ena] processonework+0x22b/0x3d0 workerthread+0x4d/0x3f0 ? processonework+0x3d0/0x3d0 kthread+0x12a/0x150 ? setkthreadstruct+0x50/0x50 retfrom_fork+0x22/0x30 </TASK>
Apparently, the reset delays are getting so large they can trigger a UBSAN panic.
Looking at the code, the current timeout is capped at 5000us. Using a base value of 100us, the current code will overflow after (1<<29). Even at values before 32, this function wraps around, perhaps unintentionally.
Cap the value of the exponent used for this backoff at (1<<16) which is larger than currently necessary, but large enough to support bigger values in the future.
[
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0939c264729d4a081ff88efce2ffdf85dc5331e0",
"deprecated": false,
"id": "CVE-2023-53272-13446c9f",
"target": {
"function": "ena_delay_exponential_backoff_us",
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"function_hash": "243305086006511337775005364000215071451",
"length": 228.0
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0939c264729d4a081ff88efce2ffdf85dc5331e0",
"deprecated": false,
"id": "CVE-2023-53272-2372ab38",
"target": {
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217250764876899851905766711606141430301",
"308137031723555227236609583847495256216",
"38669243094546268784981767441343182090",
"118933543244054665436060025605637628588",
"42289498336672223446846340485530143639",
"64366601054330877277608598792542114324",
"127581608222419013256454368830834439061"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3e36cc94d6e60a27f27498adf1c71eeba769ab33",
"deprecated": false,
"id": "CVE-2023-53272-38642e1f",
"target": {
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217250764876899851905766711606141430301",
"308137031723555227236609583847495256216",
"38669243094546268784981767441343182090",
"118933543244054665436060025605637628588",
"42289498336672223446846340485530143639",
"64366601054330877277608598792542114324",
"127581608222419013256454368830834439061"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90947ebf8794e3c229fb2e16e37f1bfea6877f14",
"deprecated": false,
"id": "CVE-2023-53272-5441bf8c",
"target": {
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217250764876899851905766711606141430301",
"308137031723555227236609583847495256216",
"38669243094546268784981767441343182090",
"118933543244054665436060025605637628588",
"42289498336672223446846340485530143639",
"64366601054330877277608598792542114324",
"127581608222419013256454368830834439061"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1e9cb763e9bacf0c932aa948f50dcfca6f519a26",
"deprecated": false,
"id": "CVE-2023-53272-5a2b4026",
"target": {
"function": "ena_delay_exponential_backoff_us",
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"function_hash": "243305086006511337775005364000215071451",
"length": 228.0
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1e760b2d18bf129b3da052c2946c02758e97d15e",
"deprecated": false,
"id": "CVE-2023-53272-5cb03f3d",
"target": {
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217250764876899851905766711606141430301",
"308137031723555227236609583847495256216",
"38669243094546268784981767441343182090",
"118933543244054665436060025605637628588",
"42289498336672223446846340485530143639",
"64366601054330877277608598792542114324",
"127581608222419013256454368830834439061"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1e760b2d18bf129b3da052c2946c02758e97d15e",
"deprecated": false,
"id": "CVE-2023-53272-6e81004c",
"target": {
"function": "ena_delay_exponential_backoff_us",
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"function_hash": "243305086006511337775005364000215071451",
"length": 228.0
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90947ebf8794e3c229fb2e16e37f1bfea6877f14",
"deprecated": false,
"id": "CVE-2023-53272-8cf53d75",
"target": {
"function": "ena_delay_exponential_backoff_us",
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"function_hash": "243305086006511337775005364000215071451",
"length": 228.0
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1e9cb763e9bacf0c932aa948f50dcfca6f519a26",
"deprecated": false,
"id": "CVE-2023-53272-994ccd60",
"target": {
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"217250764876899851905766711606141430301",
"308137031723555227236609583847495256216",
"38669243094546268784981767441343182090",
"118933543244054665436060025605637628588",
"42289498336672223446846340485530143639",
"64366601054330877277608598792542114324",
"127581608222419013256454368830834439061"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3e36cc94d6e60a27f27498adf1c71eeba769ab33",
"deprecated": false,
"id": "CVE-2023-53272-b12feb03",
"target": {
"function": "ena_delay_exponential_backoff_us",
"file": "drivers/net/ethernet/amazon/ena/ena_com.c"
},
"digest": {
"function_hash": "243305086006511337775005364000215071451",
"length": 228.0
},
"signature_type": "Function"
}
]