From: Thomas Huth <huth@tuxfamily.org>
To: sohu0106 <sohu0106@126.com>
Cc: schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: drivers/s390/char/keyboard.c kernel stack infoleak
Date: Fri, 4 Aug 2017 11:09:24 +0200 [thread overview]
Message-ID: <0b76e8f9-e1ea-da9e-23f2-92cdbd475ec9@tuxfamily.org> (raw)
In-Reply-To: <116f735.aa23.15da864e94a.Coremail.sohu0106@126.com>
Hi,
On 03.08.2017 15:59, sohu0106 wrote:
>
> The stack object "kbdiacr" has a total size of 4 bytes. Its last 1 bytes are padding bytes after "result" which are not initialized and leaked to userland via "copy_to_user".
>
>
> diff --git a/keyboard.c b/keyboard.c
> index ba0e4f9..76a6d35 100644
> --- a/keyboard.c
> +++ b/keyboard.c
> @@ -480,6 +480,8 @@ int kbd_ioctl(struct kbd_data *kbd, unsigned int cmd, unsigned long arg)
> struct kbdiacr diacr;
> int i;
>
> + memset( &diacr, 0, sizeof(struct kbdiacr) );
> +
I think it would be nicer to simply init the struct with "= {}"
directly, i.e.:
struct kbdiacr diacr = {};
And by the way, please have a look at the kernel patch submission
guidelines first, especially the COO part here:
https://www.kernel.org/doc/html/v4.12/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
So looking at your patch, please try to send plain text mails, and sign
your patch with a Signed-off-by line (i.e. no anonymous contributions).
Thanks!
Thomas
next prev parent reply other threads:[~2017-08-04 9:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 13:59 sohu0106
2017-08-04 9:09 ` Thomas Huth [this message]
2017-08-04 9:20 ` Heiko Carstens
[not found] ` <78655e6a.d34.15db01cd5b8.Coremail.sohu0106@126.com>
2017-08-05 7:12 ` Thomas Huth
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=0b76e8f9-e1ea-da9e-23f2-92cdbd475ec9@tuxfamily.org \
--to=huth@tuxfamily.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=sohu0106@126.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
all inboxes | Powered by JetHome®