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: <ZBSeGjBEEzeBv35c@kroah.com>
Date:   Fri, 17 Mar 2023 18:06:34 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Rodolfo Giometti <giometti@...eenne.com>
Cc:     Alex Komrakov <alexander.komrakov@...adcom.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] pps: Add elapsed realtime timestamping

On Fri, Mar 17, 2023 at 05:34:28PM +0100, Rodolfo Giometti wrote:
> On 17/03/23 15:22, Greg KH wrote:
> > On Fri, Mar 17, 2023 at 03:04:31PM +0100, Rodolfo Giometti wrote:
> > > On 17/03/23 10:51, Alex Komrakov wrote:
> > > > > +     if (!(pps->info.mode & PPS_CAPTURECLEAR))
> > > > > +             return 0;   Why are you not returning an error?
> > > > [AK] I used the style in this file sysfs.c.
> > > >    assert_show() and clear_show()  have the same condition.
> > > > When '& PPS_CAPTURECLEAR' -- 0 means no interrupt asserted  and it is not error
> > > > Probably Rodolfo can get more info why return 0
> > > 
> > > It's just as Alex said, if the PPS source has no PPS_CAPTUREASSERT or
> > > PPS_CAPTURECLEAR mode it should not print ASSERT and CLEAR info.
> > 
> > But shouldn't you return an error instead of an empty string?
> 
> This is not an error... it's just a disabled capability. :)

Then maybe return "0" or something like that?

> > > > And why are these sysfs files even present if the mode is not set
> > > > properly?  Can the mode be set while the device is attached or is this
> > > > only defined at probe time?  If at probe time, just never create these
> > > > files.
> > > > [AK] we can understand mode is set when interrupts asserted and
> > > > file assert_elapsed will be updated.
> > > 
> > > PPS source's "mode bits" can be set at runtime via PPS_SETPARAMS.
> > 
> > Ok, that's good to know.  But I think the error return value is a better
> > indication that something went wrong here and this attribute does not
> > work for this device at this point in time.
> 
> I see... however I suppose several code relays on this behavior.

If that's the case, then you are right, you can't change it, and I'll
stop complaining here :)

What tools use these sysfs files?  How did you test your changes?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ