mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: musl@lists.openwall.com
Cc: Bob Richmond <robert.richmond@greenwavesystems.com>
Subject: Re: [musl] getaddrinfo/AI_ADDRCONFIG with ipv6 disabled
Date: Fri, 30 Apr 2021 12:59:39 -0400	[thread overview]
Message-ID: <CAH8yC8nTwTST1YP_tteuEFOk0aqEwsg-+ptjjQp9zS4DpPuxDw@mail.gmail.com> (raw)
In-Reply-To: <20210430123803.GX2546@brightrain.aerifal.cx>

On Fri, Apr 30, 2021 at 8:38 AM Rich Felker <dalias@libc.org> wrote:
> ....
> It's been raised that this is NOT a result of
>
>     echo 1 >/proc/sys/net/ipv6/conf/lo/disable_ipv6
>
> but rather appears to be fib6 policy setup by OpenWRT for some reason,
> whereby the kernel (net/ipv6/fib6_rules.c: fib6_rule_action)
> synthesizes error codes for routing policy reasons. This is probably
> wrong for the kernel to do -- especially their re-appropriation of
> EINVAL for FR_ACT_BLACKHOLE when POSIX already specifies it for
>
>     "The address_len argument is not a valid length for the address
>     family; or invalid address family in the sockaddr structure."
>
> So in light of this mess, the patch may be correct, despite the
> problem being misattributed, but it should probably also handle the
> EINVAL case. Also it's not 100% clear whether we should interpret this
> as "no IPv6" or ignore it as an access control policy rather than
> reflection of IPv6 existing. If there are any other ways the kernel
> can return EACCES or EINVAL here, we would not want to misinterpret
> that in a way that breaks IPv6.
>
> Someone should probably also ping OpenWRT about why they're using this
> arcane mechanism to block IPv6 to localhost.

The kernel has been doing that stupid thing for ages. They have no
interest in fixing it. (I brought it up on one of the kernel mailing
lists).

It gets worse with components like SELinux. They hijack error codes
there, too. You can waste hours trying to track down an EACCESS on a
web server only to find out the kernel hijacked the return code in
SELinux.

God forbid they actually provide a selinux_errno to check for SELinux errors...

Jeff

  parent reply	other threads:[~2021-04-30 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  2:44 Bob Richmond
2021-04-30  0:13 ` [musl] " Rich Felker
2021-04-30 12:38   ` Rich Felker
2021-04-30 16:40     ` Bastian Bittorf
2021-04-30 16:52       ` Rich Felker
2021-04-30 17:59         ` Julian Squires
2021-04-30 16:59     ` Jeffrey Walton [this message]
2021-04-30 18:49       ` Markus Wichmann
2021-04-30 19:50         ` Rich Felker

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=CAH8yC8nTwTST1YP_tteuEFOk0aqEwsg-+ptjjQp9zS4DpPuxDw@mail.gmail.com \
    --to=noloader@gmail.com \
    --cc=musl@lists.openwall.com \
    --cc=robert.richmond@greenwavesystems.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).