lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEj4Fp05_lTdMgu3@hoboy.vegasvil.org>
Date: Tue, 10 Jun 2025 20:29:26 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Carolina Jubran <cjubran@...dia.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
	Bar Shapira <bshapira@...dia.com>,
	Maciek Machnikowski <maciejm@...dia.com>,
	Wojtek Wasko <wwasko@...dia.com>,
	Vinicius Costa Gomes <vinicius.gomes@...el.com>,
	Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
	Mahesh Bandewar <maheshb@...gle.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] ptp: extend offset ioctls to expose raw free-running
 cycles

On Tue, Jun 10, 2025 at 08:19:05PM +0300, Carolina Jubran wrote:

> @@ -398,8 +423,14 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
>  			break;
>  		}
>  		sts.clockid = extoff->clockid;
> +		cycles = !!(extoff->rsv[0] & PTP_OFFSET_CYCLES);
>  		for (i = 0; i < extoff->n_samples; i++) {
> -			err = ptp->info->gettimex64(ptp->info, &ts, &sts);
> +			if (cycles)
> +				err = ptp->info->getcyclesx64(ptp->info, &ts,
> +							      &sts);
> +			else
> +				err = ptp->info->gettimex64(ptp->info, &ts,
> +							    &sts);

ugh...

> @@ -86,9 +111,15 @@
>   *
>   */
>  struct ptp_clock_time {
> -	__s64 sec;  /* seconds */
> -	__u32 nsec; /* nanoseconds */
> -	__u32 reserved;
> +	union {
> +		struct {
> +			__s64 sec;  /* seconds */
> +			__u32 nsec; /* nanoseconds */
> +			__u32 reserved;
> +		};
> +		__u64 cycles;
> +	};
> +
>  };

This overloading of an ioctl with even more flags goes too far.
Why not just add a new ioctl in a clean way?

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ