Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2929829iog; Mon, 20 Jun 2022 07:42:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t1tw+TCEBi584Wl3HkMjMyXjc4nEForLQkAtqVvXNGb9CxHV/o7QiMwezn6kJejHDahtbI X-Received: by 2002:a17:90a:5502:b0:1ec:788a:2d13 with SMTP id b2-20020a17090a550200b001ec788a2d13mr19220114pji.182.1655736158468; Mon, 20 Jun 2022 07:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736158; cv=none; d=google.com; s=arc-20160816; b=WaNpvSsk+whZ50u5GFqWAZtMScP9ayQEuq9s+Z6I35sRVTG1nTsD9ATmeNh0b2E8jq WgoWz6EDQwOtDiER6E8SCB0s1LDV0bXyGkXvbRHYlJTSIu4BM3Y7EJ+4+bsVzeSCBbzF 6vEJX9S10nlrG1cm7K1Zy+gLUF9R59NJJK2k70WC8HNUS4nKzcw54I1WQh1jr/XfIZ/r SGoh5+qkvxd6a0Z3u4hW3xxCPEsWxcMFbL1h3onuEhPP6EAFsjQh/FbddEBVOlvsqvMX iz6fo7F/WhUn63ikmTpkkOls2a8pfiMyT+PYIvSrP7+AkWzl7s3e3u2KLeuuEpk9NNZK Vv2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2JFG+ihVbkVMs7ZKyfVQGFlNvjR7EkmBYgUn1iM7IjA=; b=FWByuEOlkwbRMLOLuRGfic29+W1UHgB0bEJ3KV6Sq8051J4/dnOzMIdTJsp37cAWLR RE3y9q5o3tHZf+K9b7+SeYEy2Z6Dt8w4uVxqL+Uvt5JoIjOYhk2f0kUvY7iGiCMJyj4G eTzFrDyZ5etms5MmLfpn4fhqVoOZm8yabj+ccXiCWuyWoaJWWkuA0lFrYKW3wGsPm9j2 jwF76ptwadPyNqiwOxTSDRR5y3z6Bwtpe3pAJ/tvkE0K7L4Bwux1ml4pDy8W7nGHiMQP Oug4PUfU4tPAsoG9GbZpIQ6JpVJCmmf04NM3AjjYxnRTtX42knWV6hwgTfKgy+UILTSA b+fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xtIP+2wj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a636b0a000000b0040c8e075d69si8195858pgc.149.2022.06.20.07.42.25; Mon, 20 Jun 2022 07:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xtIP+2wj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347211AbiFTNkW (ORCPT + 99 others); Mon, 20 Jun 2022 09:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347301AbiFTNiS (ORCPT ); Mon, 20 Jun 2022 09:38:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C7C1F609; Mon, 20 Jun 2022 06:14:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F78F60C1A; Mon, 20 Jun 2022 13:13:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F90AC3411C; Mon, 20 Jun 2022 13:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655730834; bh=qphTwdliIn8w9lKPm/HwNo5p+1kw3P0H8jVb9mzhi/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xtIP+2wj8qEo4Ovjz9UzPkZpFcCqPZsyc0tqjHhIusv3qWWVQxxLbGaJ2ywkdkTNY BVpIMSOEeI1Yu4XNlhE8xRwKW2eedBs3SfCUWhDtc4R8VqBLVSlLG6PkuaLwyCQyKY ynFKXDNc9ahRluPEqcldAVqJnevtCf1FJIWIavfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Richard Henderson , Mark Brown , Theodore Tso , "Jason A. Donenfeld" Subject: [PATCH 5.4 029/240] linux/random.h: Mark CONFIG_ARCH_RANDOM functions __must_check Date: Mon, 20 Jun 2022 14:48:50 +0200 Message-Id: <20220620124738.687364273@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Henderson commit 904caa6413c87aacbf7d0682da617c39ca18cf1a upstream. We must not use the pointer output without validating the success of the random read. Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200110145422.49141-7-broonie@kernel.org Signed-off-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- include/linux/random.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/include/linux/random.h +++ b/include/linux/random.h @@ -118,19 +118,19 @@ unsigned long randomize_page(unsigned lo #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; }