dirmngr doesn't work with kernel parameter ipv6.disable=1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnupg2 (Ubuntu) |
Fix Released
|
High
|
Heitor Alves de Siqueira | ||
Bionic |
Fix Released
|
High
|
Heitor Alves de Siqueira | ||
Focal |
Fix Released
|
High
|
Heitor Alves de Siqueira | ||
Groovy |
Fix Released
|
High
|
Heitor Alves de Siqueira | ||
Hirsute |
Fix Released
|
High
|
Heitor Alves de Siqueira |
Bug Description
[Impact]
apt-key fails to fetch keys with "Address family not supported by protocol"
[Description]
We've had users report issues about apt-key being unable to fetch keys when IPv6 is disabled. As the mentioned kernel command line parameter disables IPV6 socket support, servers that allow/respond with IPv6 will cause connect_server() to fail with EAFNOSUPPORT.
As this error is not being handled in some version of dirmngr, it'll simply fail the connection and could cause other processes to fail as well. In the test scenario below, it's easy to demonstrate this behaviour through apt-key.
This has been reported upstream, and has been fixed with the following commit:
- dirmngr: Handle EAFNOSUPPORT at connect_server. (109d16e8f644)
The fix has been present upstream starting with GnuPG 2.22, so it's not currently available in any Ubuntu releases.
[Test Case]
1. Spin up Focal VM
2. Disable IPv6:
$ sudo vi /etc/default/grub
(...)
GRUB_CMDLINE_
$ sudo update-grub
3. Reboot the VM
4. Try to fetch a key:
sudo apt-key adv --fetch-keys https:/
You'll get the following error:
gpg: WARNING: unable to fetch URI https:/
[Regression Potential]
The patch introduces additional error handling when connecting to servers, to properly mark remote hosts as having valid IPv4 and/or IPv6 connectivity. We should look out for potential regressions when connecting to servers with exclusive IPv4 or IPv6 connectivity, to make sure the server is not getting marked as 'dead' due to missing one of the versions.
This commit has also been tested in the corresponding Ubuntu series, and has been deemed safe for backporting to stable branches of upstream GnuPG. The overall regression potential for this change should be fairly low, and breakage should be easily spotted.
Related branches
- Dan Streetman (community): Approve
- Support Engineering Sponsors: Pending requested
-
Diff: 68 lines (+46/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/dirmngr-handle-EAFNOSUPPORT-at-connect_server.patch (+38/-0)
debian/patches/series (+1/-0)
- Dan Streetman (community): Approve
- Support Engineering Sponsors: Pending requested
-
Diff: 144 lines (+105/-3)5 files modifieddebian/changelog (+10/-0)
debian/patches/dirmngr-handle-EAFNOSUPPORT-at-connect_server.patch (+57/-0)
debian/patches/series (+1/-0)
debian/tests/control (+3/-3)
debian/tests/simple-tests (+34/-0)
- Dan Streetman (community): Approve
- Support Engineering Sponsors: Pending requested
-
Diff: 68 lines (+46/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/dirmngr-handle-EAFNOSUPPORT-at-connect_server.patch (+38/-0)
debian/patches/series (+1/-0)
- Dan Streetman (community): Approve
- Support Engineering Sponsors: Pending requested
-
Diff: 68 lines (+46/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/dirmngr-handle-EAFNOSUPPORT-at-connect_server.patch (+38/-0)
debian/patches/series (+1/-0)
Changed in gnupg2 (Ubuntu Bionic): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
Changed in gnupg2 (Ubuntu Focal): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
Changed in gnupg2 (Ubuntu Groovy): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
status: | New → In Progress |
Changed in gnupg2 (Ubuntu Focal): | |
status: | New → In Progress |
Changed in gnupg2 (Ubuntu Bionic): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in gnupg2 (Ubuntu Groovy): | |
importance: | Undecided → High |
Changed in gnupg2 (Ubuntu Focal): | |
importance: | Undecided → High |
tags: | added: sts-sponsor |
Changed in gnupg2 (Ubuntu Groovy): | |
status: | Incomplete → In Progress |
added some minor comments to MRs about versioning; also the backport for bionic needs a bit of fixing