public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unaligned access in sk_run_filter()
@ 2006-04-17 11:12 Kirill Korotaev
  2006-04-18 21:50 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill Korotaev @ 2006-04-17 11:12 UTC (permalink / raw)
  To: Andrew Morton, David S. Miller, devel, Linux Kernel Mailing List,
	Mishin Dmitry

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

[PATCH] unaligned access in sk_run_filter()

This patch fixes unaligned access warnings noticed on IA64
in sk_run_filter(). 'ptr' can be unaligned.

Signed-Off-By: Dmitry Mishin <dim@openvz.org>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>


[-- Attachment #2: diff-ms-ia64-unalign-skrunfilter --]
[-- Type: text/plain, Size: 752 bytes --]

--- ./net/core/filter.c.ve125	2006-04-05 15:11:24.000000000 +0400
+++ ./net/core/filter.c	2006-04-05 15:55:33.000000000 +0400
@@ -34,6 +34,7 @@
 #include <linux/timer.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/unaligned.h>
 #include <linux/filter.h>
 
 /* No hurry in this branch */
@@ -177,7 +178,7 @@ unsigned int sk_run_filter(struct sk_buf
 load_w:
 			ptr = load_pointer(skb, k, 4, &tmp);
 			if (ptr != NULL) {
-				A = ntohl(*(u32 *)ptr);
+				A = ntohl(get_unaligned((u32 *)ptr));
 				continue;
 			}
 			break;
@@ -186,7 +187,7 @@ load_w:
 load_h:
 			ptr = load_pointer(skb, k, 2, &tmp);
 			if (ptr != NULL) {
-				A = ntohs(*(u16 *)ptr);
+				A = ntohs(get_unaligned((u16 *)ptr));
 				continue;
 			}
 			break;

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

* Re: [PATCH] unaligned access in sk_run_filter()
  2006-04-17 11:12 [PATCH] unaligned access in sk_run_filter() Kirill Korotaev
@ 2006-04-18 21:50 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2006-04-18 21:50 UTC (permalink / raw)
  To: dev; +Cc: akpm, devel, linux-kernel, dim

From: Kirill Korotaev <dev@openvz.org>
Date: Mon, 17 Apr 2006 15:12:11 +0400

> [PATCH] unaligned access in sk_run_filter()
> 
> This patch fixes unaligned access warnings noticed on IA64
> in sk_run_filter(). 'ptr' can be unaligned.
> 
> Signed-Off-By: Dmitry Mishin <dim@openvz.org>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>

I've been meaning to add this fix, thanks a lot.

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

end of thread, other threads:[~2006-04-18 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-17 11:12 [PATCH] unaligned access in sk_run_filter() Kirill Korotaev
2006-04-18 21:50 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox