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: <20230726092652.GA7943@redhat.com>
Date:   Wed, 26 Jul 2023 11:26:53 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Fiona Ebner <f.ebner@...xmox.com>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        akpm@...ux-foundation.org,
        Thomas Lamprecht <t.lamprecht@...xmox.com>,
        Wolfgang Bumiller <w.bumiller@...xmox.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: segfaults of processes while being killed after commit "mm: make
 the page fault mmap locking killable"

On 07/25, Linus Torvalds wrote:
>
> What exactly made you notice? Is it just the logging from
> 'show_unhandled_signals' being set?
>
> Because the actual signal itself, from the
>
>         force_sig_fault(SIGSEGV, si_code, (void __user *)address);
>
> in __bad_area_nosemaphore() should be overridden by the fact that a
> lethal signal was already pending.

Yes, SIGSEGV won't be even delivered, prepare_signal() returns F if
SIGNAL_GROUP_EXIT is set.

> But let's add a couple of signal people rather than the mm people to
> the participants. Eric, Oleg - would not an existing fatal signal take
> precedence over a new SIGSEGV? I obviously thought it did, but looking
> at 'get_signal()' and the signal delivery, I don't actually see any
> code to that effect.

See

		/* Has this task already been marked for death? */
		if ((signal->flags & SIGNAL_GROUP_EXIT) ||
		     signal->group_exec_task) {
			clear_siginfo(&ksig->info);
			ksig->info.si_signo = signr = SIGKILL;
			sigdelset(&current->pending.signal, SIGKILL);
			trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
				&sighand->action[SIGKILL - 1]);
			recalc_sigpending();
			goto fatal;
		}

in get_signal().

So yes, get_signal() returns SIGKILL if fatal_signal_pending() == T which
implies SIGNAL_GROUP_EXIT.

I think your patch is fine.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ