summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2011-05-29 12:55:44 +0200
committerDavid S. Miller <davem@zippy.davemloft.net>2011-06-01 00:11:02 +0200
commit48bdf072c3f1f8f739f76d19c74f4c79605cac46 (patch)
tree0cf0f1600892a781949451df0087b2407522a5ed /include
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.... (diff)
downloadlinux-48bdf072c3f1f8f739f76d19c74f4c79605cac46.tar.xz
linux-48bdf072c3f1f8f739f76d19c74f4c79605cac46.zip
ip_options_compile: properly handle unaligned pointer
The current code takes an unaligned pointer and does htonl() on it to make it big-endian, then does a memcpy(). The problem is that the compiler decides that since the pointer is to a __be32, it is legal to optimize the copy into a processor word store. However, on an architecture that does not handled unaligned writes in kernel space, this produces an unaligned exception fault. The solution is to track the pointer as a "char *" (which removes a bunch of unpleasant casts in any case), and then just use put_unaligned_be32() to write the value to memory. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: David S. Miller <davem@zippy.davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions