Fix buffer overrun in HID-SENSOR name string
Subsystems (3)
PATCH v2 1/1 Fix buffer overrun in HID-SENSOR name string
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 parse 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, we initialize the real_usage string with 0s.
Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
--- drivers/hid/hid-sensor-custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-sensor-custom.c +1 -1
@@ -940,7 +940,7 @@ hid_sensor_register_platform_device(struct platform_device *pdev,struct hid_sensor_hub_device *hsdev, const struct hid_sensor_custom_match *match) { - char real_usage[HID_SENSOR_USAGE_LENGTH]; + char real_usage[HID_SENSOR_USAGE_LENGTH] = { 0 };struct platform_device *custom_pdev;const char *dev_name;char *c;
Signature · 1 line
2.17.1
Hi Todd,
Quoted 12 lines · Todd Brandt
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 parse 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.
Quoted 8 lines
To address this, we initialize the
real_usagestring with 0s.Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
Reported-and-tested-by Todd Brandt <[email protected]>Signed-off-by Todd Brandt <[email protected]>
Why is not Philip in the SoB list?
Anyway the original patch made it to stable, so:
and with those you can add:
Andi
Quoted 17 lines · Andi Shyti
Hi Todd,
Quoted 14 lines · Todd Brandt
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 parse 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, we initialize the
real_usagestring with 0s.
Quoted 9 lines
Quoted 6 lines
Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
Reported-and-tested-by Todd Brandt <[email protected]>Signed-off-by Todd Brandt <[email protected]>Why is not Philip in the SoB list?
Oh, sorry, I got feedback and assumed it needed more work on the changelog. I also forgot to copy over Phillip's SoB line so this one is probably worse than the original. The original was just fine, please ignore this one.
Quoted 11 lines
Anyway the original patch made it to stable, so:
Fixes 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iiosensors")
Cc: [email protected]and with those you can add:
Reviewed-by Andi Shyti <[email protected]>Andi
srinivas pandruvada
maintainerQuoted 9 lines · Todd Brandt
Quoted 8 lines · Andi Shyti
Hi Todd,
Quoted 5 lines · Todd Brandt
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"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
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 parse
s parse/parses
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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, we
Remove "we"
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
initialize the
real_usagestring with 0s.Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
You don't need the above two lines. You can add
Before your SOB.
Quoted 25 lines
Quoted 7 lines
Quoted 4 lines
Reported-and-tested-by: Todd Brandt
<[email protected]>Why is not Philip in the SoB list?
Oh, sorry, I got feedback and assumed it needed more work on the changelog. I also forgot to copy over Phillip's SoB line so this one is
probably worse than the original. The original was just fine, please ignore this one.Quoted 11 lines
Anyway the original patch made it to stable, so:
Fixes 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iiosensors")
Cc: [email protected]and with those you can add:
Reviewed-by Andi Shyti <[email protected]>Andi
Quoted 12 lines · Todd Brandt
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 parse 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.
Quoted 7 lines
To address this, we initialize the
real_usagestring with 0s.Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
Reported-and-tested-by Todd Brandt <[email protected]>Signed-off-by Todd Brandt <[email protected]>
SoB denotes that you reported this and tested. Otherwise shall we start adding Reported and Tested tags to all of our commits?
Best regards,
Krzysztof
Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · Todd Brandt
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 parse 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, we initialize the
real_usagestring with 0s.Philipp Jungkamp created this fix, I'm simply submitting it. I've verified it fixes bugzilla issue 217169
Quoted 7 lines
Quoted 2 lines
Reported-and-tested-by Todd Brandt <[email protected]>Signed-off-by Todd Brandt <[email protected]>SoB denotes that you reported this and tested. Otherwise shall we start
adding Reported and Tested tags to all of our commits?
I just copied it from someone else's post on the mailing list, I thought it was part of the standard lkml vernacular but I just looked it up and it's explicitly forbidden in Documentation/process/maintainer-top.rst line 385. So the answer is no. I'll not use it again.
Quoted 4 lines
Best regards,
Krzysztof