Page MenuHome GnuPG

gpg segfaults when signing a key with --edit-key and --set-notation=rem@gnupg.org=foo
Closed, ResolvedPublic

Description

$ gpg --version
gpg (GnuPG) 2.5.11-beta3
libgcrypt 1.11.1
[...]

$ GNUPGHOME=~/dev/g10/.gnupghomes/2.4 gpg --status-fd 2 --with-colons --expert -u F8D51DE0EE16E9B57009B8DE458612006D8E6F0D --set-notation=rem@gnupg.org=foo --no-ask-cert-expire --default-cert-expire 0 --edit-key -- 3A8536D46F57779C49F0CF542C0444CB59852D29
gpg (GnuPG) 2.5.11-beta3; Copyright (C) 2025 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: enabled debug flags: memstat
gpg: enabled compatibility flags:
[GNUPG:] KEY_CONSIDERED 3A8536D46F57779C49F0CF542C0444CB59852D29 0
Secret key is available.

gpg: using pgp trust model

gpg> sign
[GNUPG:] KEY_CONSIDERED F8D51DE0EE16E9B57009B8DE458612006D8E6F0D 0


Are you sure that you want to sign this key with your
key "Berta Boss <Berta.Boss@demo.gnupg.com>" (458612006D8E6F0D)

Really sign? (y/N) y

gpg: signal Segmentation fault caught ... exiting
Segmentation fault (core dumped)

gdb backtrace:

#0  mk_notation_policy_etc (ctrl=ctrl@entry=0x5347c0, sig=sig@entry=0x63fc60, pk=pk@entry=0x529a90, pksk=pksk@entry=0x589500, 
    with_manu=<optimized out>) at /home/ingo/dev/g10/src/gnupg-2.6/g10/sign.c:130
#1  0x000000000046a9cc in make_keysig_packet (ctrl=ctrl@entry=0x5347c0, ret_sig=0x7fffffffca08, pk=pk@entry=0x529a90, uid=0x548f90, 
    subpk=subpk@entry=0x0, pksk=pksk@entry=0x589500, sigclass=16, timestamp=<optimized out>, duration=0, 
    mksubpkt=0x413e20 <sign_mk_attrib>, opaque=0x7fffffffca20, cache_nonce=0x0) at /home/ingo/dev/g10/src/gnupg-2.6/g10/sign.c:1927
#2  0x00000000004182d0 in sign_uids (ctrl=ctrl@entry=0x5347c0, fp=fp@entry=0x0, keyblock=<optimized out>, 
    locusr=locusr@entry=0x535e00, flags=flags@entry=0, trustsigstr=trustsigstr@entry=0x0, ret_modified=0x7fffffffcb14)
    at /home/ingo/dev/g10/src/gnupg-2.6/g10/keyedit.c:1148
#3  0x000000000041f946 in keyedit_menu (ctrl=ctrl@entry=0x5347c0, 
    username=username@entry=0x538040 "3A8536D46F57779C49F0CF542C0444CB59852D29", locusr=0x535e00, commands=<optimized out>, 
    commands@entry=0x0, quiet=quiet@entry=0, seckey_check=seckey_check@entry=1) at /home/ingo/dev/g10/src/gnupg-2.6/g10/keyedit.c:1848
#4  0x00000000004103be in main (argc=<optimized out>, argv=<optimized out>) at /home/ingo/dev/g10/src/gnupg-2.6/g10/gpg.c:4809

gpg does not segfault if I remove the option --set-notation=rem@gnupg.org=foo from the command line.