Skip to contentSkip to conversation

APs from the Kernel Summit run Linux

DISCUSSION Vojtech Pavlik 8 participants 12 messages Aug 30, 2005 – Sep 1, 2005

lore
Share & tools
lore
#0 lore raw

Hi!

The D-Link DWL-G730AP devices from the Kernel Summit run Linux, And it's likely a GPL violation, too, since sources are nowhere to be found.

They're based on a Marvell Libertas AP-32 (ARM9) design, similar to the ASUS WL-530g. A bootlog from the ASUS (which has telnet enabled for some reason, and thus can be logged in) is at the end of the mail.

A firmware image is available from D-Link ([URL removed]) and it seems to be composed of compressed blocks padded by zeroes. I haven't verified yet that it's indeed a compressed kernel, cramfs, etc, but it seems quite likely.

Anyone interested in dissecting it, and pushing D-Link/Marvell to release the kernel sources? I'd love to get more out of this cute device ...

Linux version 2.4.22-uc0 ([email protected])

	(gcc version 2.95.3 20010315 (release)
	(ColdFire patches - 20010318 from [URL removed])
	(uClinux XIP and shared lib patches from [URL removed]))
	#1369 Wed Aug 18 21:32:58 CDT 2004

Processor: ARM Arm946id(wb) revision 1
Architecture: MV88W85x0
On node 0 totalpages: 4032
zone(0): 0 pages.
zone(1): 4032 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,38400 root=/dev/mtdblock1 ro rootfstype=cramfs Calibrating delay loop... 87.85 BogoMIPS
Memory: 15MB = 15MB total
Memory: 14616KB available (1045K code, 227K data, 48K init)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with no serial options enabled ttyS00 at 0x8000c840 (irq = 11) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize PPP generic driver version 2.4.2
PPP MPPE compression module registered
PPP Deflate Compression module registered
PPP BSD Compression module registered
Marvell Libertas AP-32 flash mapping: 400000 at ffc00000
Marvell Libertas AP-32: Found 1 x16 devices at 0x0 in 16-bit mode
Amd/Fujitsu Extended Query Table at 0x0040
Marvell Libertas AP-32: Swapping erase regions for broken CFI table. number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness. Creating 4 MTD partitions on "Marvell Libertas AP-32":
0x00000000-0x00380000 : "Libertas AP-32 compressed kernel" 0x000a0000-0x00380000 : "Libertas AP-32 romfs root file system" 0x00380000-0x003d0000 : "Libertas AP-32 jffs2 file system" 0x003d0000-0x003e0000 : "Libertas AP-32 manufacture data"
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
ip_conntrack version 2.1 (126 buckets, 1008 max) - 320 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
ipt_time loading
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
Bridge firewalling registered
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 48K
name: Libertas AP-32 compressed kernel
name: Libertas AP-32 romfs root file system
name: Libertas AP-32 jffs2 file system
ip_conntrack_pptp.c:init: ip_conntrack_pptp.c: registering helper ip_conntrack_pptp version 1.9 loaded
ASSERT ip_conntrack_core.c:630 &ip_conntrack_lock not readlocked ip_nat_pptp version 1.5 loaded
QD initiated
mvWLAN_crypt: registered algorithm 'WEP'
mvWLAN_crypt: registered algorithm 'TKIP'
mvWLAN_hw_init()
mvWLAN: Registered netdevice wlan0
wlan0: enabling hostapd mode
wlan0: Registered netdevice wlan0ap for AP management
wlan0: Registered netdevice wlan0sta for STA use
wlan0: mvWLAN_open
wlan0ap: mvWLAN_open
device LAN entered promiscuous mode
device wlan0 entered promiscuous mode
wlan0: attempt to add interface with same source address.

More details on the WL-530g are available at: [URL removed]

PS. I already tried to send this mail twice, but something ate it. I've removed the URLs this time, hopefully that was the reason the spam filter at LKML didn't like it.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#1 lore raw
Quoted 5 lines · Vojtech Pavlik

Hi!

The D-Link DWL-G730AP devices from the Kernel Summit run Linux, And it's likely a GPL violation, too, since sources are nowhere to be found.

Quoted 8 lines

They're based on a Marvell Libertas AP-32 (ARM9) design, similar to the ASUS WL-530g. A bootlog from the ASUS (which has telnet enabled for some reason, and thus can be logged in) is at the end of the mail.

A firmware image is available from D-Link ([URL removed]) and it seems to be composed of compressed blocks padded by zeroes. I haven't verified yet that it's indeed a compressed kernel, cramfs, etc, but it seems quite likely.

Why [URL removed] ? ;)

There's an ongoing project to "bring some power" into other D-Link devices (from DSL series; one of them, DSL-G604T (which I own) has an access point too) at http://mcmcc.bat.ru/dlinkt/ . This stuff is also based on the same design, it seems (but I know right to nothing about all this arm stuff - wasn't even able to compile a cross-gcc for it yet). McMCC (the author of this whole work) figured out the layout of the firmware images and mtd devices, and got D-Link stuff (out of http://ftp.dlink.ru/pub/ADSL/GPL_source_code/ ) to build and run on those boards...

BTW, DSL series has telnet by default (user root, password is the one set in the admin interface, default is 'admin'). And the whole webinterface looks very similar (but this DWL-G730AP device has some "advanced" controls for the wireless component which are absent in my DSL-G604T).

/mjt

#2 lore raw
Quoted 10 lines · Michael Tokarev
Quoted 9 lines · Vojtech Pavlik

Hi!

The D-Link DWL-G730AP devices from the Kernel Summit run Linux, And it's likely a GPL violation, too, since sources are nowhere to be found.

They're based on a Marvell Libertas AP-32 (ARM9) design, similar to the ASUS WL-530g. A bootlog from the ASUS (which has telnet enabled for some reason, and thus can be logged in) is at the end of the mail.

Quoted 6 lines
Quoted 4 lines

A firmware image is available from D-Link ([URL removed]) and it seems to be composed of compressed blocks padded by zeroes. I haven't verified yet that it's indeed a compressed kernel, cramfs, etc, but it seems quite likely.

Why [URL removed] ? ;)

See the comment at the end of the mail. I tried to send the mail twice already, and with the URLs in, it wasn't delivered. Probably some spam filter at kernel.org ate it.

Quoted 9 lines

There's an ongoing project to "bring some power" into other D-Link devices (from DSL series; one of them, DSL-G604T (which I own) has an access point too) at http://mcmcc.bat.ru/dlinkt/ . This stuff is also based on the same design, it seems (but I know right to nothing about all this arm stuff - wasn't even able to compile a cross-gcc for it yet). McMCC (the author of this whole work) figured out the layout of the firmware images and mtd devices, and got D-Link stuff (out of http://ftp.dlink.ru/pub/ADSL/GPL_source_code/ ) to build and run on those boards...

These seem to have an entirely different architecture. The DSL's are Texas Instrument MIPS, while the Libertas is an Marvell ARM.

Quoted 5 lines

BTW, DSL series has telnet by default (user root, password is the one set in the admin interface, default is 'admin'). And the whole webinterface looks very similar (but this DWL-G730AP device has some "advanced" controls for the wireless component which are absent in my DSL-G604T).

The web interface is likely the only part done by D-Link. In the DWL-G730AP, the rest (board design, etc) was done by Marvell and Global Sun Technology. The PCB name is "WL AP 2454 NM1 VER:1.1".

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#3 lore raw
In reply to Vojtech Pavlik

Mmm.. curious sequence in the first 512 bytes of the DWL-G730AP firmware binary. It has this sequence of bytes repeated several times:

81 40 20 10 08 04 02 81 40 20 10 08 04 02 ...

That should be recognizable to somebody, I think.

I'll try loading the works into another ARM system I have here, and see (1) if it runs as-is, and (2) what the disassembly shows.

I'd certainly like to get source for my 730AP here, as it seems to be a bit buggy on the WEP implementation.

Cheers

Signature · 3 lines
Mark Lord
Real-Time Remedies Inc.
[email protected]
#4 lore raw
Quoted 7 lines · Mark Lord

Mmm.. curious sequence in the first 512 bytes of the DWL-G730AP firmware binary. It has this sequence of bytes repeated several times:

81 40 20 10 08 04 02 81 40 20 10 08 04 02 ...

That should be recognizable to somebody, I think.

I noticed this already. Might be a beginning of address space, some kind of table, might be just empty memory padding pattern, or it might be a trivial obfuscating XOR of the whole binary.

There are no strings until the end, and the binary is quite compressible, which is very suspicious, and looks more like obfuscation than compression.

Quoted 6 lines

I'll try loading the works into another ARM system I have here, and see (1) if it runs as-is, and (2) what the disassembly shows.

I'd certainly like to get source for my 730AP here, as it seems to be a bit buggy on the WEP implementation.

It seems quite buggy in other respects, too, one day it stopped accepting any packets through the WiFi interface, even after factory reset. The WiFi did work, though, I could associate, etc. The other side worked too. But no data. Then, another day, all was OK again.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#5 lore raw
In reply to Mark Lord
Quoted 3 lines · Mark Lord

I'll try loading the works into another ARM
system I have here, and see (1) if it runs as-is,
and (2) what the disassembly shows.

You can identify ARM code quite readily - look for a large number of 32-bit words naturally aligned and grouped together whose top nibble is 14 - ie 0xE.......

The top nibble is the conditional execution field, and 14 is "always".

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#6 lore raw
Quoted 10 lines · Russell King
Quoted 3 lines · Mark Lord

I'll try loading the works into another ARM
system I have here, and see (1) if it runs as-is,
and (2) what the disassembly shows.

You can identify ARM code quite readily - look for a large number of 32-bit words naturally aligned and grouped together whose top nibble is 14 - ie 0xE.......

The top nibble is the conditional execution field, and 14 is "always".

Didn't find that. Anyway:

The firmware has four parts. Each starts at a nice round number and is padded to the next one with zeros.

        0x000000-0x0fffff 560 kB
        0x100000-0x15ffff 316 kB
        0x160000-0x1bffbf 331 kB
        0x1bffc0-0x1bffff  64 bytes ASCII identificatoin

Each of the first three large parts starts with this sequence of bytes:

        00 10 00 00 03 00 00 00 ED

The first and third parts contain a repeating 7-byte sequence

        81 40 20 10 08 04 02

near the beginning, while part 2 is padded with zeroes in the same place.

There are no strings except in the last part. Most likely it's some kind of compressed data, although the repeating parts would appear in regular compressed blobs.

Anyone, does this ring a bell?

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#7 lore raw
Quoted 1 line

Each of the first three large parts starts with this sequence of bytes

Actually, the byte structure of the first 0x100 bytes of each section seems to be very similar.

Some kind of header.

#8 lore raw
In reply to Vojtech Pavlik
Quoted 15 lines · Vojtech Pavlik
Quoted 7 lines · Russell King
Quoted 4 lines · Mark Lord

I'll try loading the works into another ARM
system I have here, and see (1) if it runs as-is,
and (2) what the disassembly shows.

Quoted 5 lines

You can identify ARM code quite readily - look for a large number of 32-bit words naturally aligned and grouped together whose top nibble is 14 - ie 0xE.......

The top nibble is the conditional execution field, and 14 is "always".

Quoted 8 lines

Didn't find that. Anyway:

The first and third parts contain a repeating 7-byte sequence

        81 40 20 10 08 04 02

near the beginning, while part 2 is padded with zeroes in the same place.

That sequence is altered in the first and last repetitions, like this:

88 4020 1008 0402
81 4020 1008 0402
[...]
81 4020 1008 0402
81 4020 1008 04c2

The 4020 and 0402 look oddly symmetrical to me, but that could just be my imagination.

I wrote a quick perl script to find the number of occurrences of 8-bit aligned sequences of 16-bits, for all 16-bit values. It has some interesting (and potentially useful) results.

The script:
http://zeus.moffetthome.net/~kyle/hexfreq

The output:
http://zeus.moffetthome.net/~kyle/dwl.hexmult

Reprocessed output by frequency:
http://zeus.moffetthome.net/~kyle/dwl.hexfreq

Reprocessing command:
<dwl.hexmult sed -re 's/^(.*): (.*)$/\2: \1/g' | sort -gr >dwl.hexfreq

Cheers,
Kyle Moffett

--
Somone asked me why I work on this free (http://www.fsf.org/philosophy/)
software stuff and not get a real job. Charles Shultz had the best answer:

"Why do musicians compose symphonies and poets write poems? They do it because life wouldn't have any meaning for them if they didn't. That's why I draw cartoons. It's my life."
-- Charles Shultz

#9 lore raw

Hi.

Quoted 2 lines · Kyle Moffett

The 4020 and 0402 look oddly symmetrical to me, but that could just be my imagination.

All I saw in it was byte n+1 = byte n >> 1. Can't see any use to that either, though. Maybe it's just there to torment reverse engineerers, or trap memory corruption?

Nigel

Signature · 4 lines
Evolution.
Enumerate the requirements.
Consider the interdependencies.
Calculate the probabilities.
#10 lore raw

Hi!

Quoted 6 lines
Quoted 2 lines

The 4020 and 0402 look oddly symmetrical to me, but that could just be my imagination.

All I saw in it was byte n+1 = byte n >> 1. Can't see any use to that either, though. Maybe it's just there to torment reverse engineerers, or trap memory corruption?

I had seen something like that before -- it was image compression and they were using 9bit "bytes"... which worked like obfuscation, too.

Pavel

Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         
#11 lore raw
Quoted 11 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 2 lines

The 4020 and 0402 look oddly symmetrical to me, but that could just be my imagination.

All I saw in it was byte n+1 = byte n >> 1. Can't see any use to that either, though. Maybe it's just there to torment reverse engineerers, or trap memory corruption?

I had seen something like that before -- it was image compression and they were using 9bit "bytes"... which worked like obfuscation, too.

Yes, if they were using 7bit bytes, that'd explain the 0x81 in the sequence ...

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR