Skip to contentSkip to conversation

ath9k: fix keycache leak in split tkip case

PATCH In review tom.leiming at gmail.com 7 participants 14 messages Feb 6, 2010 – Feb 13, 2010 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix keycache leak in split tkip case

From: Ming Lei <[email protected]>

If split tkip key is used, ath_delete_key should delete rx key and rx mic key. This patch fixes the leak of hw keycache in the case.

---
The patch is against the latest wireless test tree.

---
 drivers/net/wireless/ath/ath9k/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +1 -0
index 6796d5c..928402b 100644
@@ -809,6 +809,7 @@ static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf
 
 	clear_bit(key->hw_key_idx + 64, common->keymap);
 	if (common->splitmic) {
+		ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
 		clear_bit(key->hw_key_idx + 32, common->keymap);
 		clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
 	}
Signature · 1 line
1.6.2.5
#1 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Hi All
Anyone have porting the ath9k to 2.6.25? Is it can work on
2.6.25?

Regards,
Yanfei Zhang

Quoted 49 lines

-----Original Message-----
From: ath9k-devel-bounces at venema.h4ckr.net [mailto:ath9k-devel-bounces at venema.h4ckr.net] On Behalf Of tom.leiming at gmail.com
Sent: Saturday, February 06, 2010 10:38 PM
To: lrodriguez at atheros.com
Cc: linux-wireless at vger.kernel.org; linville at tuxdriver.com; ath9k-devel at venema.h4ckr.net; johannes at sipsolutions.net; stable at kernel.org
Subject: [ath9k-devel] [PATCH] ath9k: fix keycache leak in split tkip case

From: Ming Lei <[email protected]>

If split tkip key is used, ath_delete_key should delete rx key and rx mic key. This patch fixes the leak of hw keycache in the case.

---
The patch is against the latest wireless test tree.

---
 drivers/net/wireless/ath/ath9k/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +0 -0
index 6796d5c..928402b 100644
@@ -809,6 +809,7 @@ static void ath_key_delete(struct 

ath_common *common, struct ieee80211_key_conf

drivers/net/wireless/ath/ath9k/main.c +1 -1
 	clear_bit(key->hw_key_idx + 64, common->keymap);
 	if (common->splitmic) {
+		ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
 		clear_bit(key->hw_key_idx + 32, common->keymap);
 		clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
 	}
--

1.6.2.5

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

#2 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Quoted 3 lines · On Mon, 2010-02-08 at 17:20 +0800, Zhang Yanfei-B21500 wrote:

Hi All
Anyone have porting the ath9k to 2.6.25? Is it can work on
2.6.25?

...

Quoted 2 lines
Quoted 2 lines

Subject: [ath9k-devel] [PATCH] ath9k: fix keycache leak in split tkip case

Please don't top post by quoting the message wholesale and writing your message above it. It's hard to follow the discussion this way, it's start to quote your message. It's very common for top-posters to overlook something in the message they are quoted. By replying below the text, paragraph-by-paragraph, you would at least give the impression that you looked at the quoted text.

Please don't hijack existing threads by replying to unrelated posts. The message you have quoted is not related to your question.

Please don't mail individual developers unless they already participate in the discussion or you have a good reason to think that they need to be involved and may overlook your message in the list.

Please avoid cross-posting to several mailing lists unless you have a good reason for that. If in doubt, please use the more specific list.

If you are asking a question, it would be a good idea to show that you have put some effort into finding the answer, that you have looked in some places, that you have tried something and it didn't work.

I suggest that you have a look at this document:
http://catb.org/~esr/faqs/smart-questions.html

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

In reply to Zhang Yanfei-B21500
Quoted 4 lines · On Mon, Feb 8, 2010 at 1:20 AM, Zhang Yanfei-B21500 <[email protected]>…

Hi All
? ? ? ?Anyone have porting the ath9k to 2.6.25? Is it can work on 2.6.25?

This tarball has 2.6.25 enabled:

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2

Newer stable kernels after this required multiqueue backported which I gave a try but haven't gotten reports from users on:

http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2

After untarring you will have to select to compile only ath9k:

./scripts/driver-select ath9k

Luis

#4 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Dear Luis,

Is this tarball also working on kernel 2.6.24?

I've been trying, but it may have some problem.

Thanks.

-Jinsung

-----Original Message-----
From: [email protected] [mailto:ath9k-devel-bounces at lists.ath9k.org] On Behalf Of Luis R. Rodriguez
Sent: Tuesday, February 09, 2010 3:02 AM
To: Zhang Yanfei-B21500
Cc: ath9k-devel at venema.h4ckr.net; linux-wireless at vger.kernel.org
Subject: Re: [ath9k-devel] can ath9k run on linux 2.6.25

Quoted 4 lines · On Mon, Feb 8, 2010 at 1:20 AM, Zhang Yanfei-B21500 <[email protected]>…

Hi All
Anyone have porting the ath9k to 2.6.25? Is it can work on
2.6.25?

This tarball has 2.6.25 enabled:

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2

Newer stable kernels after this required multiqueue backported which I gave a try but haven't gotten reports from users on:

http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2

After untarring you will have to select to compile only ath9k:

./scripts/driver-select ath9k

Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

#5 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Quoted 3 lines · Jinsung Lee

Dear Luis,

Is this tarball also working on kernel 2.6.24?

I think it should work down to 2.6.23 actually for ath9k.

Luis

#6 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

In reply to Jinsung Lee

Hi Guys

Thanks a lot... Good news. Do you have porting to 2.6.25
successfully with good performace also ?

I am going to porting it to a powerpc board base on 2.6.25 kernel.

Regards,
yanfei

Quoted 58 lines

-----Original Message-----
From: Jinsung Lee [mailto:ljs at netsys.kaist.ac.kr]
Sent: Tuesday, February 09, 2010 2:10 PM
To: 'Luis R. Rodriguez'; Zhang Yanfei-B21500
Cc: ath9k-devel at venema.h4ckr.net; linux-wireless at vger.kernel.org
Subject: RE: [ath9k-devel] can ath9k run on linux 2.6.25

Dear Luis,

Is this tarball also working on kernel 2.6.24?

I've been trying, but it may have some problem.

Thanks.

-Jinsung

-----Original Message-----
From: ath9k-devel-bounces at lists.ath9k.org [mailto:ath9k-devel-bounces at lists.ath9k.org] On Behalf Of Luis R. Rodriguez
Sent: Tuesday, February 09, 2010 3:02 AM
To: Zhang Yanfei-B21500
Cc: ath9k-devel at venema.h4ckr.net; linux-wireless at vger.kernel.org
Subject: Re: [ath9k-devel] can ath9k run on linux 2.6.25

Quoted 4 lines · On Mon, Feb 8, 2010 at 1:20 AM, Zhang Yanfei-B21500 <[email protected]>…

Hi All
Anyone have porting the ath9k to 2.6.25? Is it can work on
2.6.25?

This tarball has 2.6.25 enabled:

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.
6.32/compat-wireless-2.6.32.3.tar.bz2

Newer stable kernels after this required multiqueue backported which I gave a try but haven't gotten reports from users on:

http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.
32.5-rc3.tar.bz2

After untarring you will have to select to compile only ath9k:

./scripts/driver-select ath9k

Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

#7 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Quoted 4 lines · On Mon, Feb 08, 2010 at 10:36:09PM -0800, Zhang Yanfei-B21500 wrote:

Hi Guys

Thanks a lot... Good news. Do you have porting to 2.6.25
successfully with good performace also ?

It should be OK for the release without the multiqueue backported. Multiqueue was added back on the 2.6.32.4 release so 2.6.32.3 should be the last release without it. That I believe was tested to work well with ath9k.

After that I have not received any feedback with respect to the multiqueue backport. Feedback on that is appreciated.

Quoted 1 line

I am going to porting it to a powerpc board base on 2.6.25 kernel.

You should not need to do much but just test. Can you please let me know.

This one should just work:

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2

Newer stable kernels after this required multiqueue backported which I gave a try but haven't gotten reports from users on:

http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2

Luis

#8 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Hi Luis

I am porting the compat-wireless-2.6.32-3 to my powerpc platform
with 2.6.25 kernel. After disable the LED marco in config.mk i have compile it sucess. but when i load it , it show below error messages, anyone can help on this?
the kernel modules manually load order is below: am i right ?
1. rfkill_backport
2. cfg_802.11
3. mac80211
4. ath
5. ath9k
#insmod rfkill_backport.ko
rfkill_backport: Unknown symbol dev_set_name
insmod: cannot insert 'rfkill_backport.ko': unknown symbol in module (-1): No such file or directory

i found that the compat-2.6.26 have the dev_set_name function, but
compat-2.6.25 don't have this.
In new kernel(2.6.29) it's is device/base/core.c, then i try to copy
the function into my 2.6.25 kernel.
but it loss the 'kobject_set_name_vargs', here is the compile information.
$drivers/base/core.c: In function 'dev_set_name':
$drivers/base/core.c:880: error: implicit declaration of function 'kobject_set_name_vargs'

Regards
Yanfei

Quoted 42 lines

-----Original Message-----
From: Luis R. Rodriguez [mailto:[email protected]]
Sent: Wednesday, February 10, 2010 1:10 AM
To: Zhang Yanfei-B21500
Cc: Jinsung Lee; Luis R. Rodriguez; [email protected]; [email protected]
Subject: Re: [ath9k-devel] can ath9k run on linux 2.6.25

Quoted 4 lines · On Mon, Feb 08, 2010 at 10:36:09PM -0800, Zhang Yanfei-B21500 wrote:

Hi Guys

Thanks a lot... Good news. Do you have porting to 2.6.25
successfully with good performace also ?

It should be OK for the release without the multiqueue backported. Multiqueue was added back on the 2.6.32.4 release so 2.6.32.3 should be the last release without it. That I believe was tested to work well with ath9k.

After that I have not received any feedback with respect to the multiqueue backport. Feedback on that is appreciated.

Quoted 1 line

I am going to porting it to a powerpc board base on 2.6.25 kernel.

You should not need to do much but just test. Can you please let me know.

This one should just work:

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.
6.32/compat-wireless-2.6.32.3.tar.bz2

Newer stable kernels after this required multiqueue backported which I gave a try but haven't gotten reports from users on:

http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.
32.5-rc3.tar.bz2

Luis

#9 lore raw

[ath9k-devel] can ath9k run on linux 2.6.25

Quoted 17 lines · On Wed, Feb 10, 2010 at 7:03 PM, Zhang Yanfei-B21500 <[email protected]>…

Hi Luis

? ?I am porting the compat-wireless-2.6.32-3 to my powerpc platform with 2.6.25 kernel. ?After disable the LED marco in config.mk i have compile it sucess. but when i load it , it show below error messages, anyone can help on this?
the kernel modules manually load order is below: am i right ? ? ?1. rfkill_backport
? ? 2. cfg_802.11
? ? 3. mac80211
? ? ? ? 4. ath
? ? ? ? 5. ath9k
#insmod rfkill_backport.ko
rfkill_backport: Unknown symbol dev_set_name
insmod: cannot insert 'rfkill_backport.ko': unknown symbol in module (-1): No such file or directory

Quoted 2 lines

?i found that the compat-2.6.26 have the dev_set_name function, but compat-2.6.25 don't have this.

That is the point, so the way the compat-2.6.x files work is that say you are on 2.6.25 it means you need backport work for 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32 and 2.6.33.

So you get compiled the respective objects for each kernel and these get linked into a compat module.

dev_set_name() was added as of the 2.6.26 kernel so having it defined for kernels >= 2.6.25 is correct, and it is also exported.

Only thing I can think of is perhaps rfkill doesn't have the compat.h header included? I'll check in a while.

Quoted 7 lines

?In new kernel(2.6.29) ?it's is device/base/core.c, then i try to copy the function into my 2.6.25 kernel.
but it loss the 'kobject_set_name_vargs', here is the compile information.
$drivers/base/core.c: In function 'dev_set_name':
$drivers/base/core.c:880: error: implicit declaration of function 'kobject_set_name_vargs'

Senthil backported this on compat-2.6.26.c, there are two different ways to backport this, one for kernels >= 2.6.25 which is at the top and then for kernels older, at the bottom:

/* 2.6.24 does not have the struct kobject with a name */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))

/**
* kobject_set_name_vargs - Set the name of an kobject
* @kobj: struct kobject to set the name of
* @fmt: format string used to build the name
* @vargs: vargs to format the string.
*/
static
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)

{
        const char *old_name = kobj->name;
        char *s;

        if (kobj->name && !fmt)
                return 0;

        kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
        if (!kobj->name)
                return -ENOMEM;

        /* ewww... some of these buggers have '/' in the name ... */
        while ((s = strchr(kobj->name, '/')))
                s[0] = '!';

        kfree(old_name);
        return 0;
}

#else
static
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)

{
        struct device *dev;
        unsigned int len;
        va_list aq;

        dev = container_of(kobj, struct device, kobj);

        va_copy(aq, vargs);
        len = vsnprintf(NULL, 0, fmt, aq);
        va_end(aq);

        len = len < BUS_ID_SIZE ? (len + 1) : BUS_ID_SIZE;

        vsnprintf(dev->bus_id, len, fmt, vargs);
        return 0;
}

#endif

Luis

#10 lore raw

PATCH 1/1 ath9k: fix keycache leak in split tkip case

In reply to tom.leiming at gmail.com
Quoted 5 lines · On Sat, Feb 6, 2010 at 6:38 AM, <[email protected]> wrote:

From: Ming Lei <[email protected]>

If split tkip key is used, ath_delete_key should delete rx key and rx mic key. This patch fixes the leak of hw keycache in the case.

Can you please resend with Cc: stable at kernel.org on the commit log entry?

Quoted 4 lines

---
The patch is against the latest wireless test tree.

Luis

author
#11 lore raw

PATCH 1/1 ath9k: fix keycache leak in split tkip case

#12 lore raw

PATCH 1/1 ath9k: fix keycache leak in split tkip case

Quoted 9 lines · Ming Lei

From 67b0faf7e7a57c3e6a971ff43d1f03f8e939429b Mon Sep 17 00:00:00 2001
From: Ming Lei <[email protected]>
Date: Sat, 6 Feb 2010 22:30:53 +0800
Subject: [PATCH] ath9k: fix keycache leak in split tkip case

If split tkip key is used, ath_delete_key should delete rx key and rx mic key. This patch fixes the leak of hw keycache in the case.

Quoted 5 lines

---
The patch is against the latest wireless test tree.

Cc stable at kernel.org

This is ordered wrong, it needs to be

----------
From: foo

If split ...

Signed-off-by ...
Cc stable...

---
The patch is against...
(everything after --- is removed from the commit log when committing)
----------

johannes

author
#13 lore raw

PATCH 1/1 ath9k: fix keycache leak in split tkip case