Bug 695426

Summary: SIGBUS resolving srv records
Product: Red Hat Enterprise Linux 6 Reporter: Stephen Gallagher <sgallagh>
Component: c-aresAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: urgent Docs Contact:
Priority: high    
Version: 6.1CC: azelinka, dennis, dhorak, dpal, jhrozek, mkhusid, tcallawa
Target Milestone: rc   
Target Release: ---   
Hardware: sparcv9   
OS: Linux   
Whiteboard:
Fixed In Version: c-ares-1.7.0-6.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 695424 Environment:
Last Closed: 2012-06-20 14:27:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 695424    
Bug Blocks: 750334    
Attachments:
Description Flags
A reproducer none

Description Stephen Gallagher 2011-04-11 17:24:55 UTC
+++ This bug was initially created as a clone of Bug #695424 +++

Created attachment 491286 [details]
full backtrace of the crash

Description of problem:

using sssd with srv record lookup enabled im getting a sigbus in c-ares on sparc

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


How reproducible: always


Steps to Reproduce:
1. start sssd
2. try to log in
3.
  
Actual results:
Program received signal SIGBUS, Bus error.
ares_parse_srv_reply (abuf=0xff855720 ")r\205\200", alen=238, srv_out=0xff85551c) at ares_parse_srv_reply.c:142
142	          srv_curr->priority = ntohs (*((unsigned short *)vptr));

Expected results:
things to work

Additional info:

SIGBUS on sparc means that there is a memory alignment issue.  this will likely effect arm and s390 also

Comment 1 Jakub Hrozek 2011-04-12 08:19:20 UTC
Created attachment 491425 [details]
A reproducer

A simple program that is able to resolve a SRV query. To compile, run:

gcc ares_srv.c -o ares_srv -lcares

To resolve a query, pass a nameserver and a SRV query to the program:

./ares_srv 1.2.3.4 _ldap._tcp.example.com

Comment 5 Jakub Hrozek 2011-12-11 19:03:38 UTC
This was fixed upstream by using the DNS__<XY>BIT macros instead of ntohs.

Comment 9 errata-xmlrpc 2012-06-20 14:27:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0922.html