Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Dec 2004 20:24:17 -0500 (EST)
From:      Atom 'Smasher' <atom@suspicious.org>
To:        gnupg-devel@gnupg.org, freebsd-bugs@freebsd.org
Subject:   GnuPG + FreeBSD 5.3 = intermitent memory warning
Message-ID:  <20041212192018.P99530@willy.wonka>
In-Reply-To: <20041210150749.GA1379@jabberwocky.com>
References:  <20041208014034.A62757@willy.wonka> <20041210150749.GA1379@jabberwocky.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-625275858-1102901057=:99530
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

** cross posted **

for those not familiar with GnuPG, read here for relevant background info: 
http://www.gnupg.org/documentation/faqs.html#q6.1

if the binary is suid-root, it should not generate warnings about insecure 
memory. my binary *is* suid-root, and whether it's run as a privileged or 
unprivileged user i get intermittent warnings about insecure memory.

i only noticed this intermittent behavior after upgrading from FreeBSD 4.9 
to 5.3. i'm seeing essentially the same results with GnuPG 1.2 and 1.3 
branches.

attached is a script and the output from 1000000 invocations of gpg (just 
over 24 hours on a duron-1200). there were 543398 (almost 55%) errors. at 
first i thought that there was a relation between the errors and 
downloading large files, but now i'm not sure if that's a factor.

SHA-1 checksums:
   126694aa13085e757c1fb75e105549b9d6997fc2 gnupg_err.txt.gz
   6332229dafcc8f5b4becfc74fd2f39b9af4d2164 gpg_memory_warning.sh.gz

the "gnupg_err.txt" was produced by running:
 	./gpg_memory_warning.sh 1000 1000 | tee gnupg_err.txt



On Fri, 10 Dec 2004, David Shaw wrote:
> On Wed, Dec 08, 2004 at 02:12:30AM -0500, Atom 'Smasher' wrote:
>
>> i thought i was either going crazy or stupid, but i really am getting
>> intermittent warnings:
>>  	WARNING: using insecure memory!
>>
>> the test above is unique, because usually in a test of 100, 500, or 1000
>> trials i get either 0% or 100% warnings. before getting that result, i got
>> a bunch of 100% error... after running that test i got a bunch of 0%
>> error.
>>
>> i suspect that it might be a bug in FreeBSD 5.3-RELEASE since i haven't
>> noticed it before. now i'm having the same problem with 1.2.6 and 1.3.92.
>> has anyone else noticed this?
>
> I tried to duplicate it on Linux, but without any luck.  It might be a
> FreeBSD thing, or it might be something particular to your machine?
> I've never heard of this happenening, even on FreeBSD, so I don't know
> what to think yet.
>
>> please advise how to trace this problem when it appears... i'm not sure
>> which --debug flag(s) or process-tracking applications (with what options)
>> will be most useful.
>
> If you do C, take a peek at the code in util/secmem.c:lock_pool.  It
> is unfortunately quite rich in #ifdefs since locking memory is pretty
> platform-specific.  Add some debugging there - say, printing out errno
> whenever mlock() returns -1.
=================

i'm not much good in C :(



- -- 
         ...atom

  _________________________________________
  PGP key - http://atom.smasher.org/pgp.txt
  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
  -------------------------------------------------

 	"Military men are just dumb stupid animals
 	 to be used as pawns in foreign policy."
 		-- Henry Kissinger,
 	Kiss the Boys Goodbye: How the United
 	States Betrayed Its Own POWs in Vietnam

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.92 (FreeBSD)
Comment: What is this gibberish?
Comment: http://atom.smasher.org/links/#digital_signatures

iQEcBAEBCAAGBQJBvO9JAAoJEAx/d+cTpVci1qIH/A2wqA3gUjm2waWnzqBsKEj1
NiEp4cIbxsrDRsFzmHxlJzSL322toXoDIbBVKvsBLqH9ZgtTos3Kc26sk+Vt1lo9
IpsKj2QxXEcXKgs6drVgLXacfgldcl/WCY2iuicdMs5gw/415rKZQyS/Eerhx7jm
0K+xGxhfJYaaS6lPswZvB1GeANwxU9nVrbmbTb/6roNiMxL6O8BThwP3jD/Ne+FB
v7YxkbFQUyqq4WMO3Qfee2gy9zox+BG8oaC7xBNlvlGZXH7sPlotzJkpZhKVoBHF
o5TM+vSYSGJV/OvXEH/XaWKApC1e+mfCKYqrCi0eMiT8X4bXofVAcry0oc1HMOQ=
=z+OV
-----END PGP SIGNATURE-----
--0-625275858-1102901057=:99530
Content-Type: APPLICATION/octet-stream; name="gpg_memory_warning.sh.gz"
Content-Transfer-Encoding: BASE64
Content-ID: <20041212202417.E99530@willy.wonka>
Content-Description: 
Content-Disposition: attachment; filename="gpg_memory_warning.sh.gz"

H4sIANdZu0ECA62TUW/TMBDHn+NPceuabYila4d4KdrKYKVMGgOtQwimirrJ
JTFL7Mh2KFXb7845KWoG5W1+iGz/7353uTvv753MhDwxKWP7T7AIAhaNBRNq
UViwCkJuwxSEtKhzYVFaGMny0whyzJVewJxrKWQCMRdZqdE4Arcqf21yblLU
HaUTtgU7UyHhnUZ8M76El50Xwe3wengxHoJJ1dw8CoRaK10R6x3lImGGZBOV
IUYwW0Ck5jJTPHJcDhnXCUIsMgSlYTAYPE1RWKZU8V1Iifqs3atPqrTudMqY
iOEe9qDVXm7N1i2YwGq1UwgSC12ST88PIGA2Rcm8RoBet8ti8Q+2ircL+0f4
L7bOtFdBlwxoUUFDJY2IUINNhYFI8EQq6k5ItY3VMXAZgUH60AAYS3aanCpf
DFMFrdLwBPvQXnbXcL9NfrOvIk4mrYbDVSVfk+q8GvXwjoT8qR4QkiKpk8m5
XIAVORooXII0Nc+aqI+O/hhV18A70qVsMsjTkOsaeucH1KiYZkK66Zv+UPbv
+k1ZpJiHvwqlLdx9O/t89xaqmc0yiLhFV4nSINA9mblEAgJVynP/a8fPO350
7L/v+x/6/tibMm93tM0QkO7Cecuavar+PggyYWzwgAsDronwCtaunT3SMdFY
wOGXi9ubq5tRn1KpX5LBkF7d5jEeOqp0uHkIQcbcgf0GmhbxWCIEAAA=

--0-625275858-1102901057=:99530
Content-Type: APPLICATION/octet-stream; name="gnupg_err.txt.gz"
Content-Transfer-Encoding: BASE64
Content-ID: <20041212202417.L99530@willy.wonka>
Content-Description: 
Content-Disposition: attachment; filename="gnupg_err.txt.gz"

H4sIAPyuvEECA32dW5LDug1E/7OKLCCVEl4U5f0vLARoy7keHM1vl2QCghoP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O19KJY5wZ5fD9/8Awzoxy+P5fYRhnRjl8/68wjDOnHL7/V5iR
z5xy+P5fYUo+c8rhur8PTT7zf+Tw/wGpefibYG0AAA==

--0-625275858-1102901057=:99530--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041212192018.P99530>