Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3273349iog; Mon, 20 Jun 2022 15:52:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1velZJNUnOcfEOQgtJ0KMJ3OPMReISml8iqra9qdKWP8LoKrp8MnUNnpqn2FZK7AFqycqg0 X-Received: by 2002:aa7:de8c:0:b0:433:5eea:27f7 with SMTP id j12-20020aa7de8c000000b004335eea27f7mr32108878edv.328.1655765573934; Mon, 20 Jun 2022 15:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655765573; cv=none; d=google.com; s=arc-20160816; b=QOuu/FCWldAD25Gsm28vAP//GApwDhTUgssZHu2iJLSBzumoukPC3OPkontINhBhVH wFOU03WCoXDsJ9qIqSwpwPtavGvutVAn2GCp2fAFtU8XO+QktxLFlZ/TiiBfFPpNDSqC AeNu4aeq5MXfK9BfgqHkN9qkABxFjBAbChZTweMqduYjqhi05HgZjrjMa9gR7A8SjGk7 6QUmGBarh69J6n76RioiKBiZfhSzGbYZuZdIKOTg90Ykcjl0H+Je8YK9mefi9XdtDSRz so1VdfNe/qsz7jg8xjOeGuwcnLxwgR6ZEa96SxIwdJd+zWYqU5310s0JKDp/s+7JpNl4 tlYA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EXc4zdICVXyYuZT3mYGMNiXmjUFP4MgtX6ODMQRhdDc=; b=s3EuK1abKoJfJ7+oiscDqAdH1BquCd4pmUModGsAPwGS1nI1bYB23i1BIFfy/H/WBe jOq7CZQ6wbd2R7fqRUiheYay2EWeBOkkNtjwA9sun2DZFcE1N8DVOVy/kb9d1DqYaUtU RGpWgPSEbMa2KOATfgsus9Sh/68wCo6TSnzoO9oIRK8kDgqLpOHjo28JvlSWPh6ok9Mj GciMU5XuFbI7OPgVJyAYXmA/G6XvUq1vvbEKeVImWUKLaFP4JgejPlaKZoFCEuqrVIdn 1gr/w+v0iCToUS+/Y5nuzSNYIHuwQafyz/UEABezXmk3yC53xUMnxdtFliIO0Ix75RCa ckjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=XzFX3G1K; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp8-20020a1709073e0800b00718d033df10si16181823ejc.448.2022.06.20.15.52.29; Mon, 20 Jun 2022 15:52:53 -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=@zx2c4.com header.s=20210105 header.b=XzFX3G1K; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241907AbiFTWmL (ORCPT + 99 others); Mon, 20 Jun 2022 18:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233825AbiFTWmJ (ORCPT ); Mon, 20 Jun 2022 18:42:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708D81276A for ; Mon, 20 Jun 2022 15:42:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 31C18B811EC for ; Mon, 20 Jun 2022 22:42:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1082EC3411C; Mon, 20 Jun 2022 22:42:04 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="XzFX3G1K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1655764923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EXc4zdICVXyYuZT3mYGMNiXmjUFP4MgtX6ODMQRhdDc=; b=XzFX3G1KQjd5Wdq6qeTCBkYmYFEEywcRNIG/KDh3u+jTDhTyoIhBWn5F4+l3pOB7Nc46rl lHkbhOHsCjcTgJDfJoEA1riCXKRO5IG42WqlBbKb8cQ3LV136CqDPyQsi/t/S4KQ4bfJQp 4KqtrKjnJu589j/ncvvXtoSEW/I0TGc= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8ff005c1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 20 Jun 2022 22:42:03 +0000 (UTC) Date: Tue, 21 Jun 2022 00:41:59 +0200 From: "Jason A. Donenfeld" To: Linus Torvalds Cc: Sebastian Siewior , Jann Horn , Theodore Ts'o , LKML , Thomas Gleixner Subject: Re: [PATCH] random: Fix signal_pending() usage Message-ID: References: <20220405163931.1108442-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 On Mon, Jun 20, 2022 at 02:00:18PM -0500, Linus Torvalds wrote: > Handling signals is the *default* behavior. It is only regular files > where that doesn't happen. This is not a regular file, and the "it's > about security" is not an argument. > > As mentioned, expecting an uninterruptible read is not "security". It's garbage. Indeed, practically speaking you are right. A few months back when I was fixing this to respect signals in the first place (because it used to be wrongly conditioned on need_resched()), I did some global code searches to see if I'd break anything, and basically it seemed like anything that used huge buffers handled EINTR, and only little buffers weren't filled iteratively. So PAGE_SIZE would seem to widely handle the real code out there. If this is to change as an API ease of use argument or something, I'd expect the behavior to change across devices (/dev/zero and such I mentioned earlier in mem.c), not just this one -- no need to be a special snowflake -- which means convincing people to change something pretty well established. Jason