breakings 866c0bd91a
busybox: Fix snprintf arguments in lock (#9239)
* busybox: fix busybox lock applet pidstr buffer overflow

Kernel setting `/proc/sys/kernel/pid_max` can be set up to 4194304 (7
digits) which will cause buffer overflow in busbox lock patch, this
often happens when running in a rootfs container environment.
This commit enlarges `pidstr` to 12 bytes to ensure a sufficient buffer
for pid number and an additional char '\n'.

Signed-off-by: Qichao Zhang <njuzhangqichao@gmail.com>

* busybox: Fix snprintf arguments in lock

The first argument for snprintf is the buffer and the 2. one is the
size. Fix the order. This broke the lock application.

Fixes: 34567750db2c ("busybox: fix busybox lock applet pidstr buffer overflow")
Reported-by: Hartmut Birr <e9hack@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Co-authored-by: Qichao Zhang <njuzhangqichao@gmail.com>
Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-14 10:18:09 +08:00
..
2020-07-02 23:30:56 +08:00
2017-09-06 19:19:45 +08:00
2020-07-02 23:30:56 +08:00
2021-06-15 17:58:07 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2020-07-02 23:30:56 +08:00
2021-06-15 17:58:07 +08:00
2021-06-15 17:58:07 +08:00