public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v3] Linux: Simplify __opensock and fix race condition [BZ #28353]
Date: Wed, 17 Nov 2021 14:54:07 +0100	[thread overview]
Message-ID: <87v90q6g74.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <371babb1-e79e-fb0b-b021-fa167bf023b0@linaro.org> (Adhemerval Zanella's message of "Mon, 8 Nov 2021 14:22:29 -0300")

* Adhemerval Zanella:

> On 27/09/2021 15:53, Florian Weimer via Libc-alpha wrote:
>> AF_NETLINK support is not quite optional on modern Linux systems
>> anymore, so it is likely that the first attempt will always succeed.
>> Consequently, there is no need to cache the result.  Keep AF_UNIX
>> and the Internet address families as a fallback, for the rare case
>> that AF_NETLINK is missing.  The other address families previously
>> probed are totally obsolete be now, so remove them.
>> 
>> Use this simplified version as the generic implementation, disabling
>> Netlink support as needed.
>
> It seems that defaulting to AF_NETLINKS fails for some operations on
> older kernels:
>
> $ uname -a
> Linux ubuntu16 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
> $ ./testrun.sh --tool=strace inet/test_ifindex --direct
> [...]
> socket(PF_NETLINK, SOCK_DGRAM|SOCK_CLOEXEC, NETLINK_ROUTE) = 3
> ioctl(3, SIOCGIFINDEX, {ifr_name="lo"}) = -1 EOPNOTSUPP (Operation not supported)
> close(3)                                = 0
>
> I am not sure if this something related to the system configuration or
> some security features, but AF_UNIX does work in this case.

Right.  I will send a patch.  I think it's not worth trying AF_NETLINK
at all.

Thanks,
Florian


      reply	other threads:[~2021-11-17 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 18:53 Florian Weimer
2021-09-28 14:38 ` Adhemerval Zanella
2021-11-08 17:22 ` Adhemerval Zanella
2021-11-17 13:54   ` Florian Weimer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v90q6g74.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).