]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.3/orinoco-fix-gfp_kernel-in-orinoco_set_key-with-interrupts-disabled.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.3 / orinoco-fix-gfp_kernel-in-orinoco_set_key-with-interrupts-disabled.patch
CommitLineData
80e6ae8f
GKH
1From 5b0691508aa99d309101a49b4b084dc16b3d7019 Mon Sep 17 00:00:00 2001
2From: Andrey Borzenkov <arvidjaar@mail.ru>
3Date: Tue, 22 Dec 2009 21:38:44 +0300
4Subject: orinoco: fix GFP_KERNEL in orinoco_set_key with interrupts disabled
5
6From: Andrey Borzenkov <arvidjaar@mail.ru>
7
8commit 5b0691508aa99d309101a49b4b084dc16b3d7019 upstream.
9
10orinoco_set_key is called from two places both with interrupts disabled
11(under orinoco_lock). Use GFP_ATOMIC instead of GFP_KERNEL. Fixes following
12warning:
13
14[ 77.254109] WARNING: at /home/bor/src/linux-git/kernel/lockdep.c:2465 lockdep_trace_alloc+0x9a/0xa0()
15[ 77.254109] Hardware name: PORTEGE 4000
16[ 77.254109] Modules linked in: af_packet irnet ppp_generic slhc ircomm_tty ircomm binfmt_misc dm_mirror dm_region_hash dm_log dm_round_robin dm_multipath dm_mod loop nvram toshiba cryptomgr aead pcompress crypto_blkcipher michael_mic crypto_hash crypto_algapi orinoco_cs orinoco cfg80211 smsc_ircc2 pcmcia irda toshiba_acpi yenta_socket video i2c_ali1535 backlight rsrc_nonstatic ali_agp pcmcia_core psmouse output crc_ccitt i2c_core alim1535_wdt rfkill sg evdev ohci_hcd agpgart usbcore pata_ali libata reiserfs [last unloaded: scsi_wait_scan]
17[ 77.254109] Pid: 2296, comm: wpa_supplicant Not tainted 2.6.32-1avb #1
18[ 77.254109] Call Trace:
19[ 77.254109] [<c011f0ad>] warn_slowpath_common+0x6d/0xa0
20[ 77.254109] [<c014206a>] ? lockdep_trace_alloc+0x9a/0xa0
21[ 77.254109] [<c014206a>] ? lockdep_trace_alloc+0x9a/0xa0
22[ 77.254109] [<c011f0f5>] warn_slowpath_null+0x15/0x20
23[ 77.254109] [<c014206a>] lockdep_trace_alloc+0x9a/0xa0
24[ 77.254109] [<c018d296>] __kmalloc+0x36/0x130
25[ 77.254109] [<dffcb6a8>] ? orinoco_set_key+0x48/0x1c0 [orinoco]
26[ 77.254109] [<dffcb6a8>] orinoco_set_key+0x48/0x1c0 [orinoco]
27[ 77.254109] [<dffcb9fc>] orinoco_ioctl_set_encodeext+0x1dc/0x2d0 [orinoco]
28[ 77.254109] [<c035b117>] ioctl_standard_call+0x207/0x3b0
29[ 77.254109] [<dffcb820>] ? orinoco_ioctl_set_encodeext+0x0/0x2d0 [orinoco]
30[ 77.254109] [<c0307f1f>] ? rtnl_lock+0xf/0x20
31[ 77.254109] [<c0307f1f>] ? rtnl_lock+0xf/0x20
32[ 77.254109] [<c02fb115>] ? __dev_get_by_name+0x85/0xb0
33[ 77.254109] [<c035b616>] wext_handle_ioctl+0x176/0x200
34[ 77.254109] [<dffcb820>] ? orinoco_ioctl_set_encodeext+0x0/0x2d0 [orinoco]
35[ 77.254109] [<c030020f>] dev_ioctl+0x6af/0x730
36[ 77.254109] [<c02eec65>] ? move_addr_to_kernel+0x55/0x60
37[ 77.254109] [<c02eed59>] ? sys_sendto+0xe9/0x130
38[ 77.254109] [<c02ed77e>] sock_ioctl+0x7e/0x250
39[ 77.254109] [<c02ed700>] ? sock_ioctl+0x0/0x250
40[ 77.254109] [<c019cf4c>] vfs_ioctl+0x1c/0x70
41[ 77.254109] [<c019d1fa>] do_vfs_ioctl+0x6a/0x590
42[ 77.254109] [<c0178e50>] ? might_fault+0x90/0xa0
43[ 77.254109] [<c0178e0a>] ? might_fault+0x4a/0xa0
44[ 77.254109] [<c02ef90e>] ? sys_socketcall+0x17e/0x280
45[ 77.254109] [<c019d759>] sys_ioctl+0x39/0x60
46[ 77.254109] [<c0102e3b>] sysenter_do_call+0x12/0x32
47[ 77.254109] ---[ end trace 95ef563548d21efd ]---
48
49Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
50Signed-off-by: John W. Linville <linville@tuxdriver.com>
51Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
52
53---
54 drivers/net/wireless/orinoco/wext.c | 6 +++---
55 1 file changed, 3 insertions(+), 3 deletions(-)
56
57--- a/drivers/net/wireless/orinoco/wext.c
58+++ b/drivers/net/wireless/orinoco/wext.c
59@@ -23,7 +23,7 @@
60 #define MAX_RID_LEN 1024
61
62 /* Helper routine to record keys
63- * Do not call from interrupt context */
64+ * It is called under orinoco_lock so it may not sleep */
65 static int orinoco_set_key(struct orinoco_private *priv, int index,
66 enum orinoco_alg alg, const u8 *key, int key_len,
67 const u8 *seq, int seq_len)
68@@ -32,14 +32,14 @@ static int orinoco_set_key(struct orinoc
69 kzfree(priv->keys[index].seq);
70
71 if (key_len) {
72- priv->keys[index].key = kzalloc(key_len, GFP_KERNEL);
73+ priv->keys[index].key = kzalloc(key_len, GFP_ATOMIC);
74 if (!priv->keys[index].key)
75 goto nomem;
76 } else
77 priv->keys[index].key = NULL;
78
79 if (seq_len) {
80- priv->keys[index].seq = kzalloc(seq_len, GFP_KERNEL);
81+ priv->keys[index].seq = kzalloc(seq_len, GFP_ATOMIC);
82 if (!priv->keys[index].seq)
83 goto free_key;
84 } else