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:	Wed, 12 May 2010 17:54:53 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Cedric Le Goater <clg@...t.ibm.com>,
	Dave Hansen <haveblue@...ibm.com>,
	Eric Biederman <ebiederm@...ssion.com>,
	Herbert Poetzl <herbert@...hfloor.at>,
	Ingo Molnar <mingo@...e.hu>,
	Mathias Krause <Mathias.Krause@...unet.com>,
	Roland McGrath <roland@...hat.com>,
	Serge Hallyn <serue@...ibm.com>,
	Sukadev Bhattiprolu <sukadev@...ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] INIT_TASK() should initialize ->thread_group list

On 05/11, Sukadev Bhattiprolu wrote:
>
> Oleg Nesterov [oleg@...hat.com] wrote:
> | The trivial /sbin/init doing
> |
> | 	int main(void)
> | 	{
> | 		kill(0, SIGKILL)
> | 	}
> |
> | crashes the kernel.
>
> Really subtle. Good catch.

Thanks to Mathias ;)

> So, now init is not part of any process group until it calls setsid().
> So the above SIGKILL is lost right ? - i.e it does not kill even init
> itself.

No, no. swapper != init. With or without these patches (more precisely,
the next patch) /sbin/init still belongs to the 0 pgrp/sid.

> In my quick test, the following init process lives on inspite of the
> SIGKILL.

Yes, /sbin/init is not killable, that is why it survies.

But:

> 	main()
> 	{
> 		kill(0, SIGKILL);
>
> 		while(1)
> 			sleep(1);
> 	}

Yes. if /sbin/init exits the kernel panics. The real test-case shouldn't
exit, like your example.

> I don't have a better solution. Maybe a hung init is better than a
> crashed kernel.

Agreed!!! I sent the patch a long ago. But security people do not
like it, they use exit() from init to provoke the crash intentionally.
And I still think they are wrong, but this is another story.

> Acked-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>

Thanks!

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ