From: "Bjørn Mork" <bjorn@mork.no>
To: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
Cc: noloader@gmail.com, kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Kernel TLS
Date: Sat, 30 Nov 2019 09:13:35 +0100 [thread overview]
Message-ID: <8736e5pys0.fsf@miraculix.mork.no> (raw)
In-Reply-To: <50226.1575096007@turing-police> ("Valdis Klētnieks"'s message of "Sat, 30 Nov 2019 01:40:07 -0500")
"Valdis Klētnieks" <valdis.kletnieks@vt.edu> writes:
> On Fri, 29 Nov 2019 23:37:35 -0500, Jeffrey Walton said:
>
> repl: bad addresses:
> Valentin VidiD\a <vvidic@valentin-vidic.from.hr> -- no mailbox in address, only a phrase (Valentin VidiD\a)
>> On Fri, Nov 29, 2019 at 3:04 PM Jeffrey Walton <noloader@gmail.com> wrote:
>> > ...
>> > So now I am at:
>> >
>> > $ gcc -Wall -g2 -O1 ktls.c -o ktls
>> > $ ./ktls
>> > setsockopt failed, 524, Unknown error 524
>>
>> Now open in the Fedora bug tracker:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1778348
>
> Looks like the 'unknown error' issue is a glibc strerror() problem. On the
> kernel side, git blame says:
>
> [/usr/src/linux-next] git blame include/linux/errno.h | grep -C 5 524
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 22)
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 23) /* Defined for the NFSv3 protocol */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 24) #define EBADHANDLE 521 /* Illegal NFS file handle */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 25) #define ENOTSYNC 522 /* Update synchronization mismatch */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 26) #define EBADCOOKIE 523 /* Cookie is stale */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 27) #define ENOTSUPP 524 /* Operation is not supported */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 28) #define ETOOSMALL 525 /* Buffer or request is too small */
> ^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 29) #define ESERVERFAULT 526 /* An untranslatable error occurred */
>
> So I'm mystified why glibc's strerror() doesn't handle it.
> Though I think Alexander is correct on why the kernel returns ENOTSUPP.
include/linux/errno.h is kernel internal only. The UAPI header is
uapi/linux/errno.h, which is an alias for uapi/asm/errno.h. There is no
524 in include/uapi/asm-generic/errno.h or
include/uapi/asm-generic/errno-base.h
The codes in include/linux/errno.h should be translated for userspace.
This does look like a bug in the kernel tls code.
Bjørn
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2019-11-30 8:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 19:36 Kernel TLS Jeffrey Walton
2019-11-29 19:46 ` Alexander Mihalicyn
2019-11-29 19:48 ` Valentin Vidić
2019-11-29 19:57 ` Jeffrey Walton
2019-11-29 20:04 ` Jeffrey Walton
2019-11-30 4:37 ` Jeffrey Walton
2019-11-30 6:16 ` Alexander Mihalicyn
2019-11-30 6:40 ` Valdis Klētnieks
2019-11-30 8:13 ` Bjørn Mork [this message]
2019-11-30 9:11 ` Valdis Klētnieks
2019-11-30 10:10 ` Bjørn Mork
2019-11-30 10:34 ` Valdis Klētnieks
2019-11-30 12:54 ` [PATCH] net/tls: Fix return values for setsockopt Valentin Vidic
2019-11-30 13:15 ` Jeffrey Walton
2019-11-30 13:31 ` Valentin Vidić
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736e5pys0.fsf@miraculix.mork.no \
--to=bjorn@mork.no \
--cc=kernelnewbies@kernelnewbies.org \
--cc=noloader@gmail.com \
--cc=valdis.kletnieks@vt.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.