Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp881506ybt; Fri, 10 Jul 2020 15:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzhaKQcQMHvZO/NiyjncezTLql/d9uGJfm6BwydBfDQLk7KO6aJsJpDzPCYaBBBNyxJbM4 X-Received: by 2002:a50:fe16:: with SMTP id f22mr73435984edt.315.1594418914945; Fri, 10 Jul 2020 15:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594418914; cv=none; d=google.com; s=arc-20160816; b=kul9yXHK8ZXJl50U+vs/FkIKFwWcemBrpdXe7gSnoYd1kWKaDz/pQWaeQZcTcu5j+E AepWta+LWWYv8aeB0GmAmuTXa4XLjTM03L9hZFFMOHqkxBLdC+LNkOVM6iZYEgaJ+3jM 8WTeLSJsnaSdz1sz6ZnwYxchNJBI9EBk+XWOKbnYKGn00exnLI0nM4adL902YeXL1DH4 iKY5ydn6T4kmBXfgDAiwqOOms7CF1v5dneFepnwOXS3nDjpciVJ+G6OEdnjI6b5qBexd huJcAV9crdkvp4X9xPf8WFAVFnTuvlZuV/aA8NpJGsgdapNyb4dMSvANGNmSPkakPMZY 8Q5A== 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 :dkim-signature; bh=Sm08KILQrIhAFoGlCB+I5zhmi1eIMEDSey/M3AAwvrU=; b=fRT+2G/pfhyxFe1IP9VyQTY1muIIm+dDTMa/cFb55hrP1CgL+1nSZbJHYh0+1KPwYq wcvVKWGkDsbIdfwOU/QnCQUrIySRIJyBdZdoN28VvKWAePpKz+lrXgjjgAAdDDqJ9pJO Zp9e9K8bbdptAOh8NX7llYgIQbin475bnsmNP/utICAD3Yp7beCgiRkRzda898v6dshp 5uAr+WjKHMgs1oGhcFdlRqThL02UB5uxTShnO13yhKHZfyyrEHNuYIeaqCj1RsvyLEwu IhCy/ULQOx1namS+nyDL2fnrgsWvqPLBUXDrLin/A31PG3/nYlq0GhE16mh9W3ApGE2w Qz1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Gf95zy8J; 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 bu2si5328337edb.423.2020.07.10.15.08.10; Fri, 10 Jul 2020 15:08:34 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Gf95zy8J; 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 S1726365AbgGJWE7 (ORCPT + 99 others); Fri, 10 Jul 2020 18:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbgGJWE7 (ORCPT ); Fri, 10 Jul 2020 18:04:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3A84C08C5DC; Fri, 10 Jul 2020 15:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Sm08KILQrIhAFoGlCB+I5zhmi1eIMEDSey/M3AAwvrU=; b=Gf95zy8J04apBo9wUZ1mnOjWys Q3E03aUJHod0cOCoGZfdB++6r3mBBHEKatQ07qkf93nEwhMrFMsQ2Ca/R1uwDGBQtByztdqV22DbK MbowX9JA/4O7y2NTMT32X7ukvtTKvL4/tDSchahf7/ARoWtxtGK3tAyFycxBMjF07h2aGRzNfDyBF 896zhV0TFTjt1H9YL00Om/6oR87oi92+QAYOnGSnDR68RuREB5bOdQ0YbsY7JcalooY6BII+0YORf A/9yXRmMifrzgpx+7GSxIYeCBTW8H9j9HVFaCoB1CvgXqNlUuS9P0V4JDL+gHl0AwbpanQyn4Gw33 z3h2bHmQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ju17r-0000Yi-Ej; Fri, 10 Jul 2020 22:04:11 +0000 Date: Fri, 10 Jul 2020 23:04:11 +0100 From: Matthew Wilcox To: Scott Branden Cc: Kees Cook , James Morris , Luis Chamberlain , Mimi Zohar , Greg Kroah-Hartman , "Rafael J. Wysocki" , Alexander Viro , Jessica Yu , Dmitry Kasatkin , "Serge E. Hallyn" , Casey Schaufler , "Eric W. Biederman" , Peter Zijlstra , Matthew Garrett , David Howells , Mauro Carvalho Chehab , Randy Dunlap , "Joel Fernandes (Google)" , KP Singh , Dave Olsthoorn , Hans de Goede , Peter Jones , Andrew Morton , Stephen Boyd , Paul Moore , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 2/4] fs: Remove FIRMWARE_PREALLOC_BUFFER from kernel_read_file() enums Message-ID: <20200710220411.GR12769@casper.infradead.org> References: <20200707081926.3688096-1-keescook@chromium.org> <20200707081926.3688096-3-keescook@chromium.org> <3fdb3c53-7471-14d8-ce6a-251d8b660b8a@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fdb3c53-7471-14d8-ce6a-251d8b660b8a@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2020 at 02:00:32PM -0700, Scott Branden wrote: > > @@ -950,8 +951,8 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size, > > goto out; > > } > > - if (id != READING_FIRMWARE_PREALLOC_BUFFER) > > - *buf = vmalloc(i_size); > > + if (!*buf) > The assumption that *buf is always NULL when id != > READING_FIRMWARE_PREALLOC_BUFFER doesn't appear to be correct. > I get unhandled page faults due to this change on boot. Did it give you a stack backtrace?