From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2B43C433F5 for ; Fri, 20 May 2022 03:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345144AbiETDbr (ORCPT ); Thu, 19 May 2022 23:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344901AbiETDbn (ORCPT ); Thu, 19 May 2022 23:31:43 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B6257B28 for ; Thu, 19 May 2022 20:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wHef6Z3MEY5uLblxjBwpzUeUe+sPUOyaDIdO+GUS+wY=; b=TmGiw23nicyT2P87FuBkBrGDth AcURHnVmtwfvyAHpc8zwxmSSPWAwwmunJdnYkmrkcgE3rjyyhn7xfglNY3nGkwRhpp6+ulloeo/yH /okWjmfkP/VfFfWGwpzv9FzxQ+/GFjQgFZJQ8MAFQPq0/Vvu2NO78VdfFMo0t29yRSJgVZyvJETO6 xVF117u4pFuWduLiV6dtjt5BQyfGcNgnuL63gdA6ZJNZgsk/G2TIiiUZrhsxSVzYQ/cw3l96P9ZiX HGVFvTEGPGS1FVf4GPHQ/MiZjdQIrT6SIy6srfGij07BIJEl40dm4R2JGLgHIk6luBgKeFZTDl9Nl O+tdatTA==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrtMa-00GUId-SQ; Fri, 20 May 2022 03:31:40 +0000 Date: Fri, 20 May 2022 03:31:40 +0000 From: Al Viro To: Jens Axboe Cc: "Jason A. Donenfeld" , LKML Subject: Re: [PATCH] random: convert to using fops->write_iter() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2022 at 09:25:30PM -0600, Jens Axboe wrote: > > Feed it a buffer with only 1 byte mapped, watch it'll pass to mix_pool_bytes(). > > And see how much of 'block' has been used uninitialized... > > I don't follow? Buffer with 1 byte, iter setup with 1 byte. We copy 1 byte, > and we pass 1 byte to mix_pool_bytes(). What am I missing? "only 1 byte mapped" != "len is 1"... Anonymous mmap() of 2*PAGE_SIZE, munmap() the second half, ask that sucker to write PAGE_SIZE from buffer + PAGE_SIZE - 1...