Modify

Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#9547 closed defect (fixed)

lantiq etop invalid MAC, using random

Reported by: conor@… Owned by: blogic
Priority: high Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: lantiq, etop, ethernet Cc:

Description

Bumped into this using trunk build for arv4518pw. Looks like it affects all similar targets.

From boot log:

0x0000003f0000-0x000000400000 : "board_config"
etop: invalid MAC, using random
ltq_mii: probed
Registering RTL8306SD switch with Chip ID: 0x5988, version: 0x0000

Tracked it down to an incorrect copy operation into the ltq_eth_data.mac structure in mach-arv45xx.c. Happens in all the xxx_ethernet_register functions. Doing -

	memcpy_fromio(&ltq_eth_data.mac,

While the driver is checking -

	if (!is_valid_ether_addr(mac.sa_data))

where mac is a -

struct sockaddr {
	sa_family_t	sa_family;	/* address family, AF_xxx	*/
	char		sa_data[14];	/* 14 bytes of protocol address	*/
};

Copy obviously going over sa_family part. Breaks on MACs with odd 3rd byte, as that will look like a multicast address.

I'm not up to speed on submitting patches, but I hope to do one for this in the next couple of days, if you can wait.

Thanks,

Conor

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by jow

  • Owner changed from developers to blogic
  • Status changed from new to assigned

comment:2 Changed 7 years ago by conor@…

Patch submitted via mailing list http://patchwork.openwrt.org/patch/1093/

comment:3 Changed 7 years ago by florian

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with r27172

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.