Linux Media Controller development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] dvb: fix potential format string leak
Date: Mon, 16 Sep 2013 16:48:52 -0700	[thread overview]
Message-ID: <1379375332.7083.3.camel@joe-AO722> (raw)
In-Reply-To: <20130916233720.GA3967@www.outflux.net>

On Mon, 2013-09-16 at 16:37 -0700, Kees Cook wrote:
> Make sure that a format string cannot accidentally leak into the printk
> buffer.
[]
> diff --git a/drivers/media/dvb-frontends/dib9000.c b/drivers/media/dvb-frontends/dib9000.c
[]
> @@ -649,7 +649,7 @@ static int dib9000_risc_debug_buf(struct dib9000_state *state, u16 * data, u8 si
>  	b[2 * (size - 2) - 1] = '\0';	/* Bullet proof the buffer */
>  	if (*b == '~') {
>  		b++;
> -		dprintk(b);
> +		dprintk("%s", b);
>  	} else
>  		dprintk("RISC%d: %d.%04d %s", state->fe_id, ts / 10000, ts % 10000, *b ? b : "<emtpy>");
>  	return 1;

This looks odd.

Perhaps this should be:

	if (*b == '~')
		b++;
	dprintk("etc...);

It'd be nice to fix the <empty> typo too.



  reply	other threads:[~2013-09-16 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 23:37 [PATCH] dvb: fix potential format string leak Kees Cook
2013-09-16 23:48 ` Joe Perches [this message]
2013-09-30 16:20   ` Michael Krufky

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=1379375332.7083.3.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.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