[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-hardening
Subject:    Re: [PATCH v2] drivers/bluetooth: Remove all strcpy() uses
From:       Marcel Holtmann <marcel () holtmann ! org>
Date:       2021-07-29 11:47:25
Message-ID: B9CF4857-98A5-418D-B689-A13A230A6641 () holtmann ! org
[Download RAW message or body]

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 <len.baker@gmx.com>
> ---
> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic