Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3294581lfo; Mon, 23 May 2022 00:57:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUvwIB4ZOUjcWMSDtOy78TulEBWHdXx/fdh0gwlBrjsJxtpyXgP+VDPByOObcTSUVGJtlI X-Received: by 2002:a17:902:c2c1:b0:161:c6af:278e with SMTP id c1-20020a170902c2c100b00161c6af278emr22039305pla.151.1653292621008; Mon, 23 May 2022 00:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653292621; cv=none; d=google.com; s=arc-20160816; b=UhZjSe0EFJKG0okRP3z8QNJ1WVLlJESnRz/nReSsRxZS6zrhBYLwulReHcQc6ZgdEg PQd5BtQhqcxkQOtIidQ3rbQGiiaNrDC2eQl6K44wS0ZYok4j2VofGudfgdDDs6AwhTbh OMWxALPMhbLOGtXLgf1C0YGgJMNSo/aHRaVCzehfXXWqe3pK2F7Ui+TcGIMDhBIH5tAf Tk/6CugTeIwoUWRJ1W7XznnETDutkF6iprejG1OrOC7kLpSEwyKfwt3YRr33gMdLlJyy 7H6DlB6XgUKeW2H0+fckEHhyU6bdL/rH+WgsSoDDAg8hRWDhPOfGvgsMAoR5LxujIU/U Tsog== 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=hmADdHULjYqs4wkpWmCIgpha8mSnfTgSG1iLN/3rKFQ=; b=SlrxmpZkuwEg9bTNMjP9eZyor1tzd8lkVD7kXYTnorvjZMLeCDCm/ElVBrSIpLC/+2 0Cpveh5H1kMtebtcMX/8fZWoXlu9BOPTXOcYDpjLYUklREyTcc8EdIucRu9CMAAXGBwt E44bb+28blHn0dt2GOhzadpSVhDcnZCcHfR2uUaYKBbvQM4cxMX/JBx8b7hXLBslHOR2 uYsJ27EDqwwmabOxF85x0FupxPER+wm2owuv+EPMD8ltvSF4hzCKiY4rShem/7iBfrP6 46lp4qV0VPTRzdCJPLi6zoTgXCTeYoEg2qWTd9Bz86rbmamE6zGnczUou0HdVHouPp3p gTAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=UyXaa50y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t6-20020a170902bc4600b0015d00299840si8626184plz.592.2022.05.23.00.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:57:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=UyXaa50y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5FD021E34; Sun, 22 May 2022 23:57:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244593AbiESUGh (ORCPT + 99 others); Thu, 19 May 2022 16:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239198AbiESUGe (ORCPT ); Thu, 19 May 2022 16:06:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8683464BFD for ; Thu, 19 May 2022 13:06:31 -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 021FF61C33 for ; Thu, 19 May 2022 20:06:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBE78C385AA; Thu, 19 May 2022 20:06:29 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="UyXaa50y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1652990788; 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=hmADdHULjYqs4wkpWmCIgpha8mSnfTgSG1iLN/3rKFQ=; b=UyXaa50y21jgqcK7zgu6xHZsaJ646nk3IdZMvdNxslgWRs6WiulpdjTMp+4rsk/vDCqBx2 hwEirvT/5rfpNseXzX1bv4cvLO3PAbIUHYGyccFmyIrZQfsB66F0+7BEfyXLHdlSnzuoqp CgLHWbjYAI8osAx7NR09b09lakbik+Y= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id cf4f919a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 19 May 2022 20:06:27 +0000 (UTC) Date: Thu, 19 May 2022 22:05:29 +0200 From: "Jason A. Donenfeld" To: Jens Axboe Cc: tytso@mit.edu, hch@lst.de, linux-kernel@vger.kernel.org Subject: Re: [PATCHSET 0/2] Fix splice from random/urandom Message-ID: References: <20220519193133.194138-1-axboe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220519193133.194138-1-axboe@kernel.dk> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Jens, On Thu, May 19, 2022 at 01:31:31PM -0600, Jens Axboe wrote: > Hi, > > We recently had a failure on a kernel upgrade because splice no longer > works on random/urandom. This is due to: > > 6e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Thanks for this. I'd noticed this a few months ago and assumed it has just always been that way, and hadn't gotten to looking at what was up. I'll take a look at these patches in detail when I'm home in a few hours, but one thing maybe you can answer more easily than my digging is: There's a lot of attention in random.c devoted to not leaving any output around on the stack or in stray buffers. The explicit use of copy_to_user() makes it clear that the output isn't being copied anywhere other than what's the user's responsibility to cleanup. I'm wondering if the switch to copy_to_iter() introduces any buffering or gotchas that you might be aware of. Also you may need to rebase this on the random.git tree at https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git Regards, Jason