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] [day] [month] [year] [list]
Message-ID: <CACT4oudV-rA0ViZy5tWkvTufYji3bZzUyXcU0tTB67GjsvcvFw@mail.gmail.com>
Date:   Fri, 3 Feb 2023 17:04:53 +0100
From:   Íñigo Huguet <ihuguet@...hat.com>
To:     Richard Cochran <richardcochran@...il.com>
Cc:     Miroslav Lichvar <mlichvar@...hat.com>, netdev@...r.kernel.org,
        yangbo.lu@....com, gerhard@...leder-embedded.com,
        habetsm.xilinx@...il.com, ecree.xilinx@...il.com,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, alex.maftei@....com,
        Jacob Keller <jacob.e.keller@...el.com>
Subject: Re: PTP vclock: BUG: scheduling while atomic

On Fri, Feb 3, 2023 at 1:10 AM Richard Cochran <richardcochran@...il.com> wrote:
>
> On Thu, Feb 02, 2023 at 05:33:15PM +0100, Miroslav Lichvar wrote:
> > On Thu, Feb 02, 2023 at 05:02:07PM +0100, Íñigo Huguet wrote:
> > > Our QA team was testing PTP vclocks, and they've found this error with sfc NIC/driver:
> > >   BUG: scheduling while atomic: ptp5/25223/0x00000002
> > >
> > > The reason seems to be that vclocks disable interrupts with `spin_lock_irqsave` in
> > > `ptp_vclock_gettime`, and then read the timecounter, which in turns ends calling to
> > > the driver's `gettime64` callback.
> >
> > The same issue was observed with the ice driver:
> > https://lists.osuosl.org/pipermail/intel-wired-lan/Week-of-Mon-20221107/030633.html
> >
> > I tried to fix it generally in the vclock support, but was not
> > successful. There was a hint it would be fixed in the driver. I'm not
> > sure what is the best approach here.
>
> Can ptp_vclock_gettime use a mutex instead?

I don't see any place where these vclock functions are called in
atomic context, so it might be possible, but there are many callback
indirections and I'm not sure if I might have missed any.

>
> Thanks,
> Richard
>


-- 
Íñigo Huguet

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ