This is a note to let you know that I've just added the patch titled

    rt2500usb: fallback to SW encryption for TKIP+AES

to the 2.6.32-longterm tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
     rt2500usb-fallback-to-sw-encryption-for-tkip-aes.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm 
tree,
please let <[email protected]> know about it.


>From 13e7b151e828019f4117b6857699889705b04adb Mon Sep 17 00:00:00 2001
From: Ondrej Zary <[email protected]>
Date: Wed, 23 Jun 2010 12:57:15 +0200
Subject: rt2500usb: fallback to SW encryption for TKIP+AES

From: Ondrej Zary <[email protected]>

commit 75f64dd54a185150ebfc45e99351c890d4a2252f upstream.

HW crypto in rt2500usb does not seem to support keys with different ciphers,
which breaks TKIP+AES mode. Fall back to software encryption to fix it.

This should fix long-standing problems with rt2500usb and WPA, such as:
http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=4&t=4834
https://bugzilla.redhat.com/show_bug.cgi?id=484888

Also tested that it does not break WEP, TKIP-only and AES-only modes.

Signed-off-by: Ondrej Zary <[email protected]>
Acked-by: Gertjan van Wingerde <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
[bwh: Adjust context for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/net/wireless/rt2x00/rt2500usb.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -347,6 +347,7 @@ static int rt2500usb_config_key(struct r
        int timeout;
        u32 mask;
        u16 reg;
+       enum cipher curr_cipher;
 
        if (crypto->cmd == SET_KEY) {
                /*
@@ -357,6 +358,7 @@ static int rt2500usb_config_key(struct r
                mask = TXRX_CSR0_KEY_ID.bit_mask;
 
                rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
+               curr_cipher = rt2x00_get_field16(reg, TXRX_CSR0_ALGORITHM);
                reg &= mask;
 
                if (reg && reg == mask)
@@ -365,6 +367,14 @@ static int rt2500usb_config_key(struct r
                reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);
 
                key->hw_key_idx += reg ? ffz(reg) : 0;
+               /*
+                * Hardware requires that all keys use the same cipher
+                * (e.g. TKIP-only, AES-only, but not TKIP+AES).
+                * If this is not the first key, compare the cipher with the
+                * first one and fall back to SW crypto if not the same.
+                */
+               if (key->hw_key_idx > 0 && crypto->cipher != curr_cipher)
+                       return -EOPNOTSUPP;
 
                /*
                 * The encryption key doesn't fit within the CSR cache,


Patches currently in longterm-queue-2.6.32 which might be from 
[email protected] are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/rt2500usb-fallback-to-sw-encryption-for-tkip-aes.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to