gpg --verify has race conditions when used concurrently

Bug #1342807 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnupg (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

There is a race condition with gnupg --verify when multiple processes
act at the same time.
strace helps cause the race condition (probably by slowing thing down)
gpgv does not seem to have the issue.

The result is you will see transient verify failures with output like below.
using '--lock-once' seems to improve the problem, but not to entirely fix it.

gpg: Signature made Fri 10 Jan 2014 05:41:43 PM UTC using DSA key ID 437D05B5
gpg: 12: read expected rec type 10, got 0
gpg: lookup_hashtable failed: trust database error
gpg: trustdb: searching trust record failed: trust database error
gpg: Error: The trustdb is corrupted.
gpg: You may try to re-create the trustdb using the commands:
gpg: cd ~/.gnupg
gpg: gpg2 --export-ownertrust > otrust.tmp
gpg: rm trustdb.gpg
gpg: gpg2 --import-ownertrust < otrust.tmp
gpg: If that does not work, please consult the manual

See the attached 'verify-race' to show the issue.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: gnupg 1.4.16-1.2ubuntu1
ProcVersionSignature: User Name 3.16.0-3.8-generic 3.16.0-rc4
Uname: Linux 3.16.0-3-generic x86_64
ApportVersion: 2.14.4-0ubuntu2
Architecture: amd64
Date: Wed Jul 16 16:09:42 2014
Ec2AMI: ami-0000002c
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnupg
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
description: updated
description: updated
Revision history for this message
Scott Moser (smoser) wrote :

updated race-verify a bit. no functional change.

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
Changed in gnupg (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

From upstream bug
 | Date: 2015-06-15.05:49:50.
 | Fixed in master which was released as 2.1.5.
 | Fixed in the repo of 1.4 and 2.0.

Since Ubuntu version1.4.18-7ubuntu1 was uploaded prior to that comment, I assume still not fixed in ubuntu.
Debian has 1.4.19, but that was released in Feb of 2015.

So it would appear, for a fix we'd need something 2.1.5 or later or later than 1.4.19.

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

I reproduced a race still, and passed those comments upstream. See the upstream bug. The net is that it is *much* better than it was, but still can have races.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.