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: <87imgsuxs4.fsf@nanos.tec.linutronix.de>
Date:   Tue, 19 May 2020 10:36:11 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Xianting Tian <xianting_tian@....com>, john.stultz@...aro.org,
        sboyd@...nel.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timers: Use set_current_state macro

Xianting Tian <xianting_tian@....com> writes:
> Use set_current_state macro instead of current->state = TASK_RUNNING
>
> Signed-off-by: Xianting Tian <xianting_tian@....com>
> ---
>  kernel/time/timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 4820823..b9ecf87 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1882,7 +1882,7 @@ signed long __sched schedule_timeout(signed long timeout)
>  			printk(KERN_ERR "schedule_timeout: wrong timeout "
>  				"value %lx\n", timeout);
>  			dump_stack();
> -			current->state = TASK_RUNNING;
> +			set_current_state(TASK_RUNNING);

This is still wrong. Again:

   "That's not the same and adds a barrier which is not needed.

    Not a big problem in that particular error handling code path, but in
    general you really have to look whether your replacement is resulting in
    the same code.

    If not then you need to make an argument in the changelog why you are
    replacing existing code with something which is not fully equivalent.

    For this particular case, please check the implementation and read the
    documentation of set_current_state() in include/linux/sched.h."

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ