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));