Hi, > So, looking into this problem, I was able to come up with a patch > (attached. Note, it also includes remnants of the patch recommended by > Sebastian Andrzej Siewior in > http://marc.info/?l=linux-wireless&m=122493409906326&w=2). The problem > occurs within compare_ether_addr() and this immediately reminded me that > the patches recommended to me way back last year > (http://marc.info/?l=linux-wireless&m=119543627712471&w=2) also dealt > with this problem. I think you forgot to attach the patch. > Looking into how it was solved then, all the compare_ether_addr() calls > were replaced with memcmp() calls. This is what I have done with my > patch as well... but this approach did not fill me with confidence. It > seemed to me like a quick fix that didn't directly address the alignment > problem. And IMO my subsequent findings confirm this. > > I now hit the following kernel errors: > > > [ 240.139093] Kernel unaligned access at TPC[100f7f44] > > sta_info_get+0x24/0x68 [mac80211] > > [ 240.233255] Kernel unaligned access at TPC[100f7f48] > > sta_info_get+0x28/0x68 [mac80211] > > [ 240.328015] Kernel unaligned access at TPC[100f7f50] > > sta_info_get+0x30/0x68 [mac80211] > > [ 240.422771] Kernel unaligned access at TPC[100f7f44] > > sta_info_get+0x24/0x68 [mac80211] > > [ 240.517554] Kernel unaligned access at TPC[100f7f48] > > sta_info_get+0x28/0x68 [mac80211] > > Looking into this, and the underlying problem is again > compare_ether_addr(). Now, I'm sure that replacing this with a memcmp() > is now treading on more toes than just zd1211rw users. And for this > reason, I think a better solution is going to be required. > > Does that sound right? I will persist in trying to understand the code > to try and come up with a fix. But obviously, I hope that I can get help > with this to make the former an education exercise, not a kernel > maintenance exercise. :) Yes, I think you're right, it appears that the 802.11 header isn't aligned on a 2-byte boundary, which is extremely strange. Can you, with your patch applied, do something like printk(KERN_DEBUG "%p\n", skb->data); before this code in zd_mac.c: memcpy(skb_put(skb, length), buffer, length); ieee80211_rx_irqsafe(hw, skb, &stats); johannes
Attachment:
signature.asc
Description: This is a digitally signed message part