LKML Archive on
 help / color / Atom feed
From: Andi Kleen <>
To: Hugues FRUCHET <>
Cc: Andi Kleen <>,
	"" <>,
	"" <>,
	Andi Kleen <>,
	"" <>
Subject: Re: [PATCH] Fix read buffer overflow in delta-ipc
Date: Wed, 3 Jan 2018 16:19:34 -0800
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Jan 03, 2018 at 09:40:04AM +0000, Hugues FRUCHET wrote:
> Hi Andi,
> Thanks for the patch but I would suggest to use strlcpy instead, this 
> will guard overwriting and add the NULL termination in case
> of truncation:
> -	memcpy(, name, sizeof(;
> -[sizeof( - 1] = 0;
> +	strlcpy(, name, sizeof(;

I'm not an expert on your setup, but it seems strlcpy would leak some
uninitialized stack data over your ipc mechanism. strclpy doesn't pad the
data. If the IPC is a security boundary that would be a security bug.

So I think the original patch is better than strlcpy.


  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22  0:12 Andi Kleen
2018-01-03  9:40 ` Hugues FRUCHET
2018-01-04  0:19   ` Andi Kleen [this message]
2018-01-04  9:53     ` Hugues FRUCHET

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox