Your message dated Tue, 7 Jan 2025 22:20:36 +0100
with message-id <z32apgwphlfag...@aurel32.net>
and subject line Re: Bug#472269: libc6: res_query makes assumptions about the
alignment of the answer argument
has caused the Debian Bug report #472269,
regarding libc6: res_query makes assumptions about the alignment of the answer
argument
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
472269: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472269
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.7-9
Severity: normal
Hi,
libc6 assumes the answer argument to the res_query function which is of
type unsigned char * is aligned in such a way it can be cast to HEADER.
Thus following apparently correct code causes a SIGBUS on sparc:
#include <stdio.h>
#include <arpa/nameser.h>
#include <resolv.h>
int
main (int argc, char ** argv) {
unsigned char padding[3];
unsigned char answer[1024];
res_query ("_xmpp-client._tcp.gmail.com", C_IN, T_SRV,
answer, sizeof(answer));
return 0;
}
Which is obviously quite nasty.
Sjoerd
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=nl_NL (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libgcc1 1:4.3.0-1 GCC support library
libc6 recommends no packages.
-- debconf information:
glibc/upgrade: true
glibc/restart-failed:
glibc/restart-services:
--- End Message ---
--- Begin Message ---
Version: 2.36-1
Hi Dave,
On 2022-03-22 18:01, John David Anglin wrote:
> Package: libc6
> Followup-For: Bug #472269
>
> Dear Maintainer,
>
> I believe this bug is fixed upstream by the following commit:
>
> commit 05dec22d7be722987ff07aebf9690f6078b3c4e9 (HEAD -> master,
> origin/master,
> origin/HEAD)
> Author: John David Anglin <dang...@gcc.gnu.org>
> Date: Tue Mar 22 17:35:54 2022 +0000
>
> resolv: Fix unaligned accesses to fields in HEADER struct
>
> The structure HEADER is normally aligned to a word boundary but
> sometimes it needs to be accessed when aligned on a byte boundary.
> This change defines a new typedef, UHEADER, with alignment 1.
> It is used to ensure the fields are accessed with byte loads and
> stores when necessary.
>
> V4: Change to res_mkquery.c deleted. Small whitespace fix.
>
> V5: Move UHEADER typedef to resolv/resolv-internal.h. Replace all
> HEADER usage with UHEADER in resolv/res_send.c.
>
> Signed-off-by: John David Anglin <dave.ang...@bell.net>
> Reviewed-by: Adhemerval Zanella <adhemerval.zane...@linaro.org>
>
Indeed, thanks for the notice and sorry for the delay. Closing it.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://aurel32.net
--- End Message ---