diff options
author | Todd Brandt <[email protected]> | 2023-03-14 11:12:56 -0700 |
---|---|---|
committer | Jiri Kosina <[email protected]> | 2023-03-24 14:09:29 +0100 |
commit | 7c3650a8007c43bc1a60d8bdb4cdbea3ad9a7dd4 (patch) | |
tree | 0991968f95b5d54392de0cdaef69bd4c9b014790 /net/unix/af_unix.c | |
parent | dbf56d2fb53b7397002219bd221cfc72aadfdc82 (diff) |
HID: hid-sensor-custom: Fix buffer overrun in device name
On some platforms there are some platform devices created with
invalid names. For example: "HID-SENSOR-INT-020b?.39.auto" instead
of "HID-SENSOR-INT-020b.39.auto"
This string include some invalid characters, hence it will fail to
properly load the driver which will handle this custom sensor. Also
it is a problem for some user space tools, which parses the device
names from ftrace and dmesg.
This is because the string, real_usage, is not NULL terminated and
printed with %s to form device name.
To address this, initialize the real_usage string with 0s.
Reported-and-tested-by: Todd Brandt <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217169
Fixes: 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iio sensors")
Cc: [email protected]
Suggested-by: Philipp Jungkamp <[email protected]>
Signed-off-by: Philipp Jungkamp <[email protected]>
Signed-off-by: Todd Brandt <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions