mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [RFC][PATCH] vsprintf: Do not have bprintf dereference pointers
Date: Thu, 28 Dec 2017 20:03:28 -0500	[thread overview]
Message-ID: <20171228200328.57b6c2fa@gandalf.local.home> (raw)
In-Reply-To: <20171228185026.17ff7b7d@gandalf.local.home>

On Thu, 28 Dec 2017 18:50:26 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> +			default:
> +				if (!isalnum(*fmt)) {
> +					process = true;
> +					break;
> +				}
> +				/* Pointer dereference was already processed */
> +				if (str < end) {
> +					len = copy = strlen(args);
> +					if (copy > end - str)
> +						copy = end - str;
> +					memcpy(str, args, copy);
> +					str += copy;

Actually, that should have been: str += len; as str will be used to
return the amount that would be processed, even if the size wasn't long
enough.

V2 coming up.

-- Steve

> +					args += len;
> +				}
> +			}

      reply	other threads:[~2017-12-29  1:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 23:50 Steven Rostedt
2017-12-29  1:03 ` Steven Rostedt [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=20171228200328.57b6c2fa@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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®