Re: [v3] net/ceph/messenger: support IPv6 Link-Local with scope identifier

Max Kellermann <[email protected]>
Newsgroups org.kernel.vger.ceph-devel
Message-ID <CAKPOu+-oYFT=-q60-92R-6jh9ZiCTxe1SkH090HTeC9HZ+EhPQ@mail.gmail.com>
On Tue, Aug 11, 2026 at 4:32 PM Alex Markuze <[email protected]> wrote:
>   1. [critical] messenger.c:1259: scope_id leaks into wire identity, breaking handshake
>      `inet_pton_with_scope()` stores the local interface index in

Uh-oh! The Ceph protocol indeed copies struct sockaddr as-is on the
wire. Is that portable?

Any way to work around this mess is ugly. I decided to fix that by
wrapping the memcmp() in a function that clears the scope id. That
requires no extra storage, and it's still possible to see the scope id
in log messages (though ceph_pr_addr() still ignores the scope id
currently).

>   2. [minor] messenger.c:1334: Allocation failure masked by DNS fallback
>      `ceph_pton()` can return `-ENOMEM` from `kstrndup()`, but
>      `ceph_parse_server_name()` treats any non-zero return as "not an IP
>      literal" and falls through to `ceph_dns_resolve_name()`. This
>      silently turns OOM into a spurious DNS lookup.
>      Suggested fix: Fall back to DNS only on `-EINVAL`; propagate
>      `-ENOMEM` directly.
>   3. [nit] messenger.c:1247: GFP_NOFS in non-filesystem context
>      `kstrndup(str, len, GFP_NOFS)` is used during mount option parsing
>      — process context, no filesystem locks held. `GFP_KERNEL` would be
>      more appropriate.

All three fixed in v4.

-- 
Max Kellermann
Principal Architect
Hosting Technology

cm4all | Im Mediapark 6a | 50670 Köln | Germany
General information about the company can be found here:
https://www.cm4all.com/impressum
A member of the IONOS Group
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.