Bug 58067 - systemd-udevd and udevadm segfault on MSB platforms
Summary: systemd-udevd and udevadm segfault on MSB platforms
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-10 05:32 UTC by Eric Benoit
Modified: 2012-12-11 14:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix issue with hwdb on MSB platforms (887 bytes, text/plain)
2012-12-10 05:32 UTC, Eric Benoit
Details
Slightly improved patch (1.72 KB, patch)
2012-12-10 05:57 UTC, Eric Benoit
Details | Splinter Review

Description Eric Benoit 2012-12-10 05:32:00 UTC
Created attachment 71250 [details]
Patch to fix issue with hwdb on MSB platforms

I recently upgraded to udev-196-r1 (systemd-196) on Gentoo Linux on SPARC, and observed (with USE=hwdb and the database created) systemd-udevd and udevadm to be causing segfaults. Further investigation (tested on PowerPC) and some debugging reveals this to be an endianness issue. The attached patch appears to correct the issue, but may not be the most elegant fix.

Note that node->values_count is also referenced at libudev-hwdb.c:239, though in my testing was not reached. It may be similarly affected.
Comment 1 Eric Benoit 2012-12-10 05:57:06 UTC
Created attachment 71251 [details] [review]
Slightly improved patch
Comment 2 Kay Sievers 2012-12-11 12:02:15 UTC
Are you sure you wanted to remove the loop:
  for (i = 0; i < node->values_count; i++) {
?
Comment 3 Eric Benoit 2012-12-11 13:47:12 UTC
(In reply to comment #2)
> Are you sure you wanted to remove the loop:
>   for (i = 0; i < node->values_count; i++) {
> ?

Whoops, you're right. I was thinking the preceding conditional would always have this loop iterate exactly once. Back to my original patch.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.