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;