All of lore.kernel.org
 help / color / mirror / Atom feed
* [NET][IA64] Unaligned access in sk_run_filter
@ 2006-02-20 15:28 Dmitry Mishin
  2006-02-20 15:43 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Mishin @ 2006-02-20 15:28 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel, netfilter-devel, rusty, devel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [NET][IA64] Unaligned access in sk_run_filter
  2006-02-20 15:28 [NET][IA64] Unaligned access in sk_run_filter Dmitry Mishin
@ 2006-02-20 15:43 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2006-02-20 15:43 UTC (permalink / raw)
  To: Dmitry Mishin
  Cc: David S. Miller, linux-kernel, netfilter-devel, rusty, devel

>>>>> "Dmitry" == Dmitry Mishin <dim@openvz.org> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-20 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 15:28 [NET][IA64] Unaligned access in sk_run_filter Dmitry Mishin
2006-02-20 15:43 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.