From: Matt Domsch <Matt_Domsch@dell.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@oss.sgi.com, jamal <hadi@cyberus.ca>
Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len
Date: Mon, 1 Nov 2004 14:38:21 -0600 [thread overview]
Message-ID: <20041101203821.GA15086@lists.us.dell.com> (raw)
In-Reply-To: <20041101202754.GA23149@gondor.apana.org.au>
On Tue, Nov 02, 2004 at 07:27:54AM +1100, Herbert Xu wrote:
> Same problem as before. If dev->addr_len is greater than zero but less
> than sizeof ifr->ifr_hwaddr.sa_data, then you've got garbage in there.
> Zero is not a special case.
OK, I'll unconditionally clear it all first. How's this?
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
===== net/core/dev.c 1.169 vs edited =====
--- 1.169/net/core/dev.c 2004-10-26 11:09:33 -05:00
+++ edited/net/core/dev.c 2004-11-01 14:35:02 -06:00
@@ -2375,6 +2375,12 @@
return dev_set_mtu(dev, ifr->ifr_mtu);
case SIOCGIFHWADDR:
+ if (net_ratelimit())
+ printk(KERN_DEBUG "Warning: %s uses obsolete ioctl(SIOCGIFHWADDR), please convert it to rtnetlink(3,7)\n", current->comm);
+
+ if ((size_t) dev->addr_len > sizeof ifr->ifr_hwaddr.sa_data)
+ return -EOVERFLOW;
+ memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data);
memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr,
min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len));
ifr->ifr_hwaddr.sa_family = dev->type;
next prev parent reply other threads:[~2004-11-01 20:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-29 21:51 [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Matt Domsch
2004-10-30 1:37 ` Matt Domsch
2004-10-30 1:51 ` Herbert Xu
2004-10-30 3:09 ` Matt Domsch
2004-10-30 19:10 ` jamal
2004-11-01 4:44 ` Matt Domsch
2004-11-01 17:34 ` Matt Domsch
2004-11-01 20:27 ` Herbert Xu
2004-11-01 20:38 ` Matt Domsch [this message]
2004-11-01 20:41 ` Herbert Xu
2004-11-01 20:45 ` Matt Domsch
2004-11-01 21:50 ` jamal
2004-11-01 21:59 ` Matt Domsch
2004-11-01 22:06 ` Herbert Xu
2004-11-04 0:07 ` David S. Miller
2004-11-04 3:42 ` Matt Domsch
2004-11-01 22:03 ` Herbert Xu
2004-10-30 1:48 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041101203821.GA15086@lists.us.dell.com \
--to=matt_domsch@dell.com \
--cc=hadi@cyberus.ca \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.