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: <20180115151916.GC4305@osiris>
Date:   Mon, 15 Jan 2018 16:19:16 +0100
From:   Heiko Carstens <heiko.carstens@...ibm.com>
To:     Eugene Syromiatnikov <esyr@...hat.com>
Cc:     linux-s390@...r.kernel.org,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Philippe Ombredanne <pombredanne@...b.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390: fix setgid16/setuid16 handling of -1

On Mon, Jan 15, 2018 at 12:52:42PM +0100, Eugene Syromiatnikov wrote:
> For some reason, the implementation of these two 16-bit ID system calls
> used cast instead of low2highgid/low2highuid macros for converting [GU]IDs,
> which leads to incorrect handling of value of -1 (which ought to be
> considered invalid).
> 
> Discovered by strace test suite.
> 
> Signed-off-by: Eugene Syromiatnikov <esyr@...hat.com>
> ---
>  arch/s390/kernel/compat_linux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
> index f04db37..e48a31a 100644
> --- a/arch/s390/kernel/compat_linux.c
> +++ b/arch/s390/kernel/compat_linux.c
> @@ -110,7 +110,7 @@ COMPAT_SYSCALL_DEFINE2(s390_setregid16, u16, rgid, u16, egid)
> 
>  COMPAT_SYSCALL_DEFINE1(s390_setgid16, u16, gid)
>  {
> -	return sys_setgid((gid_t)gid);
> +	return sys_setgid(low2highgid(gid));
>  }
> 
>  COMPAT_SYSCALL_DEFINE2(s390_setreuid16, u16, ruid, u16, euid)
> @@ -120,7 +120,7 @@ COMPAT_SYSCALL_DEFINE2(s390_setreuid16, u16, ruid, u16, euid)
> 
>  COMPAT_SYSCALL_DEFINE1(s390_setuid16, u16, uid)
>  {
> -	return sys_setuid((uid_t)uid);
> +	return sys_setuid(low2highuid(uid));

Thank you! Would you mind to fix this also for s390_setfsuid16 and
s390_setfsgid16 within the same file, and resend?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ