summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
AgeCommit message (Collapse)Author
2023-10-15staging: rtl8192u: Remove broken driverPhilipp Hortmann
Tests on rtl8192u hardware have shown that this driver is broken since 2016. Remove broken driver. Find fix for two bugs in second link. Link: https://lore.kernel.org/lkml/db98d9ac-7650-4a72-8eb9-4def1f17ea0d@app.fastmail.com/ Link: https://lore.kernel.org/lkml/cover.1697089416.git.philipp.g.hortmann@gmail.com/ Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/20231014211051.GA29518@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-22staging: rtl8192u: change get_key functions to return 0 instead of -1Rebecca Mckeever
Currently, these three get_key functions return -1 when the provided len value is less a specific key length value, which can result in buffer overflow depending on how the returned value is used. These functions are used in three places in ieee80211/ieee80211_wx.c: ieee80211_wx_get_encode() : The behavior of this function will be unchanged. ieee80211_wx_get_encode_ext() : The result of the get_key function is written to ext->key_len, resulting in a buffer overflow if the result is negative. ieee80211_wx_set_encode() : The behavior of this function will change. When len is less than the key length value, it will set a default key of all 0. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/Yl/7QPKXer7YtXOs@bertie Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-25staging: rtl8192u: rework init and exit functionTong Zhang
The init and exit functions are not releasing resource properly. An error can be observed when we load/unload/load r8192u_usb module due to this issue. This patch rework init and exit functions to do proper resource release on init error and module unload. The __exit attribute is stripped from some functions since they are now being used by module init functions. [ 493.068012] proc_dir_entry 'net/ieee80211' already registered [ 493.271973] proc_mkdir+0x18/0x20 [ 493.272136] ieee80211_debug_init+0x28/0xde8 [r8192u_usb] [ 493.272404] rtl8192_usb_module_init+0x10/0x161 [r8192u_usb] [ 13.910616] proc_dir_entry 'net/rtl819xU' already registered [ 13.918931] proc_mkdir+0x18/0x20 [ 13.919098] rtl8192_usb_module_init+0x142/0x16d [r8192u_usb] Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tong Zhang <ztong0001@gmail.com> Link: https://lore.kernel.org/r/20220224064033.1530924-3-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-25mm: remove kzfree() compatibility definitionEric Biggers
Commit 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()") renamed kzfree() to kfree_sensitive(), but it left a compatibility definition of kzfree() to avoid being too disruptive. Since then a few more instances of kzfree() have slipped in. Just get rid of them and remove the compatibility definition once and for all. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-09-11staging/rtl8192u: switch to RC4 library interfaceArd Biesheuvel
Switch to the ARC4 library interface, to remove the pointless dependency on the skcipher API, from which we will hopefully be able to drop ecb(arc4) skcipher support. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-08-21staging: rtl8192u: fix spacing in ieee80211Stephen Brennan
Checkpatch emits several errors, warnings, and checks about spacing. Apply checkpatch's suggested spacing rules. Signed-off-by: Stephen Brennan <stephen@brennan.io> Link: https://lore.kernel.org/r/20190821143540.4501-4-stephen@brennan.io Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: rtl8192u: add proper SPDX identifiers on files that did not have them.Greg Kroah-Hartman
There were a few files for the rtl8192u driver that did not have SPDX identifiers on them, so fix that up. At the same time, remove the "free form" text that specified the license of the file, as that is impossible for any tool to properly parse. Cc: John Whitmore <johnfwhitmore@gmail.com> Cc: Bhanusree Pola <bhanusreemahesh@gmail.com> Cc: Sanjana Sanikommu <sanjana99reddy99@gmail.com> Cc: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-28lib80211: Remove VLA usage of skcipherKees Cook
In the quest to remove all stack VLA usage from the kernel[1], this replaces struct crypto_skcipher and SKCIPHER_REQUEST_ON_STACK() usage with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(), which uses a fixed stack size. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: Johannes Berg <johannes@sipsolutions.net> Cc: linux-wireless@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-04-23staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in prism2_wep_initJia-Ju Bai
prism2_wep_init() is never called in atomic context. prism2_wep_init() is only set as ".init" in struct ieee80211_crypto_ops. The call chains ending up at "->init" function are: [1] ->init() <- ieee80211_wpa_set_encryption() <- ieee80211_wpa_supplicant_ioctl() [2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <- r8192_wx_set_enc_ext() [3] ->init() <- ieee80211_wx_set_encode_rsl() <- r8192_wx_set_enc() ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and r8192_wx_set_enc() call mutex_lock(), which indicates these functions are not called in atomic context. Despite never getting called from atomic context, prism2_wep_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: rtl8192u: Clean up tests if NULL returned on failuresimran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: rtl8192u: Fixing no new typedef warningsimran singhal
This patch fixes following checkpatch.pl warnings: WARNING:do not add new typedefs. All the related files have been modified. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12Staging: rtl8192u: ieee80211: ieee80211_crypt_wep.c - style fixDerek Robson
Fixed style of block comments Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-17Merge tag 'staging-4.6-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big staging driver pull request for 4.6-rc1. Lots of little things here, over 1600 patches or so. Notable is all of the good Lustre work happening, those developers have finally woken up and are cleaning up their code greatly. The Outreachy intern application process is also happening, which brought in another 400 or so patches. Full details are in the very long shortlog. All of these have been in linux-next with no reported issues" * tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits) staging: lustre: fix aligments in lnet selftest staging: lustre: report minimum of two buffers for LNet selftest load test staging: lustre: test for proper errno code in lstcon_rpc_trans_abort staging: lustre: filter remaining extra spacing for lnet selftest staging: lustre: remove extra spacing when setting variable for lnet selftest staging: lustre: remove extra spacing of variable declartions for lnet selftest staging: lustre: fix spacing issues checkpatch reported in lnet selftest staging: lustre: remove returns in void function for lnet selftest staging: lustre: fix bogus lst errors for lnet selftest staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc staging: android: ion: fix up file mode staging: ion: debugfs invalid gfp mask staging: rts5208: Replace pci_enable_device with pcim_enable_device Staging: ieee80211: Place constant on right side of the test. staging: speakup: Replace del_timer with del_timer_sync staging: lowmemorykiller: fix 2 checks that checkpatch complained staging: mt29f_spinand: Drop void pointer cast staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED ...
2016-02-14Staging: rtl819u: ieee80211: Remove function ieee80211_wep_nullBhumika Goyal
Remove function ieee80211_wep_null from the file as is it blank and remove its declaration from the header file. Also remove its function call as it is of no use calling this function. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-27staging: rtl8192u: Use skcipher and ahashHerbert Xu
This patch replaces uses of blkcipher with skcipher, and the long obsolete hash interface with ahash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08Staging: rtl8192u: Remove two useless lines at ieee80211_wep_nullPedro Marzo Perez
Remove two lines at ieee80211_wep_null which checkpatch.pl reported as errors. The first one because it has a C99 comment style and the second one because it is a void return which is useless. The function ieee80211_wep_null cannot be completely removed because it is exported and used to autoload the module. Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08Staging: rtl8192u: Simplify error check code at prism2_wep_initPedro Marzo Perez
Simplify prism2_wep_init error check code employing goto when a failure is detected. Removed pr_debug which was given a checkpatch.pl error because of literal string splitted across two lines of code, it was seldom going to be printed anyway. Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31Staging: rtl8192u: Correct include indentation and openning braces at new linePedro Marzo Perez
Opening braces should never be in a new line. Correct include indentation. Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09Staging: rtl8192u: Replace #include <asm/string.h>Dilek Uzulmez
The following patch fixes the checkpatch.pl warning: WARNING: Use #include <linux/string.h> instead of #include <asm/string.h> Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: rtl8192u: ieee80211: Add blank line after declarationsHatice ERTÜRK
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c WARNING: Missing a blank line after declarations Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192u: Replace printk() with pr_debug()Ksenija Stanojevic
For dynamic debugging netdev_dbg(), dev_dbg() or pr_debug() macro is preferred over printk(), which is the raw way to print something. Network system has it's own printk format, netdev_dbg, but in this case function's argument list has no pointer to a struct netdevice so pr_debug is used instead. Issue found by checkpatch.pl. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: rtl8192u: Remove commented header.Navya Sri Nizamkari
This patch removes the commented header <linux/config.h> as it is not used in modern linux systems. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25staging: Convert __FUNCTION__ to __func__Joe Perches
Use the normal mechanism for emitting a function name. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ↵Xenia Ragiadakou
ieee80211_crypt_wep.c This patch fixes the pointer position in ieee80211_crypt_wep.c to meet the kernel coding style conventions. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-07-05Remove unneeded version.h includes from drivers/staging/rtl*/Jesper Juhl
It was pointed out by 'make versioncheck' that some includes of linux/version.h are not needed in drivers/staging/rtl8187se/, drivers/staging/rtl8192e/, drivers/staging/rtl8192u/ & drivers/staging/rtl8712/. This patch removes them. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14Staging: Use kcalloc or kzallocJulia Lawall
Use kcalloc or kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y,flags; statement S; type T; @@ x = - kmalloc + kcalloc ( - y * sizeof(T), + y, sizeof(T), flags); if (x == NULL) S -memset(x, 0, y * sizeof(T)); @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
2009-12-11Staging: rtl8192u: remove bad whitespacesMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11Staging: rtl8192u: make it compileMauro Carvalho Chehab
Add it to staging Kbuild and fixes some API differences that prevents compilation. It seems that the ieee80211 stack is very close to rtl8192su one. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11Staging: Added Realtek rtl8192u driver to stagingJerry Chuang
Add Realtek linux driver for rtl8192u as provided by Realtek rtl8192u_linux_2.6.0006.1031.2008.tar.gz, send to me C/C staging ML. This version won't compile against upstream, doesn't follow Linux CodingStyle and has their own ieee80211 stack. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>