Bug 281460 - if_ovpn doesn't work with crypto.ko
Summary: if_ovpn doesn't work with crypto.ko
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-12 14:14 UTC by Helge Oldach
Modified: 2024-09-18 08:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2024-09-12 14:14:34 UTC
amd64 with stripped-down kernel (kind of MINIMAL). crypto.ko gets dynamically loaded. In that scenario, loading if_ovpn fails though:

root@latitude / # kldload if_ovpn
kldload: an error occurred while loading module if_ovpn. Please check dmesg(8) for more details.
root@latitude / # dmesg -a | tail -2
link_elf_obj: symbol crypto_freesession undefined
linker_load_file: /boot/kernel/if_ovpn.ko - unsupported file type
root@latitude / #

I noticed that crypto_freesession is a *local* text symbol in crypto.ko.

root@latitude / # nm /boot/kernel/crypto.ko | fgrep crypto_freesession
0000000000000d60 t crypto_freesession
root@latitude / #

However, in a GENERIC kernel (with device crypto) it's a global text symbol:

root@latitude / # nm /boot/GENERIC/kernel | fgrep crypto_freesession
ffffffff805a0520 T crypto_freesession
root@latitude / #

Indeed if_ovpn kldloads nicely with linked-in crypto.

Is this intended behaviour?
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-09-12 17:34:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=17c9ac457cf16c1251afa7364bc47ed52ec29057

commit 17c9ac457cf16c1251afa7364bc47ed52ec29057
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-09-12 15:51:04 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-09-12 17:32:05 +0000

    if_ovpn: declare our dependency on the crypto module

    PR:             281460
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 sys/net/if_ovpn.c | 1 +
 1 file changed, 1 insertion(+)
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2024-09-14 00:34:33 UTC
^Triage: appears to be a problem with loadable modules.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-09-18 08:25:54 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=79c34d704f3121cb7f3748ec6b7a5c7f787633bf

commit 79c34d704f3121cb7f3748ec6b7a5c7f787633bf
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-09-12 15:51:04 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-09-18 08:22:39 +0000

    if_ovpn: declare our dependency on the crypto module

    PR:             281460
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

    (cherry picked from commit 17c9ac457cf16c1251afa7364bc47ed52ec29057)

 sys/net/if_ovpn.c | 1 +
 1 file changed, 1 insertion(+)