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 48F73EE49A4 for ; Tue, 22 Aug 2023 13:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235825AbjHVNuw convert rfc822-to-8bit (ORCPT ); Tue, 22 Aug 2023 09:50:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235657AbjHVNuw (ORCPT ); Tue, 22 Aug 2023 09:50:52 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E9D81A1 for ; Tue, 22 Aug 2023 06:50:49 -0700 (PDT) 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-162-8E3v38OlNGKU5le7b_tmJw-1; Tue, 22 Aug 2023 14:50:46 +0100 X-MC-Unique: 8E3v38OlNGKU5le7b_tmJw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 22 Aug 2023 14:50:45 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Tue, 22 Aug 2023 14:50:45 +0100 From: David Laight To: 'Breno Leitao' , Gabriel Krisman Bertazi CC: "sdf@google.com" , "axboe@kernel.dk" , "asml.silence@gmail.com" , "willemdebruijn.kernel@gmail.com" , "martin.lau@linux.dev" , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "io-uring@vger.kernel.org" , "kuba@kernel.org" , "pabeni@redhat.com" Subject: RE: [PATCH v3 8/9] io_uring/cmd: BPF hook for getsockopt cmd Thread-Topic: [PATCH v3 8/9] io_uring/cmd: BPF hook for getsockopt cmd Thread-Index: AQHZ1A/0EN7qKGB0O0aA2j2x1rbL4q/2UZaA Date: Tue, 22 Aug 2023 13:50:45 +0000 Message-ID: <687cf089ecc5451d9e398d71c9e171f0@AcuMS.aculab.com> References: <20230817145554.892543-1-leitao@debian.org> <20230817145554.892543-9-leitao@debian.org> <87pm3l32rk.fsf@suse.de> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org ... > Not really, sock->ops->getsockopt() does not suport sockptr_t, but > __user addresses, differently from setsockopt() > ... > int (*getsockopt)(struct socket *sock, int level, > int optname, char __user *optval, int __user *optlen); > > In order to be able to call sock->ops->getsockopt(), the callback > function will need to accepted sockptr. It is also worth looking at whether 'optlen' can be passed in as a numeric parameter and then returned on success. That would move the user copy into the syscall wrapper. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)