Revert "arp: Prevent overflow in arp_req_get()."
This reverts commit 97eaa2955db4120ce6ec2ef123e860bc32232c50 which is
commit a7d6027790acea24446ddd6632d394096c0f4667 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I05947b1018c5e28cdcb891edddf72163a2a0666a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 8ae9bd6..83a4799 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1104,8 +1104,7 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
if (neigh) {
if (!(neigh->nud_state & NUD_NOARP)) {
read_lock_bh(&neigh->lock);
- memcpy(r->arp_ha.sa_data, neigh->ha,
- min(dev->addr_len, (unsigned char)sizeof(r->arp_ha.sa_data_min)));
+ memcpy(r->arp_ha.sa_data, neigh->ha, dev->addr_len);
r->arp_flags = arp_state_to_flags(neigh);
read_unlock_bh(&neigh->lock);
r->arp_ha.sa_family = dev->type;