Bug 538225

Summary: Message_set_reply_serial assumes that "long" is 32-bits wide
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: dbus-pythonAssignee: Dan Mashal <dan.mashal>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-29 08:41:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Malcolm 2009-11-17 23:46:27 UTC
Description of problem:
_dbus_bindings/message.c has this code:

Message_set_reply_serial(Message *self, PyObject *args)
{
    dbus_uint32_t value;

    if (!PyArg_ParseTuple(args, "k", &value)) return NULL;

[snip]

The 'k' format code expects a pointer to an "unsigned long" (see http://docs.python.org/c-api/arg.html).

On an architecture where "unsigned long" is 8 bytes wide (s390x, off the top of my head, probably other 64 bit archs), PyArg_ParseTuple will write 8 bytes into the stack location of "value", which presumably is only 4 bytes wide.  

So I believe this will fail on big-endian architectures for which "sizeof(long) > 4" , and also on such 64-bit archs in which the stack descends in memory (is this the case on any of our archs?).

Version-Release number of selected component (if applicable):
dbus-python-0.83.0

Found using my new static checker for Python code (which could be buggy):
http://dmalcolm.livejournal.com/3689.html

Comment 1 Bug Zapper 2010-03-15 13:05:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bug Zapper 2011-06-02 17:25:49 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Dave Malcolm 2011-06-08 20:08:36 UTC
Bug still present in latest git packaging sources.

Comment 4 Fedora Admin XMLRPC Client 2013-02-24 10:41:34 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Dan Mashal 2013-03-29 08:41:11 UTC
Please try

https://admin.fedoraproject.org/updates/FEDORA-2013-3108/dbus-python-1.1.1-3.fc18

And reopen if you still have issues.