From patchwork Wed Nov 6 14:12:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178708 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp664804ilf; Wed, 6 Nov 2019 06:13:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyLrRBMKK0vJJvth1FMCrddztaMjiVNiYQ6oyrJasUpOueoHlKaprB2/iKM7sPZRRz1jtpa X-Received: by 2002:a17:906:70d2:: with SMTP id g18mr35838926ejk.18.1573049607801; Wed, 06 Nov 2019 06:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049607; cv=none; d=google.com; s=arc-20160816; b=vYZf1dF2io4pe9sg3H2/k6nXJBUoKsKVImHEyK1hbAfkmdVZQn1sw3jrv1moyczSn5 WDb+114Bnej3qsaPsuxtXq8LCwzr2kb2tpUxpbljfyu1riAbOBjByAh3zyf+NvKiEVgv B41u51bgSFRraAWHw4FgYjsUKtIO4C8ZSbe1MKDu/DuriJeHO/i0z32sGhoxa5CGzbbX LopSUaf3ePvAspfS3R04PpyTqS25TersOT0MpZR0rXai0m+XN4aUsFv80QxBtAyhmJU2 ecMLBIX3mMgJGvQFR1nBipjgy8oypKSMWYI9oEcQj4c/733MpSN+krgjuodaw7LePEI8 zvdQ== 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=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=dVeshQ7+3iW04TQz0AY7fcYIBSs3rK2CPTaX6XfxsKDJrYSbd8AA6vEIFz5swQeCJr p5CS6X6M6GC7Tnxx5FEmeaq99iutJdN1qgT0HXaOTePCR3fi5DODqTl/mQqFTy5VmCrx SvMZOPL2aPLhUfLbRF9f8b09q4i46leFEp5nnwHgnn4Ba69n0ovidhubUnDdJjfrBHwE QhJR+g14TU+fRNGlTT0i7lZA0XzaJ/o1othcrvNk1Db2oI+n3sza19z4Fu/SFhXbHp5e 2KDzLkeSYze5aVhOS8lXZ0TxxHbvlFJTvT3EYHlepeDJbhWJAAJdA/l01TMZ3/IjzChj 65Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=huUR3QVI; 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.13.27; Wed, 06 Nov 2019 06:13:27 -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=huUR3QVI; 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 S1727324AbfKFON0 (ORCPT + 3 others); Wed, 6 Nov 2019 09:13:26 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45016 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727616AbfKFON0 (ORCPT ); Wed, 6 Nov 2019 09:13:26 -0500 Received: by mail-wr1-f66.google.com with SMTP id f2so17072998wrs.11 for ; Wed, 06 Nov 2019 06:13:24 -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=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=huUR3QVIlM/iMH0usGmIB9OiEcCLZqXcp97YwEo5S55jvpui/qZdGTCJbFI62dX4/j 2W64NWcBKbPpYtkVVdo/cO1Jt92q8rAf5ACvD4PU71NfcDy1YwoV8btWGC4x7jK7xBZH 4pgY90Y5biZu7ryNMqgndRgyVybVzvi6p61/yXwqnS60DGsgWKw/oS56vnc+2wljX/IS jjo7CDxwHqosEN+WVtvNt9GxrZEEeNlAO6la4IXeWWkEZQG8RuRmPzPChqiiwmD03fka KBkfelHAHCWA/mSrfKOHrqlItLLBFxLHUluhYQUZBpOvPwIkowMuH0Ftl02VvxcVd/Z3 ixaw== 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=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=KQizo1xGjlI4roHrPdf2LTgnCUTNT4S5HyYsC7gEEsLjnaZAqlV1+nTxJm0BKxY3uk PzPh9xbyt7moCrrGWTNxdYksEqShWG7/jiGpYAN8zSCr6+sS02mwiOSnSeyJ/g37BirI PFMNfS3Vmi4XZ9CtZpQ0Bl3T02u2qPhZ684SMLWgns56QcHrpu6GxhrjRcEd0lsTcBA7 CPW2DNka2m85GdsdqQlBX6fYbjU3rhS5yNwqtgCpMs1mN2Gw6P2j/g0pkRYDBL2eBp5X NsxJNdLcJRa1ZgQ43mD4VIKiB7iDhjJlJG5W119sURraeh4nHCK9yPbNqn3wEzUOUaVg IF9w== X-Gm-Message-State: APjAAAUmcXESgtOU0XP8kutlzHuJ4UjhM7Ni8F79ojOf1tUUqVPIxzz3 sIgkaCk68XxrOU9Wy6An/jR0G1Yxb/IXwQ== X-Received: by 2002:a5d:4649:: with SMTP id j9mr2973687wrs.248.1573049604042; Wed, 06 Nov 2019 06:13:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:23 -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 01/10] x86: Remove arch_has_random, arch_has_random_seed Date: Wed, 6 Nov 2019 15:12:59 +0100 Message-Id: <20191106141308.30535-2-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 Use the expansion of these macros directly in arch_get_random_*. These symbols are currently part of the generic archrandom.h interface, but are currently unused and can be removed. Signed-off-by: Richard Henderson --- arch/x86/include/asm/archrandom.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h index af45e1452f09..feb59461046c 100644 --- a/arch/x86/include/asm/archrandom.h +++ b/arch/x86/include/asm/archrandom.h @@ -73,10 +73,6 @@ static inline bool rdseed_int(unsigned int *v) return ok; } -/* Conditional execution based on CPU type */ -#define arch_has_random() static_cpu_has(X86_FEATURE_RDRAND) -#define arch_has_random_seed() static_cpu_has(X86_FEATURE_RDSEED) - /* * These are the generic interfaces; they must not be declared if the * stubs in are to be invoked, @@ -86,22 +82,22 @@ static inline bool rdseed_int(unsigned int *v) static inline bool arch_get_random_long(unsigned long *v) { - return arch_has_random() ? rdrand_long(v) : false; + return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_long(v) : false; } static inline bool arch_get_random_int(unsigned int *v) { - return arch_has_random() ? rdrand_int(v) : false; + return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_int(v) : false; } static inline bool arch_get_random_seed_long(unsigned long *v) { - return arch_has_random_seed() ? rdseed_long(v) : false; + return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_long(v) : false; } static inline bool arch_get_random_seed_int(unsigned int *v) { - return arch_has_random_seed() ? rdseed_int(v) : false; + return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_int(v) : false; } extern void x86_init_rdrand(struct cpuinfo_x86 *c); From patchwork Wed Nov 6 14:13:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178710 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666209ilf; Wed, 6 Nov 2019 06:14:33 -0800 (PST) X-Google-Smtp-Source: APXvYqw8oTAdhWOeBW1bUODCXqNGcjFQSXMIIeOWJq2mE5PQd+gopHww7jHA2F6G3pG9qRFbQ0K1 X-Received: by 2002:aa7:d299:: with SMTP id w25mr2998185edq.14.1573049673223; Wed, 06 Nov 2019 06:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049673; cv=none; d=google.com; s=arc-20160816; b=zpCwm8ab9RThtIKkIyf7NE+xdtxJ13J+1nOGq6nlkz2syDMeVvuU3H9fF3Lz7I+Snr RaAWSZgspHbdxj3Ob+O3IPSpuO2zUmJYD1NmomTXdUwu3fXxY4nvN9/gyRmkTU4slqz8 EsDb7yqHXf010tMtQP6F8gGiF43qYKOo5Whd7w/DBU4BFuRXK+pPzHPsdM7pgMKdiI4T dBtARymAiQYlycqi/0/89PzoayXcdwNqK4Rr940oKX7upT6TDR/H3qR/g+xXoitBavPI H+fJLHH50C45sGOtV/14w9pwedDhoVyv5XzEvtXVZIVQDVuQCwSgEe3I90ag0/O5wic1 K1VQ== 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=gp6KNxHNYtmFYMKMCYa0gsOo8NLakQXjLI1+wdZrrFY=; b=CmfnEKQ7rgn2VUCOM9YvtjD4zMLWAIR4JwF/hNnBq9uK3Q+cE8ISxoWpMkxGYwsF8o yvom/bJd/eKVLm51LCr62SsFQk8en2Syi3od1pfmi4jLLYFFNW1g8B4mD2L6GWByKl0Q djmv/bWON+wHFaUOeiYof7oa+P+a5ME/sm4AfRyFzAgUSLfpEDfVtOA6KTbvMImkV0pG +Z2fxaM6jABVLC0H1WGHNo/Om57lvAOPSV6MP9oxOUL7AvSUfAfcPdlunclMHff+KTp0 om/oMcBlnKjOkEEXJbs7RQQS/EZAKErSnkRKPzYb7J47/rSOyL3ZDs/MbZ+4vZkUSS+A okVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Opt6blMO; 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.33; Wed, 06 Nov 2019 06:14:33 -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=Opt6blMO; 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 S1731882AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53330 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731804AbfKFON2 (ORCPT ); Wed, 6 Nov 2019 09:13:28 -0500 Received: by mail-wm1-f67.google.com with SMTP id x4so3608809wmi.3 for ; Wed, 06 Nov 2019 06:13:26 -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=gp6KNxHNYtmFYMKMCYa0gsOo8NLakQXjLI1+wdZrrFY=; b=Opt6blMOd91CMO9Sq9Y5A3q4PwF3GSjNzIXhSluaGOyG+rbDxGLdCQGbPVE5bXKBKZ aiLXzj4m6i5ZQoTXpmx5rChqonOJISLaMtdj1+byk7Lr8lPtDs28C0jlPzGHMMtEbZmm 7dm9d8IvcXzRGMnZAKYMbPIBPY2bDTOk49lIHT4bFr5KqZ5prLSSgXUOv6jUPSLjGUYR 6DJPE/b5BRZTkL0wI0LsgP3k3jLyGQ9uB69hYUuVFG9xxRxpoVLOxmiRAUjNlawvAFIn cXqLhSYYSbeV1YOl+1KwcdK62FIuDKKMLAF0JTvEXftqvOXeMxpVSFsKMNrZ9n/m2c0V I1nQ== 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=gp6KNxHNYtmFYMKMCYa0gsOo8NLakQXjLI1+wdZrrFY=; b=KtuKwFFAair/JrSiZegdG3IuOb5H1N+cPz6K7DQB4TZG7D8aXqwIFpv7+OSU+l3R/Z tp1+IexHFGcMSYvtEPDOAEufBdRV/hWzwk/zUSd8tNP60BQH7WvQmFB/WPPM1U5noeAT kaZ4GM/64w56JJpPF+uNW58qjhMyaTgUkVKmTR8/97hyar4+bI+jDLpT/jXY28/OYA1e FgX7yJb1MWES08GQBl7cfMUWglGfivBBwRY4rVSXqB6Z5SbD7UWpvBL38B4ZUeIeQKyn kkmdyusCi85desX7OUjCpaOnA7+zL//Z9hlMmHs8tkRH7ETmyGv8VGnA6VXReSBsI+hH l55w== X-Gm-Message-State: APjAAAWMa6cHtvBtV2uM5ljiebPlzcmFNQyhnbfpdmFpG8MW0G0coIdy i5GQlefr9ZZdV2PcNFyoU/Zaugpsc4zpzw== X-Received: by 2002:a7b:c549:: with SMTP id j9mr2820695wmk.88.1573049605900; Wed, 06 Nov 2019 06:13:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:25 -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 02/10] powerpc: Remove arch_has_random, arch_has_random_seed Date: Wed, 6 Nov 2019 15:13:00 +0100 Message-Id: <20191106141308.30535-3-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 These symbols are currently part of the generic archrandom.h interface, but are currently unused and can be removed. Signed-off-by: Richard Henderson --- arch/powerpc/include/asm/archrandom.h | 10 ---------- 1 file changed, 10 deletions(-) -- 2.17.1 diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h index 9c63b596e6ce..c2ed3b4681f5 100644 --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -34,16 +34,6 @@ static inline int arch_get_random_seed_int(unsigned int *v) return rc; } - -static inline int arch_has_random(void) -{ - return 0; -} - -static inline int arch_has_random_seed(void) -{ - return !!ppc_md.get_random_seed; -} #endif /* CONFIG_ARCH_RANDOM */ #ifdef CONFIG_PPC_POWERNV From patchwork Wed Nov 6 14:13:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178714 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666300ilf; Wed, 6 Nov 2019 06:14:36 -0800 (PST) X-Google-Smtp-Source: APXvYqySXXnkFD3i7Jrv02//qd5A+aY7kV/nMtNAYDH64i6EX1zn5sayGv/RvUjcuu/JJbQ7Xk33 X-Received: by 2002:a05:6402:3042:: with SMTP id bu2mr2893007edb.298.1573049676390; Wed, 06 Nov 2019 06:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049676; cv=none; d=google.com; s=arc-20160816; b=QcnRnG2eAb/Rb8Y7A+/4xDOm9E+YwI6Cu5ykMFDFZGvAX873Ln0Qn+pvuUpD4+oWcj 6Kjpraox2FcWtwo0j+sEpdAXUQMxouKkNjjb/60i14YQ1xOJN27CG8yD6/Doz9I3EBpb vme2DVEjD8KXF+2a5pDw/c8nESQF3RTBjo7OL+QT+PnasMWsclDOmpBTGSukGrgzm6t/ kuCGWeuvIYyroEhdbeb/L+yk+Qvkcu3LcXRGXLsbUzD1NYBfZJDssX2hnIqnhPkbMN7n 4azLj7hXlmEDU7l9QgQZ47LLbE58gGgVjkYk9RPdrIbtHcGzXovBV3jJuiSIetZhBwGG 0dDw== 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=Bz6tm/Oq0JWNumhKoQOUWz+Q8JBAOdsIYOzjRyK0W9o=; b=hrMggOG+HXMohkkkr+Ea3OrQ3RK3XV6Y2yL0WKYnbKUvpex0mBUl2ptKzKGpnSeChm 2FnSrSbkOvGITg1wFvAqYK8jzlm9Zi0NstIfHFg8E6YXEeI8ClK5NIfYrP4iW9mFgecp a3vIAib5abtC/RoeRt/N6y0X6gHrRaQcPjtWUsABDKluDRp3JKPGv69EeBs0T1jMTQ/Y Jc9MGpzX2ZRPHsG1W9Kp+P4ljpB0O7NiTE/ycifrkZ9i5P1Bhc2sGs7/MMve5TAnvfRL uNnrBY1AoiNJqr386FTvWfrnB3LIHrzLWXqBFIRlo7LzAG+KQF41CZVfUq13NZj+IKcm PsWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlbxIkKe; 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.36; Wed, 06 Nov 2019 06:14:36 -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=jlbxIkKe; 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 S1731804AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53162 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbfKFONa (ORCPT ); Wed, 6 Nov 2019 09:13:30 -0500 Received: by mail-wm1-f67.google.com with SMTP id c17so3609543wmk.2 for ; Wed, 06 Nov 2019 06:13:28 -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=Bz6tm/Oq0JWNumhKoQOUWz+Q8JBAOdsIYOzjRyK0W9o=; b=jlbxIkKeL3Kg9sDbtCvzA0n80dNlWQeuKrHjCLy6JkLv+44YWN0XV/6Ri5hrDJmKx7 RMw4nFFVFEbc3Y43ASQyDevRbQ1KafjwpXr/+E2NcnKi61gvBNO4T5/CoC/aVOJm1lF8 afbdpOMvBrB1PiyE7mIkTCZmfFEppYlBRLE9bG4/7knt6uyuQCtc6yz3OfqEd7nJhW4y GaY42uHnvI3nskibfGwiI5um1+tf3nhRZnrxGC/x4jUZBdRvl7Ux9op1d4aYxNqMN6Yy Ugk6EsBMx1LG9OwSj5B/GAIoV5iSi0eBnC1ZNGpu0dDycG59m6by5s72ZnVqiH3P+Yu/ polQ== 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=Bz6tm/Oq0JWNumhKoQOUWz+Q8JBAOdsIYOzjRyK0W9o=; b=WiJ5TaRWxMCYUZXyTrE2+v1Cs847FFT/N9eeNj0nQglEySYMay8A3pjmO0WTmkBD9j N5vkHjRVodXycbyuDhAtazK/8sz3Qc4WdcCYncYunYDTF0V+bx7x7+bUmHv4hq4EvZjz vCst3oaW+3mL9jcXXtc7kvtsaEYZcNseXbeeyEw9gQyrNT02685N9FFwIkCzizPDdqdW FhkP46FdJWevfEZxqXcRl0uwGabfI3ZhCZcLOvdtbNFeC2fizHTxTpbOUYPVf/pa1tiD YGt/oaxn6Y4CQ/gLyakz3N39zcgc9ZihdJ0S/+We2uA0zOL2qmzZHBkTIjnjd7KGxed/ XHhQ== X-Gm-Message-State: APjAAAWSP8wtGQlEEVBJgv3CpVSkKg7TfsE9hEPxdJyGap6mNfDArtNv uE5gmRUd/eFTYceALZf0LHCEkg1OFLHPsg== X-Received: by 2002:a05:600c:28c:: with SMTP id 12mr2652459wmk.25.1573049607535; Wed, 06 Nov 2019 06:13:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:27 -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 03/10] s390: Remove arch_has_random, arch_has_random_seed Date: Wed, 6 Nov 2019 15:13:01 +0100 Message-Id: <20191106141308.30535-4-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 These symbols are currently part of the generic archrandom.h interface, but are currently unused and can be removed. Signed-off-by: Richard Henderson --- arch/s390/include/asm/archrandom.h | 12 ------------ 1 file changed, 12 deletions(-) -- 2.17.1 diff --git a/arch/s390/include/asm/archrandom.h b/arch/s390/include/asm/archrandom.h index c67b82dfa558..9a6835137a16 100644 --- a/arch/s390/include/asm/archrandom.h +++ b/arch/s390/include/asm/archrandom.h @@ -21,18 +21,6 @@ extern atomic64_t s390_arch_random_counter; bool s390_arch_random_generate(u8 *buf, unsigned int nbytes); -static inline bool arch_has_random(void) -{ - return false; -} - -static inline bool arch_has_random_seed(void) -{ - if (static_branch_likely(&s390_arch_random_available)) - return true; - return false; -} - static inline bool arch_get_random_long(unsigned long *v) { return false; From patchwork Wed Nov 6 14:13:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178709 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666197ilf; Wed, 6 Nov 2019 06:14:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyPfZsf0CgGz+VW5Q7r3yvBuzuMbPA5zrPbYW3xMJzNg6pPZvBcu3oHhkL5uUdtyY8R7erP X-Received: by 2002:a17:906:9248:: with SMTP id c8mr18531529ejx.47.1573049672918; Wed, 06 Nov 2019 06:14:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049672; cv=none; d=google.com; s=arc-20160816; b=t8PAdGYzZ4veMsSPE37p9iZzAukd2qdILGBiUlQBbyGn8u9i6U6QYz73BzsVw6Umma FUGH1hiKZggJI5hKi5Rm5/ML2UvEJeEC1xvAk/+sEFpFy5He1AEwY6E+yux2GrB5ESjU u6S8FC9pCeUdcNx3dxUGAXXH2jU1uQ2g7hH7oZcY2aAY1DzSunqnfxmmC4MIdXqE+7Jr PO7YOx0OfKPlOW5dQYzFwYKEFXQpBFYvGapPKxsSjhTjTJl4C/b1ItakoG3UH4ZklmlW 8I+8kaPhbzLzRbTVnpNqvFuFx/ffd1GfogDs2JfTOV54geeJF5TF5JXqMNey31qn6yFq aRjA== 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=QNZ1kA4q8aBB50NVJWu8PbKcs9AjHNKMK3pxZ9fNJP4=; b=VOOTFleVVWr3mh1faY5YRVQ0iN1uI6cH+xILOWZ9n248mbsuOFZ/0eYNjBZX5oiW4R 7jEb65ukspsRhik/MCHDbFhBUQgkS0AT3i7/ZKbCqbktf3sdOxN7fn0q9DlRj9mUjgsL OIH8LNvLhO1k4BF+t9Nb1BOpWbpwXhTv2PDf2NOyM2HZvw4Lp+/Z/y6NXeRqq/ALZA7+ T6D0/Y0CnmmgFQCVB4/FsgF5CCctXxqCYjmwxKyuRZl01LiGZ1m79K8wEHK74421SHkf 69RgdMKlRGv0Dc9EQUK0tOVWYFPorweWbYFeLpzbuPHzRrs8y0xFLhfSk+LisJeD9zHD vV7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xf2Ks/Jq"; 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.32; Wed, 06 Nov 2019 06:14:32 -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="Xf2Ks/Jq"; 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 S1727690AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36044 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731854AbfKFONb (ORCPT ); Wed, 6 Nov 2019 09:13:31 -0500 Received: by mail-wm1-f67.google.com with SMTP id c22so3546747wmd.1 for ; Wed, 06 Nov 2019 06:13:30 -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=QNZ1kA4q8aBB50NVJWu8PbKcs9AjHNKMK3pxZ9fNJP4=; b=Xf2Ks/Jq/ihGwNCma8VLqakFtNZHKXIuWjUMxPXRRbJUiPMCjNJdWtn/qgWP/5sax7 Ujfw6TL3LrTHr+uDBhPChxFljQzS5xgGpRxtwOO3Cwx5CN9yZ8J+CA955DxnUVBtrQY9 UQ1bY0WghbSRoxyO+YnPSEFpDzUjl87KqEH5SgdaSVeeYvhaF4C+6ymBYsygd0tMpK+B v1Ysb6J+hZxqg7dNd/kemAXJbzAWO4QDbjPoSV2WnuX18FdLVu+FkYfbLwr3DTApGJwK qos9OGs4AuUlU8h/o/Y+yYw2NPn+omvenj9islnObpixtFKklAt0n2mEtWosrHsO99wv YyoA== 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=QNZ1kA4q8aBB50NVJWu8PbKcs9AjHNKMK3pxZ9fNJP4=; b=Hv2DQ3iMw7RQt1lJXlX2HDYg8+8P9FwVTs4bLHX2NaI25MmLnpuMkqVpohZr9RbwYY jvXGSJwAz1qdd7wGLW42e+bcHUSVQXnZpJyG29XghuRMyFRb89/DQ4YNl1EwAdhes+bS 503T40lN++3UIpboDTt82Q6vXqjzBsWbDm4/IAY5nXoFRy+00ZzY/QJVXO/Gq847b5cU OvdwT8GBXaEvVQcfbqr+eLhdm/DssxRBntGtfcxbeqsfz2V+9sPkETb9+pTm4A7DlL3U jqf6jMSR9JSZYFKjiGmnFNZui8lKBDL11jrJemPcsSizhVCLwJZx9tVFLYopXcxhnMJs hLIw== X-Gm-Message-State: APjAAAXfAvwr+pnMzqSN18xpF6eyS0GLddtyNcoukilEPlLUeiyX8Rx+ MG522DzbOV0Bj4lvfHIef36113dkTfBC7w== X-Received: by 2002:a1c:544b:: with SMTP id p11mr2802294wmi.46.1573049609122; Wed, 06 Nov 2019 06:13:29 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:28 -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 04/10] linux/random.h: Remove arch_has_random, arch_has_random_seed Date: Wed, 6 Nov 2019 15:13:02 +0100 Message-Id: <20191106141308.30535-5-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 The arm64 version of archrandom.h will need to be able to test for support and read the random number without preemption, so a separate query predicate is not practical. Since this part of the generic interface is unused, remove it. Signed-off-by: Richard Henderson --- include/linux/random.h | 8 -------- 1 file changed, 8 deletions(-) -- 2.17.1 diff --git a/include/linux/random.h b/include/linux/random.h index f189c927fdea..7fd0360908d2 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -175,10 +175,6 @@ static inline bool arch_get_random_int(unsigned int *v) { return 0; } -static inline bool arch_has_random(void) -{ - return 0; -} static inline bool arch_get_random_seed_long(unsigned long *v) { return 0; @@ -187,10 +183,6 @@ static inline bool arch_get_random_seed_int(unsigned int *v) { return 0; } -static inline bool arch_has_random_seed(void) -{ - return 0; -} #endif /* Pseudo random number generator from numerical recipes. */ From patchwork Wed Nov 6 14:13:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178715 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666316ilf; Wed, 6 Nov 2019 06:14:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxGkMp9VNj3ipxAHFDfis6y0H2jwxrue/H6cuSxA4rTHRZ2VxOgTgErQrensV19L9di6Ft0 X-Received: by 2002:a50:9850:: with SMTP id h16mr2980166edb.193.1573049676990; Wed, 06 Nov 2019 06:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049676; cv=none; d=google.com; s=arc-20160816; b=PJf5kWQ2SjlMkDsoLoCD7lgUa0tSVm5xN7Fb4EzXOBWBqq7izuKwMEmqGW/nXp6NSm Og0yChwwNIveHDYbjgQNbu8W+vc5r2YPwWySNTlsaB0N7v2F4hrst1XqAmuQ+n0okOYq NANQqg76/sTfztVq/Qr4g3WEFfsbtZLHSSkQ1iwjGBVaoFufQG1knunJH0lKTHrSTCGV thqFMRZjndsJmDQKBB4zyqLjsqe6FDotLjdDtbnwbwq3PACs+HS1Jg6OZAvXMlRp0USi 7ag73AohS1TVD/5XnpPgeuAk3H/93aYPLe8hZMnwkiHAW0QQFS8vYsZLJxI6q4DoiqiF mVAw== 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=WSWMpSoTK1qPuZQMUXUs+rrNl9psDWT+JwajLc5x63s=; b=B4b89s0cCGs6iMACNBQI+Zj6CTlGxZCj9JYzfjWJVqIrZFakNCdP4ELzgo/zu+ynrZ S/jAdIeivm4zmxAXmSkHDqhT7wLvsOGZruFbTtezN6mK0Ou+yZncSZ9rM6skeed1sQuD 3bmpTHzOPgBZp+Qx8Kn7UqAYkXkhyAO3Cw31e5tTZjjeLstzqrdkkbizws06tPfBWM67 Az/Bctkyo3GBkGDlRcq936OxA97DUG1xvaSbxJLjb/+0LxyAh4ZhE3VrdA1BJTHh34gp /YsoL6UWU3ruU7wfqxhOBFAH2gH2QfF7ITUyCvCaaECh8pGpja+Oh9f9L1f/FX4wsWn0 4IVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o3RLE9hu; 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.36; Wed, 06 Nov 2019 06:14:36 -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=o3RLE9hu; 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 S1731807AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36048 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731870AbfKFONc (ORCPT ); Wed, 6 Nov 2019 09:13:32 -0500 Received: by mail-wm1-f66.google.com with SMTP id c22so3546858wmd.1 for ; Wed, 06 Nov 2019 06:13:31 -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=WSWMpSoTK1qPuZQMUXUs+rrNl9psDWT+JwajLc5x63s=; b=o3RLE9hugfNMGeayOKXMF63poaTZyNZSixnercrQpPsfWWgoGcVsahZ9wGvxqajkTL 65VNFHB6mdXVYgOXplvY1kFNexysDEPq5Mte9WIOjqcg1aowVtTrhVDsnT0wub/uMIGv 9plm99mfCRtSEw63V2+FJEO0avUTLLDH0v6gLjF9DVOTaBg6oIbNyb7sjS7eGkIP45xe 49mB8MByUP2KQml5xF2ln4ggynO86gSJMmUBV6ZeCzC7nwpX1YYgQOkj2KBMtTdJsDRM SSr5E0h3bqcqVqwF535O59szwWAxXieho+zlqJlenhqMZUeXa7L9rW2HfuF4DfbrOvdy Hi6A== 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=WSWMpSoTK1qPuZQMUXUs+rrNl9psDWT+JwajLc5x63s=; b=ZItKAQQyByGPRsuvAW4V8xee+31gxwnIEO65Ohi4vtb1BONOveKlSoPBzwfTdT9rj6 VYDCiGhB0MabFYSJbt9psUC+26viKpRHJrQ7LTHuwgjBGiO4Vd7xb1INi2XS9yx/JL9l Q0FGrOsg3yuBQN48Z1wD4kp2eJKoDkb4YkooyWhPvLSPyhf/8DYoHztKR0KLS/vKK666 hn+9+mm3czXfIye74Aj7lQoH+00Xhnv//S1dpDZ5KA9mzFJOXgizR3yj5H8P7osVMHeB KYceAEA4OxpexEZSpOZP+y4eBBWM90hXHi1kPygTNwyjWM+Dn9yMjkrkm1TvIOVKMnjI OLFA== X-Gm-Message-State: APjAAAUsWvHh6k5MGo34RuH2dctEhV0dVLZ0eha0HBsw6BGkGqyREm9k ekjgwZ32By2OOxhXJlrT+vZYV5A+ER2c5A== X-Received: by 2002:a1c:9a15:: with SMTP id c21mr2802805wme.93.1573049610656; Wed, 06 Nov 2019 06:13:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:30 -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 05/10] linux/random.h: Use false with bool Date: Wed, 6 Nov 2019 15:13:03 +0100 Message-Id: <20191106141308.30535-6-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 Keep the generic fallback versions in sync with the other architecture specific implementations and use the proper name for false. Suggested-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 7fd0360908d2..ea0e2f5f1ec5 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -169,19 +169,19 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed) #else static inline bool arch_get_random_long(unsigned long *v) { - return 0; + return false; } static inline bool arch_get_random_int(unsigned int *v) { - return 0; + return false; } static inline bool arch_get_random_seed_long(unsigned long *v) { - return 0; + return false; } static inline bool arch_get_random_seed_int(unsigned int *v) { - return 0; + return false; } #endif 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; } From patchwork Wed Nov 6 14:13:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178716 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666335ilf; Wed, 6 Nov 2019 06:14:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxaJmqQFWddGsQSb3sowFYdC03E1HyHx6kRDwz+04gdWsdqsgNUtAw/RV+r99HBkKTv9DxZ X-Received: by 2002:a05:6402:3042:: with SMTP id bu2mr2893125edb.298.1573049677636; Wed, 06 Nov 2019 06:14:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049677; cv=none; d=google.com; s=arc-20160816; b=PAuMcMafiMOf4zQsQyIwvc9/krl62YnRs2X7n333txfWeZ8eaqXqmKuMHDoIe1pt4G ZXPBVs5/eOVaWOwv4bzESGXRctsTXWMl8KGc5+M79alBA63GWDXYMFYE33h/eHc/xJxq Q+KW4ci8SNTwy9nR1pfbvm+TnXL/rqOQiF77nOQUbGVSYydHh48f2yk206rr8aEWFBvs f4gHyJqw+w3n9/HD9yxfJh9Z9CgWXX6K9Xv01nphmBbJ1FduSpSPy/td4SnNnEd8Kxny xjIfHcidHB1lfBiCUdBCidbrUdO1P2gKee19qR5WFrlc4KDO3Wpjjh+L7fIGNZAvtveC KCgg== 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=U6fBBHvVLMFc3f5G49uqUA0oEjUKRfSKZZVGrXe7yqU=; b=wDFbdSkm4TMr1Ey+5Rvc5wPP+WgJYsuPHUQ0MLOTnbrVnlyUn8JohPuZquqSH44mqE 8HVkKKv4l4Ta4D7JYUGzF/lYKX177nLejI9dsFxGOlYHIYkK0gD70nxncQ8ov7fmwpnv wAkcZ1bBRSQ2rxo6iKCMSmL+xoRnv75lZS90xhhnMugqaMrAGVDf3vqjYuyq0+jnzaJB PojnDy74lViM6kMeKxzSeXIdR1g0ne2t6At01LDbaqUkixOGfmMfdbmVKurYKXPFd3xk y0Hj7YinPvDVSJT/DncY2t6kB6dj3tSo45bYlBW5sXcI9uVili8CIgY6a5uWdaV4FOKH B/mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oHHyP9Ax; 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.37; Wed, 06 Nov 2019 06:14:37 -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=oHHyP9Ax; 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 S1731887AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45046 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731896AbfKFONi (ORCPT ); Wed, 6 Nov 2019 09:13:38 -0500 Received: by mail-wr1-f68.google.com with SMTP id f2so17073665wrs.11 for ; Wed, 06 Nov 2019 06:13:35 -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=U6fBBHvVLMFc3f5G49uqUA0oEjUKRfSKZZVGrXe7yqU=; b=oHHyP9AxSmf/91/+kpsv96IW5mCrfizqwOEzQn77TJGE4AA2TD2YE3WvYlno86vRrQ 3StHv1NQbhGvXwAhJk/7vyPl7kycnXc0qSnPpxKeCGP/oUNgicAcN3rLEnV4yJ2ZPWxI CcnqFRzZJteQfh75tsK/Dt4GRIgBQyKsAz4bB/OplfiKxsnhAYgXcW77Qa7uOUBHdNRn z/EO4axjbLqUY1SiZ0WZo/MIzMQotVjg9Ny55z9wlWKbVipolH1vvOmbccbra6On6B2W pnOOwOtcRR3Af+/5TPl6TnpoBlTy+VoxpdgYTBzZzIpphqhdQS2iv3RM/Blyw8vyoFAM FBhw== 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=U6fBBHvVLMFc3f5G49uqUA0oEjUKRfSKZZVGrXe7yqU=; b=daTVnQ/0udpMVh81mi4uARWAkrCIJ6GuCvCQTQVRN0+qCwthyN+FL2f6qQeoNLRfSJ 6j33AVWueuTqQ3jIVJiLO36XxyIkQDF7EC1lmiiqj5nDoxsGnwtHc6ZxwqJ6int0Sg1t gmt3qqxdEiTOWsigFuTEnEEUr2Snt1eHdHY2D7waihZEhnoNAi3JpwJkyMw+a3fXStjX R7oFj5k6UnxoTsHvqO1FPlQvMgRriR7za6iZ8AMuIHsXjZ9AyLaDKpr3jdQ7eq1sbDTW xMgU0Y/Y3rzVA6GYoIvpPS2MmvxEpBqJixRliZBxOKl4F9sLQlQRZRYWjshc1HKk9tBe TcEA== X-Gm-Message-State: APjAAAVuoUgnmCnW19JLDbWnT9tNijKIWbaJJfKze3MDWZD3IfPKQWJj cMCQAOiPkKa1IWP0n0cs1iGDYaH+pd+lyw== X-Received: by 2002:adf:fc0a:: with SMTP id i10mr2719969wrr.257.1573049614286; Wed, 06 Nov 2019 06:13:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:33 -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 07/10] x86: Mark archrandom.h functions __must_check Date: Wed, 6 Nov 2019 15:13:05 +0100 Message-Id: <20191106141308.30535-8-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 --- arch/x86/include/asm/archrandom.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h index feb59461046c..7a4bb1bd4bdb 100644 --- a/arch/x86/include/asm/archrandom.h +++ b/arch/x86/include/asm/archrandom.h @@ -27,7 +27,7 @@ /* Unconditional execution of RDRAND and RDSEED */ -static inline bool rdrand_long(unsigned long *v) +static inline bool __must_check rdrand_long(unsigned long *v) { bool ok; unsigned int retry = RDRAND_RETRY_LOOPS; @@ -41,7 +41,7 @@ static inline bool rdrand_long(unsigned long *v) return false; } -static inline bool rdrand_int(unsigned int *v) +static inline bool __must_check rdrand_int(unsigned int *v) { bool ok; unsigned int retry = RDRAND_RETRY_LOOPS; @@ -55,7 +55,7 @@ static inline bool rdrand_int(unsigned int *v) return false; } -static inline bool rdseed_long(unsigned long *v) +static inline bool __must_check rdseed_long(unsigned long *v) { bool ok; asm volatile(RDSEED_LONG @@ -64,7 +64,7 @@ static inline bool rdseed_long(unsigned long *v) return ok; } -static inline bool rdseed_int(unsigned int *v) +static inline bool __must_check rdseed_int(unsigned int *v) { bool ok; asm volatile(RDSEED_INT @@ -80,22 +80,22 @@ static inline bool rdseed_int(unsigned int *v) */ #ifdef CONFIG_ARCH_RANDOM -static inline bool arch_get_random_long(unsigned long *v) +static inline bool __must_check arch_get_random_long(unsigned long *v) { return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_long(v) : false; } -static inline bool arch_get_random_int(unsigned int *v) +static inline bool __must_check arch_get_random_int(unsigned int *v) { return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_int(v) : 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 static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_long(v) : 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 static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_int(v) : false; } From patchwork Wed Nov 6 14:13:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178717 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666281ilf; Wed, 6 Nov 2019 06:14:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyj7U5pVPSWrKWSmZqmO9xPjs04juQgjRP1gs57e4NPoT6vK+T4ZcMfvDCwm24/LZ7asNA9 X-Received: by 2002:a17:906:1505:: with SMTP id b5mr35487845ejd.195.1573049675437; Wed, 06 Nov 2019 06:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049675; cv=none; d=google.com; s=arc-20160816; b=MV/T9Cv9fWXhXGdLp5L/zHz5Cc07ngn683bGUdbVApxywY+YSg/wuJjqlXEUiZhKcC 6H8CBIARfjzPvSrwAfhrArD3TnMy5V0HoMB8B4Rof6OIvO0M1OOdLt7uhQP1Y81DrbP/ EU/gNZ/QyQ9mnYhlvVJBIo4eaIr/JuMRndL552Yv8w8diWsYNCYpuUabxAOOKiTFS6e8 SKaTevgo1zkzx0FXLNM+CSgQHKz+EUrZluAA2qtU5dHRBxhY6bBKH2tyo7cy+efbBh4T wyWUiIL8wtm+Pd+fBkE0APx1o2A8g6YoNWfw5OqbJMhrzWD1s+Vp44f95qS6ncPy/Gfp AR6Q== 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=fqzAPQhanx5lXrgKjEv9uTOrlBIqmOP4j8raLoO2k80=; b=aGu3RrFeX5/7afd2K9KkZp3TVRBAUSfvDmNiDdkn3BveeNxfhk6d42AWCs0StzmfA/ 3UTy+9AgoPfpYKFTdClm6mgkWV9XJbSwKf4jjEZDyCUEtUBpVjEQ4Kcrz8Tl+WwWozcW dgQqq0M0wRTZNIC/PlsrKgSnn1FQZKMq9EQwnxUfUMmT1RpVssHt/2xJr5/41JZHZv6R Nigz//I29WuNdP+UMiEtd6ICXfoEI8XRK11AsK2AII+DReTt3e9nyNP763mengPhx1iP XwRIZorvYwLg5jEM+JDAZUAfPKoZ8olaAEbOMI2WfHQJ9NfirJ3NBxqT2CaDZQhW1na6 6Sjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2POX88Z; 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.35; Wed, 06 Nov 2019 06:14:35 -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=I2POX88Z; 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 S1731870AbfKFOOA (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:00 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42090 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731910AbfKFONi (ORCPT ); Wed, 6 Nov 2019 09:13:38 -0500 Received: by mail-wr1-f68.google.com with SMTP id a15so25959550wrf.9 for ; Wed, 06 Nov 2019 06:13:36 -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=fqzAPQhanx5lXrgKjEv9uTOrlBIqmOP4j8raLoO2k80=; b=I2POX88ZgDVEIXbxSVYMlxZS/dZ7L9KVhUwt+3VSv9oM/hQnoUVFd/6BdiDiRkN72e mb3HIJ8zn335Mrlnm7+1kBy52YQr8iVQF2Ja5iGFzC2aYsdzlXapp9hOL4hr/d25WSIb TLlS5LGfym6UNlJ25r+k4XhtiyR+AcOmsf8KxheDxTBSYyezHh6NYY+RQW8omSd+sxht EExXnP+uHJklWzU8BZnUIUTZqb1eV8tqpuILEWnzNrXEiuexc65TTdG06IsXsKChYaG2 M8rk6v6P9kDamxYzI4+MMtDD4T8sy85hVCZM4ztqGTKQTpNvGNLVZNDmZx/i/SqHqgJj 0d0g== 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=fqzAPQhanx5lXrgKjEv9uTOrlBIqmOP4j8raLoO2k80=; b=bTMmTOqyR+dEmv+0UWQK8eriAu49n1fMvWXAfCzDAYxE1E7t6nmkHnNL/GwFb0f+xJ 8rwc2o+fPgF68hFIxZGvt0NUMAoTQHHkCDcL1VsGhcgbaT32ZXjV8RUUOWYmBDQzTFM0 c3KdJp4y//xoVrrbVR3n+HBvtnNE7E1SfylSHeb8UvsyWfnLYYc5VYC46APPww5fvzF2 lL89u6COmMafXmF0jG6+VknKV4TQccs8V0kbrF0TW0h1Jq940u0U/Wx40BvoAM2SgRGY PLWm96ROkLxA2FNjLFjmPm9xqQskN49WaqGyrI8hA32cB5vGtBfhga8dzgVFukrcUS/2 8DkQ== X-Gm-Message-State: APjAAAU1L9U/XRWNZZQFfLxnbRKbwnorK4BDvA+2b41zv0iZrvgSm9Ja O3tTgQDignAEK6LusuB7X8wAuRLRt9mwNA== X-Received: by 2002:a05:6000:128c:: with SMTP id f12mr3122000wrx.279.1573049615963; Wed, 06 Nov 2019 06:13:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:35 -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 08/10] powerpc: Use bool in archrandom.h Date: Wed, 6 Nov 2019 15:13:06 +0100 Message-Id: <20191106141308.30535-9-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 The generic interface uses bool not int; match that. Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson --- arch/powerpc/include/asm/archrandom.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h index c2ed3b4681f5..7766812e2355 100644 --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -6,27 +6,28 @@ #include -static inline int arch_get_random_long(unsigned long *v) +static inline bool arch_get_random_long(unsigned long *v) { - return 0; + return false; } -static inline int arch_get_random_int(unsigned int *v) +static inline bool arch_get_random_int(unsigned int *v) { - return 0; + return false; } -static inline int arch_get_random_seed_long(unsigned long *v) +static inline bool arch_get_random_seed_long(unsigned long *v) { if (ppc_md.get_random_seed) return ppc_md.get_random_seed(v); - return 0; + return false; } -static inline int arch_get_random_seed_int(unsigned int *v) + +static inline bool arch_get_random_seed_int(unsigned int *v) { unsigned long val; - int rc; + bool rc; rc = arch_get_random_long(&val); if (rc) From patchwork Wed Nov 6 14:13:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178713 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666270ilf; Wed, 6 Nov 2019 06:14:35 -0800 (PST) X-Google-Smtp-Source: APXvYqz3uUJyBK70PqMlqUHHfYUxxHEvNch0bHEBPBuuLWYu5PszsAWQkaakLAYb3fKOPwh4Qpu/ X-Received: by 2002:a17:906:6bc4:: with SMTP id t4mr35963107ejs.1.1573049675125; Wed, 06 Nov 2019 06:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049675; cv=none; d=google.com; s=arc-20160816; b=Wy4Ylshuu/sGcJdYMK8R/+tiTj4ltI1tpyDUBjCuWCixOm9c6Mw0GlQjE5ZZwebF/H 6bikzdYDY4bLTkAscC4ar8c/a2VpUrsJVnQjv7IVuzg1lMbLRAmLgHbl2inzeqHCrzfO OZ+Fnl2cgQUAqG/oMxEN4+OyVMtJ/kXwaxL7rez/v0RM0dI9lNCDQAPUdZYkP6NcCP97 3AtFuNmYuxpU7BgGjfHtrvnwNKGlnqxSd+6U5H7Fgd/nPXDEDJJdKjfQM6onoauVHKNI wCrpFipU2Z1fl7N8SwYZ9owPA4d3gd/95gJ2CYonfPVzWqneOEOr3oN4I2a5p7aUs0yk r63A== 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=d0srGooF0rUVSStaoSaPVl4d3tRFVDopwGFjT5DN+Wg=; b=MLNOE7hGbmKeEA65+0JKeoBZMeND451HJVQHEg6AqUP7Xyy0ae010ihXu+GSYu7Epv wIROkgD4xFAWQbb3MWxk4sV7RknR0kAScb/ewW/VSDgdy0/TUm63ORaVYuI25vufUXod 6YZOUa003jZpc6gYl3uLZxxpNEk0PC+wBkaIEHi0pBES3kXsTlMzN9Vl4jz+PXrE8sCn 6vOcSayGOCBcL4KpLYUYa5EkGLwhF3Z2S6iNEv60DYZ+E4MX/ugJk3vQAR20eaoQk9rA WWXTpx39SIcIJuSDyYlwcoa98nppjBgYdgY2Hi4ZN6JOMwAVePgo/4sLR4y9CjkzKQm4 r/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zt7Gm1T+; 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:35 -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=Zt7Gm1T+; 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 S1731896AbfKFOOB (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:01 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35492 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731912AbfKFONj (ORCPT ); Wed, 6 Nov 2019 09:13:39 -0500 Received: by mail-wm1-f65.google.com with SMTP id 8so3554411wmo.0 for ; Wed, 06 Nov 2019 06:13:38 -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=d0srGooF0rUVSStaoSaPVl4d3tRFVDopwGFjT5DN+Wg=; b=Zt7Gm1T+U7ZFk4dp2KJZ4ivQM/cx3tQpRMnDTSvYsTCPaOs14OPmmARgBVQFEc+lD0 wYz0WNdI63E1W72X/zcnwS74mw7NVDXzTtQkjtu03sHH5Tm2+jJJn8rorasVu2SPgGSa FXCvlLKDVIhnLqiwjxdmyrineQ1dQ8I/2Byaia80R9wHg/FW+fui6G2yTLgOEMsGu+94 M+8Z2PiVw8Kk3wLLnI9gVlIlrXpzhhk5KjTYVkMAqTNit8YehzmBakPJCHH0g0XOT5+r EvOn6Zv32u5W8323sPpA6JDD/iM0DyWGqIGVDMHA+zaXXVcYLV1HROnbbjEYRp4JYyfT BHHA== 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=d0srGooF0rUVSStaoSaPVl4d3tRFVDopwGFjT5DN+Wg=; b=quy6oo3B9dy14vZ/9Or/1k4hjPe+zXoahVWRgRZlDHzyX8+wRTPCowZV1uU76BtBvc 3uHTXXwxkw8aNJVNfdqBpJl2FxdsRxb0g/tdiLlvHIG/yJogyxrrNQW1sBjFkfbajc42 lAKgMkZULu4pInX2vvvgQqHSg5MPTGeQXVuS195D96HsL6yJzCY+92ycFQAQKJk68ivf FaWwmbfWlcQrrtddfCA3yupuTmqp60mWBcy1UKIGecG8VSPxWelWlhKXBujlAI4s4VW8 z0vL09b2oQ+/GVDJKX1EZXW14TTa2Jw2bkNcBTr+U0Ak7c1Z7w0xKg+DTCaRzztrEuKh zb0A== X-Gm-Message-State: APjAAAX6yxxeWoGA9xCvVqNjtL/ZOdro3tQYLSJ0ERMVLBi+BtOfpg0Y /rZ8X92ZEv0bPYGaWdwSnCga0AMyQ4HwXg== X-Received: by 2002:a1c:2b82:: with SMTP id r124mr2757815wmr.112.1573049617471; Wed, 06 Nov 2019 06:13:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:37 -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 09/10] powerpc: Mark archrandom.h functions __must_check Date: Wed, 6 Nov 2019 15:13:07 +0100 Message-Id: <20191106141308.30535-10-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. Acked-by: Michael Ellerman Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson --- arch/powerpc/include/asm/archrandom.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h index 7766812e2355..60b8ad798743 100644 --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -6,17 +6,17 @@ #include -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) { if (ppc_md.get_random_seed) return ppc_md.get_random_seed(v); @@ -24,7 +24,7 @@ static inline bool 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) { unsigned long val; bool rc; From patchwork Wed Nov 6 14:13:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178712 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp666253ilf; Wed, 6 Nov 2019 06:14:34 -0800 (PST) X-Google-Smtp-Source: APXvYqy1f/PGt/TVe8sUxhbjFqpQkH5lA4bHQkvnj88Px8r1YtGlqoEDTaqUaKU12gkaiFWiNeo8 X-Received: by 2002:a17:906:684a:: with SMTP id a10mr10587827ejs.160.1573049674504; 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=oPERm20PbVGbxbDaQ7Kat1NJ9oQtrdjqM1NsSMhTWOTPlceBXtZZRcSnhxrRv9nQLj s016xsKvBq7BTiur77jz07d4DwNPzJRLqpBO0E9UkeIwHjfNfq5QPY5AqBpaViEiUyWr Yoc8Ch1n4AkUrvETQKPkQvNRwFlgjA+o+/HZIrw0dgBdkyYUjMZ0otxQdZN5qJR9u5CB PvDGHKTCCaAuqaxX6bYa4JGdx1p7+FB8YSEE4OBGNfYRke3EEWNoeD1bIL9bku/zxsYK jzHjRNJrG93EpWXKJ9Ay0VgogGTpWb64ZO3upi47aRxtVPVvktqkwuz5KnVlEu5mihAj Fw0Q== 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=EtW7c5+Vxuw361NPgarxEa4pkxF91xrS2XEr4qnN4jI=; b=cm6Zbo9FyMSmi0kVV8dpN9uFHdjcm4oYqQbnhY1yzpB6km/sngdXFeiwTHpn3+tWU/ StjPa8+FJhMGWe+MjVzJVQmFrWnoZwQqvfCR/G3wQ6khiL2dIFQS4c00U87nVYRorDFB kZXwlPnYfJDW1PdPhHnqu52nlqcPA3Prk2gVrx44Jpk6in/PgojYEDr7UY/PRDjM9t+i Lnx1h1qkubfeTX4JgtvaLVtSeEBJHRnUaRtnluNtNeMNMg3Wqblf+kjQMR9NBNGqUsk2 1tNgaH/V2CykuKCYAtR4e7Zsv5Giil0y4mXlhozNFf16QHcK5OjOz0z11NU/5X2k9//3 +sAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e5nNk39V; 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=e5nNk39V; 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 S1731911AbfKFOOB (ORCPT + 3 others); Wed, 6 Nov 2019 09:14:01 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55491 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731922AbfKFONl (ORCPT ); Wed, 6 Nov 2019 09:13:41 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so678438wmb.5 for ; Wed, 06 Nov 2019 06:13:40 -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=EtW7c5+Vxuw361NPgarxEa4pkxF91xrS2XEr4qnN4jI=; b=e5nNk39VJ5IOgRqdcXf58JkLAmLsag2O4+U458JjYo5P0PSEMekSFRL7LZc2d3m3VJ URQyFUvE8jMn4eVvMtPS4S4bwU+o51HOhtfgwYme4dhoLAOHd8OHl1q5buqF/oxhumhw +z3jc1g7Ck1yBgoUiT30MrVfaQcI9SAZcV6//J2C/MjC41OM02IYNasElc3UDquPybqb baWyh7WRSDEfEhipTjcqjxsGo/IM/qSUCmUCE5UrGsB4dj0txgaPvPHy4E6e/8b6xTks +7wsbS1O4VTbwJoSISfsP2WPk3MvEuhRHnX4Tq6FkCgrC9KgWh7M7bDPmgQZAuRo+xGE Q0vg== 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=EtW7c5+Vxuw361NPgarxEa4pkxF91xrS2XEr4qnN4jI=; b=qQ/givsx4rWI/O/LzWuJMThUdRXVKIb3d0w92T9jOHmABoSwhjAeELejhmZSpLdBus wA8ylk4B5Zd2Z/IwuwmSl3JgvpqTxzHjmgLiCLmKnWjHmNtKA0T+6kSwwbMO+syNnPRA 2fnh82stszzLR6Nnww4hlNCC09C6LNHmYjWQXZ2A1ySbr3zKC4onPxTNllBiIfvi8Wbf sZB4FhPLSn3aY1mKmDmB1tK2UNHuu0QLk/6SmNMwTo6wRiNzmnwR2x6D075PNmH7Xxel PUASLzVbE5oUtWB1r8b0aa6AlTxhSNX/4IjzFoW1/ZHQeKWInBqOoltFT4UN2GJLj2O0 qhUQ== X-Gm-Message-State: APjAAAXUCnBI9YJ/AXokXPE8h2Uf1ma2on1d4td4teRXwpXSZ/zkIvJx CqFI3wpP8UzESrJpnGkJ7ObDp5FAUQD5Yw== X-Received: by 2002:a7b:c776:: with SMTP id x22mr2609658wmk.144.1573049619319; Wed, 06 Nov 2019 06:13:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:38 -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 10/10] s390x: Mark archrandom.h functions __must_check Date: Wed, 6 Nov 2019 15:13:08 +0100 Message-Id: <20191106141308.30535-11-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: Harald Freudenberger Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson --- arch/s390/include/asm/archrandom.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/arch/s390/include/asm/archrandom.h b/arch/s390/include/asm/archrandom.h index 9a6835137a16..de61ce562052 100644 --- a/arch/s390/include/asm/archrandom.h +++ b/arch/s390/include/asm/archrandom.h @@ -21,17 +21,17 @@ extern atomic64_t s390_arch_random_counter; bool s390_arch_random_generate(u8 *buf, unsigned int nbytes); -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) { if (static_branch_likely(&s390_arch_random_available)) { return s390_arch_random_generate((u8 *)v, sizeof(*v)); @@ -39,7 +39,7 @@ static inline bool 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) { if (static_branch_likely(&s390_arch_random_available)) { return s390_arch_random_generate((u8 *)v, sizeof(*v));