kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: "Valentin Vidić" <vvidic@valentin-vidic.from.hr>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Kernel TLS
Date: Fri, 29 Nov 2019 14:57:51 -0500	[thread overview]
Message-ID: <CAH8yC8nSCZwRwT=9RDRc0EFgC3dJeMektHYYrwG5Ym1Y=tXMHQ@mail.gmail.com> (raw)
In-Reply-To: <20191129194801.GI20116@valentin-vidic.from.hr>

On Fri, Nov 29, 2019 at 2:48 PM Valentin Vidić
<vvidic@valentin-vidic.from.hr> wrote:
>
> On Fri, Nov 29, 2019 at 02:36:10PM -0500, Jeffrey Walton wrote:
> > I'm trying to run through the example at
> > https://www.kernel.org/doc/html/latest/networking/tls.html#kernel-tls
> > .
> >
> > I'm working on Fedora 31 x86_64 (fully patched). Running my program results in:
> >
> >     $ ./ktls
> >     setsockopt failed, 2, No such file or directory
> >
> > I observed:
> >
> >     $ cat /proc/sys/net/ipv4/tcp_available_ulp
> >     $
> >
> > Is there a way to enable ULP at boot? Or is this a kernel config
> > option? Or maybe I am doing something else wrong?
>
> strace gives me:
>
> ...
> socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
> setsockopt(3, SOL_TCP, TCP_ULP, [7564404], 4) = -1 ENOENT (No such file or directory)
> fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x2), ...}) = 0
> brk(NULL)                               = 0x55d76b14e000
> brk(0x55d76b16f000)                     = 0x55d76b16f000
> write(1, "setsockopt failed, 2, No such fi"..., 48setsockopt failed, 2, No such file or directory
> ) = 48
> exit_group(1)                           = ?
> +++ exited with 1 +++
>
> $ grep TLS /boot/config-4.19.0-6-amd64
> CONFIG_HAVE_COPY_THREAD_TLS=y
> # CONFIG_TLS is not set
> # CONFIG_VIDEO_IVTV_DEPRECATED_IOCTLS is not set
>
> So you probably need to rebuild the kernel with CONFIG_TLS to get this working.

Thanks Valentin.

Here's what I am seeing:

    $ grep TLS /boot/config-5.3.12-300.fc31.x86_64
    CONFIG_HAVE_COPY_THREAD_TLS=y
    CONFIG_TLS=m
    ...

I believe the 'm' means a loadable module. But:

    $ insmod tls
    insmod: ERROR: could not load module tls: No such file or directory

Jeff

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2019-11-29 19:59 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 [this message]
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
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='CAH8yC8nSCZwRwT=9RDRc0EFgC3dJeMektHYYrwG5Ym1Y=tXMHQ@mail.gmail.com' \
    --to=noloader@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=vvidic@valentin-vidic.from.hr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).