printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e6fe3e5b7d16e8f146a4ae7fe481bc6e97acde1e · < 404e5fd918a0b14abec06c7eca128f04c9b98e41| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
Shifting 1 << 31 on a 32-bit int causes signed integer overflow, which leads to undefined behavior. To prevent this, cast 1 to u32 before performing the shift, ensuring well-defined behavior.
This change explicitly avoids any potential overflow by ensuring that the shift occurs on an unsigned 32-bit integer.
From the CVE record · Linux
In the Linux kernel's printk component, defining LOG_BUF_LEN_MAX can cause signed integer overflow and undefined behavior when shifting 1 by 31 on a 32-bit int. The input does not establish what an attacker could do or whether exploitation requires network access, local access, authentication, or user interaction.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.