netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: alan@linux.intel.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] 6pack: fix buffer length mishandling
Date: Tue, 20 Sep 2016 22:51:58 -0400 (EDT)	[thread overview]
Message-ID: <20160920.225158.1366025915900844841.davem@davemloft.net> (raw)
In-Reply-To: <147431251411.53012.5151201638797223106.stgit@localhost.localdomain>

From: Alan <alan@linux.intel.com>
Date: Mon, 19 Sep 2016 20:15:24 +0100

> Dmitry Vyukov wrote:
>> different runs). Looking at code, the following looks suspicious -- we
>> limit copy by 512 bytes, but use the original count which can be
>> larger than 512:
>>
>> static void sixpack_receive_buf(struct tty_struct *tty,
>>     const unsigned char *cp, char *fp, int count)
>> {
>>     unsigned char buf[512];
>>     ....
>>     memcpy(buf, cp, count < sizeof(buf) ? count : sizeof(buf));
>>     ....
>>     sixpack_decode(sp, buf, count1);
> 
> With the sane tty locking we now have I believe the following is safe as
> we consume the bytes and move them into the decoded buffer before
> returning.
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>

Applied to net-next, thanks Alan.

      reply	other threads:[~2016-09-21  2:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 19:15 [PATCH] 6pack: fix buffer length mishandling Alan
2016-09-21  2:51 ` 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=20160920.225158.1366025915900844841.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alan@linux.intel.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).