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] [day] [month] [year] [list]
Message-ID: <20190130131049.gnhge73xvh62p3gl@treble>
Date:   Wed, 30 Jan 2019 07:10:49 -0600
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Joe Lawrence <joe.lawrence@...hat.com>,
        Alice Ferrazzi <alicef@...cef.me>, jeyu@...nel.org,
        jikos@...nel.org, mbenes@...e.cz, live-patching@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Alice Ferrazzi <alice.ferrazzi@...aclelinux.com>
Subject: Re: [PATCH] livepatch: core: Return ENOTSUPP instead of ENOSYS

On Wed, Jan 30, 2019 at 01:41:56PM +0100, Petr Mladek wrote:
> Hmm, the error code is passed to the syscall, for example:
> 
> + SYSCALL_DEFINE3(init_module
>   + load_module()
>     + do_init_module()
>       + do_one_initcall(mod->init);
> 
> I am not sure if we are allowed to return -ENOTSUPP (-524).
> It is defined in the internal include/linux/errno.h. There
> is the following commnent:
> 
> /*
>  * These should never be seen by user programs...
> 
> 
> 
> I tried to find a better alternative and found:
> 
> #define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
> 
> 
> There is the following note in man errno:
> 
>        ENOTSUP         Operation not supported (POSIX.1)
> 
>        EOPNOTSUPP      Operation not supported on socket (POSIX.1)
> 		       (ENOTSUP and EOPNOTSUPP have the same value
> 		       on Linux, but according to POSIX.1 these error
> 		       values should be distinct.)
> 
> And it looks that -EOPNOTSUPP is used widely in many subsystes (not
> only network).

Yes, you are right.  It's confusing that ENOTSUPP and ENOTSUP are not
the same thing.  EOPNOTSUPP sounds good.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ