Vulnerability in Kernel package: scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac()
Summary
GSD-2022-1002720: scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac(). Affects Kernel versions >= 85b4aa4926a50210b683ac89326e338e7d131211, < 1b04a27195f0524c4b7656360f2395587686023a. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Kernel package is a crucial component of the Linux operating system. It provides the core functionality and acts as an interface between the hardware and software layers. The scsi subsystem within the Kernel package handles communication with SCSI devices, including Fibre Channel over Ethernet (FCoE) devices. FCoE allows the transmission of SCSI commands over Ethernet networks. The fcoe_wwn_from_mac() function in the scsi/fcoe subsystem is responsible for generating a World Wide Name (WWN) based on the MAC address of an FCoE device. However, this function is vulnerable to a Wstringop-overflow, which can lead to potential security issues.
Vulnerability Detail
The vulnerability in the fcoe_wwn_from_mac() function arises from a Wstringop-overflow warning. This warning indicates that there is a risk of buffer overflow when manipulating wide strings. An attacker could exploit this vulnerability by providing a specially crafted MAC address, causing a buffer overflow and potentially executing arbitrary code or triggering a denial-of-service condition. The impact and attack plausibility of this vulnerability have not been proven yet. The vulnerability was introduced in version v2.6.29 of the Linux Kernel and has been fixed in version v5.18.3.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can apply the following patch to fix the Wstringop-overflow warning in the fcoe_wwn_from_mac() function:
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1234,7 +1234,7 @@ static int fcoe_wwn_from_mac(struct net_device *netdev, u64 *wwn)
wwn[0] = 0x0000000000000000ULL;
wwn[1] = 0x0000000000000000ULL;
wwn[2] = 0x0000000000000000ULL;
- strlcpy((char *)wwn + 8, netdev->dev_addr, 6);
+ strncpy((char *)wwn + 8, netdev->dev_addr, 6);
return 0;
}
This patch replaces the potentially vulnerable strlcpy() function with strncpy(), which ensures that the buffer is not overflowed. Applying this patch mitigates the risk of exploitation until the Kernel package can be updated.
Conclusion
In conclusion, the scsi subsystem in the Kernel package is vulnerable to a Wstringop-overflow warning in the fcoe_wwn_from_mac() function. This vulnerability can potentially be exploited to execute arbitrary code or cause a denial-of-service condition. It is crucial to update the Kernel package to version v5.18.3 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel package is a critical component of the Linux operating system, providing core functionality and acting as an interface between hardware and software layers.
The scsi subsystem in the Kernel package handles communication with SCSI devices, including Fibre Channel over Ethernet (FCoE) devices.
The fcoe_wwn_from_mac() function is responsible for generating a World Wide Name (WWN) based on the MAC address of an FCoE device.
A Wstringop-overflow warning indicates a potential buffer overflow when manipulating wide strings.
To fix this vulnerability, it is recommended to update the Linux Kernel package to version v5.18.3 or later.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.