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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECE81CCD1AB for ; Wed, 22 Oct 2025 14:24:23 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4csBHp1Yj2z30V7; Thu, 23 Oct 2025 01:24:22 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2001:8b0:10b:1236::1" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1761143062; cv=none; b=Zu7n+IMQr9IYQsK04AGdPf+Qyec01Jlza6JnwWsl4ZUawoS3jEzct0oHejh5wANc3dKE0x8JkyvIjMQfbo3uQGkKyASl6Cb4VXvXdYSXqSaaCeu4ZBUARWvMrk+QIe16wrY7NJTjZVYG23xxji55nABNK5yztwPr347xMn6TTxATwpuryZ+fgrxsVHEG3vA9Ovup9yWU+TVaOsWr/3PESYYzzWod6ZyR2XuG5YpTaTcBGK6fZZy0fOogXcRpkBtN1hlKNUsc4HMqQ++DnLJQvKVsZNv/MtH2EE0o7se/6HnG6M4PVCe+JKMoDDhvSmJYk1CJG0xa/vxcJcLOeBa2zQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1761143062; c=relaxed/relaxed; bh=dctXkstECTenaZhiUiTAEPs/+u3lBJ+4oLit/DWtNCs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E1Iv3/mZyZHdvgGg1cIL2ij0+ELOo4tb4tZd6KMwXJkt2apx2rAqCM2zWcsblm5aLBf4CEJ9Gl2T9UOFo5g7hTqB+4mZAsF5rzQ0L1fMioPX07ni6o2HJDXzRWil4cylWxhUAU1KSQ9c5VrhEcWWp9yS7sPJXBWXtPV8K8tFv6q7MzD0AsHk6sRZ9XkcOQhzjS43r8fFWCsQZNlMR3HvdBpp0r/BYm1XltfFs486mFjniZF6T3TJm8DRkFNWnZaJtBurjRhf6mw/Qh/crwSWdjKolu4hb2ENrCMKdeWPloI/jPeYRt2XB/QsT7NVL1AMickWQGY5wNqjsFdueiyShw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=W+uMC0i8; dkim-atps=neutral; spf=none (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=peterz@infradead.org; receiver=lists.ozlabs.org) smtp.mailfrom=infradead.org Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=W+uMC0i8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=peterz@infradead.org; receiver=lists.ozlabs.org) Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4csBHl2X2qz2xxS for ; Thu, 23 Oct 2025 01:24:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dctXkstECTenaZhiUiTAEPs/+u3lBJ+4oLit/DWtNCs=; b=W+uMC0i8lkaiKuhkl8eUM+csMP zH9Alfil/ggkWS+mff98nPo9bDIMkuW8K5C5+KY2e8934/ExnLSA4XSDvs16qF9TmynNu52oe7tVO alhtY8gr8526Ul/GMwiNjT57GxRn6C1/yPzHIibpvNmoPRJeplLP1368i919MkX3vMD0TfWO58XqB EaUXdGG6nfjfQNZR1hVFszBgQD2CFgdZfn+DgZnjBkiVlcKh5kkIe9C65p09XP2z5JubaB3DW+xwx QnSnO4coWaBJMspnjlZNpjlij/u6mnQPePfu4Nb2uYSAp9cc5ZSqjPHhLdI24izWy1wkOQRbI8Bdl /7A8lvtg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBZkt-00000007mfm-1HRN; Wed, 22 Oct 2025 14:24:00 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 542B830039F; Wed, 22 Oct 2025 16:23:59 +0200 (CEST) Date: Wed, 22 Oct 2025 16:23:59 +0200 From: Peter Zijlstra To: David Laight Cc: Thomas Gleixner , LKML , Christophe Leroy , Mathieu Desnoyers , Andrew Cooper , Linus Torvalds , kernel test robot , Russell King , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Heiko Carstens , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org, Julia Lawall , Nicolas Palix , Darren Hart , Davidlohr Bueso , =?iso-8859-1?Q?Andr=E9?= Almeida , Alexander Viro , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org Subject: Re: [patch V4 07/12] uaccess: Provide scoped user access regions Message-ID: <20251022142359.GQ4067720@noisy.programming.kicks-ass.net> References: <20251022102427.400699796@linutronix.de> <20251022103112.294959046@linutronix.de> <20251022152006.4d461c8b@pumpkin> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251022152006.4d461c8b@pumpkin> On Wed, Oct 22, 2025 at 03:20:06PM +0100, David Laight wrote: > I think that 'feature' should be marked as a 'bug', consider code like: > for (; len >= sizeof (*uaddr); uaddr++; len -= sizeof (*uaddr)) { > scoped_user_read_access(uaddr, Efault) { > int frag_len; > unsafe_get_user(frag_len, &uaddr->len, Efault); > if (!frag_len) > break; > ... > } > ... > } > All the scoped_* () things are for loops. break is a valid way to terminate them.