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]
Date:   Fri, 8 Apr 2022 11:55:30 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, jstultz@...gle.com,
        Stephen Boyd <sboyd@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Guenter Roeck <linux@...ck-us.net>
Subject: Re: [RFC][PATCH] timers: Add del_time_free() to be called before
 freeing timers

On Fri, 08 Apr 2022 12:37:40 +0200
Thomas Gleixner <tglx@...utronix.de> wrote:

> +++ b/include/linux/timer.h
> @@ -183,12 +183,17 @@ extern int timer_reduce(struct timer_lis
>  extern void add_timer(struct timer_list *timer);
>  
>  extern int try_to_del_timer_sync(struct timer_list *timer);
> +extern int __del_timer_sync(struct timer_list *timer, bool free);

Do we really want to expose this to all the kernel?

That is, we do not need to make the static inlines in the header, but
instead do the split in the timer.c file. Not to mention, why have the
"free" parameter be created by the callers? It duplicates the work of
updating the second parameter around the kernel, instead of just in one
place.

One concern I have is that I wanted to keep the "free" version right next
to the del_timer() prototype. That way it becomes more visible to users and
they will be more likely to see it. I'm wondering if some of the issue
with not using del_timer_sync() is because it is not next to the other
prototypes, and people may have missed it.

>  
> -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)

Is the above not important for del_timer_sync() anymore?

Can we just have a del_timer_sync() prototype and not have this macro logic
anymore?

Anyway, I'll take this code and make my updates and send out a v2.

Thanks,

-- Steve

> -  extern int del_timer_sync(struct timer_list *timer);
> -#else
> -# define del_timer_sync(t)		del_timer(t)
> -#endif
> +static inline int del_timer_sync(struct timer_list *timer)
> +{
> +	return __del_timer_sync(timer, false);
> +}
> +
> +static inline int del_timer_sync_free(struct timer_list *timer)
> +{
> +	return __del_timer_sync(timer, true);
> +}
>  
>  #define del_singleshot_timer_sync(t) del_timer_sync(t)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ