public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <axboe@kernel.dk>,
	"David S. Miller" <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.hengli.com.au>,
	David Woodhouse <dwmw2@infradead.org>,
	Anton Vorontsov <cbou@mail.ru>,
	Karsten Keil <isdn@linux-pingi.de>
Subject: Re: [PATCH 5/8] device: avoid format string in dev_set_name
Date: Fri, 7 Jun 2013 16:10:55 -0700	[thread overview]
Message-ID: <20130607231055.GA23081@kroah.com> (raw)
In-Reply-To: <1370551945-8444-6-git-send-email-keescook@chromium.org>

On Thu, Jun 06, 2013 at 01:52:22PM -0700, Kees Cook wrote:
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -515,7 +515,6 @@ EXPORT_SYMBOL(bdi_destroy);
>  int bdi_setup_and_register(struct backing_dev_info *bdi, char *name,
>  			   unsigned int cap)
>  {
> -	char tmp[32];
>  	int err;
>  
>  	bdi->name = name;
> @@ -524,8 +523,8 @@ int bdi_setup_and_register(struct backing_dev_info *bdi, char *name,
>  	if (err)
>  		return err;
>  
> -	sprintf(tmp, "%.28s%s", name, "-%d");
> -	err = bdi_register(bdi, NULL, tmp, atomic_long_inc_return(&bdi_seq));
> +	err = bdi_register(bdi, NULL, "%.28s-%d", name,
> +			   atomic_long_inc_return(&bdi_seq));
>  	if (err) {
>  		bdi_destroy(bdi);
>  		return err;

This chunk causes the following build warning to now show up:
mm/backing-dev.c: In function ‘bdi_setup_and_register’:
mm/backing-dev.c:527:7: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat]

Care to fix it up and resend it?

thanks,

greg k-h

  reply	other threads:[~2013-06-07 23:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 20:52 [PATCH 0/8] format string usage clean ups Kees Cook
2013-06-06 20:52 ` [PATCH 1/8] block: do not pass disk names as format strings Kees Cook
2013-06-06 20:52 ` [PATCH 2/8] kobject: sanitize argument for format string Kees Cook
2013-06-06 20:52 ` [PATCH 3/8] crypto: " Kees Cook
2013-06-06 20:52 ` [PATCH 4/8] power: ensure event is not used as " Kees Cook
2013-06-07  0:39   ` Anton Vorontsov
2013-06-07  1:25     ` [PATCH] power: Add missing newlines, fix a couple of typos, add pr_fmt Joe Perches
2013-06-07 18:31       ` Kees Cook
2013-06-09 17:10         ` Anton Vorontsov
2013-06-06 20:52 ` [PATCH 5/8] device: avoid format string in dev_set_name Kees Cook
2013-06-07 23:10   ` Greg Kroah-Hartman [this message]
2013-06-06 20:52 ` [PATCH 6/8] workqueue: avoid format strings in names Kees Cook
2013-06-06 20:52 ` [PATCH 7/8] kthread: avoid parsing names as format strings Kees Cook
2013-06-06 20:52 ` [PATCH 8/8] isdn: clean up debug format string usage Kees Cook
2013-06-07 18:32   ` Kees Cook

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=20130607231055.GA23081@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=cbou@mail.ru \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=herbert@gondor.hengli.com.au \
    --cc=isdn@linux-pingi.de \
    --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