Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update openssl to v3 #342

Open
trimpim opened this issue Sep 21, 2023 · 10 comments
Open

update openssl to v3 #342

trimpim opened this issue Sep 21, 2023 · 10 comments

Comments

@trimpim
Copy link
Contributor

trimpim commented Sep 21, 2023

This is needed to complete genodelabs/genode#4992

trimpim pushed a commit to trimpim/genode-world that referenced this issue Sep 21, 2023
openssl 3 marks some functions as deprecated.

Issue genode#4992
Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 21, 2023
Additionally use '[build_artifacts]'
Additionally use fix changes regarding vfs_pipe pulugin
Additionally fix `linux_nic_drv` now using Uplink session

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 21, 2023
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 21, 2023
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 21, 2023
 - vfs_pipe plugin changes
 - use [build_artifacts]
 - openssl 3 uses more ram

Issue genodelabs#342
@trimpim
Copy link
Contributor Author

trimpim commented Sep 21, 2023

This is still in testing.

The following test succeed on x86_64:

  • run/grpc
  • run/grpc-server
  • run/grpc-startup -> times out no idea what triggers the condition of the run script
  • run/iperf_internal
  • run/iperf_lxip
  • run/iperf_lxip_bridge
  • run/iperf_lxip_router
  • run/ssh
  • run/ssh_exec_channel

The following run scripts fail as they still reference /repos/base/run/platform_drv.inc which no longer exists:

  • run/mbim-fetchurl
  • run/pkcs11_tool
  • run/ssh_client
  • run/ssh_terminal
  • run/stubby

run/scrcpy fails during run time with (also when I checkout 23.08 on both genode and genode-world):

[init -> scrcpy] Error: LD: exception during program load: 'Genode::Region_map::Region_conflict'

The following run scripts fail when building components:

  • run/keynote
    auxil.c:79:35: error: invalid use of incomplete typedef‘RSA’ {aka ‘struct rsa_st’}
    
  • run/umurmur
    umurmur-a194b75e385ebbd429835056c75917373be5b4e1/src/app/umurmur/src/ssli_openssl.c:171:41: error: ‘CRYPTO_MEM_CHECK_ON’undeclared (first use in this function)
    
  • run/drill
     `dnssec_verify.c:2630:41: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX’ {>
    

Next I investigate solutions for the known issues and run the tests on arm_v8a and x86_32 (qemu).

trimpim added a commit to trimpim/genode-world that referenced this issue Sep 24, 2023
Remove the dependency to repos/base/run/platform_drv.inc

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 28, 2023
Remove the dependency to repos/base/run/platform_drv.inc

This doesn't work yet.

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Sep 28, 2023
Remove the dependency to repos/base/run/platform_drv.inc

This doesn't work yet.

Issue genodelabs#342
@trimpim trimpim changed the title update openssl to v3 tvrblldvkudckupdate openssl to v3 Oct 2, 2023
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
Remove the dependency to repos/base/run/platform_drv.inc

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
Remove the dependency to repos/base/run/platform_drv.inc

Issue genodelabs#342
@trimpim trimpim changed the title tvrblldvkudckupdate openssl to v3 update openssl to v3 Oct 2, 2023
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
This patches the sources so that the library and the test program
can be compiled with openssl version 3.

There is no new upstream version of the library since 3.2.

The test finishes successful, but I'm not sure, if all parts of the fix
are correct.

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
- fix compilation of app/umurmur
- add missing nic_router and adapt configuration
- increase resources for umurmur

The run script starts without errors but I do not know how to test it.

Issue genodelabs#342
trimpim added a commit to trimpim/genode-world that referenced this issue Oct 2, 2023
- add nic_router
- drill add libc random configuration

Issue genodelabs#342
@trimpim
Copy link
Contributor Author

trimpim commented Oct 2, 2023

@chelmuth except for run/pkcs11_tool I can now successful execute all run scripts.

In run/pkcs11_tool as soon as I enable the pkcs11-tool start node the messages message below is printed.

I'm guessing, that this might be related to the changes mentioned in https://genode.org/documentation/release-notes/23.05#USB.

As the pkcs11-tool isn't in the repository (yet) maybe @m-stein could guide me on how I can build a new version? I see there are the branches pkcs11_tool and sculpt_pkcs11_tool in his repository. Could I pick some commits from these to build the tool?

[init] child "drivers" requests resources: ram_quota=1067418
[init] child "drivers" requests resources: ram_quota=1067418
[init -> drivers] Warning: unable to transfer session quota (1068237 bytes, 5 caps) of forwarded Usb session
[init] Warning: pkcs11-tool: could not revert session RAM quota (service=Usb cid=22 args='tx_buf_size=1048576, cap_quota=5, label="pkcs11-tool -> usb_device",o
[init] ta=5)
[init -> pkcs11-tool] Error: Usb-session creation failed (label="usb_device", ram_quota=1044K, cap_quota=5, tx_buf_size=1048576)
[init -> pkcs11-tool] Error: Uncaught exception of type 'Genode::Service_denied'
[init -> pkcs11-tool] Warning: abort called - thread: ep

@m-stein
Copy link
Contributor

m-stein commented Oct 6, 2023

@trimpim Have you tried following the instructions in https://genodians.org/m-stein/2022-08-18-pkcs11-tool-1 ? It should give you the newest version ported so far.

@trimpim
Copy link
Contributor Author

trimpim commented Oct 9, 2023

@m-stein I had forgotten about this genodians article but in the meantime I did give it a try.

I had to update form 0.22.0-rc2 to 0.24.0-rc1 as the former version failed to build on my arch based Linux distribution.

With the updated version I'm able to build pkcs11_tool but I get the warning below about thirty times.

/usr/local/genode/tool/21.05/bin/../lib/gcc/x86_64-pc-elf/10.3.0/../../../../x86_64-pc-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000001000000

I guess this is the cause of the execution error I get when executing the updated pcks-tool:

[init -> pkcs11-tool]   0x400000 .. 0x103fffff: linker area
[init -> pkcs11-tool] Error: LD: exception during program load: 'Genode::Region_map::Region_conflict'
[init -> pkcs11-tool] Error: Uncaught exception of type 'Genode::Region_map::Region_conflict'
[init -> pkcs11-tool] Warning: abort called - thread: ep

I'm currently investigating the cause of this.

@m-stein
Copy link
Contributor

m-stein commented Oct 13, 2023

AFAIK, the _start symbol should be part of the crt0 in the startup lib that is part of the base-* lib and therefor of the ld-* lib that is linked dynamically behind the ld api. In which context do you see the warnings?

@trimpim
Copy link
Contributor Author

trimpim commented Oct 13, 2023

@m-stein the warning was printed when a program was linked. I figured out how to fix this warning about two hours ago. The culprit was that automake ignored LDLIBS.

I have pushed my current state to https://github.com/trimpim/goa_projects/tree/pkcs11_tool-for_openssl3 (it is not cleaned up currently).

The Genode::Region_map::Region_conflict exception still persists when I test the run script. The exception is thrown in repos/base/src/core/region_map_component.cc because of

if (attr.offset < 0 || align_addr(attr.offset, get page_size_log2()) != attr.offset)

@m-stein
Copy link
Contributor

m-stein commented Oct 16, 2023

@trimpim Glad to hear that you could fix the LD exception! I have no direct clue what the region conflict could be caused by. I'd backtrace it into the application code.

@trimpim
Copy link
Contributor Author

trimpim commented Oct 16, 2023

@m-stein I intend to look in to this when sculp 23.10 is released. I will then rebase all branches to this release and see if the exception still gets triggered.

I'm currently guessing, that this is might be caused by mismatching versions of packages between Goa and the other repositories.

@m-stein
Copy link
Contributor

m-stein commented Oct 26, 2023

I've updated my packages to current stagings Sculpt and am getting the same region conflict so far.

@trimpim
Copy link
Contributor Author

trimpim commented Dec 21, 2023

@m-stein I just had the same error, when I was switching a libc application to a native and forgot to replace

void Libc::Component::construct(Libc::Env &env)

with

void Component::construct(Genode::Env &env)

I'm not sure if the problem with the pcsc-tool is the same, I just remembered this when I did see the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants