All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: hch@lst.de, viro@ZenIV.linux.org.uk,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	willy@infradead.org, kernel-team@fb.com
Subject: [PATCH 0/6] Some buffer management fixes for proc
Date: Thu, 13 Aug 2020 17:04:05 -0400	[thread overview]
Message-ID: <20200813210411.905010-1-josef@toxicpanda.com> (raw)

This initialy started with

  [PATCH 1/6] proc: use vmalloc for our kernel buffer

Which came about because we were getting page alloc failures when cat tried to
do a read with a 64kib buffer, triggering an order 4 allocation.  We need to
switch to kvmalloc for this buffer to avoid these high order allocations.  Then
Christoph suggested renaming vmemdup_user to kvmemdup_user, so then we have this

  [PATCH 2/6] tree-wide: rename vmemdup_user to kvmemdup_user

And then finally Viro noticed that if we allocate an extra byte for the NULL
terminator then we can use scnprintf() in a few places, and thus the next set of
patches

  [PATCH 3/6] proc: allocate count + 1 for our read buffer
  [PATCH 4/6] sysctl: make proc_put_long() use scnprintf
  [PATCH 5/6] parport: rework procfs handlers to take advantage of the
  [PATCH 6/6] sunrpc: rework proc handlers to take advantage of the new

There's one case that I didn't convert, _proc_do_string, and that's because it's
one of the few places that takes into account ppos, and so we'll skip forward in
the string we're provided with from the caller.  In this case it makes sense to
just leave it the way it is.  I'm pretty sure I caught all the other people who
directly mess with the buffer, but there's around 800 ->proc_handler's, and my
eyes started to glaze over after a while.

Josef


             reply	other threads:[~2020-08-13 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 21:04 Josef Bacik [this message]
2020-08-13 21:04 ` [PATCH 1/6] proc: use vmalloc for our kernel buffer Josef Bacik
2020-09-01 15:14   ` Christoph Hellwig
2020-08-13 21:04 ` [PATCH 2/6] tree-wide: rename vmemdup_user to kvmemdup_user Josef Bacik
2020-09-01 15:14   ` Christoph Hellwig
2020-08-13 21:04 ` [PATCH 3/6] proc: allocate count + 1 for our read buffer Josef Bacik
2020-09-01 15:14   ` Christoph Hellwig
2020-08-13 21:04 ` [PATCH 4/6] sysctl: make proc_put_long() use scnprintf Josef Bacik
2020-09-01 15:15   ` Christoph Hellwig
2020-08-13 21:04 ` [PATCH 5/6] parport: rework procfs handlers to take advantage of the new buffer Josef Bacik
2020-09-01 15:15   ` Christoph Hellwig
2020-08-13 21:04 ` [PATCH 6/6] sunrpc: rework proc " Josef Bacik
2020-09-01 15:15   ` Christoph Hellwig

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=20200813210411.905010-1-josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=hch@lst.de \
    --cc=kernel-team@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.