Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp292591rdb; Sat, 27 Jan 2024 06:52:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtY+6I8o98Gz0v0gx4gdvNVyjc1vhwRx90D2lm+VZd8cTtp5zr/7XIvL/qJEH58coYtU5d X-Received: by 2002:a05:6a21:7892:b0:19c:6a60:b433 with SMTP id bf18-20020a056a21789200b0019c6a60b433mr944768pzc.3.1706367160559; Sat, 27 Jan 2024 06:52:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706367160; cv=pass; d=google.com; s=arc-20160816; b=FHh7dyUW7mQTyrztaU8xS4oUPFo3//RQpto/hkkQ1Pd6QhOTZbITRnu1gjFwsl6SbB obJ0+/nIOI0DzwBQ1gpLUtemgRuQ0KIqTmchvQCKbuXaRgmUl2EHs/mST71hG+rNcPp0 pNvj3ZbXzmu2a3feQcxC+ZL+koL8d4m1XnIRm10YM7awTNMJbBMS2ohv74gos87AwYg0 FNPO+lNOV1RGWvvnCe31/h7DngwxZ0qZcHFe8StbatB4/+7AOJY3Im1415uWqTw7wtKf xEDzKsabZELrsX4GDRzPMjWn+KathWQdnVxSNDx4HJxiWwntIm9puaC0aOhT9tLGVL9F vBIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=6F3GVkmNQ0+WFReiuFS+taqj8xQl5e3HR13KdIoqD6U=; fh=HkHdyF1ENw6gGzR/p2dq2P1Rsifx2pE5V6Uf/cDUI4I=; b=LSfWnk+KQbwowB9/utBkR2nmqnAHJplbwjD8PpQaDWttNDD5K9c6Lr3og0NlcH2O6o geXDY2UBl76v9ZzxHCcl7l8TAnIpzrJnx3K36b9J8pjuzoAz7oMp1hk0gRuBDfouBvC/ wW5AqMrRQcB+E0TzmME3LOcIsoofpWoi291PqaOxoqw8mAyk2nwmfuZNweYRFmDFT7iT FuLPy3W4pdkDmu7MpIVRUjuPZ5kY18OtdomMX0GQWe4uM9tl1lEC+BnP2/3t1iqI+Cc9 /NQrR7ICzbJsc+i83QJyVSL/z5AJVrK/uDKqP2JK8JVb60roq26J2l+hQJcYHzoC9Dbf jOkQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-41230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n32-20020a635c60000000b005ce172ef504si2766433pgm.36.2024.01.27.06.52.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 06:52:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-41230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 77A2CB21BE4 for ; Sat, 27 Jan 2024 14:52:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5278A28DDA; Sat, 27 Jan 2024 14:52:24 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DA71288A7 for ; Sat, 27 Jan 2024 14:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706367143; cv=none; b=FGYB08sCjxMnvMKY98gyRZZ7D1K1uEfKqVU8F/0SCtBgFHemPw5vwdCTN4oNUAB8C7z7n9uLH9n/gPiChBl7ieJCKryi3S0eew7ADh5Nghmsx5LBkMde15ermX2fjsjjEjMqHwpz0Cj1YWWkxKqsL0WMIlb5yO6wM9uwswtM/No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706367143; c=relaxed/simple; bh=Be/y4DGVPbfmx4K3rGTzJCiIH9BNVn8X6ivVn+mUvI0=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=SyXuY1k30R823C+Caa8YBjk1bplTO0umiFQ/djAaLGhhgrUij8QoXa6pFOgy/hmekI/I4wzCL/lFhf1JEkg9hRuG3e7l+pvX7f8UaF+sjANjBshY8uSRtooXbzMk/hGc1brCi8UlZQ96pnQoOLslwXUgsyjODis+m5UvEgTayEk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.86.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-89-lY5SiMHAMkCe7VPZSgwSoQ-1; Sat, 27 Jan 2024 14:52:18 +0000 X-MC-Unique: lY5SiMHAMkCe7VPZSgwSoQ-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 27 Jan 2024 14:51:58 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sat, 27 Jan 2024 14:51:58 +0000 From: David Laight To: 'Arnd Bergmann' , Joe Damato , "Greg Kroah-Hartman" CC: "linux-kernel@vger.kernel.org" , Netdev , Chuck Lever , Jeff Layton , "linux-api@vger.kernel.org" , Christian Brauner , "Eric Dumazet" , "David S . Miller" , "alexander.duyck@gmail.com" , Sridhar Samudrala , Jakub Kicinski , "Willem de Bruijn" , "weiwan@google.com" , Jonathan Corbet , Alexander Viro , Jan Kara , Michael Ellerman , Nathan Lynch , Steve French , Thomas Zimmermann , Jiri Slaby , Julien Panis , Andrew Waterman , Thomas Huth , Palmer Dabbelt , "open list:DOCUMENTATION" , "open list:FILESYSTEMS (VFS and infrastructure)" Subject: RE: [PATCH net-next v3 3/3] eventpoll: Add epoll ioctl for epoll_params Thread-Topic: [PATCH net-next v3 3/3] eventpoll: Add epoll ioctl for epoll_params Thread-Index: AQHaUCR+m5BGvEW2OU6rGFqZjiahCbDtv1nw Date: Sat, 27 Jan 2024 14:51:58 +0000 Message-ID: References: <20240125225704.12781-1-jdamato@fastly.com> <20240125225704.12781-4-jdamato@fastly.com> <2024012551-anyone-demeaning-867b@gregkh> <20240126001128.GC1987@fastly.com> <2024012525-outdoors-district-2660@gregkh> <20240126023630.GA1235@fastly.com> <57b62135-2159-493d-a6bb-47d5be55154a@app.fastmail.com> In-Reply-To: <57b62135-2159-493d-a6bb-47d5be55154a@app.fastmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Arnd Bergmann > Sent: 26 January 2024 06:16 >=20 > On Fri, Jan 26, 2024, at 03:36, Joe Damato wrote: > > On Thu, Jan 25, 2024 at 04:23:58PM -0800, Greg Kroah-Hartman wrote: > >> On Thu, Jan 25, 2024 at 04:11:28PM -0800, Joe Damato wrote: > >> > On Thu, Jan 25, 2024 at 03:21:46PM -0800, Greg Kroah-Hartman wrote: > >> > > On Thu, Jan 25, 2024 at 10:56:59PM +0000, Joe Damato wrote: > >> > > > +struct epoll_params { > >> > > > +=09u64 busy_poll_usecs; > >> > > > +=09u16 busy_poll_budget; > >> > > > + > >> > > > +=09/* for future fields */ > >> > > > +=09u8 data[118]; > >> > > > +} EPOLL_PACKED; > >> > > > > > > Sure, that makes sense to me. I'll remove it in the v4 alongside the ot= her > > changes you've requested. > > > > Thanks for your time and patience reviewing my code. I greatly apprecia= te > > your helpful comments and feedback. >=20 > Note that you should still pad the structure to its normal > alignment. On non-x86 targets this would currently mean a > multiple of 64 bits. >=20 > I would suggest dropping the EPOLL_PACKED here entirely and > just using a fully aligned structure on all architectures, like >=20 > struct epoll_params { > __aligned_u64 busy_poll_usecs; > __u16 busy_poll_budget; > __u8 __pad[6]; > }; >=20 > The explicit padding can help avoid leaking stack data when > a structure is copied back from kernel to userspace, so I would > just always use it in ioctl data structures. Or just use 32bit types for both fields. Both values need erroring before they get that large. 32bit of usec is about 20 seconds. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)