Thread (3 messages) 3 messages, 3 authors, 2021-07-29

Re: [PATCH v2] drivers/bluetooth: Remove all strcpy() uses

flat view

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2021-07-29 11:47:29
Also in: linux-hardening, lkml

Hi Len,
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy() but in
this case it is better to use the scnprintf to simplify the arithmetic.

This is a previous step in the path to remove the strcpy() function
entirely from the kernel.

Signed-off-by: Len Baker <redacted>
---
Changelog v1 -> v2
- Add spaces to the "plus" sign.
- Use the correct size for the fw_dump_ptr buffer (Adam Sampson)

drivers/bluetooth/btmrvl_sdio.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
patch has been applied to bluetooth-next tree.

Regards

Marcel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help