From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 851AA357CF4 for ; Wed, 22 Jul 2026 13:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784727765; cv=none; b=LUFhtTZXAQgfQekmGP5o4qDk5KoVA9nnfHX3BcRFFZ0gQTnZ0Obcr6zxJ/sO7lqJF+XdTDhwTajFJieNLDa7u9728Q9eZfFIUa8+A9Z2aBUEmqx891t7vodNMDOKEidBefYY2QTzeZbO9LcT++XwqSGXUlmdso2L1ZqtTNZoXcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784727765; c=relaxed/simple; bh=4Ed3FEjfLXijc1yxxqYpI07on3pOxk69h5KyHejFQJw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qRaKEvXmAV+2n4XeJy/3ZkWhuSp/yC9qQaPR4Sy0Av2v4szbHlIWR8r6HqLaMIaUpOmMgWaC4PDDHmLiu//N1I+lKALIqPKy7pLxsu+sVLZWTTJLY9Yg7gqvmn4oZ/aKqTXmuujTF7zwdyTXBaldoC3i/qokxKKSc6ZBYWZkJic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=fAuQ0Sjg; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="fAuQ0Sjg" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-c9e7391839cso8180773a12.0 for ; Wed, 22 Jul 2026 06:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1784727762; x=1785332562; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=crZ98YrnqpB8dh6d/2NV8XT+VsDzcgb/h4PFQm4GzmE=; b=fAuQ0SjgGEzflEvVmT31aZ57Z0IZ4xVjKso+L+ulcIWts2Al/6Hu5A28ThiCeYYx3M mDOsGRilucUNjW6OGWImDwKYS6lG/Rj5tOKHra04WdoiHH9l4Pzuei/msEWzbuv48ID1 RJNEj9cw12isIyZ2jmXOeKl0OPSWAlExI8D5G5jCRnAm8+vGnVyW0M9XnjMRzPBHVK0L WdF33SIdor1wgNkS2E1ev+LEKe10nMnbQeoiU6qtsQIznPGwXLKqudU3cR89hWHttz6A g4k5ogWr/EbkkQ4sjHFdoZFJIi2lWH+4uvbpFWe0fHQ3aS9QpERRyAh3b28IpXA3ec+m SMmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784727762; x=1785332562; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=crZ98YrnqpB8dh6d/2NV8XT+VsDzcgb/h4PFQm4GzmE=; b=oagqppvyI89n6Eh3NcpKmugSug7JrKHNf3kRAcwR3Oac1J/XAPRvjUQjU0WRWQ+Fvv lA8Gk4LZy8D5CvA/qG88dXI6jf2E3ycdC9rJxjdgGOF/azQVnfB3xgsg6Z44vHM6cQV9 0abDp9kU/Qp/VIQak0T2Bgc+zPXXOx6G6Cv+cdQflD1voCfAkhTOt84Vuq4w1qpDanS/ QNHMAZQzeWfyr8MkOQ17hz9R5fKrG4i7sLlJivX5AVa17LGOoLYmr5+TfHWJsDHv9okH HKC7lm6yDA+PXlPwAx+Q77H6eBhPQUi1WBt81VUmJvr240445UipxLTfNZ8yDdyUqP5D EWaQ== X-Forwarded-Encrypted: i=1; AHgh+RpEqhEFwOKfoIexUSYm+BUpdHNALePBIi1Z5IRZKDN23PmhwAOtG7dzyl7kIZQHMA0akfIWHQDTAPxeF3w=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0LiZP/3BGsmlMjJHhGdQrcDTQ8ip3Rumxlcm77HnNcHRir7nU taR8RoDK60rZEib0AHboga4jdCmCo4wMdOnSq9ltlhk5KEjItXyQFev++0OpODmtIwk= X-Gm-Gg: AR+sD13JrcTp4ofSPLAH16CLQpdjDaryM22aN8vt/P5EuX0UuhuF67t4ngDL1WorpXs soyHvqeMrDB2diJ0dZY7dXWJdj/qc4pFoqGlVa+qBFt4n6K9KAzCOdA1IENEdz+7JscXzBY3R+1 MMiaTBB+TKEQh/Lz2gFviTzJx1Ky1b1iMB11WMnAfBCQbjWaOnoR3V79fAmiZpYxa8pwGbLi5w/ iLXYUMRhpAVHPcagvEnppwttBT4oZ9eKnSzvdXSh47P/SHwiP7p4FqCPL5iTVdrjuHTT05G4+10 rOi3FXnrMXYo793HK1v9bhdYqW08gOig7/cbyXVXc5Cii6c0s5ZhDfbx7XuTptYXV8/BGclrYtA cNokJrC/U+2+TItHCg6lS0zEbyokjwS8dKY04M91vGk7G+Qk3PYgEIvwWsUFTKSyf3/Ws0g== X-Received: by 2002:a05:6a21:510:b0:3c4:1916:9d40 with SMTP id adf61e73a8af0-3c419169f4fmr7786967637.12.1784727762450; Wed, 22 Jul 2026 06:42:42 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:44::]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbb8f0d872bsm1233076a12.7.2026.07.22.06.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 06:42:41 -0700 (PDT) Date: Wed, 22 Jul 2026 06:42:41 -0700 From: Joe Damato To: Breno Leitao Cc: sdf@fomichev.me, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Alexander Aring , Stefan Schmidt , Miquel Raynal , Remi Denis-Courmont , =?iso-8859-1?Q?R=E9mi?= Denis-Courmont , John Fastabend , Sabrina Dubroca , Shuah Khan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@meta.com, =?iso-8859-1?Q?R=E9mi?= Denis-Courmont Subject: Re: [PATCH net-next v2 0/7] net: convert rawv6, ieee802154, phonet and tls getsockopt to sockopt_t Message-ID: Mail-Followup-To: Joe Damato , Breno Leitao , sdf@fomichev.me, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Alexander Aring , Stefan Schmidt , Miquel Raynal , Remi Denis-Courmont , =?iso-8859-1?Q?R=E9mi?= Denis-Courmont , John Fastabend , Sabrina Dubroca , Shuah Khan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@meta.com, =?iso-8859-1?Q?R=E9mi?= Denis-Courmont References: <20260720-getsockopt_phase4-v2-0-8a08fcfa0d72@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260720-getsockopt_phase4-v2-0-8a08fcfa0d72@debian.org> On Mon, Jul 20, 2026 at 09:17:41AM -0700, Breno Leitao wrote: > Now that sockopt_init_user() was already merged, builds a user-backed > sockopt_t from the __user pair. A getsockopt leaf can then take > a sockopt_t behind a thin __user wrapper: the wrapper builds it, calls > the leaf, and writes the length back to optlen. The leaf copies with > copy_to_iter() instead of copy_to_user(). > > Convert four more leaves the way udp and raw already were: ipv6 raw > (do_rawv6_getsockopt), ieee802154 dgram, phonet pep, and tls > (do_tls_getsockopt and its per-option helpers). > > Converting phonet surfaced a pre-existing bug: pep_getsockopt() clamps the > length it reports but writes a full int with put_user(), overrunning an > optval buffer shorter than sizeof(int). It is fixed in its own patch, with > a Fixes: tag, before the phonet conversion, so it can be backported alone. > > The last patch adds getsockopt_iter selftest fixtures for rawv6, > ieee802154, phonet and tls, checking the returned length and errno across > exact, oversized and short buffers, an unknown optname and a bad level. > > For full motivation about these changes, please check the initial thread > at link > https://lore.kernel.org/all/20260401-getsockopt-v2-0-611df6771aff@debian.org/#t > > Signed-off-by: Breno Leitao > --- > Changes in v2: > - Replace min_t() by umin() (David) > - Link to v1: https://patch.msgid.link/20260716-getsockopt_phase4-v1-0-4f45cb12dce7@debian.org Other than the nit I mentioned about min vs min_t on the one patch, it looks good overall to me, so for the series: Reviewed-by: Joe Damato