* remote memory reading using arp?
@ 2002-04-27 20:27 Warchild
2002-04-27 20:48 ` Bryan Rittmeyer
0 siblings, 1 reply; 8+ messages in thread
From: Warchild @ 2002-04-27 20:27 UTC (permalink / raw)
To: linux-kernel
greetings,
While doing some work earlier today, I happened to have a window open on my
(Slackware 8) 2.4.16 box with tcpdump running. Since I really wasn't doing
anything on the laptop the only traffic that was flying by via tcpdump was
the occassional ntp sync and some arp traffic here and there.
Out of the corner of my eye, I happened to notice something that seemed
very out of place -- human readable text included as part of the arp
packet. Ok, so maybe the chances of that aren't _that_ slim, but the text
was familiar to me. To see if this was just a one time thing or not, I
fired up tcpdump and told it to capture all arp traffic (tcpdump -ni eth0
-w /tmp/arp arp). I did this 3 times while browsing the web, scp'ing stuff
around and screwing around on my laptop.
I then replayed the tcpdump sessions and used the -X option (dumps the
packet in emacs-hexl like format), piped them to less and looked for
anything suspicous. Here's some examples of what I found:
(pardon the paste)
15:20:09.186852 0:40:96:15:16:4f ff:ff:ff:ff:ff:ff 0806 60: arp who-has
192.168.1.1 tell 192.168.1.2
0000: 0001 0800 0604 0001 0040 9615 164f c0a8 .........@...Oˬ
0010: 0102 0000 0000 0000 c0a8 0101 652f 656e ........ˬ..e/en
0020: 6c69 6768 7465 6e6d 656e 742f 7468 lightenment/th
15:20:11.187501 0:6:25:3:ce:65 0:40:96:15:16:4f 0806 60: arp reply
192.168.1.1 is-at 0:6:25:3:ce:65
0000: 0001 0800 0604 0002 0006 2503 ce65 c0a8 ..........%.ÎeÀ¨
0010: 0101 0040 9615 164f c0a8 0102 6874 656e ...@...Oˬ..hten
0020: 6d65 6e74 2f74 6865 6d65 732f 4761 ment/themes/Ga
15:20:12.186895 0:40:96:15:16:4f ff:ff:ff:ff:ff:ff 0806 60: arp who-has
192.168.1.1 tell 192.168.1.2
0000: 0001 0800 0604 0001 0040 9615 164f c0a8 .........@...Oˬ
0010: 0102 0000 0000 0000 c0a8 0101 705f 632e ........ˬ..p_c.
0020: 706e 670a 2f75 7372 2f58 3131 5236 png./usr/X11R6
15:00:55.970007 0:6:25:3:ce:65 0:40:96:15:16:4f 0806 60: arp reply
192.168.1.1 is-at 0:6:25:3:ce:65
0000: 0001 0800 0604 0002 0006 2503 ce65 c0a8 ..........%.ÎeÀ¨
0010: 0101 0040 9615 164f c0a8 0102 6574 2d31 ...@...Oˬ..et-1
0020: 2e30 2e32 612f 6269 6e2f 0500 0000 .0.2a/bin/....
15:03:07.290878 0:6:25:3:ce:65 0:40:96:15:16:4f 0806 60: arp reply
192.168.1.1 is-at 0:6:25:3:ce:65
0000: 0001 0800 0604 0002 0006 2503 ce65 c0a8 ..........%.ÎeÀ¨
0010: 0101 0040 9615 164f c0a8 0102 0d00 1d00 ...@...Oˬ......
0020: 696e 6572 4861 6e64 6c65 722e 6874 inerHandler.ht
192.168.1.2 is a Slackware 8 box with 2.4.16, and 192.168.1.1 is an OpenBSD
3.1-current box. It struck me as extremely strange that the contents of
the arp packets contained information about my laptop. To ensure that
this wasn't just tcpdump acting dumb, I left tcpdump running while I wasn't
doing anything on the laptop at all. I got similar results.
I couldn't find anything in the archives about this, and also didn't see
any changes in the arp implementation of the 2.4 kernel between 2.4.16 and
2.4.18. I also browsed rfc826 to see if there was any mention of 'padding
data', but nothing caught my eye.
Any ideas what is causing this?
thanks in advance,
-warchild
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: remote memory reading using arp?
2002-04-27 20:27 remote memory reading using arp? Warchild
@ 2002-04-27 20:48 ` Bryan Rittmeyer
2002-04-27 21:19 ` Warchild
0 siblings, 1 reply; 8+ messages in thread
From: Bryan Rittmeyer @ 2002-04-27 20:48 UTC (permalink / raw)
To: Warchild; +Cc: linux-kernel
Warchild wrote:
> [oh my god, i see userspace text strings in ARP packets]
>
> I couldn't find anything in the archives about this, and also didn't see
> any changes in the arp implementation of the 2.4 kernel between 2.4.16 and
> 2.4.18. I also browsed rfc826 to see if there was any mention of 'padding
> data', but nothing caught my eye.
>
> Any ideas what is causing this?
It's not the ARP layer that's causing the padding... Ethernet has a
minimum transmit size of 64 bytes (everything below that is disgarded
by hardware as a fragment), so the network device driver or
the hardware itself will pad any Linux skb smaller than 60 bytes up to
that size (so that it's 64 bytes after appending CRC32). Apparently, in
some cases that's done by just transmitting whatever uninitialized
memory follows skb->data, which, after the system has been running
for a while, may be inside a page previously used by userspace.
This is NOT a "remote memory reading" exploit, since there is no way to
remotely control what address in memory gets used as padding. I guess
you could packet blast a machine and hope to find something
interesting, but that'd be a denial of service attack long before you
got a complete view of system memory. In any case, it's arguably
userspace's responsibility to clear any sensitive memory contents
before exiting. I would be more concerned if you can find data
from currently in use, userspace-allocated pages flying out as packet
padding (i.e. if reading past skb->data pushes you into somebody else's
page, which seems unlikely since new skb's tend to get allocated near
the beginning of a page).
If you are really concerned you could probably patch the network driver
to zero out memory that will be used as padding, though I don't think
the security risk justifies that performance hit.
-Bryan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: remote memory reading using arp?
2002-04-27 20:48 ` Bryan Rittmeyer
@ 2002-04-27 21:19 ` Warchild
0 siblings, 0 replies; 8+ messages in thread
From: Warchild @ 2002-04-27 21:19 UTC (permalink / raw)
To: Bryan Rittmeyer; +Cc: linux-kernel
On Sat, Apr 27, 2002 at 01:48:43PM -0700, Bryan Rittmeyer wrote:
> > [oh my god, i see userspace text strings in ARP packets]
*sigh*
> It's not the ARP layer that's causing the padding... Ethernet has a
> minimum transmit size of 64 bytes (everything below that is disgarded
> by hardware as a fragment), so the network device driver or
> the hardware itself will pad any Linux skb smaller than 60 bytes up to
> that size (so that it's 64 bytes after appending CRC32). Apparently, in
> some cases that's done by just transmitting whatever uninitialized
> memory follows skb->data, which, after the system has been running
> for a while, may be inside a page previously used by userspace.
That makes perfect sense. Thanks for the explanation.
> This is NOT a "remote memory reading" exploit, since there is no way to
> remotely control what address in memory gets used as padding. I guess
> you could packet blast a machine and hope to find something
> interesting, but that'd be a denial of service attack long before you
> got a complete view of system memory. In any case, it's arguably
> userspace's responsibility to clear any sensitive memory contents
> before exiting. I would be more concerned if you can find data
> from currently in use, userspace-allocated pages flying out as packet
> padding (i.e. if reading past skb->data pushes you into somebody else's
> page, which seems unlikely since new skb's tend to get allocated near
> the beginning of a page).
Correct. It'd take far too long and I'd go cross-eyed long before I got
anything other than useless garbage. Isn't this similar to the bug within
the last year that dealt with userland memory disclosure via tcp/icmp? What
was the "verdict" with that?
Please note that nowhere in my email did I use the word exploit.
> If you are really concerned you could probably patch the network driver
> to zero out memory that will be used as padding, though I don't think
> the security risk justifies that performance hit.
Agreed. It doesn't bother me much at all. I was just curious what was
going on.
thanks, and keep up the good work,
-warchild
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20020427202756.GC6240@spoofed.org.suse.lists.linux.kernel>]
end of thread, other threads:[~2002-04-30 3:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-27 20:27 remote memory reading using arp? Warchild
2002-04-27 20:48 ` Bryan Rittmeyer
2002-04-27 21:19 ` Warchild
[not found] <20020427202756.GC6240@spoofed.org.suse.lists.linux.kernel>
[not found] ` <3CCB0EAB.9050602@ixiacom.com.suse.lists.linux.kernel>
2002-04-28 12:26 ` Andi Kleen
2002-04-28 17:47 ` warchild
2002-04-29 15:24 ` Calin A. Culianu
2002-04-29 15:31 ` Andi Kleen
2002-04-30 3:04 ` warchild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox