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-next>] [day] [month] [year] [list]
Message-ID: <cfa886ad-e3b7-c0d2-3ff8-58d94170eab5@ti.com>
Date:   Tue, 11 Feb 2020 12:23:59 +0200
From:   Grygorii Strashko <grygorii.strashko@...com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Petr Mladek <pmladek@...e.com>
CC:     <linux-rt-users@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        netdev <netdev@...r.kernel.org>,
        Richard Cochran <richardcochran@...il.com>
Subject: Question about kthread_mod_delayed_work() allowed context

Hi All,

I'd like to ask question about allowed calling context for kthread_mod_delayed_work().

The comment to kthread_mod_delayed_work() says:

  * This function is safe to call from any context including IRQ handler.
  * See __kthread_cancel_work() and kthread_delayed_work_timer_fn()
  * for details.
  */

But it has del_timer_sync() inside which seems can't be called from hard_irq context:
kthread_mod_delayed_work()
   |-__kthread_cancel_work()
      |- del_timer_sync()
	|- WARN_ON(in_irq() && !(timer->flags & TIMER_IRQSAFE));

My use case is related to PTP processing using PTP auxiliary worker:
(commit d9535cb7b760 ("ptp: introduce ptp auxiliary worker")):
  - periodic work A is started and res-schedules itself for every dtX
  - on IRQ - the work A need to be scheduled immediately

Any advice on how to proceed?
Can kthread_queue_work() be used even if there is delayed work is
scheduled already (in general, don't care if work A will be executed one
more time after timer expiration)?

-- 
Best regards,
grygorii

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ