From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C34DBC4360C for ; Wed, 2 Oct 2019 21:54:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D32720842 for ; Wed, 2 Oct 2019 21:54:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbfJBVyZ (ORCPT ); Wed, 2 Oct 2019 17:54:25 -0400 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:41372 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbfJBVyZ (ORCPT ); Wed, 2 Oct 2019 17:54:25 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1iFmZd-0005nW-C8; Wed, 02 Oct 2019 23:54:17 +0200 Date: Wed, 2 Oct 2019 23:54:17 +0200 From: Florian Westphal To: Eric Dumazet Cc: Florian Westphal , "David S . Miller" , netdev , Eric Dumazet , Hannes Frederic Sowa , syzbot Subject: Re: [PATCH net] ipv6: drop incoming packets having a v4mapped source address Message-ID: <20191002215417.GB13866@breakpoint.cc> References: <20191002163855.145178-1-edumazet@google.com> <20191002183856.GA13866@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Eric Dumazet wrote: > > > @@ -223,6 +223,16 @@ static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev, > > > if (ipv6_addr_is_multicast(&hdr->saddr)) > > > goto err; > > > > > > + /* While RFC4291 is not explicit about v4mapped addresses > > > + * in IPv6 headers, it seems clear linux dual-stack > > > + * model can not deal properly with these. > > > + * Security models could be fooled by ::ffff:127.0.0.1 for example. > > > + * > > > + * https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 > > > + */ > > > + if (ipv6_addr_v4mapped(&hdr->saddr)) > > > + goto err; > > > + > > > > Any reason to only consider ->saddr instead of checking daddr as well? > > I do not see reasons the packet should be accepted for sane configurations ? Fair enough, thanks for explaining.