From: Kirill Korotaev <dev@openvz.org>
To: Andrew Morton <akpm@osdl.org>,
"David S. Miller" <davem@davemloft.net>,
devel@openvz.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mishin Dmitry <dim@openvz.org>
Subject: [PATCH] unaligned access in sk_run_filter()
Date: Mon, 17 Apr 2006 15:12:11 +0400 [thread overview]
Message-ID: <4443780B.1040108@openvz.org> (raw)
[-- 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;
next reply other threads:[~2006-04-17 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-17 11:12 Kirill Korotaev [this message]
2006-04-18 21:50 ` [PATCH] unaligned access in sk_run_filter() David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4443780B.1040108@openvz.org \
--to=dev@openvz.org \
--cc=akpm@osdl.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=dim@openvz.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox