From: Jon Mason <jdmason@kudzu.us>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <Allen.Hubbe@emc.com>
Subject: Re: [PATCH] ntb: avoid format string in dev_set_name
Date: Mon, 27 Jul 2015 15:04:50 -0400 [thread overview]
Message-ID: <20150727190450.GA22852@kudzu.us> (raw)
In-Reply-To: <20150724233559.GA15973@www.outflux.net>
On Fri, Jul 24, 2015 at 04:35:59PM -0700, Kees Cook wrote:
> Avoid any chance of format string expansion when calling dev_set_name.
Looks good to me. I'll pull it into my next release.
Thanks,
Jon
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/ntb/ntb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ntb/ntb.c b/drivers/ntb/ntb.c
> index 23435f2a5486..2e2530743831 100644
> --- a/drivers/ntb/ntb.c
> +++ b/drivers/ntb/ntb.c
> @@ -114,7 +114,7 @@ int ntb_register_device(struct ntb_dev *ntb)
> ntb->dev.bus = &ntb_bus;
> ntb->dev.parent = &ntb->pdev->dev;
> ntb->dev.release = ntb_dev_release;
> - dev_set_name(&ntb->dev, pci_name(ntb->pdev));
> + dev_set_name(&ntb->dev, "%s", pci_name(ntb->pdev));
>
> ntb->ctx = NULL;
> ntb->ctx_ops = NULL;
> --
> 1.9.1
>
>
> --
> Kees Cook
> Chrome OS Security
prev parent reply other threads:[~2015-07-27 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 23:35 Kees Cook
2015-07-27 19:04 ` Jon Mason [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=20150727190450.GA22852@kudzu.us \
--to=jdmason@kudzu.us \
--cc=Allen.Hubbe@emc.com \
--cc=dave.jiang@intel.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®