You have been subscribed to a public bug by Dan Streetman (ddstreet):

[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_LINUX="ipv6.disable=1"
$ sudo update-grub

3. Reboot the VM

4. Try to fetch a key:
sudo apt-key adv --fetch-keys https://www.postgreSQL.org/media/keys/ACCC4CF8.asc

You'll get the following error:
gpg: WARNING: unable to fetch URI 
https://www.postgresql.org/media/keys/ACCC4CF8.asc: Address family not 
supported by protocol

[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.

** Affects: gnupg2 (Ubuntu)
     Importance: High
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress

** Affects: gnupg2 (Ubuntu Bionic)
     Importance: High
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress

** Affects: gnupg2 (Ubuntu Focal)
     Importance: High
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress

** Affects: gnupg2 (Ubuntu Groovy)
     Importance: High
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress

** Affects: gnupg2 (Ubuntu Hirsute)
     Importance: High
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress


** Tags: seg sts sts-sponsor sts-sponsor-ddstreet
-- 
dirmngr doesn't work with kernel parameter ipv6.disable=1
https://bugs.launchpad.net/bugs/1910432
You received this bug notification because you are a member of STS Sponsors, 
which is subscribed to the bug report.

-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to     : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp

Reply via email to