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: <20090626202411.GH7337@hmsreliant.think-freely.org>
Date:	Fri, 26 Jun 2009 16:24:11 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, earl_chew@...lent.com,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 1/2] exec: Make do_coredump more robust and safer when
	using pipes in core_pattern: recursive dump detection

On Fri, Jun 26, 2009 at 06:59:08PM +0200, Oleg Nesterov wrote:
> On 06/26, Neil Horman wrote:
> >
> > +		if (core_limit == 0) {
> > +			 /*
> > +			 * Normally core limits are irrelevant to pipes, since
> > +			 * we're not writing to the file system, but we use
> > +			 * core_limit of 0 here as a speacial value. Any
> > +			 * non-zero limit gets set to RLIM_INFINITY below, but
> > +			 * a limit of 0 skips the dump.  This is a consistent
> > +			 * way to catch recursive crashes.  We can still crash
> > +			 * if the core_pattern binary sets RLIM_CORE =  !0
> > +			 * but it runs as root, and can do lots of stupid things
> > +			 * Note that we use task_tgid_vnr here to grab the pid of the
> > +			 * process group leader.  That way we get the right pid if a thread
> > +			 * in a multi-threaded core_pattern process dies.
> > +			 */
> > +			printk(KERN_WARNING "Process %d(%s) has RLIMIT_CORE set to 0\n",
> > +			       task_tgid_vnr(current), current->comm);
> > +			printk(KERN_WARNING "Aborting core\n");
> 
> Andrew has already pointed out this, unprivileged-user-triggerable
> printk.
> 
> Doesn't look good, if core_pattern starts with "|" any user can set
> RLIMIT_CORE = 0 and then just do
> 
> 	for (;;)
> 		if (pid = fork())
> 			kill(pid, SIGQUIT);
> 
> to DOS printk/syslog, no?
> 
I don't think SIGQUIT will trigger this, but SIGSEGV will.  Regardless, if you
do that, I would think you have bigger problems on your system.  I would be
silent about this, but I'm not sure thats a better solution

Neil

> 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/
> 
--
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