Received: by 10.223.185.111 with SMTP id b44csp17875wrg; Thu, 8 Mar 2018 23:55:49 -0800 (PST) X-Google-Smtp-Source: AG47ELsMmqV3+sMVh2/kfoBw6BjuY61l6RMXTsy/WgpOSZ666AignrTuK/Sj4Yzc4nR45jAoM+Do X-Received: by 10.99.107.131 with SMTP id g125mr1630441pgc.16.1520582149149; Thu, 08 Mar 2018 23:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520582149; cv=none; d=google.com; s=arc-20160816; b=ne7bym4UoBzrc4yDt/P9gDaIIOKmecTe13E6By0S7yQqEDJxgUktAgy7IsQc08xBx2 x1Mv6KAL2ybd0IL1OSYAihGSPZTA4t1pGIcWvvqqnZ26aXrCWqsX3T0+UzeMTvl/iW3E QqiltiFmn8+3nD/xLvxqNoALHDgUmdZbdSaKoImSmMGaruBpMFL9u6helsYiEohTP5Bl mhW7tXERh1DXi5++ZAgbQVDyDdQKuiGw7BHQq7HXhEdU06kg/E8COe+mWHOohj4CTCgI IWgeOeWumIjSV0zIZgiHysDqle8Hp2+/r8FEvJM5YpqZmlMrFSOs2UKJ81TMa/VjOs6o N59g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VRoufI3tWnu0k1UHncN2f8vw15X+SaUQfGjCWO0rHhY=; b=RkQuzVgMjQV3uhVnbZQYSgEoXwzXcbyNs9FEUDdcusgqIj2wMuHs8ZdFDQOCO3SC+0 OSmYZsf08NvwNupNBuZEZeVdc4wIa3pQIOt8nLeImirPOb2tmHHjWcz84gnaZDNiS0UQ V/x0qbfuuL49c9c+a0vlXRtRwR64bn6heMrKphsnkd4oX567O6qom5g7w/ofvMUhAtn3 5Mxlgh38R20xftKnQWGVVogxqbs0xMqIUeEVlbQZ2iRDLxYi7yb/d+zGp7at8ofijSVW ddT90Gct7m1k7/psOot4B10fNuhMeDxGvTF0KphzBGohboaYEKRln0Bse5kYGX1BYXI4 8IHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nZkBJyva; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si450825pfj.11.2018.03.08.23.55.34; Thu, 08 Mar 2018 23:55:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nZkBJyva; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751389AbeCIHym (ORCPT + 99 others); Fri, 9 Mar 2018 02:54:42 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42787 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbeCIHyk (ORCPT ); Fri, 9 Mar 2018 02:54:40 -0500 Received: by mail-wr0-f196.google.com with SMTP id k9so8065676wre.9; Thu, 08 Mar 2018 23:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VRoufI3tWnu0k1UHncN2f8vw15X+SaUQfGjCWO0rHhY=; b=nZkBJyvaAMi/SJzpx+X4PcBD36PWz/IWkotZpRXA++GvnOd+PbM6KXr1w6P9HPkmoC DzA9kt7UbQoe31opPfhKOokeCy+6bSICXlcfk4sOCilVuP4XNGA1V3rkGFy4lPA7uvb/ mdQOWeoB+czygeP86XyDbEKarp9opdlO5hlO8lLRvRVdOCOzKV/3l7d2c7ztgDmW1Yjd RSmOMXRyoOzP9ws+Dw9E11bY3rktXS/dTTkk4sIULcGC7K6CUvYgLY+w5af0sJQ47jkA mSlr3fUSXz2R87ZJUeNjVAQy/fDZAB6n5mUaElMuEFbR9IS58uBFtNXZfIV5plRlImhA lUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VRoufI3tWnu0k1UHncN2f8vw15X+SaUQfGjCWO0rHhY=; b=cYELI0b1muhQQFmBEZJ3gIQtf5mUDFv63PJm8ISKqjOFHNTmim95d4WrXTZF2Msop/ Vgne58tSdBt5GWeG0zaQqWDY8lYZUVRqEfXyf3Wu+jQUHHnENpsXxJOnFDsQIYGTIPpJ psVsqo760rGvBovxULKrSh7XiIwRANq2o5mxGq08guYQNQAMZOGrIUpNSN/Reme5PzRk t8u5gPmN+1mhSQc2CWPe6so4qNss2+XGcFuDz6qLKKN0dUECRNEot7xJUiSKeY74caPH /tMEwM//jpN5j21tx2E5mZ6jk+9QIqoc1kIqdu1Gp12ZJCg2IWsjaAusj5f3ilauk60y +ucw== X-Gm-Message-State: APf1xPAuK2ki15Q/qStrIDdimpNtMYD2ly8J2xMA6RavLge7BUBAf+IV yx7Iqm5jbrdR/9LaH8LcxTU= X-Received: by 10.223.129.163 with SMTP id 32mr24595664wra.124.1520582079157; Thu, 08 Mar 2018 23:54:39 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id c14sm968930wmi.16.2018.03.08.23.54.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 23:54:38 -0800 (PST) Date: Fri, 9 Mar 2018 08:54:36 +0100 From: Ingo Molnar To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, Thomas Gleixner , Jia-Ju Bai , linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/12] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Message-ID: <20180309075436.tedbueuh3wuocr3p@gmail.com> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> <20180308080020.22828-7-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308080020.22828-7-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ard Biesheuvel wrote: > From: Jia-Ju Bai > > The function kzalloc here is not called in atomic context. > If nonblocking in efi_query_variable_store is true, > namely it is in atomic context, efi_query_variable_store will return before > this kzalloc is called. > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. > > This is found by a static analysis tool named DCNS written by myself. Please fix typos/spelling in changelogs when applying patches. I improved the above to: efi_query_variable_store() does an atomic kzalloc() unnecessarily, because we can never get this far when called in an atomic context, namely when nonblocking == 1. Replace it with GFP_KERNEL. This was found by the DCNS static analysis tool written by myself. Thanks, Ingo