netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: keescook@chromium.org
Cc: netdev@vger.kernel.org, rasesh.mody@cavium.com,
	sudarsana.kalluru@cavium.com, linux-kernel@vger.kernel.org,
	Dept-GELinuxNICDev@cavium.com, danielmicay@gmail.com
Subject: Re: [PATCH] bna: ethtool: Avoid reading past end of buffer
Date: Mon, 08 May 2017 14:42:15 -0400 (EDT)	[thread overview]
Message-ID: <20170508.144215.2146113320361341036.davem@davemloft.net> (raw)
In-Reply-To: <20170505223023.GA17972@beast>

From: Kees Cook <keescook@chromium.org>
Date: Fri, 5 May 2017 15:30:23 -0700

> Using memcpy() from a string that is shorter than the length copied means
> the destination buffer is being filled with arbitrary data from the kernel
> rodata segment. Instead, use strncpy() which will fill the trailing bytes
> with zeros.
> 
> This was found with the future CONFIG_FORTIFY_SOURCE feature.
> 
> Cc: Daniel Micay <danielmicay@gmail.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Applied.

      reply	other threads:[~2017-05-08 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 22:30 [PATCH] bna: ethtool: Avoid reading past end of buffer Kees Cook
2017-05-08 18:42 ` David Miller [this message]

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=20170508.144215.2146113320361341036.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Dept-GELinuxNICDev@cavium.com \
    --cc=danielmicay@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rasesh.mody@cavium.com \
    --cc=sudarsana.kalluru@cavium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).