aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
AgeCommit message (Collapse)Author
2021-03-17staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()Dan Carpenter
commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream. The "ie_len" is a value in the 1-255 range that comes from the user. We have to cap it to ensure that it's not too large or it could lead to memory corruption. Fixes: 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/YEHyQCrFZKTXyT7J@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-17staging: rtl8188eu: prevent ->ssid overflow in rtw_wx_set_scan()Dan Carpenter
commit 74b6b20df8cfe90ada777d621b54c32e69e27cd7 upstream. This code has a check to prevent read overflow but it needs another check to prevent writing beyond the end of the ->ssid[] array. Fixes: a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/YEHymwsnHewzoam7@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-04staging: rtl8188eu: Add Edimax EW-7811UN V2 to device tableMartin Kaiser
commit 7a8d2f1908a59003e55ef8691d09efb7fbc51625 upstream. The Edimax EW-7811UN V2 uses an RTL8188EU chipset and works with this driver. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210204085217.9743-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-01staging:r8188eu: avoid skb_clone for amsdu to msdu conversionIvan Safonov
[ Upstream commit 628cbd971a927abe6388d44320e351c337b331e4 ] skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Link: https://lore.kernel.org/r/20200423191404.12028-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-02staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device tableLarry Finger
commit 38ef48f7d4b7342f145a1b4f96023bde99aeb245 upstream. The ASUS USB-N10 Nano B1 has been reported as a new RTL8188EU device. Add it to the device tables. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: kovi <zraetn@gmail.com> Cc: Stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200321180011.26153-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25staging: rtl8188eu: Add device id for MERCUSYS MW150US v2Michael Straube
commit bb5786b9286c253557a0115bc8d21879e61b7b94 upstream. This device was added to the stand-alone driver on github. Add it to the staging driver as well. Link: https://github.com/lwfinger/rtl8188eu/commit/2141f244c3e7 Signed-off-by: Michael Straube <straube.linux@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200312093652.13918-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-28staging: rtl8188eu: Fix potential overuse of kernel memoryLarry Finger
commit 4ddf8ab8d15ddbc52eefb44eb64e38466ce1f70f upstream. In routine wpa_supplicant_ioctl(), the user-controlled p->length is checked to be at least the size of struct ieee_param size, but the code does not detect the case where p->length is greater than the size of the struct, thus a malicious user could be wasting kernel memory. Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). Reported by: Pietro Oliva <pietroliva@gmail.com> Cc: Pietro Oliva <pietroliva@gmail.com> Cc: Stable <stable@vger.kernel.org> Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20200210180235.21691-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-28staging: rtl8188eu: Fix potential security holeLarry Finger
commit 499c405b2b80bb3a04425ba3541d20305e014d3e upstream. In routine rtw_hostapd_ioctl(), the user-controlled p->length is assumed to be at least the size of struct ieee_param size, but this assumption is never checked. This could result in out-of-bounds read/write on kernel heap in case a p->length less than the size of struct ieee_param is specified by the user. If p->length is allowed to be greater than the size of the struct, then a malicious user could be wasting kernel memory. Fixes commit a2c60d42d97c ("Add files for new driver - part 16"). Reported by: Pietro Oliva <pietroliva@gmail.com> Cc: Pietro Oliva <pietroliva@gmail.com> Cc: Stable <stable@vger.kernel.org> Fixes: a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16") Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20200210180235.21691-2-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-24staging: rtl8188: avoid excessive stack usageArnd Bergmann
[ Upstream commit c497ae2077c055b85c1bf04f3d182a84bd8f365b ] The rtl8188 copy of the os_dep support code causes a warning about a very significant stack usage in the translate_scan() function: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'translate_scan': drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:306:1: error: the frame size of 1560 bytes is larger than 1400 bytes [-Werror=frame-larger-than=] Use the same trick as in the rtl8723bs copy of the same function, and allocate it dynamically. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200104214832.558198-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-14staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21Michael Straube
commit 58dcc5bf4030cab548d5c98cd4cd3632a5444d5a upstream. This device was added to the stand-alone driver on github. Add it to the staging driver as well. Link: https://github.com/lwfinger/rtl8188eu/commit/b9b537aa25a8 Signed-off-by: Michael Straube <straube.linux@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20191228143725.24455-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-31staging: rtl8188eu: fix possible null dereferenceConnor Kuehl
[ Upstream commit 228241944a48113470d3c3b46c88ba7fbe0a274b ] Inside a nested 'else' block at the beginning of this function is a call that assigns 'psta' to the return value of 'rtw_get_stainfo()'. If 'rtw_get_stainfo()' returns NULL and the flow of control reaches the 'else if' where 'psta' is dereferenced, then we will dereference a NULL pointer. Fix this by checking if 'psta' is not NULL before reading its 'psta->qos_option' data member. Addresses-Coverity: ("Dereference null return value") Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20190926150317.5894-1-connor.kuehl@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-17staging: rtl8188eu: fix interface sanity checkJohan Hovold
commit 74ca34118a0e05793935d804ccffcedd6eb56596 upstream. Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. Failing to do so could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: c2478d39076b ("staging: r8188eu: Add files for new driver - part 20") Cc: stable <stable@vger.kernel.org> # 3.12 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20191210114751.5119-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-06staging: rtl8188eu: fix null dereference when kzalloc failsConnor Kuehl
[ Upstream commit 955c1532a34305f2f780b47f0c40cc7c65500810 ] If kzalloc() returns NULL, the error path doesn't stop the flow of control from entering rtw_hal_read_chip_version() which dereferences the null pointer. Fix this by adding a 'goto' to the error path to more gracefully handle the issue and avoid proceeding with initialization steps that we're no longer prepared to handle. Also update the debug message to be more consistent with the other debug messages in this function. Addresses-Coverity: ("Dereference after null check") Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com> Link: https://lore.kernel.org/r/20190927214415.899-1-connor.kuehl@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-04staging: rtl8188eu: Fix potential NULL pointer dereference of kcallocAditya Pakki
[ Upstream commit 7671ce0d92933762f469266daf43bd34d422d58c ] hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Acked-by: Mukesh Ojha <mojha@codeaurora.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
2019-01-31staging: rtl8188eu: Add device code for D-Link DWA-121 rev B1Michael Straube
commit 5f74a8cbb38d10615ed46bc3e37d9a4c9af8045a upstream. This device was added to the stand-alone driver on github. Add it to the staging driver as well. Link: https://github.com/lwfinger/rtl8188eu/commit/a0619a07cd1e Signed-off-by: Michael Straube <straube.linux@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-16staging: rtl8188eu: Fix module loading from tasklet for WEP encryptionLarry Finger
commit 7775665aadc48a562051834a73519129bf717d73 upstream. Commit 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a WEP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") Cc: Stable <stable@vger.kernel.org> # v4.17+ Cc: Michael Straube <straube.linux@gmail.com> Cc: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-16staging: rtl8188eu: Fix module loading from tasklet for CCMP encryptionLarry Finger
commit 84cad97a717f5749a0236abd5ce68da582ea074f upstream. Commit 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a CCMP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") Cc: Stable <stable@vger.kernel.org> # v4.17+ Reported-and-tested-by: Michael Straube <straube.linux@gmail.com> Cc: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-18Merge tag 'staging-4.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO updates from Greg KH: "Here are the big staging/iio patches for 4.19-rc1. Lots of churn here, with tons of cleanups happening in staging drivers, a removal of an old crypto driver that no one was using (skein), and the addition of some new IIO drivers. Also added was a "gasket" driver from Google that needs loads of work and the erofs filesystem. Even with adding all of the new drivers and a new filesystem, we are only adding about 1000 lines overall to the kernel linecount, which shows just how much cleanup happened, and how big the unused crypto driver was. All of these have been in the linux-next tree for a while now with no reported issues" * tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (903 commits) staging:rtl8192u: Remove unused macro definitions - Style staging:rtl8192u: Add spaces around '+' operator - Style staging:rtl8192u: Remove stale comment - Style staging: rtl8188eu: remove unused mp_custom_oid.h staging: fbtft: Add spaces around / - Style staging: fbtft: Erases some repetitive usage of function name - Style staging: fbtft: Adjust some empty-line problems - Style staging: fbtft: Removes one nesting level to help readability - Style staging: fbtft: Changes gamma table to define. staging: fbtft: A bit more information on dev_err. staging: fbtft: Fixes some alignment issues - Style staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style staging: rtl8188eu: remove unused array dB_Invert_Table staging: rtl8188eu: remove whitespace, add missing blank line staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.c staging: rtl8188eu: remove whitespace - style staging: rtl8188eu: cleanup block comment - style staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.c staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.c staging: rtlwifi: refactor rtl_get_tcb_desc ...
2018-08-08staging: rtl8188eu: remove unused mp_custom_oid.hMichael Straube
The header mp_custom_oid.h is not used, so remove it. 'git grep mp_custom_oid.h drivers/staging/rtl8188eu/' returns nothing. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: remove unused array dB_Invert_TableColin Ian King
Array dB_Invert_Table is declared but not used, hence it is redundant and can be removed. Cleans up clang warning: warning: ‘dB_Invert_Table’ defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: remove whitespace, add missing blank lineMichael Straube
Replace tabs with spaces and/or remove spaces where appropriate. Add a missing blank line after declarations. Also clears checkpatch warnings. WARNING: Statements should start on a tabstop WARNING: suspect code indent for conditional statements (8, 17) Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.cMichael Straube
Use is_multicast_ether_addr instead of custom IS_MCAST in core/rtw_sta_mgt.c. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: remove whitespace - styleMichael Straube
Replace tabs with spaces and/or remove spaces where appropriate. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: cleanup block comment - styleMichael Straube
Cleanup a block comment to conform with kernel coding style. Also cleans 'line over 80 characters' checkpatch warnings. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.cMichael Straube
Use is_multicast_ether_addr instead of custom IS_MCAST in hal/rtl8188eu_xmit.c. There is only one use, so remove the extra variable for the result of IS_MCAST. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.cMichael Straube
Use is_multicast_ether_addr instead of custom IS_MCAST in os_dep/recv_linux.c. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08Revert "staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames"Michael Straube
On a Raven Ridge system with a r8188eu usb wifi device commit 515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames") is causing two bugs and a warning in dmesg: [ 22.618465] BUG: scheduling while atomic: NetworkManager/489/0x00000202 [ 22.618466] Modules linked in: amdkfd amd_iommu_v2 amdgpu nls_iso8859_1 nls_cp437 vfat fat r8188eu(C) edac_mce_amd chash kvm_amd gpu_sched i2c_algo_bit ccp ttm rng_core lib80211 kvm snd_hda_codec_realtek snd_hda_codec_generic cfg80211 snd_hda_codec_hdmi snd_hda_intel input_leds drm_kms_helper irqbypass snd_hda_codec crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc rfkill led_class mousedev joydev wmi_bmof snd_hda_core drm aesni_intel snd_hwdep aes_x86_64 crypto_simd cryptd glue_helper snd_pcm pcspkr sp5100_tco snd_timer r8169 k10temp agpgart i2c_piix4 snd mii syscopyarea sysfillrect sysimgblt fb_sys_fops soundcore rtc_cmos evdev gpio_amdpt pinctrl_amd mac_hid wmi pcc_cpufreq acpi_cpufreq crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto hid_generic usbhid hid sd_mod [ 22.618549] ahci xhci_pci libahci xhci_hcd crc32c_intel libata usbcore scsi_mod usb_common [ 22.618554] Preemption disabled at: [ 22.618558] [<ffffffff94600954>] __dev_queue_xmit+0x74/0x910 [ 22.618561] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G C 4.18.0-rc7-staging+ #14 [ 22.618562] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.618563] Call Trace: [ 22.618569] dump_stack+0x5c/0x80 [ 22.618571] ? __dev_queue_xmit+0x74/0x910 [ 22.618574] __schedule_bug.cold.14+0x82/0x9b [ 22.618576] __schedule+0x6fd/0x8b0 [ 22.618578] ? enqueue_task_fair+0xc3/0x730 [ 22.618580] schedule+0x32/0x90 [ 22.618581] schedule_timeout+0x311/0x4a0 [ 22.618583] ? _raw_spin_unlock_irqrestore+0x20/0x40 [ 22.618585] ? try_to_wake_up+0x231/0x480 [ 22.618586] wait_for_common+0x15f/0x190 [ 22.618588] ? wake_up_q+0x70/0x70 [ 22.618597] ? rtw_aes_encrypt+0x26f/0x290 [r8188eu] [ 22.618598] wait_for_completion_killable+0x19/0x30 [ 22.618601] call_usermodehelper_exec+0x115/0x160 [ 22.618603] __request_module+0x1ac/0x3e2 [ 22.618606] ? netlink_broadcast_filtered+0x142/0x400 [ 22.618607] ? netlink_broadcast+0xf/0x20 [ 22.618615] rtw_aes_encrypt+0x26f/0x290 [r8188eu] [ 22.618622] ? rtw_get_stainfo+0xe6/0x130 [r8188eu] [ 22.618629] rtw_xmitframe_coalesce+0x950/0xb00 [r8188eu] [ 22.618631] ? _raw_spin_lock_irqsave+0x25/0x50 [ 22.618638] rtw_hal_xmit+0x83/0x130 [r8188eu] [ 22.618645] rtw_xmit+0x258/0x5d0 [r8188eu] [ 22.618652] rtw_xmit_entry+0xe8/0x2e7 [r8188eu] [ 22.618654] dev_hard_start_xmit+0xa5/0x240 [ 22.618657] sch_direct_xmit+0x150/0x340 [ 22.618658] __dev_queue_xmit+0x2f6/0x910 [ 22.618661] packet_sendmsg+0x948/0x15a7 [ 22.618663] ? attach_to_pi_owner+0x38/0x180 [ 22.618666] sock_sendmsg+0x33/0x40 [ 22.618668] __sys_sendto+0xee/0x160 [ 22.618670] ? memzero_explicit+0xa/0x10 [ 22.618672] ? urandom_read+0x120/0x270 [ 22.618675] __x64_sys_sendto+0x24/0x30 [ 22.618677] do_syscall_64+0x5b/0x170 [ 22.618678] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.618680] RIP: 0033:0x7f0942790c12 [ 22.618680] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.618700] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.618701] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.618702] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.618703] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.618703] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.618704] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 [ 22.620488] lib80211_crypt: registered algorithm 'CCMP' [ 22.620735] ------------[ cut here ]------------ [ 22.620738] DEBUG_LOCKS_WARN_ON(val > preempt_count()) [ 22.620744] WARNING: CPU: 3 PID: 489 at kernel/sched/core.c:3246 preempt_count_sub+0x5a/0x90 [ 22.620749] Modules linked in: lib80211_crypt_ccmp amdkfd amd_iommu_v2 amdgpu nls_iso8859_1 nls_cp437 vfat fat r8188eu(C) edac_mce_amd chash kvm_amd gpu_sched i2c_algo_bit ccp ttm rng_core lib80211 kvm snd_hda_codec_realtek snd_hda_codec_generic cfg80211 snd_hda_codec_hdmi snd_hda_intel input_leds drm_kms_helper irqbypass snd_hda_codec crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc rfkill led_class mousedev joydev wmi_bmof snd_hda_core drm aesni_intel snd_hwdep aes_x86_64 crypto_simd cryptd glue_helper snd_pcm pcspkr sp5100_tco snd_timer r8169 k10temp agpgart i2c_piix4 snd mii syscopyarea sysfillrect sysimgblt fb_sys_fops soundcore rtc_cmos evdev gpio_amdpt pinctrl_amd mac_hid wmi pcc_cpufreq acpi_cpufreq crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto hid_generic [ 22.620792] usbhid hid sd_mod ahci xhci_pci libahci xhci_hcd crc32c_intel libata usbcore scsi_mod usb_common [ 22.620803] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G WC 4.18.0-rc7-staging+ #14 [ 22.620804] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.620808] RIP: 0010:preempt_count_sub+0x5a/0x90 [ 22.620809] Code: 14 f7 6b c3 e8 57 89 2d 00 85 c0 74 f6 8b 15 55 6a 5a 01 85 d2 75 ec 48 c7 c6 2e 01 e7 94 48 c7 c7 db b2 e5 94 e8 90 77 fd ff <0f> 0b c3 84 d2 75 c9 e8 2a 89 2d 00 85 c0 74 c9 8b 05 28 6a 5a 01 [ 22.620842] RSP: 0018:ffffa1904133bc48 EFLAGS: 00010286 [ 22.620844] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001 [ 22.620846] RDX: 0000000080000001 RSI: ffffffff94e82606 RDI: 00000000ffffffff [ 22.620847] RBP: ffff8eb4449eac00 R08: 0000001af4246984 R09: 00000000000003f1 [ 22.620849] R10: ffffffff955f7700 R11: 0000000000000000 R12: ffff8eb4449eacac [ 22.620850] R13: ffff8eb4565da800 R14: ffff8eb453ca2000 R15: 0000000000000003 [ 22.620852] FS: 00007f0944d69000(0000) GS:ffff8eb45ecc0000(0000) knlGS:0000000000000000 [ 22.620853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 22.620854] CR2: 00007ffe20518fa8 CR3: 0000000207844000 CR4: 00000000003406e0 [ 22.620855] Call Trace: [ 22.620859] _raw_spin_unlock+0x16/0x30 [ 22.620862] sch_direct_xmit+0x178/0x340 [ 22.620866] __dev_queue_xmit+0x2f6/0x910 [ 22.620870] packet_sendmsg+0x948/0x15a7 [ 22.620873] ? attach_to_pi_owner+0x38/0x180 [ 22.620877] sock_sendmsg+0x33/0x40 [ 22.620880] __sys_sendto+0xee/0x160 [ 22.620885] ? memzero_explicit+0xa/0x10 [ 22.620887] ? urandom_read+0x120/0x270 [ 22.620891] __x64_sys_sendto+0x24/0x30 [ 22.620893] do_syscall_64+0x5b/0x170 [ 22.620896] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.620898] RIP: 0033:0x7f0942790c12 [ 22.620899] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.620925] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.620928] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.620929] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.620930] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.620931] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.620933] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 [ 22.620936] ---[ end trace ecf9299fa6cc3176 ]--- [ 22.620940] BUG: using __this_cpu_read() in preemptible [00000000] code: NetworkManager/489 [ 22.620942] caller is __local_bh_enable_ip+0x50/0x80 [ 22.620945] CPU: 3 PID: 489 Comm: NetworkManager Tainted: G WC 4.18.0-rc7-staging+ #14 [ 22.620946] Hardware name: Gigabyte Technology Co., Ltd. A320M-S2H/A320M-S2H-CF, BIOS F23d 04/17/2018 [ 22.620947] Call Trace: [ 22.620950] dump_stack+0x5c/0x80 [ 22.620955] check_preemption_disabled.cold.0+0x46/0x51 [ 22.620958] __local_bh_enable_ip+0x50/0x80 [ 22.620961] __dev_queue_xmit+0x450/0x910 [ 22.620964] packet_sendmsg+0x948/0x15a7 [ 22.620967] ? attach_to_pi_owner+0x38/0x180 [ 22.620971] sock_sendmsg+0x33/0x40 [ 22.620973] __sys_sendto+0xee/0x160 [ 22.620976] ? memzero_explicit+0xa/0x10 [ 22.620978] ? urandom_read+0x120/0x270 [ 22.620982] __x64_sys_sendto+0x24/0x30 [ 22.620984] do_syscall_64+0x5b/0x170 [ 22.620986] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 22.620990] RIP: 0033:0x7f0942790c12 [ 22.620991] Code: 48 83 ec 18 44 89 4c 24 08 e8 9a f5 ff ff 44 8b 4c 24 08 4d 89 f8 45 89 f2 89 c5 4c 89 ea 4c 89 e6 89 df b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3a 89 ef 48 89 44 24 08 e8 ca f5 ff ff 48 8b [ 22.621017] RSP: 002b:00007ffe2051be30 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 22.621020] RAX: ffffffffffffffda RBX: 0000000000000011 RCX: 00007f0942790c12 [ 22.621021] RDX: 0000000000000148 RSI: 0000559278761700 RDI: 0000000000000011 [ 22.621024] RBP: 0000000000000000 R08: 00005592787aa860 R09: 0000000000000014 [ 22.621025] R10: 0000000000000000 R11: 0000000000000293 R12: 0000559278761700 [ 22.621026] R13: 0000000000000148 R14: 0000000000000000 R15: 00005592787aa860 Revert the commit fixes the issues and dmesg looks good again. Fixes: 515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames") Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: rtl8188eu: remove unnecessary includesMichael Straube
In the header rtw_iol.h there is only one function declared. Remove the include of rtw_iol.h from files that do not use this function. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: rtl8188eu: remove redundant includeMichael Straube
The header osdep_service.h is included from drv_types.h, so remove the redundant include. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: rtl8188eu: remove unnecessary parenthesesMichael Straube
Remove unnecessary parentheses from if conditions. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: rtl8188eu: rename rtw_IOL_appliedMichael Straube
Rename rtw_IOL_applied to be all lowercase. rtw_IOL_applied -> rtw_iol_applied Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: rtl8188eu: use phydm_regdefine11n.h from rtlwifiMichael Straube
Use rtlwifi/phydm/phydm_regdefine11n.h instead of odm_RegDefine11N.h and remove the now unused odm_RegDefine11N.h. The defines from odm_RegDefine11N.h are defined with the same values in rtlwifi/phydm/phydm_regdefine11n.h. There is one define that is named different, but that one is not used in the rtl8188eu code. rtl8188eu: #define ODM_REG_RX_PATH_11N 0xC04 rtlwifi: #defnie ODM_REG_BB_RX_PATH_11N 0xC04 Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/netDavid S. Miller
The BTF conflicts were simple overlapping changes. The virtio_net conflict was an overlap of a fix of statistics counter, happening alongisde a move over to a bonafide statistics structure rather than counting value on the stack. Signed-off-by: David S. Miller <davem@davemloft.net>
2018-08-02staging: rtl8188eu: rename odm_RTL8188E - styleMichael Straube
Rename source and header file to avoid CamelCase. odm_RTL8188E.c -> odm_rtl8188e.c odm_RTL8188E.h -> odm_rtl8188e.h Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: remove unused rtw_remove_bcn_ie()Michael Straube
The function rtw_remove_bcn_ie() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: remove unused rtw_add_bcn_ie()Michael Straube
The function rtw_add_bcn_ie() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: remove unnecessary parentheses - styleMichael Straube
Remove unnecessary parentheses to improve readability. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: fix comparsions to NULL - styleMichael Straube
Use x instead of x != NULL. Use !x instead of x == NULL. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: fix indentation - styleMichael Straube
Fix indentation to clear checkpatch warnings. WARNING: suspect code indent for conditional statements Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: use is_broadcast_ether_addrMichael Straube
Use is_broadcast_ether_addr instead of checking each byte of the address array for 0xff. Shortens the code and improves readability. As required by is_broadcast_ether_addr, the address array sta_addr is properly aligned in all uses. Thanks to Joe Perches. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: rtl8188eu: use is_multicast_ether_addrMichael Straube
Use is_multicast_ether_addr instead of custom IS_MCAST. The variable for the result of IS_MCAST was only used in the if conditional. So remove the extra variable and move the call to is_multicast_ether_addr into the conditional. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: remove unnecessary parenthesesMichael Straube
Remove unnecessary parentheses, also clears checkpatch issues about missing spaces around '-'. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: fix comparsion to trueMichael Straube
Use if(x) instead of if(x == true). Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: replace tabs with spacesMichael Straube
Replace tabs with spaces in function definition and variable declarations. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: remove redundant includesMichael Straube
Both osdep_service.h and drv_types.h are included from hal_intf.h, so remove the redundant includes from hal_intf.c. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: remove unused should_forbid_n_rate()Michael Straube
The function should_forbid_n_rate() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging: rtl8188eu: remove unused dump_txrpt_ccx_88e()Michael Straube
The function dump_txrpt_ccx_88e() is nerver used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30Revert "staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames"Greg Kroah-Hartman
This reverts commit 0d4876f4e977798238db594321db9184704fcf5d as it breaks the build once 4.18-rc7 was merged into the staging-next tree. Cc: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30Merge 4.18-rc7 into staging-nextGreg Kroah-Hartman
We want the staging changes in here for testing and merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-29staging: rtl8188eu: remove unused rtw_calculate_wlan_pkt_size_by_attribue()Michael Straube
The function rtw_calculate_wlan_pkt_size_by_attribue() also defined as rtw_wlan_pkt_size() is never used, so remove it. Discovered by cppcheck. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>