linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Mark Salyzyn <salyzyn@android.com>,
	Andrea Parri <andrea.parri@amarulasolutions.com>,
	linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
	Allen Pais <allen.pais@oracle.com>,
	Young Xiao <YangX92@hotmail.com>
Subject: Re: [PATCH] Bluetooth: hidp: NUL terminate a string in the compat ioctl
Date: Sat, 6 Jul 2019 13:08:13 +0200	[thread overview]
Message-ID: <3D402D33-37D1-4FAA-B7C0-2D9C2CC5C2DE@holtmann.org> (raw)
In-Reply-To: <20190516182400.GA8270@mwanda>

Hi Dan,

> This change is similar to commit a1616a5ac99e ("Bluetooth: hidp: fix
> buffer overflow") but for the compat ioctl.  We take a string from the
> user and forgot to ensure that it's NUL terminated.
> 
> I have also changed the strncpy() in to strscpy() in hidp_setup_hid().
> The difference is the strncpy() doesn't necessarily NUL terminate the
> destination string.  Either change would fix the problem but it's nice
> to take a belt and suspenders approach and do both.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> net/bluetooth/hidp/core.c | 2 +-
> net/bluetooth/hidp/sock.c | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


      reply	other threads:[~2019-07-06 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 18:24 [PATCH] Bluetooth: hidp: NUL terminate a string in the compat ioctl Dan Carpenter
2019-07-06 11:08 ` Marcel Holtmann [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=3D402D33-37D1-4FAA-B7C0-2D9C2CC5C2DE@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=YangX92@hotmail.com \
    --cc=allen.pais@oracle.com \
    --cc=andrea.parri@amarulasolutions.com \
    --cc=dan.carpenter@oracle.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=salyzyn@android.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).