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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o9p6juwm.fsf@concordia.ellerman.id.au>
Date:   Tue, 17 Oct 2017 14:49:29 +1100
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Kees Cook <keescook@...omium.org>
Cc:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Nicholas Piggin <npiggin@...il.com>,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()

Kees Cook <keescook@...omium.org> writes:

> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Nicholas Piggin <npiggin@...il.com>
> Cc: linuxppc-dev@...ts.ozlabs.org
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
>  arch/powerpc/kernel/watchdog.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
> index 15e209a37c2d..50797528b5e1 100644
> --- a/arch/powerpc/kernel/watchdog.c
> +++ b/arch/powerpc/kernel/watchdog.c
> @@ -263,9 +263,8 @@ static void wd_timer_reset(unsigned int cpu, struct timer_list *t)
>  	add_timer_on(t, cpu);
>  }
>  
> -static void wd_timer_fn(unsigned long data)
> +static void wd_timer_fn(struct timer_list *t)

At first glance this looks like it will break, changing the signature,
but the new timer_setup() force-casts to the old signature (for now),
and we can fit a pointer in an unsigned long so it's OK.

>  {
> -	struct timer_list *t = this_cpu_ptr(&wd_timer);
>  	int cpu = smp_processor_id();
>  
>  	watchdog_timer_interrupt(cpu);
> @@ -292,7 +291,7 @@ static void start_watchdog_timer_on(unsigned int cpu)
>  
>  	per_cpu(wd_timer_tb, cpu) = get_tb();
>  
> -	setup_pinned_timer(t, wd_timer_fn, 0);
> +	timer_setup(t, wd_timer_fn, TIMER_PINNED);
>  	wd_timer_reset(cpu, t);
>  }
>  

Acked-by: Michael Ellerman <mpe@...erman.id.au>

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ