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: <4DEE754B.1020706@suse.cz>
Date:	Tue, 07 Jun 2011 21:00:27 +0200
From:	Jiri Slaby <jslaby@...e.cz>
To:	Oleg Nesterov <oleg@...hat.com>
CC:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Al Viro <viro@...iv.linux.org.uk>,
	Andi Kleen <andi@...stfloor.org>,
	Xiaotian Feng <dfeng@...hat.com>,
	Neil Horman <nhorman@...driver.com>,
	Jiri Slaby <jirislaby@...il.com>
Subject: Re: [PATCH] do_coredump: fix the "ispipe" error check

On 06/07/2011 08:35 PM, Oleg Nesterov wrote:
> do_coredump() assumes that if format_corename() fails it should
> return -ENOMEM. This is not true, for example cn_print_exe_file()
> can propagate the error from d_path. Even if it was true, this is
> too fragile. Change the code to check "ispipe < 0".
> 
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>

Acked-by: Jiri Slaby <jslaby@...e.cz>

> ---
> 
>  fs/exec.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> --- ptrace/fs/exec.c~corename_errcode	2011-06-07 19:44:30.000000000 +0200
> +++ ptrace/fs/exec.c	2011-06-07 20:20:48.000000000 +0200
> @@ -2092,16 +2092,16 @@ void do_coredump(long signr, int exit_co
>  
>  	ispipe = format_corename(&cn, signr);
>  
> -	if (ispipe == -ENOMEM) {
> -		printk(KERN_WARNING "format_corename failed\n");
> -		printk(KERN_WARNING "Aborting core\n");
> -		goto fail_corename;
> -	}
> -
>   	if (ispipe) {
>  		int dump_count;
>  		char **helper_argv;
>  
> +		if (ispipe < 0) {
> +			printk(KERN_WARNING "format_corename failed\n");
> +			printk(KERN_WARNING "Aborting core\n");
> +			goto fail_corename;
> +		}
> +
>  		if (cprm.limit == 1) {
>  			/*
>  			 * Normally core limits are irrelevant to pipes, since
> 

thanks,
-- 
js
suse labs
--
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