Skip to content

Bluetooth: hci_sock: Fix possible OOB write in create_monitor_event

Alexander Grund cip-dev 1 version Applied

Status from this message: Thank you, applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4string.h: add memcpy_and_pad()include/linux/string.h+29 -00 replies
2/4string.h: un-fortify memcpy_and_padinclude/linux/string.h+2 -130 replies
3/4string: uninline memcpy_and_padinclude/linux/string.h lib/string_helpers.c+22 -170 replies
4/4Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX namenet/bluetooth/hci_sock.c+2 -11 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchSagi GrimbergArnd BergmannGeert UytterhoevenAndy Shevchenko
1/4R-b
2/4A-b
3/4R-b A-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 4.4 0/4] Bluetooth: hci_sock: Fix possible OOB write in create_monitor_event

From: Alexander Grund <[email protected]>

This basically fixes the memcpy(dst, src, strlen(src)) where dst is a fixed size array and hence the copy can overflow it.

The changes to string[.h] introduce the required function.
The first commit (initially introducing it) uses some fortification checks & macros not available in 4.4 which I kept in as the get removed in the very next commit.
I also included the fixup commit moving it out of the header although I'm not sure this is strictly required in 4.4. But it doesn't hurt either.

Guenter Roeck (1):
string: uninline memcpy_and_pad

Kees Cook (1):
Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX
name

Martin Wilck (2):
string.h: add memcpy_and_pad()
string.h: un-fortify memcpy_and_pad

 include/linux/string.h   |  3 +++
 lib/string_helpers.c     | 20 ++++++++++++++++++++
 net/bluetooth/hci_sock.c |  3 ++-
 3 files changed, 25 insertions(+), 1 deletion(-)
Signature · 1 line
2.40.1