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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 31 Jul 2021 14:05:56 +0800
From:   Kent Gibson <warthog618@...il.com>
To:     Dipen Patel <dipenp@...dia.com>
Cc:     thierry.reding@...il.com, jonathanh@...dia.com,
        linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-gpio@...r.kernel.org, linus.walleij@...aro.org,
        bgolaszewski@...libre.com, devicetree@...r.kernel.org,
        linux-doc@...r.kernel.org, robh+dt@...nel.org,
        andriy.shevchenko@...ux.intel.com
Subject: Re: [RFC 08/11] gpiolib: cdev: Add hardware timestamp clock type

On Thu, Jul 29, 2021 at 08:07:15PM -0700, Dipen Patel wrote:
> 
> On 7/1/21 7:24 AM, Kent Gibson wrote:

<snip>
> >
> >>  			ret = gpiod_direction_output(desc, val);
> >>  			if (ret)
> >>  				return ret;
> >> @@ -1152,6 +1186,13 @@ static long linereq_set_config_unlocked(struct linereq *lr,
> >>  					polarity_change);
> >>  			if (ret)
> >>  				return ret;
> >> +
> >> +			/* Check if new config sets hardware assisted clock */
> >> +			if (flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE) {
> >> +				ret = gpiod_hw_timestamp_control(desc, true);
> >> +				if (ret)
> >> +					return ret;
> >> +			}
> >>  		}
> >>  
> > The error code here can come from the pinctrl timestamp_control(), so it
> > should be sanitised before being returned to userspace.
> 
> I do not understand what do you mean by sanitise. I just followed what
> 
> gpiod_direction_output did just above which also returns ret from gpio
> 
> driver code similar to timestamp_control API.
> 

In this context, sanitise means convert any kernel internal error codes
to their userspace equivalent before returning them to userspace.

Fair enough with the gpiod_direction_output() comparison.  I was thinking
of a patch Andy recently submitted[1] to sanitise gpiod_request(), which
can sometimes return EPROBE_DEFER.  But I guess we can wait until we find
a case of a driver returning an internal error code and add a sanitiser
then.

Cheers,
Kent.

[1] https://www.spinics.net/lists/linux-gpio/msg60998.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ