Re: unaligned access in ipt_ULOG
David Miller wrote: From: Joerg Friedrich [EMAIL PROTECTED] Date: Fri, 30 Mar 2007 23:48:57 +0200 I wanted to use the iptables ULOG target, but I ran into these error messages. can anyone explain howto read this messge. Kernel unaligned access at TPC[1029e35c] ipt_ulog_packet+0x214/0x3fc [ipt_ULOG] It just means that unaligned accesses are occuring in the ipt_ulog module. Things usually work fine when this happens, just very slowly, which is why the warning is printed. Patrick, this is on sparc64, it appears to be this code: pm-timestamp_sec = skb-tstamp.off_sec; pm-timestamp_usec = skb-tstamp.off_usec; and the NLMSG_DATA() (and thus 'pm') is not 8-byte aligned. I bet this is a 32-bit sparc binary, has the idea of a compat layer for the ULOG bits ever been discussed? No, I can't imagine how to do this since we don't have any compat infrastructure for netlink, so we would have to know whether the receiving process is a 32 bit binary in ipt_ULOG itself. We have some compat code in userspace to deal with the different structure layout, so besides the unaligned accesses, it should already work fine. Since ULOG is obsolete and nfnetlink_log shouldn't have these issues, I think the best way to fix this is to use put_unaligned in ipt_ULOG. How does this look? [NETFILTER]: ipt_ULOG: use put_unaligned Use put_unaligned to fix warnings about unaligned accesses. Signed-off-by: Patrick McHardy [EMAIL PROTECTED] --- commit fea42a5760325392653d556b1087f8274adcfb2e tree c4c32f0feb2f947fb4d4f747c39935b535aa29cf parent 2e175a90047a2dbc76fde169c990164895b25dfc author Patrick McHardy [EMAIL PROTECTED] Mon, 02 Apr 2007 13:54:14 +0200 committer Patrick McHardy [EMAIL PROTECTED] Mon, 02 Apr 2007 13:54:14 +0200 net/ipv4/netfilter/ipt_ULOG.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index a26404d..9acc018 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c @@ -61,6 +61,7 @@ #include linux/netfilter_ipv4/ipt_ULOG.h #include net/sock.h #include linux/bitops.h +#include asm/unaligned.h MODULE_LICENSE(GPL); MODULE_AUTHOR(Harald Welte [EMAIL PROTECTED]); @@ -236,9 +237,9 @@ static void ipt_ulog_packet(unsigned int hooknum, /* copy hook, prefix, timestamp, payload, etc. */ pm-data_len = copy_len; - pm-timestamp_sec = skb-tstamp.off_sec; - pm-timestamp_usec = skb-tstamp.off_usec; - pm-mark = skb-mark; + put_unaligned(skb-tstamp.off_sec, pm-timestamp_sec); + put_unaligned(skb-tstamp.off_usec, pm-timestamp_usec); + put_unaligned(skb-mark, pm-mark); pm-hook = hooknum; if (prefix != NULL) strncpy(pm-prefix, prefix, sizeof(pm-prefix));
[ANNOUNCE] Aurora SPARC Linux Build 2.98 (Beta 1 for 3.0)
The Aurora SPARC Linux project is proud to finally present Build 2.98 to the world. This is a BETA release, for what will become 3.0. Here are some of the key features in this release: - Fedora Core 6 based tree of packages (some things are newer) - Support for Niagara hardware (Sun T1000, T2000) - gcc-4.1.1 - gnome 2.16 - KDE 3.5.5 - kernel 2.6.20 (with patches!) - Full support for LVM at installtime (no more crashes!) Like all BETAs, this one has some bugs. Here are the ones we know about: - CDROM installs on sparc32 hardware don't work. If you're installing to a sparc32 system, netboot. - Smartd seems to make systems using the esp.ko SCSI driver very very unhappy. If your system is esp based, we highly recommend that you disable the smartd service in single-user before fully booting after install. - cpuspeed seems to hardlock some sparc64 systems (the V120 is an example). Again, if your system locks up at cpuspeed, we suggest that you disable the cpuspeed service in single-user mode. - Parted was doing incorrect things in previous Aurora releases. This is the source of the odd cylinder-head error messages that have popped up in the past. Sometimes these error messages are harmless, sometimes they are not. Either way, you can get rid of them by booting to rescue mode, then, at the shell prompt, run: dd if=/dev/zero of=/dev/$DRIVE bs=1M count=1 Where $DRIVE is your harddrive, likely sda or hda. Then, reinstall. The errors will vanish (for good!). Be aware that running this command will wipe out all the data and partitions on that disk. - E1 systems are not yet supported. :/ - Some headless serial installs are not getting the proper getty entries added to have a serial console. If this happens to you, please let us know, as we're not really sure why this is happening (it doesn't happen on all systems in testing). - Most IDE based SPARC systems need to boot with ide=nodma. Specifically, Ultra 5/10 and Sun Blade 100s need this for sure. - While all apps are compiled with support for SELinux, it is disabled in both sparc32 and sparc64 kernels, because it doesn't work right. At all. It prevents the system from booting. If you find other bugs, please report them at http://bugzilla.auroralinux.org/ If you install 2.98 on a system, success or fail, we wanna know! Please take a moment and add your system to the table on our wiki: http://wiki.auroralinux.net/wiki/Build2.98TestMatrix You can download the files from our primary location: ftp://ibiblio.org/pub/linux/distributions/aurora/build-2.98 http://distro.ibiblio.org/pub/linux/distributions/aurora/build-2.98/ The mirror sites should pick it up in a few hours/days, depending on whether they still remember that we exist. :) Many thanks to the folks in #aurora on freenode for their help in getting this release out, and a special thanks to Dennis Gilmore for all of the infrastructure work that made this release possible. ~spot - To unsubscribe from this list: send the line unsubscribe sparclinux in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html