From patchwork Wed Nov 6 14:13:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178711 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666239ilf; Wed, 6 Nov 2019 06:14:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxxAAl7gp/yU+cBzYNuQCeAxJXGyEGygCr6D3BgJcxHtjtgwto37JbDSAEZnmdwCru3dcJe X-Received: by 2002:a17:906:8606:: with SMTP id o6mr21939685ejx.202.1573049674194; Wed, 06 Nov 2019 06:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049674; cv=none; d=google.com; s=arc-20160816; b=tOpIYqhmbCd7r2AXMG8SMUs1hRZYIlQpkpWqqjxhHaMIqFqMBVyxeIdgLPSdRF6+/p 6tc3b/AQRKWiwngB+GkGwsi7uPy4pWZoRzJbWJAp9hM4QhzMoaAjZhKgyUQg25L2gdFQ ZOHM8mlV9/B3zfRp8kqH4Z/4T6R9Nqx4K441d5YBQX+Fa7NMzdU6ridGPFvAQhfGah+V UZmhLPGXj2Ign0mXl3G8s4mN3tMAWODEEZ1ktQY1hw/KZ3w62VAGfnC2pL8URgRY5YjT Rg3Xcrc7U6++yMHehLtWiZOEympyelEcU+EH8I9rkElb6GzBHIJ+tMjbgazYqPcvQPXz 7K+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LOCSV59QoWVHACgzHE/U/CUT/RhU8DoyNGp2OnfJ+HA=; b=NGdgd06qS1O1TV3QT5iQ9uyT8UprJrWJ7XLdNG65TTyX5HQ/h/1HuNrL4t7+bKgW75 RcFP5e638Cxajry/nrTDAe9wk10sS8D4iGvT9DrcP3MlA6gx2KmVhOelN2aBx1XKF4+X cQrwbjriidaqnX2234LxDgt09/Va1T0cN6MeFZDNEIvt4z+JplcLZCmJfErIyKg5rdmb pj4RsqtluASl6P1nICHIUKwHGPFTdVPXy6D6fUDykAcFZBFwx6DnXx6lSEsPTG53yB1h YB31inMsueqdf16FP5s+D9NJNORgKadXUQHeYpoUn7hhxln3Ak1cDF+JwSQZT1JWqyN3 oG0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lt8NSkic; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si15189348ejp.287.2019.11.06.06.14.34; Wed, 06 Nov 2019 06:14:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=Lt8NSkic; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731906AbfKFOOB (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:01 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36016 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731918AbfKFONk (ORCPT ); Wed, 6 Nov 2019 09:13:40 -0500 Received: by mail-wr1-f66.google.com with SMTP id w18so26005339wrt.3 for ; Wed, 06 Nov 2019 06:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LOCSV59QoWVHACgzHE/U/CUT/RhU8DoyNGp2OnfJ+HA=; b=Lt8NSkicjrMViO5Eg4iicjQ9Um4Q/kPhTekzALb+HzNHfhDBmznekCXpWfFCqxbPf1 XOZbS8K2jooY/Eh/31ehUIBaypEbhpyPqh9lub2S0lbmj/O81IwFa7dqMAQj6ppnMr97 h/sNucOFsQ1bw9fFy47CCesF+0lx7lCCx4pM7OMgkxiGq6zqQ0YuondQvtGoWarNmqPF O03RynY9JHqQ9r3dfWX6s/Iy4zuK/kFgiBT3QXKGHNPYenHtppO+8gHzQKodjZWngOGF /2dp4+1OO0PAUlrW0CXW7rSAK8WFPvwHkNyb3WEsqOlkKLv3LtcOVNpqbcfmzzDC32/P I53w== 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:in-reply-to :references; bh=LOCSV59QoWVHACgzHE/U/CUT/RhU8DoyNGp2OnfJ+HA=; b=pN3h9M/RvITGGwYCvzuA+9oZVyEFnRbi1sdnPHHM1uvQvCpFlZZ0xfskLXUWmqbZuS Mpc1HntfKBwXwVVpY72idl8e2/AaA2Xe8O1uknFQrynnzXtOqjwjmsQPM2uWGfCJTbbb k557fFIn9D15qS/mubXLtwNKWgDiiMOUfD4MjhEplY8EJU3nUvDXWoLQvur1bgTIooh+ 9Y4kvGu5NTdW7oziRpk1PLCMnlFoAzJCY2xZsPP+Mqzb++zNxWpMGH118Jb6+UZWXG/V h2Lx8bOitrW+9+f/vKtgOOnlVkPr0SyovJOcpTBFRT9ZuFgCI00UN3Dbte02+pudIX0d lppg== X-Gm-Message-State: APjAAAURaqck7HzapyIHvjlxgE2a5UnLPol0PFEMvYoCYuSiEEym+arh MUjtZjU3xYkE3yUv4fxbRc4d6w50Ux9KQg== X-Received: by 2002:a5d:4885:: with SMTP id g5mr3106213wrq.287.1573049612495; Wed, 06 Nov 2019 06:13:32 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id b3sm2837556wma.13.2019.11.06.06.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:32 -0800 (PST) From: Richard Henderson X-Google-Original-From: Richard Henderson To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, linux-arch@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 06/10] linux/random.h: Mark CONFIG_ARCH_RANDOM functions __must_check Date: Wed, 6 Nov 2019 15:13:04 +0100 Message-Id: <20191106141308.30535-7-rth@twiddle.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106141308.30535-1-rth@twiddle.net> References: <20191106141308.30535-1-rth@twiddle.net> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org We must not use the pointer output without validating the success of the random read. Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson --- include/linux/random.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/include/linux/random.h b/include/linux/random.h index ea0e2f5f1ec5..d319f9a1e429 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -167,19 +167,19 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed) #ifdef CONFIG_ARCH_RANDOM # include #else -static inline bool arch_get_random_long(unsigned long *v) +static inline bool __must_check arch_get_random_long(unsigned long *v) { return false; } -static inline bool arch_get_random_int(unsigned int *v) +static inline bool __must_check arch_get_random_int(unsigned int *v) { return false; } -static inline bool arch_get_random_seed_long(unsigned long *v) +static inline bool __must_check arch_get_random_seed_long(unsigned long *v) { return false; } -static inline bool arch_get_random_seed_int(unsigned int *v) +static inline bool __must_check arch_get_random_seed_int(unsigned int *v) { return false; }