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: <Y7VixOou0y+VPIXS@FVFF77S0Q05N>
Date:   Wed, 4 Jan 2023 11:28:04 +0000
From:   Mark Rutland <mark.rutland@....com>
To:     Yann Sionneau <ysionneau@...ray.eu>
Cc:     linux-kernel@...r.kernel.org,
        Clement Leger <clement.leger@...tlin.com>,
        Jules Maselbas <jmaselbas@...ray.eu>,
        Julian Vetter <jvetter@...ray.eu>
Subject: Re: [RFC PATCH 13/25] kvx: Add signal handling support

On Tue, Jan 03, 2023 at 05:43:47PM +0100, Yann Sionneau wrote:
> Add sigcontext definition and signal handling support for
> kvx.

[...]

> +asmlinkage void do_work_pending(struct pt_regs *regs,
> +				unsigned long thread_flags)
> +{
> +	/* We are called with IRQs disabled */
> +	trace_hardirqs_off();
> +
> +	do {
> +		if (thread_flags & _TIF_NEED_RESCHED) {
> +			schedule();
> +		} else {
> +			local_irq_enable();
> +			if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
> +				do_signal(regs);
> +
> +			if (thread_flags & _TIF_NOTIFY_RESUME) {
> +				clear_thread_flag(TIF_NOTIFY_RESUME);
> +				resume_user_mode_work(regs);
> +			}
> +		}
> +		/* Guarantee task flag atomic read */
> +		local_irq_disable();
> +		thread_flags = READ_ONCE(current_thread_info()->flags);

The comment here is a bit misleading; disabling IRQs doesn't affect the
atomicity of the read (and flags can be set by remote threads), so I'd
recommend removing it.

Please use read_thread_flags() to read the flags.

> +	} while (thread_flags & _TIF_WORK_MASK);
> +}

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ