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: <ZVWFWh_HL_wzYyd1@mtj.duckdns.org>
Date:   Wed, 15 Nov 2023 16:58:34 -1000
From:   Tejun Heo <tj@...nel.org>
To:     huangzaiyang <huangzaiyang@...o.com>
Cc:     jiangshanlai@...il.com, linux-kernel@...r.kernel.org,
        ZaiYang Huang <hzy0719@....com>
Subject: Re: [PATCH] workqueue: Make a warning when a pending delay work
 being re-init

Hello,

On Wed, Nov 15, 2023 at 07:34:27PM +0800, huangzaiyang wrote:
> @@ -310,6 +326,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
> 
>  #define __INIT_DELAYED_WORK(_work, _func, _tflags)                     \
>         do {                                                            \
> +               WARN_ON(delayed_work_pending(_work));                   \
>                 INIT_WORK(&(_work)->work, (_func));                     \
>                 __init_timer(&(_work)->timer,                           \
>                              delayed_work_timer_fn,                     \

As pointed out by others, as we don't know what's in the memory, this
wouldn't really work. This kind of bugs should be caught by
DEBUG_OBJECTS_WORK / DEBUG_OBJECTS_TIMERS, I think. It's not perfect as
those aren't usually turned on but catching this sort of errors does need
tracking some information out of band.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ