Bug 2387597 - Invoking update-ca-trust in a toolbox container wipes /etc/ca-trust/extracted/pem/tls-ca-bundle.pem
Summary: Invoking update-ca-trust in a toolbox container wipes /etc/ca-trust/extracte...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: p11-kit
Version: 43
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Daiki Ueno
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException
Depends On:
Blocks: F43BetaFreezeException
TreeView+ depends on / blocked
 
Reported: 2025-08-11 11:50 UTC by Frantisek Krenzelok
Modified: 2025-09-06 15:24 UTC (History)
16 users (show)

Fixed In Version: p11-kit-0.25.5-10.fc43
Clone Of:
Environment:
Last Closed: 2025-09-06 15:24:16 UTC
Type: ---
Embargoed:
fedora-admin-xmlrpc: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers toolbox issues 1661 0 None closed Running update-ca-trust(8) in the container breaks OpenSSL by emptying its /etc/pki/ca-trust/extracted/pem/tls-ca-bundle... 2025-08-11 12:16:09 UTC
Github p11-glue p11-kit issues 686 0 None open 'trust list' fails to read using p11-kit-client.so in container, with 'p11-kit server' on the host 2025-08-29 12:59:51 UTC
Github p11-glue p11-kit issues 692 0 None open Running update-ca-trust(8) in a container with remoting breaks OpenSSL by emptying its /etc/pki/ca-trust/extracted/pem/t... 2025-08-11 12:16:19 UTC
Red Hat Issue Tracker FC-1928 0 None None None 2025-08-11 11:53:03 UTC

Description Frantisek Krenzelok 2025-08-11 11:50:23 UTC
Invoking `update-ca-trust` in a toolbox container wipes the contents of the /etc/ca-trust/extracted/pem/tls-ca-bundle.pem file.



Reproducible: Always

Steps to Reproduce:
Steps to reproduce:
1. Create the toolbox and enter
$ podman pull fedora-toolbox:43
$ toolbox create --release 43 test-43-tbx
$ toolbox enter test-43-tbx

2. In toolbox:
$ ls -la /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
-r--r--r--. 1 root root 226489 Aug 11 08:20 /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
$ sudo update-ca-trust
$ ls -la /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
-r--r--r--. 1 root root 0 Aug 11 13:45 /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Actual Results:
The size of the file changes to 0 as indicated by the reproducer.

Expected Results:
The file should stay the same or be updated.

Additional Information:
This doesn't happen on host nor on a classical VM

Comment 1 Debarshi Ray 2025-08-11 12:18:44 UTC
I had discussed this with Daiki Ueno and Zoltán Fridrich a few weeks ago, and Daiki tracked it down to this p11-kit commit:
https://github.com/p11-glue/p11-kit/pull/365
https://github.com/p11-glue/p11-kit/commit/b3243a754763f6df19351593781b88e277a324bc

Comment 2 Frantisek Krenzelok 2025-08-11 12:53:42 UTC
Thanks Debarshi,

It can see that it is being tracked upstream: https://github.com/p11-glue/p11-kit/issues/692

I will move this to p11-kit so that we have a fedora tracker.

Comment 3 Jens Petersen 2025-08-21 14:37:23 UTC
Could you please provide a simple way to disable:

   5ed2442 * Give access to the CA certificates from the host

in toolbox, like an environment variable?


Currently `dnf update ca-certificates` etc basically breaks a F43+ fedora-toolbox.

Comment 4 Jens Petersen 2025-08-21 14:43:18 UTC
(Currently the only simple way seems to be removing p11-kit-server from the host, but this is also used for flatpak, so removing it is undesirable.
And I think p11-kit-client needs to be removed from the toolbox image before a container is setup and run?)

Comment 5 Debarshi Ray 2025-08-29 12:59:51 UTC
(In reply to Frantisek Krenzelok from comment #2)
> It can see that it is being tracked upstream:
> https://github.com/p11-glue/p11-kit/issues/692

Zoltán tracked this down as a duplicate of:
https://github.com/p11-glue/p11-kit/issues/686

He said that he is testing a fix for this at the moment.  (Thanks, Zoltán!)

Comment 6 Debarshi Ray 2025-08-29 13:28:00 UTC
(In reply to Jens Petersen from comment #3)
> Could you please provide a simple way to disable:
> 
>    5ed2442 * Give access to the CA certificates from the host
> 
> in toolbox, like an environment variable?

One way to work around this problem is to remove `/etc/pkcs11/modules/p11-kit-trust.module` and  `/usr/lib64/pkcs11/p11-kit-client.so` from the container.  Delete the former with `rm(1)`, and the latter by removing the `p11-kit-client` (Rawhide and F43) or `p11-kit-server` (F41 and F42) RPM.  Stop the container with `podman stop` and try to `enter` it again and it should work as before.

(In reply to Jens Petersen from comment #4)
> (Currently the only simple way seems to be removing p11-kit-server from the
> host, but this is also used for flatpak, so removing it is undesirable.

Yes, correct.

> And I think p11-kit-client needs to be removed from the toolbox image before
> a container is setup and run?)

It can be removed from the container.  Toolbx won't install the RPM at runtime if it's not there.  See above for the details.

Comment 7 Debarshi Ray 2025-08-29 22:37:39 UTC
(In reply to Debarshi Ray from comment #6)
> (In reply to Jens Petersen from comment #3)
> > Could you please provide a simple way to disable:
> > 
> >    5ed2442 * Give access to the CA certificates from the host
> > 
> > in toolbox, like an environment variable?
> 
> One way to work around this problem is to remove
> `/etc/pkcs11/modules/p11-kit-trust.module` and 
> `/usr/lib64/pkcs11/p11-kit-client.so` from the container.  Delete the former
> with `rm(1)`, and the latter by removing the `p11-kit-client` (Rawhide and
> F43) or `p11-kit-server` (F41 and F42) RPM.  Stop the container with `podman
> stop` and try to `enter` it again and it should work as before.

Oh, and one more step.  You need to run 'sudo update-ca-trust' to rebuild the files (ie., like `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem`, etc.) that got emptied by `update-ca-trust(8)` when remote p11-kit was in place.

Another work around is to replace the files in the container that got emptied by `update-ca-trust(8)` (ie., like `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem`, etc.) with the ones on the host:

⬢ [rishi@toolbx ~]$ cd /etc/pki/ca-trust/extracted/pem
⬢ [rishi@toolbx pem]$ sudo ln --symbolic /run/host/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem tls-ca-bundle.pem

Comment 8 Debarshi Ray 2025-08-29 22:42:09 UTC
(In reply to Debarshi Ray from comment #7)
> Another work around is to replace the files in the container that got
> emptied by `update-ca-trust(8)` (ie., like
> `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem`, etc.) with the ones on
> the host:
> 
> ⬢ [rishi@toolbx ~]$ cd /etc/pki/ca-trust/extracted/pem
> ⬢ [rishi@toolbx pem]$ sudo ln --symbolic
> /run/host/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem tls-ca-bundle.pem

I missed a step between those two:
⬢ [rishi@toolbx pem]$ sudo rm tls-ca-bundle.pem

Comment 9 Jens Petersen 2025-08-31 08:03:57 UTC
Let's move this back to p11-kit then, since it is getting attention upstream now.

Proposing for a Beta Freeze Exception

Dunno if this qualifies as a Final Blocker: it even affects toolbox on F41 & F42 though. ;-(

Comment 10 Adam Williamson 2025-09-01 15:52:50 UTC
+3 for Beta FE in https://pagure.io/fedora-qa/blocker-review/issue/1895 , marking accepted.

Comment 11 Fedora Update System 2025-09-03 13:07:11 UTC
FEDORA-2025-af662b3457 (p11-kit-0.25.5-10.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-af662b3457

Comment 12 Fedora Update System 2025-09-04 01:13:10 UTC
FEDORA-2025-af662b3457 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-af662b3457`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-af662b3457

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2025-09-06 15:24:16 UTC
FEDORA-2025-af662b3457 (p11-kit-0.25.5-10.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.