LINBIT / drbd

LINBIT DRBD kernel module
https://docs.linbit.com/docs/users-guide-9.0/
GNU General Public License v2.0
587 stars 100 forks source link

9.2.6 - unknown tls symbols with Kernel 6.1.60 LTS #76

Closed 1848 closed 1 year ago

1848 commented 1 year ago

Build env: Arch Linux with 6.1.60-1-lts kernel drbd.ko loads fine but drbd_transport_tcp.ko fails due to unknown symbols:

drbd_transport_tcp: Unknown symbol tls_server_hello_x509 (err -2) drbd_transport_tcp: Unknown symbol tls_handshake_cancel (err -2) drbd_transport_tcp: Unknown symbol tls_client_hello_x509 (err -2)

Those symbols are not part of the kernel until 6.4. Maybe there is a new compat patch needed for kernel < 6.4?

WanzenBug commented 1 year ago

That patch does exist. Or to be more precise, there is a handshake.ko which provides compatibility by back-porting the net/handshake module from upstream.

How did you build DRBD 9.2.6? From the release tarball?

WanzenBug commented 1 year ago

See https://github.com/LINBIT/drbd/blob/52144c0f90a0fb00df6a7d6714ec9034c7af7a28/drbd/Kbuild#L31-L38C4

There may be an issue if you have CONFIG_TLS=n for your kernel?

1848 commented 1 year ago

How did you build DRBD 9.2.6? From the release tarball?

Yes. KDIR=/usr/src/linux-lts make

There may be an issue if you have CONFIG_TLS=n for your kernel?

CONFIG_TLS=m

In the final drbd_transport_tcp.ko I see references to those symbols as unknown.

U tls_client_hello_x509
U tls_handshake_cancel
U tls_server_hello_x509

My understanding is that the compat stuff implements this internally (e.g. tls_client_hello_x509 is exported in drbd-kernel-compat/handshake) if its not found in the kernel right? So I guess those symbols should not be unknown if implemented internally...

I will try to look into the compat generation later to see what went wrong.

1848 commented 1 year ago

Yeah nvm... I already found my problem... I overlooked your hint about the handshake.ko file.

Those missing symbols are implemented in drbd-kernel-compat/handshake/handshake.ko I have to load this module too, I did not know that. I was thinking I would only need drbd.ko and drbd_transport_tcp.ko because all the compat stuff would be implemented inside those modules.

So that means I always need to scan the drbd-kernel-compat directory for .ko modules and install them together with drbd.ko and drbd_transport_tcp.ko, is that correct?

Thank you very much for your help!

WanzenBug commented 1 year ago

I guess so. Usually this is just handled by running make install and then depmod -a should pick up the required dependencies.