Bug 58067

Summary: systemd-udevd and udevadm segfault on MSB platforms
Product: systemd Reporter: Eric Benoit <eric>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to fix issue with hwdb on MSB platforms
Slightly improved patch

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.