2006-02-20 15:28:48

by Dmitry Mishin

[permalink] [raw]
Subject: [NET][IA64] Unaligned access in sk_run_filter

Hello,

We have an issue on ia64 box. It is easy triggerable 'kernel unaligned access'
in sk_run_filter:
ptr = load_pointer(skb, k, 4, &tmp);
if (ptr != NULL) {
A = ntohl(*(u32 *)ptr); << here
continue;
}

due to 'k' is coming from userspace it can be easy triggered, e.g.:
[root@node1 ~]# tcpdump -i eth0 'ip[1:2]=0'

Could you advise how to fix this?

--
Thanks,
Dmitry.


2006-02-20 15:43:20

by Jes Sorensen

[permalink] [raw]
Subject: Re: [NET][IA64] Unaligned access in sk_run_filter

>>>>> "Dmitry" == Dmitry Mishin <[email protected]> writes:

Dmitry> Hello, We have an issue on ia64 box. It is easy triggerable
Dmitry> 'kernel unaligned access' in sk_run_filter:

Dmitry> ptr = load_pointer(skb, k, 4, &tmp);
Dmitry> if (ptr != NULL) {
Dmitry> A = ntohl(*(u32 *)ptr); << here

Change the above line to something like this:

A = ntohl(get_unaligned((u32*)ptr));

And add an #include <asm/unaligned.h>

Cheers,
Jes