Received: by 10.223.176.46 with SMTP id f43csp1507396wra; Wed, 24 Jan 2018 18:26:00 -0800 (PST) X-Google-Smtp-Source: AH8x2241zh4bD0NE/TQTNJ6g9rG5j36osvTLkbdxEr3KemMDPXwJYuGOfUW2TpOjAiepvxI6+5wR X-Received: by 10.99.180.67 with SMTP id n3mr11305018pgu.169.1516847159941; Wed, 24 Jan 2018 18:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516847159; cv=none; d=google.com; s=arc-20160816; b=j9xapzimu6nTIAcJz+cAni0mMFqOr39MOXsN8cjUiOGeoUQiUIfeLAgbxNNtWk3wpX UJtS29pfAExcFWOh178HtfiATWUo4jwfA6/D9ocE/ngWn0hy4+aSpKqeZ6JKQmA+aosi nwA+kTLHgskGkqQiOu0NAQHu1LPz5W0MHEE3PXRfCF6gy7OhbQz/YLdzzf+ip8FA7rF4 nAx/Js7pf3xxrw/KMc6yeYAbZR0A6mRdhqe0LDUQQSdZqJyJ2xaPmax/20m4okrgEiDR a/qbmCulGm4dwBegdCxv8PV4dDa7+jPvu8k8nzFJrBNg41UwUQYJQddyinh+/9W4Bv/C X4fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=cxzkCNEwL8X10q0rwuVwKQ1Gm9EvqD+pMSe6ofiG7dI=; b=hDdDRiwU5IRXp251wFfNAl01Z7JqtOXfH1ydjWJq0uXXtA92v5XtcFYuhYIyLlkUDW CEePPfH2+t/nU8DeFqRIut0jurPTGbLU1bUSGcXpkRe8Yo1XRTERJSmI31NFf14Zlo4H gNvzQD4nixnvrseXH+hzvfQJ86toOKJa8m84H+80YnzXaVQ5ykgOKw4nayiaENz/k5SE Xk7MysgLn5wV4cNmjn6Rhj9TQlpf0PmSN+5gBYRY8wTMY7ODezJbaE+gMrZxVae8qdX2 8zcGX4Aaq5DlrYKc3fSN0P59mF9Qekbu0fUP0cpmkVdfmJU4hRfXzU3n1c4zD0ddlvOZ RmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z/Yi2j8h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17si3807109pfj.302.2018.01.24.18.25.45; Wed, 24 Jan 2018 18:25:59 -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=pass header.i=@gmail.com header.s=20161025 header.b=Z/Yi2j8h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752735AbeAYCZU (ORCPT + 99 others); Wed, 24 Jan 2018 21:25:20 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46470 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbeAYCZT (ORCPT ); Wed, 24 Jan 2018 21:25:19 -0500 Received: by mail-pf0-f193.google.com with SMTP id y5so4676369pff.13; Wed, 24 Jan 2018 18:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cxzkCNEwL8X10q0rwuVwKQ1Gm9EvqD+pMSe6ofiG7dI=; b=Z/Yi2j8hpuTmDFoK4Qb3sJnqI2169Y/uwpC6SQ7X7AjCDenFw/iXegmmcKsvlzZPDW 9OAr3lHDAp56qUxyxjI/JwvdBgpM8WY8Qbt5Vv4IAEwLzWN516kXlO0NQYpHSHOMPt2w KrTuY5XNpaye2Tb2P8cnsmljmeAGzhSEj+7WLb1hfb1dcx1pPjxaPQJRFerYHJzziUup SwNUJxnVEdYN1BrD5ZEtGul/GFyxroVcOFQC1dS40mwhyf38o+DFTUMpC6bImsstyULo E/4igdBxm8m/SrDIW0KgYmMilOtTzvTUgp28ALxKlj2lQb5PZ57gXwD5EPf3KdJq7Vlx T3cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cxzkCNEwL8X10q0rwuVwKQ1Gm9EvqD+pMSe6ofiG7dI=; b=lXPmgzFYIuzvNNntcxPiKD2peD2v9bW3ahSVmdrW1iet08nFYMPdn020de7DWrte2L ZiJf+lyYciONpRrUI7woMvVu2SISQkgjzg2eaySGdD2q9Aiw0xRMQtg/r365k6/YwtWB YKsmzVUfV+YLUY86locHGGwNgPWoIQur4r6AObNUhwpW3R/YfzScUNQ/4Nhet+63yw96 O2LhNA8IPAGM/um2usUOXtwb67t7TFTAjzBr0WEjdhovugLvnjld54cSY63g99k1K2Qq ydh1x2iGPRnMp82WpSh/263orLxDhHGNnyVwfg7PhDz+kUaMZRywrXFb38+w5Rvdps6G GjvQ== X-Gm-Message-State: AKwxytcDKgnpFsMCg6W05CNmzrluJkQ2L4xpaQNj6DMycplLj78hgXuP LMNQdKYl5wJB9LeE1GS3vPI= X-Received: by 2002:a17:902:a716:: with SMTP id w22-v6mr9467253plq.299.1516847118362; Wed, 24 Jan 2018 18:25:18 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:af:5698:7220:1b27]) by smtp.gmail.com with ESMTPSA id n76sm13997247pfh.95.2018.01.24.18.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 18:25:17 -0800 (PST) From: Jia-Ju Bai To: matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Date: Thu, 25 Jan 2018 10:29:46 +0800 Message-Id: <1516847386-5291-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jia-Ju Bai --- arch/x86/platform/efi/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 8a99a2e..b6dcb52 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, * that by attempting to use more space than is available. */ unsigned long dummy_size = remaining_size + 1024; - void *dummy = kzalloc(dummy_size, GFP_ATOMIC); + void *dummy = kzalloc(dummy_size, GFP_KERNEL); if (!dummy) return EFI_OUT_OF_RESOURCES; -- 1.7.9.5