Request for reviews for 4.4-st56, 4.4-cip91
Hi!
Here's the manual backports to review for the next 4.4 release which, as always, can be found in https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/log/?h=linux-4.4.y-st-rc
72982c66626c7 exec: Fix ToCToU between perm check and set-uid/gid usage 8a5da8b6126e2 USB: serial: debug: do not echo input by default 4af9a95deab1a ALSA: line6: Fix racy access to midibufe8ec978a784ee i2c: smbus: Send alert notifications to all devices if source not found ad01acb964a7f i2c: smbus: Improve handling of stuck alerts 733e3de52985d SUNRPC: Fix a race to wake a sync task52bcba99c1772 udf: prevent integer overflow in udf_bitmap_free_blocks() 9f1f1bc701217 dev/parport: fix the array out-of-bounds risk 067c903b48150 tipc: Return non-zero value from tipc_udp_addr2str() on error d9b7eda8938fd hwrng: amd - Convert PCIBIOS_* return codes to errnos c75ed93ef09eb net: fec: Refactor: #define magic constants
Thanks for having a look.
CU
Uli
Hi!
Quoted 2 lines
Here's the manual backports to review for the next 4.4 release which, as always, can be found in https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/log/?h=linux-4.4.y-st-rc
Thanks for the heads-up. Your backports look good.
a > 72982c66626c7 exec: Fix ToCToU between perm check and set-uid/gid usage
a > 8a5da8b6126e2 USB: serial: debug: do not echo input by default
a > 4af9a95deab1a ALSA: line6: Fix racy access to midibuf
a > e8ec978a784ee i2c: smbus: Send alert notifications to all devices if source not found
a just a robustness agaisnt bad hw > ad01acb964a7f i2c: smbus: Improve handling of stuck alerts
a > 733e3de52985d SUNRPC: Fix a race to wake a sync task
a not a minimum fix > 52bcba99c1772 udf: prevent integer overflow in udf_bitmap_free_blocks()
!! still buggy? sizeof(buffer)-len < 0, but snprintf takes unsigned > 9f1f1bc701217 dev/parport: fix the array out-of-bounds risk a just a robustness > 067c903b48150 tipc: Return non-zero value from tipc_udp_addr2str() on error
a > d9b7eda8938fd hwrng: amd - Convert PCIBIOS_* return codes to errnos
a just a preparation > c75ed93ef09eb net: fec: Refactor: #define magic constants
The parport change... "9f1f1bc701217 dev/parport: fix the array out-of-bounds risk": I believe this is still not correct.
if ((str = info->class_name) != NULL)
- len += sprintf (buffer + len, "CLASS:%s;\n", str);
+ len += snprintf (buffer + len, sizeof(buffer) - len, "CLASS:%s;\n", str);
if ((str = info->model) != NULL)
- len += sprintf (buffer + len, "MODEL:%s;\n", str);
+ len += snprintf (buffer + len, sizeof(buffer) - len, "MODEL:%s;\n", str);
snprintf will return "how much it would like to write". So sizoeof(buffer) - len will be < 0, AFAICT. But snprintf takes unsigned value, so it will see huge space available and overwrite.
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 6 lines · CEST Pavel Machek
Quoted 2 lines
Here's the manual backports to review for the next 4.4 release which, as always, can be found in https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/log/?h=linux-4.4.y-st-rc
Thanks for the heads-up. Your backports look good.
Thanks for the review.
Quoted 11 lines
The parport change... "
9f1f1bc701217dev/parport: fix the array out-of-bounds risk": I believe this is still not correct.if ((str = info->class_name) != NULL)(quoted diff) +2
-2- len += sprintf (buffer + len, "CLASS:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "CLASS:%s;\n", str); if ((str = info->model) != NULL) - len += sprintf (buffer + len, "MODEL:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "MODEL:%s;\n", str);
Quoted 3 lines
snprintf will return "how much it would like to write". So sizoeof(buffer) - len will be < 0, AFAICT. But snprintf takes unsigned value, so it will see huge space available and overwrite.
You are right, this looks like it was meant to use scnprintf().
CU
Uli