Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2657771imi; Mon, 25 Jul 2022 04:51:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s13RmtybRZ3HMrhEM5ilQwhLRszq7r4m2h45Dcp+Cfvi3LPHFezgCz0rbbIAFq5E7bB+z2 X-Received: by 2002:a17:907:2d23:b0:72b:7c6a:24c with SMTP id gs35-20020a1709072d2300b0072b7c6a024cmr9540672ejc.44.1658749896437; Mon, 25 Jul 2022 04:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658749896; cv=none; d=google.com; s=arc-20160816; b=GJXMvHty0TJYVcR2JUbsEmsP1napRlxUl6YREHguwUoJOC+98Aa6cQbFT4gZKhDMqQ DXyzE2ULCvci6OCYsMjYzv1LP1vIo6fPC8KtuGIhPNSrOilvHh87hMHiH+e7ePkcNOPm rheXtxnpmTOZPbKNWJGYv0mQzfe40ukoVtwbhGuypOo26udw5KQWjpcigf1MNJGJkMM7 1Gv3xRN+EWHdcO/dmmSPfsVjyy+N+Wtg3PmJZjodcwf1LrZVnDvoWLIw6eydlXtYL5vx 3YsZvQBXpIDiwET0CThSNHGxDvaAiaeTPUoyMlRXXI8NxVyt4oWBBwqlRCHWTdixtBhH AmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=FkbOTZeXbuGPcsmYrhwC6BftW6Xv7bUNRGWwxI1HptQ=; b=tniZSsyEnnEfH64oeRXZVZOwdT7e2NnmJqcVx/F8M1JpWbaN46YbgSMavzdPcgUvim szJRmoDlA+UamizgRIlxh7yqGEELsa6aeiVuIfdxoRzt1Kc/A5YNwjmvAAbl7R87BX58 20zUqS+zrzHJgK4Hk0/TXkXfGdb/8vjoU8J35xgsmUQP8C9i6Xj/NeT+h2KKXM0AQKcn Ic4xpi9/G0Eqsl6/87ZLfYdJ7HUiqSDva+EvM/4AjXSkw7Ayk2zUHvaifhNwmropPFOV qOk878JK1boG6+5+hYhN7gxbYp8SNB6RQxkLtL/FB0SfT6cv/PK1vPzjGw2x5wuZlk3d Dl/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mAaVDSEj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di14-20020a170906730e00b006ff11ed7162si14815763ejc.535.2022.07.25.04.51.11; Mon, 25 Jul 2022 04:51:36 -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=@suse.de header.s=susede2_rsa header.b=mAaVDSEj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235021AbiGYLZP (ORCPT + 99 others); Mon, 25 Jul 2022 07:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235013AbiGYLZN (ORCPT ); Mon, 25 Jul 2022 07:25:13 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0A41389D for ; Mon, 25 Jul 2022 04:25:11 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D0A912005D; Mon, 25 Jul 2022 11:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658748309; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FkbOTZeXbuGPcsmYrhwC6BftW6Xv7bUNRGWwxI1HptQ=; b=mAaVDSEjTAgRb+gypaAUY7R+Pb805t175yu3Cdz95hXurwuqX3KDRCjm0B1kDzi96v493n mGz+FITge4/ENFcD2NG9EZ3uGfbh/8t2+NL/t6sOKL3V6bczTWBFOgv3ikO+vJgP326SU7 Kgb0fKx1aeVgBckpUN5tPO9TMa1QgBs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658748309; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FkbOTZeXbuGPcsmYrhwC6BftW6Xv7bUNRGWwxI1HptQ=; b=13YM1ib7x3gMUZU6tQ+yZPfkyW0tRMGcgwWdvgvK//NobdON+l4ZJBZPkqIC04Ycx7emCW Yt5gkbw3nyZ1tHDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C3C6A13ABB; Mon, 25 Jul 2022 11:25:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id R5/BL5V93mKERQAAMHmgww (envelope-from ); Mon, 25 Jul 2022 11:25:09 +0000 Date: Mon, 25 Jul 2022 13:25:09 +0200 From: Borislav Petkov To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Heiko Carstens , Catalin Marinas , Mark Rutland , Michael Ellerman , Johannes Berg Subject: Re: [PATCH] random: discourage use of archrandom outside of rng Message-ID: References: <20220725111038.720624-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220725111038.720624-1-Jason@zx2c4.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 On Mon, Jul 25, 2022 at 01:10:38PM +0200, Jason A. Donenfeld wrote: > Borislav pointed out during the review of "random: handle archrandom > with multiple longs" that people might actually use this function, which > might not be good because the function has surprising semantics. This of > course was also the case before that patch, and indeed RDSEED-like > functions across architectures often behave surprisingly, failing often. > While random.c has been written specifically to work with that behavior, > not much else is well equipped for that. > > So add a comment suggesting that this is not for general consumption. > Fortunately, nobody uses this for general consumption anyway, and people > who try quickly find themselves in trouble. But adding this comment out > of an abundance of caution was nonetheless suggested, and it at least > means there will be easier justification for cleaning up potential > misuses of the function later. > > Cc: Borislav Petkov > Cc: Heiko Carstens > Cc: Catalin Marinas > Cc: Mark Rutland > Cc: Michael Ellerman > Cc: Johannes Berg > Suggested-by: Borislav Petkov > Signed-off-by: Jason A. Donenfeld > --- > arch/arm64/include/asm/archrandom.h | 13 +++++++++++++ > arch/powerpc/include/asm/archrandom.h | 8 ++++++++ > arch/s390/include/asm/archrandom.h | 8 ++++++++ > arch/um/include/asm/archrandom.h | 8 ++++++++ > arch/x86/include/asm/archrandom.h | 9 ++++++--- > include/asm-generic/archrandom.h | 8 ++++++++ > 6 files changed, 51 insertions(+), 3 deletions(-) Acked-by: Borislav Petkov Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH GF: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman (HRB 36809, AG Nürnberg)