Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp247213lqt; Thu, 6 Jun 2024 02:19:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8ciqQ/BJmaN7p9SAWnZn2WmyqaMNABbrw4AFbx0Ej/kVZqtvR36hdn2zRXubu/+SjoEElcbGYOcYSD5nCaq6cakgyEmTPT9u2po95uA== X-Google-Smtp-Source: AGHT+IFIUKcomczQBRz+LiKt10tbAxwkW5CppSASMbg84RGJW9OVGWhRhN4iiW01iBbJL9AIAfkc X-Received: by 2002:a05:620a:5801:b0:795:2307:97ec with SMTP id af79cd13be357-79523fbf13amr482710085a.56.1717665566414; Thu, 06 Jun 2024 02:19:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717665565; cv=pass; d=google.com; s=arc-20160816; b=Etcd4ryrLOHFS6gWlJoU3EfdXB521+4Je0YCwpJ3hbxMZTALLJ1Cb4k0dUO7QX4uDm 7oqBTk53yIhNrrK+uCtQGeZl9aZ6A9elfYPI2T6uOqqfEyHya0mN/XgF+b4M61UCZlR0 mb3JiKsW0Kp56E62azQU93sv0gT2NxRm5BGgyRGDY7SMGe6IonpehixOpLpl75tgZ8aK FXd3Tyj37YdlHyCNT8VpLQpfoOKoHD2TE1rp7H6MbsRHztx26eey1mkCvImU/N/q2uIE xDZ5K0XKzCC4te1jpKRlOTH6+s8XreN+GZ9jDWy44lRUiGpwTbKrQLlaZn7pRUJGbCsO tllA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=TyzarcjBrMym8T5g/oNt6NbYvJXKvgmRE0aRSsJwYIE=; fh=uK2z17oluc7BesR2lqkhz3j8Js8dm4VykjnsKb827w0=; b=OEuOFNKQG8W0sDc9aiBmwBBWSN8dY//CKDudCCRH0e4KbUB3gt91SQxZMCg7IXZRb9 KP75//i/sUlmVIEA+JhYVJ0nO7MnRVb1S/BhsbmKeIrEra7qgTqC0ecZaoj4OrDFLkRp YT88WuAtzGQwlbcd/l3mdp/gXkv9iRdwirVONhGeYVTcVwlh7PaLUTiMCok0JW7H4Z+E fdJMEjR0BUkQaADJCQh07nc4/BkdFoBKlqgXuBd4+2AOyjITvaf6ZsDPUUhhMk62uQxM Fyu3QIJgPu6Wb1xwjEKFSL1/0hDrGnz+kjDGllVX9DxjZb5nL8yzkviqculQ4xeyPp4q a+9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tn7E70ki; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-203967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7953333b681si97489685a.559.2024.06.06.02.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tn7E70ki; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-203967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 05D361C22B22 for ; Thu, 6 Jun 2024 09:19:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6FA31667F6; Thu, 6 Jun 2024 09:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Tn7E70ki" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0AB7015E5AE for ; Thu, 6 Jun 2024 09:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665295; cv=none; b=ZMl4zFc84VdDkbQfck4ZYpapViX3PYAMQkKCzLUXgkfRa+wjgicD1aLC+g7CVzNv/6s+vrW+nxuiZtlyep5sy0Ub/fR6ptjZNGC7BxsHwwBN+oVHVJNDJoyoQZeqcw1vUKfxvBbqO2Hy0QoTs2R0ZQMrNAg1rrzvdHJcpT7JxZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665295; c=relaxed/simple; bh=uHwI8RjIUSzq/5Y1r3oM5+yIohYnXgOarzdl1SHRFQo=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=c/NdXVEYrPSaKWnkEYz6stO8vFIA8fUjsScn3RzeLVRZErX3XFe0Zd8gSH62h7vzekhzdpUBUu2meqWC52y79RuQ2uwyBTsTVKVBD11vMhzzEPPAevHCI569Onq4Nh0611IGsRTeTcBPdg4t+J44xMolpmcgvUQ8LJQwsZGx9kw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Tn7E70ki; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717665293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=TyzarcjBrMym8T5g/oNt6NbYvJXKvgmRE0aRSsJwYIE=; b=Tn7E70kiEP+fN5JU416IONrM5hDkGrXMSpydDZOeO8rS8XMoc9SqHCzauPhJSQOqEugB0r azpJmNt6N0Na3ITKY+yF8TOWoPI7oDPYkvQDNoczTTmPCVGvQCbqTsWMs3NCgQo5thmhee X7k7z+7zCnUM/CQsjafmrli5WyBTSqQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-AszhPrrDOzOrLgsBWECwww-1; Thu, 06 Jun 2024 05:14:51 -0400 X-MC-Unique: AszhPrrDOzOrLgsBWECwww-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-35dceeb18c9so117802f8f.0 for ; Thu, 06 Jun 2024 02:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717665290; x=1718270090; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TyzarcjBrMym8T5g/oNt6NbYvJXKvgmRE0aRSsJwYIE=; b=B6s20YMjm/QHGuYnbVnciUiRI6dvVkdnkF8w1zHDCOu7JdK1BQDdrj0Ixk604YTT9Q 27XN01LJ11KSNfoHPlyKvtGRxomugvsRkfbOhevlYslt/8gnLYo/JpaH1BfYLbiFr+2R d+h6XAYrmw27s+cTKBGyupsdLh9NWc9tz4PMz6q7NBSyu9mhJZVCv5GOeDXNQ06U91Zj f8ROOwKHQXQjGtQkl9iSoI8rdubU1s5oqDGtVhggYgoa1MabFL3mz9aTqOhmyMyCr1/o jlEy5sQbXXKBv9RWKKZ7Gd6q5fDlFMWlCIcDOybasoR5vaWw3cUIBReR5nfj8YG3WOjb f+aw== X-Forwarded-Encrypted: i=1; AJvYcCVnRx4PaCKdB59dIO5KIHY/E+KCEkzUltGr+ZIjiQYrsjfj1NvM6GzajTsVE+9l8WgqH8ow0DCOGw+xyfkqwI6/vj06q++CgpXzPpqH X-Gm-Message-State: AOJu0Yw8glh9qE14HGyLz8ouGukR4WrUUGCjpjdW6HdiU0F/jvccL2u5 mxekWVkoF8czAOPeYhAmDjlE+GTnwk5YDk0eC9p6Bc0qw3T+8u6iM52IozD01JRD0wHXMyGYQcH VFIR6wa3QTbbh4CW5UtZGd6+zZiCfcjtXg2twd700YFnMH9jGpkGctk4nOreRdw== X-Received: by 2002:a05:600c:510d:b0:421:2918:3d9a with SMTP id 5b1f17b1804b1-42156256c0amr37534445e9.0.1717665289903; Thu, 06 Jun 2024 02:14:49 -0700 (PDT) X-Received: by 2002:a05:600c:510d:b0:421:2918:3d9a with SMTP id 5b1f17b1804b1-42156256c0amr37534075e9.0.1717665289504; Thu, 06 Jun 2024 02:14:49 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3344:1b74:3a10::f71]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f6c0sm48320855e9.46.2024.06.06.02.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:14:49 -0700 (PDT) Message-ID: <8b5e1ffe0bc5a9e03c622166f4d5d26c5c6ce9b5.camel@redhat.com> Subject: Re: [PATCH net-next v14 07/14] net: Add struct kernel_ethtool_ts_info From: Paolo Abeni To: Kory Maincent , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier , Rahul Rameshbabu , Alexandra Winter Date: Thu, 06 Jun 2024 11:14:47 +0200 In-Reply-To: <20240604-feature_ptp_netnext-v14-7-77b6f6efea40@bootlin.com> References: <20240604-feature_ptp_netnext-v14-0-77b6f6efea40@bootlin.com> <20240604-feature_ptp_netnext-v14-7-77b6f6efea40@bootlin.com> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w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jNRSiymIw9/neTvUT8VJJhzRl3Nb/EmO/qeahfiG7zTpqSn2dEl+AwbcwQrbAhTPzuHIcoLZYV0xDWzAibUnn7pSrQKja+b8kHD9WF+m7dPlRVY7soqEYXylyCOXr5516upH8vVBmqweCIxXSWqPAhQq8d3hB/Ww2A0H0PBTN1REVw8pRLNApEA7C2nX6RW0XmA53PIQvAP0EAakWsqHoKZ5WdpeOcH9iVlUQhRgemQSkhfNaP9LqR1XKujlTuUTpoyT3xwAzkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2024-06-04 at 12:39 +0200, Kory Maincent wrote: > @@ -2443,13 +2444,20 @@ static int ethtool_get_dump_data(struct net_devic= e *dev, > =20 > static int ethtool_get_ts_info(struct net_device *dev, void __user *user= addr) > { > + struct kernel_ethtool_ts_info kernel_info; > struct ethtool_ts_info info; > int err; > =20 > - err =3D __ethtool_get_ts_info(dev, &info); > + err =3D __ethtool_get_ts_info(dev, &kernel_info); > if (err) > return err; > =20 > + info.cmd =3D kernel_info.cmd; > + info.so_timestamping =3D kernel_info.so_timestamping; > + info.phc_index =3D kernel_info.phc_index; > + info.tx_types =3D kernel_info.tx_types; > + info.rx_filters =3D kernel_info.rx_filters; It looks like 'info' is not zeroed anymore... > + > if (copy_to_user(useraddr, &info, sizeof(info))) > return -EFAULT; ... so this risk exposing to user-space unintialized kernel memory Cheers, Paolo