Commit 51eda36
committed
Bluetooth: SCO: Fix not validating setsockopt user input
syzbot reported sco_sock_setsockopt() 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 sco_sock_setsockopt+0xc0b/0xf90
net/bluetooth/sco.c:893
Read of size 4 at addr ffff88805f7b15a3 by task syz-executor.5/12578
Fixes: ad10b1a ("Bluetooth: Add Bluetooth socket voice option")
Fixes: b96e9c6 ("Bluetooth: Add BT_DEFER_SETUP option to sco socket")
Fixes: 00398e1 ("Bluetooth: Add support for BT_PKT_STATUS CMSG data for SCO connections")
Fixes: f687340 ("Bluetooth: Allow setting of codec for HFP offload use case")
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>1 parent 45d355a commit 51eda36
2 files changed
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
588 | 597 | | |
589 | 598 | | |
590 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
847 | | - | |
| 846 | + | |
| 847 | + | |
848 | 848 | | |
849 | | - | |
850 | 849 | | |
851 | 850 | | |
852 | 851 | | |
| |||
863 | 862 | | |
864 | 863 | | |
865 | 864 | | |
866 | | - | |
867 | | - | |
868 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
869 | 868 | | |
870 | | - | |
871 | 869 | | |
872 | 870 | | |
873 | 871 | | |
| |||
890 | 888 | | |
891 | 889 | | |
892 | 890 | | |
893 | | - | |
894 | | - | |
| 891 | + | |
| 892 | + | |
895 | 893 | | |
896 | | - | |
897 | 894 | | |
898 | 895 | | |
899 | 896 | | |
| |||
934 | 931 | | |
935 | 932 | | |
936 | 933 | | |
937 | | - | |
| 934 | + | |
| 935 | + | |
938 | 936 | | |
939 | | - | |
940 | 937 | | |
941 | 938 | | |
942 | 939 | | |
| |||
0 commit comments