public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Constantine Gavrilov <constantine.gavrilov@gmail.com>
Cc: linux-kernel@vger.kernel.org, general@lists.openfabrics.org
Subject: Re: patch: support long (above 14 bytes) HW addresses in arp_ioctl
Date: Mon, 03 Nov 2008 09:39:30 -0800	[thread overview]
Message-ID: <ada63n4wvxp.fsf@cisco.com> (raw)
In-Reply-To: <490EDBDD.1030104@gmail.com> (Constantine Gavrilov's message of "Mon, 03 Nov 2008 13:09:17 +0200")

 > * arp_ioctl will corrupt the kernel and user memory when this ioctl is
 > used on the adapters that have HW addresses longer that 14 bytes.
 > This is because when copying the HW address, the arp_ioctl code copies
 > dev->addr_len bytes without checking that addr_len is not above 14
 > bytes. This is done both for copy_to_user() and memcpy() calls on
 > kernel data structures allocated on stack. The memcpy() call in
 > particular, will corrupt kernel stack.

It's not obvious to me after a quick glance where this kernel memory
corruption occurs, but clearly we should at least fix this bug.

 > The patch does not change the existing ABI but extends it.  The kernel
 > structure used in arp_ioctl calls is changed to support larger
 > addresses, while the user-space structure is extended by appending
 > extra-space to the end of the structure if ATF_NEWARPCTL -- a new flag
 > -- is set in arp_flags of existing user-space structure. This allows
 > avoiding big changes to the existing code while preserving the ABI
 > compatibility.

However, given that applications need to be changed to use this,
wouldn't it make more sense just to change those applications to use
rtnetlink, which already supports large hardware addresses?  ie is there
much point to extending a legacy ABI to add a feature that the preferred
modern interface already has?

 - R.

  parent reply	other threads:[~2008-11-03 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 11:09 patch: support long (above 14 bytes) HW addresses in arp_ioctl Constantine Gavrilov
2008-11-03 16:34 ` Constantine Gavrilov
2008-11-03 17:39 ` Roland Dreier [this message]
2008-11-03 18:56   ` Constantine Gavrilov
2008-11-03 23:53     ` Roland Dreier

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=ada63n4wvxp.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=constantine.gavrilov@gmail.com \
    --cc=general@lists.openfabrics.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox