GNOME Bugzilla – Bug 767122
test-suite failure on 32bit architectures
Last modified: 2021-06-18 10:39:37 UTC
Version: 3.20.0 As can be seen at https://buildd.debian.org/status/package.php?p=gnome-keyring the test-suite fails on various architectures The failing tests are ERROR:pkcs11/gnome2-store/test-gnome2-private-key.c:147:test_save_private_key: assertion failed: (gkm_data_der_read_private_pkcs8_crypted (data, "booo", 4, &sexp) == GKM_DATA_SUCCESS) FAIL: test-gnome2-private-key 2 /gnome2-store/private-key/save ERROR: test-gnome2-private-key process failed: 250 ERROR:pkcs11/gkm/test-data-der.c:574:test_write_pkcs8_encrypted: assertion failed: (res == GKM_DATA_SUCCESS) FAIL: test-data-der 16 /gkm/data-der/write_pkcs8_encrypted ERROR: test-data-der process failed: 250 This points are a real issue on 32bit architectures.
I have reported this earlier in bug 754633. Today I did some investigation of this, and found that there is an integer overflow in atlv_parse_length() function. There is the following fragment of code in that function: while (punt <= k && punt < n_data) { last = ans; ans = ans * 256; ... } By multiplying by 256, we quickly reach the max size of int on 32-bit systems. Here is my log for values of ans: ans = 0 ans = 0 + 254 = 254 ans = 254 * 256 = 65024 ans = 65024 + 187 = 65211 ans = 65211 * 256 = 16694016 ans = 16694016 + 7 = 16694023 ans = 16694023 * 256 = -21297408 // oops! ans < last, returning -2 I know nothing about what this function is for and in what range should the return values be, so I will leave it to Stef to decide what to do here.
Stef, would be great to have your input on this.
I looked at this a bit (ran out of time) and came to the conclusion that this was related to a bad encoding rather than lousy decoding. More soon, hopefully.
Hi Stef, do you have any updates?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/ Thank you for your understanding and your help.