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: <20090804122432.GB4367@elte.hu>
Date:	Tue, 4 Aug 2009 14:24:32 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Amerigo Wang <amwang@...hat.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Al Viro <viro@...iv.linux.org.uk>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [Patch 1/2] ia32: use generic sys_pipe()


* Amerigo Wang <amwang@...hat.com> wrote:

> As suggested by Al, it's better to use the generic sys_pipe() for 
> ia32.
> 
> Signed-off-by: WANG Cong <amwang@...hat.com>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> CC: Linus Torvalds <torvalds@...ux-foundation.org>

> --- a/arch/x86/ia32/sys_ia32.c
> +++ b/arch/x86/ia32/sys_ia32.c
> @@ -189,20 +189,6 @@ asmlinkage long sys32_mprotect(unsigned long start, size_t len,
>  	return sys_mprotect(start, len, prot);
>  }
>  
> -asmlinkage long sys32_pipe(int __user *fd)
> -{
> -	int retval;
> -	int fds[2];
> -
> -	retval = do_pipe_flags(fds, 0);
> -	if (retval)
> -		goto out;
> -	if (copy_to_user(fd, fds, sizeof(fds)))
> -		retval = -EFAULT;
> -out:
> -	return retval;
> -}

Please _ALWAYS_ mention the change in behavior in the changelog, 
just in case someone ends up bisecting it. I only found out when i 
reviewed the two syscalls out of caution.

The syscall you remove kept stale fd's around in case of -EFAULT 
from copy_to_user(). The generic version does an explicit close of 
those files:

                        sys_close(fd[0]);
                        sys_close(fd[1]);
                        error = -EFAULT;

The generic version looks like the better choice to me but this 
difference should be mentioned in the changelog nevertheless, just 
in case some buggy app runs into this issue.

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