This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] glibc: Terminate process on invalid netlink response from kernel [BZ #12926]
- From: Hannes Frederic Sowa <hannes at stressinduktion dot org>
- To: libc-alpha at sourceware dot org
- Date: Sat, 24 Oct 2015 16:21:10 +0200
- Subject: Re: [PATCH] glibc: Terminate process on invalid netlink response from kernel [BZ #12926]
- Authentication-results: sourceware.org; auth=none
- References: <562A9391 dot 1040806 at redhat dot com> <20151024042203 dot GQ26317 at vapier dot lan>
Hello,
On Sat, Oct 24, 2015, at 06:22, Mike Frysinger wrote:
> On 23 Oct 2015 22:07, Florian Weimer wrote:
> > --- /dev/null
> > +++ b/sysdeps/unix/sysv/linux/netlink_assert_response.c
> > @@ -0,0 +1,100 @@
> > +/* Copyright (C) 2015 Free Software Foundation, Inc.
> > + This file is part of the GNU C Library.
>
> guess we like to have the first line be a short desc of the file
>
> > +static int
> > +get_address_family (int fd)
> > +{
> > ...
> > + return sa.ss_family;
>
> ss_family is of type sa_family_t, not int ... not a big deal, but the
> two do differ in sign ...
Another option is to simply use a setsockopt SO_DOMAIN to retrieve the
socket family. Does not need 128 bytes on the stack, but that shouldn't
be really a problem.
Bye,
Hannes