Commit 97efdab
ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb
commit 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 upstream.
In ath9k_hif_usb_rx_cb interface number is assumed to be 0.
usb_ifnum_to_if(urb->dev, 0)
But it isn't always true.
The case reported by syzbot:
https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com
usb 2-1: new high-speed USB device number 2 using dummy_hcd
usb 2-1: config 1 has an invalid interface number: 2 but max is 0
usb 2-1: config 1 has no interface number 0
usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice=
1.08
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
general protection fault, probably for non-canonical address
0xdffffc0000000015: 0000 [Demon000#1] SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af]
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0
Call Trace
__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
__do_softirq+0x21e/0x950 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x178/0x1a0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:546 [inline]
smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200404041838.10426-6-hqjagain@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1442865 commit 97efdab
2 files changed
Lines changed: 42 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | | - | |
645 | | - | |
646 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
690 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
691 | 694 | | |
692 | | - | |
693 | | - | |
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
| |||
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| 752 | + | |
751 | 753 | | |
752 | 754 | | |
753 | 755 | | |
| |||
793 | 795 | | |
794 | 796 | | |
795 | 797 | | |
796 | | - | |
| 798 | + | |
797 | 799 | | |
798 | 800 | | |
799 | 801 | | |
| |||
830 | 832 | | |
831 | 833 | | |
832 | 834 | | |
833 | | - | |
| 835 | + | |
834 | 836 | | |
| 837 | + | |
835 | 838 | | |
836 | 839 | | |
837 | 840 | | |
838 | 841 | | |
839 | 842 | | |
840 | 843 | | |
841 | 844 | | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
842 | 851 | | |
843 | 852 | | |
844 | 853 | | |
| |||
853 | 862 | | |
854 | 863 | | |
855 | 864 | | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
856 | 868 | | |
857 | 869 | | |
858 | 870 | | |
859 | 871 | | |
860 | | - | |
| 872 | + | |
861 | 873 | | |
862 | 874 | | |
863 | 875 | | |
| |||
883 | 895 | | |
884 | 896 | | |
885 | 897 | | |
| 898 | + | |
| 899 | + | |
886 | 900 | | |
887 | 901 | | |
888 | 902 | | |
| |||
894 | 908 | | |
895 | 909 | | |
896 | 910 | | |
897 | | - | |
| 911 | + | |
898 | 912 | | |
| 913 | + | |
899 | 914 | | |
900 | 915 | | |
901 | 916 | | |
902 | 917 | | |
903 | 918 | | |
904 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
905 | 926 | | |
906 | 927 | | |
907 | 928 | | |
| |||
916 | 937 | | |
917 | 938 | | |
918 | 939 | | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
919 | 943 | | |
920 | 944 | | |
921 | 945 | | |
922 | 946 | | |
923 | | - | |
| 947 | + | |
924 | 948 | | |
925 | 949 | | |
926 | 950 | | |
| |||
946 | 970 | | |
947 | 971 | | |
948 | 972 | | |
| 973 | + | |
| 974 | + | |
949 | 975 | | |
950 | 976 | | |
951 | 977 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
0 commit comments