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: <b0468b00-8e01-59a0-56a4-deea2be28a0f@oracle.com>
Date:   Fri, 20 Oct 2017 10:24:01 -0400
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Stefano Stabellini <sstabellini@...nel.org>
Cc:     xen-devel@...ts.xen.org, linux-kernel@...r.kernel.org,
        jgross@...e.com, Stefano Stabellini <stefano@...reto.com>
Subject: Re: [PATCH v5 04/13] xen/pvcalls: implement socket command and handle
 events

On 10/19/2017 09:26 PM, Stefano Stabellini wrote:
> On Tue, 17 Oct 2017, Boris Ostrovsky wrote:
>> On 10/06/2017 08:30 PM, Stefano Stabellini wrote:

>> with one question:
>>
>>> +	/*
>>> +	 * PVCalls only supports domain AF_INET,
>>> +	 * type SOCK_STREAM and protocol 0 sockets for now.
>>> +	 *
>>> +	 * Check socket type here, AF_INET and protocol checks are done
>>> +	 * by the caller.
>>> +	 */
>>> +	if (sock->type != SOCK_STREAM)
>>> +		return -ENOTSUPP;
>>> +
>>
>>
>> Is this ENOTSUPP or EOPNOTSUPP? I didn't know the former even existed
>> and include/linux/errno.h suggests that this is NFSv3-specific.
> 
> The PVCalls spec says that unimplemented commands return ENOTSUPP,
> defined as -524. I guess that is why I used ENOTSUPP, but, actually,
> this is the return value to the caller, which has nothing to do with the
> PVCalls protocol return value. In fact, it could be something entirely
> different.
> 
> In this case, I think you are correct, it is best to use EOPNOTSUPP.
> I'll make the change and retain your Reviewed-by, if that's OK for you.
> 

Of course.

This all is somewhat convoluted:

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.)

/usr/include/bits/errno.h:
/* Linux has no ENOTSUP error code.  */
# define ENOTSUP EOPNOTSUPP


Linux kernel:
include/linux/errno.h:
/* Defined for the NFSv3 protocol */
...
#define ENOTSUPP        524     /* Operation is not supported */


include/uapi/asm-generic/errno.h:
#define EOPNOTSUPP      95      /* Operation not supported on transport
                                   endpoint */


ENOTSUP is not generally defined in Linux kernel.


Clear as mud.


-boris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ