All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: David Laight <David.Laight@ACULAB.COM>, "hch@lst.de" <hch@lst.de>,
	"viro@ZenIV.linux.org.uk" <viro@ZenIV.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH] proc: use vmalloc for our kernel buffer
Date: Thu, 13 Aug 2020 13:08:49 -0400	[thread overview]
Message-ID: <72ea0ff5-4706-d2e9-c2cf-c8827e576399@toxicpanda.com> (raw)
In-Reply-To: <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com>

On 8/13/20 12:19 PM, David Laight wrote:
> From: Josef Bacik
>> Sent: 13 August 2020 15:53
>>
>>    sysctl: pass kernel pointers to ->proc_handler
>>
>> we have been pre-allocating a buffer to copy the data from the proc
>> handlers into, and then copying that to userspace.  The problem is this
>> just blind kmalloc()'s the buffer size passed in from the read, which in
>> the case of our 'cat' binary was 64kib.  Order-4 allocations are not
>> awesome, and since we can potentially allocate up to our maximum order,
>> use vmalloc for these buffers.
> 
> What happens if I run 'dd bs=16M ...' ?
> 
> 	David
> 

         /* don't even try if the size is too large */
         error = -ENOMEM;
         if (count >= KMALLOC_MAX_SIZE)
                 goto out;

is above this code, thanks,

Josef

  parent reply	other threads:[~2020-08-13 17:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 14:53 [PATCH] proc: use vmalloc for our kernel buffer Josef Bacik
2020-08-13 14:59 ` Matthew Wilcox
2020-08-13 15:08   ` Josef Bacik
2020-08-13 15:33 ` [PATCH][v2] " Josef Bacik
2020-08-13 15:37   ` Christoph Hellwig
2020-08-13 15:40     ` Josef Bacik
2020-08-13 15:41       ` Christoph Hellwig
2020-08-13 16:20         ` Al Viro
2020-08-13 17:19           ` Josef Bacik
2020-08-13 17:31             ` Al Viro
2020-08-13 17:36               ` Josef Bacik
2020-08-13 21:10             ` David Laight
2020-08-13 21:31               ` Josef Bacik
2020-08-13 16:19 ` [PATCH] " David Laight
2020-08-13 16:21   ` Al Viro
2020-08-13 17:08   ` Josef Bacik [this message]
2021-02-10 15:54 Josef Bacik
2021-02-10 17:16 ` Vlastimil Babka
2021-02-10 18:15 ` Matthew Wilcox

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=72ea0ff5-4706-d2e9-c2cf-c8827e576399@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=David.Laight@ACULAB.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 \
    /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.