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: <YErdZh4QCaRiSV1l@Gentoo>
Date:   Fri, 12 Mar 2021 08:47:58 +0530
From:   Bhaskar Chowdhury <unixbhaskar@...il.com>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-api@...r.kernel.org
Subject: Re: Why is the bit size different between a syscall and its wrapper?

On 11:48 Fri 12 Mar 2021, Masahiro Yamada wrote:
>Hi.
>
>I think I am missing something, but
>is there any particular reason to
>use a different bit size between
>a syscall and its userspace wrapper?
>
>
>
>For example, for the unshare syscall,
>
>unshare(2) says the parameter is int.
>
>
>SYNOPSIS
>       #define _GNU_SOURCE
>       #include <sched.h>
>
>       int unshare(int flags);
>
>
>
>
>In the kernel, it is unsigned long.
>
>
>SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
>{
>        return ksys_unshare(unshare_flags);
>}
>
>
>
>
>I guess the upper 32-bit will be
>zeroed out in the c library when
>sizeof(int) != sizeof(unsigned long)
>(i.e. 64-bit system), but I'd like to know
>why we do it this way.
>
>
Small nit! never mind ...but eye catching, Masahiro :) ...are you typing this
on narrowed device, which allow only this much line length?? It's bloody
narrow...don't you think so?

Sorry, for the deviation.

~Bhaskar
>--
>Best Regards
>Masahiro Yamada

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ