Commit d072ea2
Bluetooth: RFCOMM: Fix not validating setsockopt user input
commit a97de7b upstream.
syzbot reported rfcomm_sock_setsockopt_old() is copying data without
checking user input length.
BUG: KASAN: slab-out-of-bounds in copy_from_sockptr_offset
include/linux/sockptr.h:49 [inline]
BUG: KASAN: slab-out-of-bounds in copy_from_sockptr
include/linux/sockptr.h:55 [inline]
BUG: KASAN: slab-out-of-bounds in rfcomm_sock_setsockopt_old
net/bluetooth/rfcomm/sock.c:632 [inline]
BUG: KASAN: slab-out-of-bounds in rfcomm_sock_setsockopt+0x893/0xa70
net/bluetooth/rfcomm/sock.c:673
Read of size 4 at addr ffff8880209a8bc3 by task syz-executor632/5064
Fixes: 9f2c8a0 ("Bluetooth: Replace RFCOMM link mode with security level")
Fixes: bb23c0a ("Bluetooth: Add support for deferring RFCOMM connection setup")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Keerthana K <keerthana.kalyanasundaram@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent d19a865 commit d072ea2
1 file changed
+5
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
670 | 669 | | |
671 | 670 | | |
672 | 671 | | |
| |||
688 | 687 | | |
689 | 688 | | |
690 | 689 | | |
691 | | - | |
692 | | - | |
693 | | - | |
| 690 | + | |
| 691 | + | |
694 | 692 | | |
695 | | - | |
696 | 693 | | |
697 | 694 | | |
698 | 695 | | |
| |||
708 | 705 | | |
709 | 706 | | |
710 | 707 | | |
711 | | - | |
712 | | - | |
| 708 | + | |
| 709 | + | |
713 | 710 | | |
714 | | - | |
715 | 711 | | |
716 | 712 | | |
717 | 713 | | |
| |||
0 commit comments