Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1483239pxa; Thu, 13 Aug 2020 09:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx55Wf4JzrsBAK/9RXz7HxJZClr+sshyrHle+K2eVrWwcFQSfohRw+nsq0Dme4tMxRwGsYC X-Received: by 2002:a17:907:40bf:: with SMTP id nu23mr5399559ejb.243.1597335791459; Thu, 13 Aug 2020 09:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597335791; cv=none; d=google.com; s=arc-20160816; b=VFW5jknD8q/0I3budbOwOYvScboBo9PGwg67vVrUq2+2T0zZ+wEcUxEorwkVjzr5+C 4XmD0tf+pmdO7jPdQCRmN4ObxpduKsKtfYtnbSSHRiwi7exmpzDlHBREHPnZtXuyKirG +ARA0Bujuh8yefnxpVhmObBQoreqqL4QJ9RDtDJ4lzvANmO/ShuYQSAugtjNpdggJAb5 wJ5dtnCqCxTSP/20v2xh067T70G200Cn+MyxZCcQbiEGvN5497gz03TxmR8k4q4WGLbB kQQeCJtuo/+nLiPS28WzpJKUMicdRgvKGX5G+mjQXzRiKVDEXtBewwb1Cw2I78JB4q21 iqnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ENJel17QHZm6sVoerll5mfXCZ+4/YwP5PWRN7eMiDZA=; b=CnTQLxlAJP16SwQhrfkknhus4vcTZUCaWVapkhXUDXm5gS8xkMMgi8OAcz3uPAsdOx RAJGM5CsyuB3PTmvX2pDp8zowSfcI0BelVmcAdSGoeJCK9BsiOazH5IPcC92drYQDIEQ r9bw2LS2kPN6+d9zNFrsnO9bAXRd8zsd4A5HNtdmKHmVFfATSX+5K7MQtziaxZXzn1iP aN//u4qgx/OTsM5JA9vjyYY2aW8UWe+P+3ggPYdKj2ZAKLKoRn4gLvWgK8r7Pxyx5SIV p0UNvvJN+LBv8EFAA9xjKrKI94ou1hC6pcRAl755cRYJh6nefmytYCawGmcWQN8mVCd0 /PAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si3616210edv.323.2020.08.13.09.22.48; Thu, 13 Aug 2020 09:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbgHMQVp (ORCPT + 99 others); Thu, 13 Aug 2020 12:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgHMQVp (ORCPT ); Thu, 13 Aug 2020 12:21:45 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD77FC061757; Thu, 13 Aug 2020 09:21:44 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6Fz3-00EzMC-U0; Thu, 13 Aug 2020 16:21:41 +0000 Date: Thu, 13 Aug 2020 17:21:41 +0100 From: Al Viro To: David Laight Cc: 'Josef Bacik' , "hch@lst.de" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-team@fb.com" Subject: Re: [PATCH] proc: use vmalloc for our kernel buffer Message-ID: <20200813162141.GY1236603@ZenIV.linux.org.uk> References: <20200813145305.805730-1-josef@toxicpanda.com> <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 04:19:27PM +0000, 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 ...' ? Try it.