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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180529064719.GA14800@infradead.org>
Date:   Mon, 28 May 2018 23:47:19 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Christian Brauner <christian@...uner.io>
Cc:     linux-kernel@...r.kernel.org, ebiederm@...ssion.com,
        gregkh@...uxfoundation.org, mingo@...nel.org,
        james.morris@...rosoft.com, keescook@...omium.org,
        peterz@...radead.org, sds@...ho.nsa.gov, viro@...iv.linux.org.uk,
        akpm@...ux-foundation.org, oleg@...hat.com
Subject: Re: [PATCH 8/8] signal: simplify rt_sigaction()

> +	if (act)
>  		if (copy_from_user(&new_sa.sa, act, sizeof(new_sa.sa)))
>  			return -EFAULT;

	if (act && copy_from_user(&new_sa.sa, act, sizeof(new_sa.sa)))
		return -EFAULT;

>  	ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
> -
> -	if (!ret && oact) {
> +	if (!ret && oact)
>  		if (copy_to_user(oact, &old_sa.sa, sizeof(old_sa.sa)))
>  			return -EFAULT;
> -	}

	ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
	if (!ret && oact && copy_to_user(oact, &old_sa.sa, sizeof(old_sa.sa)))
		return -EFAULT;

Althought I'd personaly write it as:

	ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
	if (ret)
		return ret;
	if (oact && copy_to_user(oact, &old_sa.sa, sizeof(old_sa.sa)))
		return -EFAULT;
	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ