All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Spengler <spender@grsecurity.net>
To: sparclinux@vger.kernel.org
Subject: Unaligned accesses w/ generic segmentation/rx/tx offloading
Date: Tue, 22 Jun 2010 23:16:14 +0000	[thread overview]
Message-ID: <20100622231614.GA10926@grsecurity.net> (raw)

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

Hi all,

I'm running the 2.6.32.15 kernel on a Sun Blade 2500 with the tg3 
driver.
gcc version is:
gcc --version
gcc (Debian 4.3.2-1.1) 4.3.2

When rx/tx/generic segmentation offloading is disabled:
ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: off
tx-checksumming: off
scatter-gather: off
tcp segmentation offload: off
udp fragmentation offload: off
generic segmentation offload: off
large receive offload: off

I've received several unaligned access messages:
Kernel unaligned access at TPC[6dae50]
Kernel unaligned access at TPC[6dae58]
Kernel unaligned access at TPC[6c8788]
Kernel unaligned access at TPC[6c8798]
Kernel unaligned access at TPC[704864]
They've only occurred once so far in a week or so, so I won't be able to 
reproduce it at will.

The unaligned accesses appear to come from the following sources:

net/ipv4/tcp_output.c:tcp_transmit_skb():
6dae50:       c2 26 e0 04     st  %g1, [ %i3 + 4 ]
6dae58:       c2 26 e0 08     st  %g1, [ %i3 + 8 ]
If my analysis is correct, these are the two lines at 666 in 2.6.32.15:
        th->seq                 = htonl(tcb->seq);
        th->ack_seq             = htonl(tp->rcv_nxt);
the problem being the unaligned th.
net/ipv4/ip_output.c:ip_queue_xmit():
6c8788:       c2 24 20 0c     st  %g1, [ %l0 + 0xc ]
6c8798:       c2 24 20 10     st  %g1, [ %l0 + 0x10 ]
If my analysis is correct, these are the two lines at 376 in 2.6.32.15:
        iph->saddr    = rt->rt_src;
        iph->daddr    = rt->rt_dst;
the problem being an unaligned iph.
arch/sparc/lib/ipcsum.S:ip_fast_csum() (2nd asm instruction, unaligned iph)

I've uploaded the associated vmlinux for analysis to:
http://grsecurity.net/unaligned-vmlinux

Please keep me on CC for any replies.

Thanks,
-Brad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

                 reply	other threads:[~2010-06-22 23:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100622231614.GA10926@grsecurity.net \
    --to=spender@grsecurity.net \
    --cc=sparclinux@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 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.