Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107508120
D33617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
922 B
Referenced Files
None
Subscribers
None
D33617.diff
View Options
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -3094,10 +3094,7 @@
struct mii_data *mii;
uint32_t reg;
uint16_t cfg;
- union {
- uint32_t align_dummy;
- u_char eaddr[ETHER_ADDR_LEN];
- } eaddr;
+ uint32_t idr[2];
RL_LOCK_ASSERT(sc);
@@ -3196,12 +3193,11 @@
* register write enable" mode to modify the ID registers.
*/
/* Copy MAC address on stack to align. */
- bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
+ bzero(idr, sizeof(idr));
+ bcopy(IF_LLADDR(ifp), idr, ETHER_ADDR_LEN);
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
- CSR_WRITE_4(sc, RL_IDR0,
- htole32(*(u_int32_t *)(&eaddr.eaddr[0])));
- CSR_WRITE_4(sc, RL_IDR4,
- htole32(*(u_int32_t *)(&eaddr.eaddr[4])));
+ CSR_WRITE_4(sc, RL_IDR0, htole32(idr[0]));
+ CSR_WRITE_4(sc, RL_IDR4, htole32(idr[1]));
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 5:16 AM (20 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15820521
Default Alt Text
D33617.diff (922 B)
Attached To
Mode
D33617: re: Avoid subobject overread when setting IDRn
Attached
Detach File
Event Timeline
Log In to Comment