[Python-modules-team] python3-cffi-backend: does not handle pointers on ILP32 ABIs correctly (was Re: python-cryptography: FTBFS on x32: TestAssertNoMemoryLeaks and others (python3 issue?))

Thorsten Glaser t.glaser at tarent.de
Mon Jul 30 17:17:24 BST 2018


retitle 884705 python3-cffi-backend: does not handle pointers on ILP32 ABIs correctly
reassign 884705 python3-cffi-backend
found 884705 1.11.5-1+b1
affects 884705 src:python-cryptography
# remove those, as they were for python-cryptography
notforwarded 884705
tags 884705 = patch
thanks

Please see the following thread (former forwarded-to) for more debugging:
https://github.com/pyca/cryptography/issues/4078

I discovered that cffi’s mechanism to zero- or sign-extend values
smaller than the CPU register size (ffi_arg) was only applied to
signed or unsigned integer values but not pointers, whereas the
x86-64 (amd64 and x32) ELF psABI specifies that 32-bit pointers
passed in 64-bit registers must be zero-padded.

Some architectures might require sign-padding them instead, but
considering that x32 appears to be the first one actually running
into this issue I’d default to zero-pad them on all architectures.
The extra code path will only ever be triggered on 64-bit ILP32
architectures, which are basically all new (unless MIPS n32 was
one of them, but I don’t think so, or they’d have been hit from
this bug).

Please forward this upstream and apply it in Debian, to make
packages that use cffi work reliably on x32.

Thanks,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.diff
Type: text/x-diff
Size: 517 bytes
Desc: 
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20180730/46e2f03f/attachment.diff>


More information about the Python-modules-team mailing list