NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/57043: netpgp --help crashes



>Number:         57043
>Category:       bin
>Synopsis:       netpgp --help crashes
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 02 14:25:00 +0000 2022
>Originator:     Rhialto
>Release:        NetBSD 9.3
>Organization:
>Environment:
System: NetBSD murthe.falu.nl 9.3 NetBSD 9.3 (MAXLWP8192) #0: Sat Aug 6 22:25:06 CEST 2022 rhialto%murthe.falu.nl@localhost:/mnt/scratch/scratch/NetBSD/NetBSD-9.3/source/sets/x/usr/src/sys/arch/amd64/compile/MAXLWP8192 amd64
Architecture: x86_64
Machine: amd64
>Description:
	Like in PR #57042 https://gnats.netbsd.org/57042, netpgp seems
	to want to do something with my gnupg keyring when it has no
	business doing so.  In the course of doing that, it even
	crashes.
>How-To-Repeat:
	$ netpgp --help
	Segmentation fault
	$ 

	$ gdb --args netpgp --help
	GNU gdb (GDB) 8.3
	...
	Reading symbols from netpgp...
	Reading symbols from /mnt/vol1/usr/libdata/debug//usr/bin/netpgp.debug...
	(gdb) run
	Starting program: /usr/bin/netpgp --help

	Program received signal SIGSEGV, Segmentation fault.
	0x00006fcd28028128 in cb_keyring_read (pkt=0x7f7fffe54f30, 
	    cbinfo=<optimized out>)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/keyring.c:623
	623                     EXPAND_ARRAY(key, subsig);
	(gdb) bt
	#0  0x00006fcd28028128 in cb_keyring_read (pkt=0x7f7fffe54f30, 
	    cbinfo=<optimized out>)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/keyring.c:623
	#1  0x00006fcd28022765 in parse_trust (stream=0x6fcd2833d000, 
	    region=0x7f7fffe50af0)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/packet-parse.c:2214
	#2  parse_packet (stream=stream@entry=0x6fcd2833d000, 
	    pktlen=pktlen@entry=0x7f7fffe56f8c)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/packet-parse.c:3161
	#3  0x00006fcd28024232 in pgp_parse (stream=stream@entry=0x6fcd2833d000, 
	    perrors=perrors@entry=0)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/packet-parse.c:3286
	#4  0x00006fcd28026472 in pgp_parse_and_accumulate (
	    keyring=keyring@entry=0x6fcd28345040, parse=parse@entry=0x6fcd2833d000)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/misc.c:203
	#5  0x00006fcd28028b6c in pgp_keyring_fileread (
	    keyring=keyring@entry=0x6fcd28345040, armour=armour@entry=0, 
	    filename=filename@entry=0x6fcd28342000 "/home/rhialto/.gnupg/pubring.gpg")
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/keyring.c:743
	#6  0x00006fcd2800d130 in readkeyring (netpgp=0x7f7fffe57630, 
	    name=0x6fcd2802cf96 "pubring")
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/netpgp.c:299
	#7  0x00006fcd2800d823 in netpgp_init (netpgp=0x7f7fffe57630)
	    at /usr/src/crypto/external/bsd/netpgp/lib/netpgp/../../dist/src/lib/netpgp.c:873
	#8  0x00000000670028ba in main (argc=<optimized out>, argv=0x7f7fffe57cb8)
	    at /usr/src/crypto/external/bsd/netpgp/bin/netpgp/../../dist/src/netpgp/netpgp.c:597
	(gdb) 

	My keyring isn't small, there could be any key which causes an issue,
	or it could be the sheer number of them, given the
	"EXPAND_ARRAY(key, subsig);".
>Fix:
	I don't know.



Home | Main Index | Thread Index | Old Index