Received: by 10.223.176.46 with SMTP id f43csp1910022wra; Thu, 25 Jan 2018 01:54:12 -0800 (PST) X-Google-Smtp-Source: AH8x225/3K4aaB0Xml+hhm2TbYJ9lQF8Iu2S2jCTw/3uEH1yEnAisxVldQUJZM7yw6RIyKEzhIxQ X-Received: by 10.99.172.25 with SMTP id v25mr12807329pge.148.1516874052069; Thu, 25 Jan 2018 01:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516874052; cv=none; d=google.com; s=arc-20160816; b=zRtIvs0AakhweqOzlJQSFuaZyuEER4l6fwkMQxxB64NPO+cIjw8cJMA6rQsy/GJMIv BqTgrOme1pL71oghcq8qHf59iJB5y2M/1klfPDqzPIsed3RL3miCqHxmd+ZHVmw9Y9pJ dLxu4TFHUkEZucPWN9F0LAIcsHePbtS0wOW/WyLlLZmaG6K8uccRfeMnUjMuAGl9g4kE lp04tT/s3/GN+JNimc0VJatn3Gr0cbRrUacXgf2sou8lLvWgPmL3BSe1wPpePIrzRF1N FUtDrXGbL8Ljmx6sbLisR76qcozKNxxFdiWA5nNBw2ZVCIw7AlYYmnM5CNZhJXY1oaRn hjJg== 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=ra0mYq5JhWf27OZvzjvrcWdqfhqFUl7qrx08dPFa54E=; b=L1+2TwDwWm3LxbpbW98mHXGpR+zHhJBp6FcB07aL48xy5xk0ISeAzpksIak7NvyZvN qsOer/W4X+eOf7+Gp80MXMBpWFNW4g8uV6yp8v1IpB17mPPgq6j0zEeGrxwcgkdoPf96 ZqpS+HxS5jQEEr8gPZKE6fyiuxrNVx0ZFv1sQilUa21cAzKaa7IXHP8PD8Nq7nWB5nOf ACt7mEMDqKYwmZRLkDq5yjZCRiY9Xv7MTMirBiRcOkDraUEq0Isw01kbw64iu+Npj+7v Px66lReNyqN+6/+2NpUqJRSq6FqrWURUPjTVfD+NJd2uXwDzZN3S4Ka+a6xAq8gLeUHI TQBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LCT+FX8N; 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 j132si1346661pgc.789.2018.01.25.01.53.57; Thu, 25 Jan 2018 01:54:12 -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=LCT+FX8N; 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 S1751330AbeAYJx2 (ORCPT + 99 others); Thu, 25 Jan 2018 04:53:28 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:37190 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751136AbeAYJxZ (ORCPT ); Thu, 25 Jan 2018 04:53:25 -0500 Received: by mail-it0-f65.google.com with SMTP id q8so8676273itb.2; Thu, 25 Jan 2018 01:53:25 -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=ra0mYq5JhWf27OZvzjvrcWdqfhqFUl7qrx08dPFa54E=; b=LCT+FX8NbyCsftlzLOUJCwN2J8RkRnOF/0EiJLpj6flQK+YKShxFi03AxBsVo3w/l7 zK5p2r6YRSgXlnBSZh8v6/k3+j04qj6rCtXoHH/0z5QlSl5SWT+2VNIHc8tS3FYgpvxG SHkmhTs8knRICoOx7ylK0fAWsHw8PB9g6v+CHnscAN/OMiorpdyPdQxADOmwU79tylSf NI9X4IYvVW4XcwupMxS6k1KZIppc7/iVQQIFVB0v0KzAVtbILX6OtINjNNI22oUCuiO/ 00sqvv7Q31KpcXiROoBRwkw1je6Y5ShIf5J/K7lEb5TUnvhTuSQihcanj35AVsizqRy2 RUUw== 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=ra0mYq5JhWf27OZvzjvrcWdqfhqFUl7qrx08dPFa54E=; b=XFZKuxOPaIpz9Fa1nvuePT6VQEVv4NlehuBnLUIc4KgQF/0zYn+kL+2CzQjImLWoCy fXl0FK5WyghlqYLrQqPCuAwR0q8a9bhM6+QlbQgLXFZkK1ccBVEw8xeFQhvKcCHaCivL ufAtq6qLhUClqE6xrXvU6ba8hN6VTSXhWsIDwFYaOgYcGnYPCLfsPXkutMUoNg/i4TeI oae0h3CYM7380GtYZbo0iO2Aqho7ZcVTAmYIFwtLPEe1M2GC33rdjG2yuUTxQTJ/i8qc 6ZjfSFcKtEml4CZCa46L/qHrkQtzmWSqbBUOaqcjOFjmJJFPjqbAedHfCoHvwTRh5RvF GPcw== X-Gm-Message-State: AKwxytfNaD1p4hGPqQimzX22wPM6vbHerawGgSCkepm6dBhwVapnrtAd sstV7gufzJebx+wam5/GOOM= X-Received: by 10.36.230.3 with SMTP id e3mr11818387ith.99.1516874004946; Thu, 25 Jan 2018 01:53:24 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:9980:256a:8e6d:5903]) by smtp.gmail.com with ESMTPSA id e78sm713732itd.37.2018.01.25.01.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 01:53:24 -0800 (PST) From: Jia-Ju Bai To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] crypto: rsa-pkcs1pad: Replace GFP_ATOMIC with GFP_KERNEL in pkcs1pad_encrypt_sign_complete Date: Thu, 25 Jan 2018 17:57:54 +0800 Message-Id: <1516874274-11851-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 After checking all possible call chains to kzalloc here, my tool finds that this kzalloc is never called in atomic context. 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 --- crypto/rsa-pkcs1pad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 2908f93..9893dbf 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c @@ -192,7 +192,7 @@ static int pkcs1pad_encrypt_sign_complete(struct akcipher_request *req, int err) if (likely(!pad_len)) goto out; - out_buf = kzalloc(ctx->key_size, GFP_ATOMIC); + out_buf = kzalloc(ctx->key_size, GFP_KERNEL); err = -ENOMEM; if (!out_buf) goto out; -- 1.7.9.5