archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <>
To: Lee Jones <>
Cc: gregkh <>,
	Linux ARM <>,
	"" <>,
	Rodolfo Giometti <>,
	"Eurotech S.p.A" <>,
	Geert Uytterhoeven <>
Subject: Re: [PATCH 1/1] misc: c2port: core: Make copying name from userspace more secure
Date: Tue, 14 Jul 2020 11:01:35 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Jul 14, 2020 at 10:33 AM Lee Jones <> wrote:
> Currently the 'c2dev' device data is not zeroed when its allocated.
> Coupled with the fact strncpy() *may not* provide a NUL terminator
> means that a 1-byte leak would be possible *if* this was ever copied
> to userspace.
> To prevent such a failing, let's first ensure the 'c2dev' device data
> area is fully zeroed out and ensure the buffer will always be NUL
> terminated by using the kernel's strscpy() which a) uses the
> destination (instead of the source) size as the bytes to copy and b)
> is *always* NUL terminated.
> Cc: Rodolfo Giometti <>
> Cc: "Eurotech S.p.A" <>
> Reported-by: Geert Uytterhoeven <>
> Signed-off-by: Lee Jones <>

Acked-by: Arnd Bergmann <>

  reply	other threads:[~2020-07-14  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  8:32 Lee Jones
2020-07-14  9:01 ` Arnd Bergmann [this message]
2020-07-23  7:41 ` Greg KH

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 1/1] misc: c2port: core: Make copying name from userspace more secure' \

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

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).