mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kees Cook <keescook@chromium.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	LKML <linux-kernel@vger.kernel.org>,
	George Spelvin <linux@horizon.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Jan Beulich <JBeulich@suse.com>,
	Motohiro KOSAKI <kosaki.motohiro@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] remove all uses of printf's %n
Date: Mon, 16 Sep 2013 08:44:37 -0700	[thread overview]
Message-ID: <1379346277.1934.9.camel@joe-AO722> (raw)
In-Reply-To: <CAGXu5jK7ALtFq74duH_ymoLnmoHKYmty+60HCG3YFyhghi2Scg@mail.gmail.com>

On Mon, 2013-09-16 at 08:25 -0700, Kees Cook wrote:
> On Mon, Sep 16, 2013 at 8:09 AM, Joe Perches <joe@perches.com> wrote:
> > On Mon, 2013-09-16 at 07:59 -0700, Kees Cook wrote:
> >> Perhaps instead of seq->count, there should be an access function?
> >> seq_get_count(seq) or something?
> >
> > My thought was to add a seq_last_len()
> 
> That would mean growing the size of the seq_file structure and adding
> instructions for all users. While I personally have no problem with
> that, I worry others might.

I don't think adding an int and a size_t is a big deal.

I'm still hoping to hear from Al if expanding the struct
is OK and race-free.

> If we just use seq->count (or equivalent
> function), then only those that want length will use it. I actually
> think this uses fewer instructions than %n. Especially in the case
> where seq_printf got replaced by seq_puts. :)

Shrug.  None of these are inline uses so the overall
code size doesn't change much.

I have patches that make seq_overflow public and replace
the current uses of the seq_printf/seq_puts/seq_putc
returns where appropriate.

Given that I was already touching a lot of the
seq_<foo> calls, I also have patches that convert all
the seq_printf(fmt) (no additional args) to seq_puts()
and all the seq_puts("[single char]") to seq_putc() as
separate patches.



  reply	other threads:[~2013-09-16 15:44 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  7:43 [PATCH 0/2] vsprintf: ignore %n again Kees Cook
2013-09-16  7:43 ` [PATCH 1/2] remove all uses of printf's %n Kees Cook
2013-09-16  8:09   ` Geert Uytterhoeven
2013-09-16 15:00     ` Kees Cook
2013-09-17 13:06       ` Tetsuo Handa
2013-09-17 14:34         ` Kees Cook
2013-09-17 20:57           ` George Spelvin
2013-09-19  8:56             ` Tetsuo Handa
2013-09-19 14:28               ` Kees Cook
2013-09-20  4:09                 ` Tetsuo Handa
2013-09-20  4:23                   ` Joe Perches
2013-09-20  4:53                     ` Kees Cook
2013-09-20  8:08                   ` Jiri Slaby
2013-09-20 19:24                     ` Kees Cook
2013-09-20 19:33                       ` Joe Perches
2013-09-21  0:28                       ` Tetsuo Handa
2013-09-22  8:09                         ` George Spelvin
2013-09-22  8:16                         ` Geert Uytterhoeven
2013-09-23 21:24                   ` Kees Cook
2013-09-30  8:16                     ` Tetsuo Handa
2013-09-16 11:41   ` Tetsuo Handa
2013-09-16 14:59     ` Kees Cook
2013-09-16 15:09       ` Joe Perches
2013-09-16 15:25         ` Kees Cook
2013-09-16 15:44           ` Joe Perches [this message]
2013-09-16 17:21         ` George Spelvin
2013-09-16 18:03           ` Joe Perches
2013-09-16 16:07   ` George Spelvin
2013-09-16 16:13     ` Joe Perches
2013-09-16 16:39       ` George Spelvin
2013-09-16 17:53         ` Joe Perches
2013-09-16 19:15           ` George Spelvin
2013-09-16 19:25             ` Joe Perches
2013-09-16  7:43 ` [PATCH 2/2] vsprintf: ignore %n again Kees Cook
2013-09-16 15:55 ` [PATCH 0/2] " Al Viro
2013-09-16 16:15   ` Lars-Peter Clausen
2013-09-16 16:30   ` George Spelvin
2013-09-16 18:20   ` Kees Cook
2013-09-18 13:14     ` Tetsuo Handa
2013-09-18 14:11       ` Dan Carpenter
2013-09-18 14:28         ` Dan Carpenter
2013-09-18 15:22         ` George Spelvin
2013-09-18 14:32       ` Kees Cook
2013-09-19  2:11         ` Tetsuo Handa
2013-09-19  7:08           ` Tetsuo Handa
2013-09-18 14:47       ` 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=1379346277.1934.9.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=JBeulich@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=keescook@chromium.org \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=viro@zeniv.linux.org.uk \
    /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®