hwmon: (sht3x) Fix unaligned accesses
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7c84f7f80d6fcea36246b793d06c3555ca53ddcd · < f46d5ab43a572b84773015a76966f5da56fc1748| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (sht3x) Fix unaligned accesses
Sashiko reports:
In sht3x_update_client(), the 16-bit temperature and humidity values are extracted from a stack-allocated byte array using be16_to_cpup(). The pointers passed to this function are calculated as buf and buf + 3. Since the difference between the two pointers is an odd number of bytes, at least one of them is guaranteed to be at an unaligned offset.
This will trigger an alignment fault on strict-alignment architectures such as ARMv5 or SPARC, resulting in a kernel panic.
Fix the problem by using get_unaligned_be16() instead of be16_to_cpup(), and put_unaligned_be16() instead of cpu_to_be16().
From the CVE record · Linux
The Linux kernel’s sht3x hwmon driver reads temperature and humidity values through potentially unaligned pointers. On strict-alignment architectures such as ARMv5 or SPARC, an sht3x sensor update can cause an alignment fault and kernel panic. The input does not specify an attacker path or authentication or user-interaction requirements.
Engineers running Linux kernels with the sht3x hwmon driver on strict-alignment architectures should check their kernel version; affected versions are not specified.