Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3054044ybi; Tue, 2 Jul 2019 01:13:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxk/9GYGu51usaDhF36VjuSmksjqZYPcC0im4H8ETptbvLkQRklbyFnuZslF3OJ4CFZWc31 X-Received: by 2002:a63:c10d:: with SMTP id w13mr28920468pgf.28.1562055220894; Tue, 02 Jul 2019 01:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562055220; cv=none; d=google.com; s=arc-20160816; b=t8uLjaPna0wRfA0rpKg6Qe5n8IIvOBy21BrBzAgrYvK4/UeWA9BCc2dgUVJbkgBloS ZKw/yi/F2sf5KYM0Sy5nErh8wioPK61KzoQHvdbkIm6s0l4kVy6QX9JqJ2WyClzJWPRG m5Q4Hz2h8v5S51NgmD21juaQ45mAvm+XZJ9Lr7e5wIcgenHSdfPQ5Un9fvs0TtVGbGJy Qk+8YkkmrITFGPDJKWr3Q62W11WKoULOEKPilRaXqMkkKF+Cpu7kmU45bgiApuW245Ok L83/+a3/LuIsbWjSM9YR1B0Vje18oNh+Mu95kOyXXQDTwj6BmJFuCCICtkyhEvtwXI5s wzQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KBWknwohWOv/3fBJBN08YXaX6Py3qoYgkCmAJen3AAU=; b=kAP2TUM3lou8IkEQKXuhtA5Y2e3pkTVYWsyUnxHE4m9mTUxIQfWuoeHJkT9fgRWgKg MBaJvBuvnaEf720/PROhjp5NchDhioqzEYB94l5fZS4xNx6KfA9qiK1pxhWqwZS8loYe JdLfKdsHiCljewOZTpmLiwspjx4wakS2V4bt/cxcSiyod8oiJJYKWUHfMSM9XVwrz1JT 5dgy1qa6eZIu5guTCVJfcdhu1TZMxjorhFjjKMcIrWXG9If2nyC+TuZ87qXxWfykllKd 06FxUKIiXoJ2u7L3mr12lJAtgBzBBxhNu8wq/Yk/SYNWO4nMMwK2X0iQBaZ582czakvn sbjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dlYrJDKB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si11995876plo.328.2019.07.02.01.13.26; Tue, 02 Jul 2019 01:13:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dlYrJDKB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbfGBIIc (ORCPT + 99 others); Tue, 2 Jul 2019 04:08:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:56068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfGBII3 (ORCPT ); Tue, 2 Jul 2019 04:08:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D90721851; Tue, 2 Jul 2019 08:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562054908; bh=pZuPC87F7Ez7v8MKlVnZCC8cf5cYx8wCtINfbQZCZWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dlYrJDKBdTGGurdGLVPpigEsWQbsVIREKYlRSxT0zy3dcgOlaUZJcuDvNMD8UszFQ uHqf3WVsDp6xdNIxciaJ++OjHMfoRHJHsKJisK4B7J05RH53AozWdwX9fQK6Th5ZGK v032E/I8w0a3OEmsBWQq2euiLjz8E58S91g3QrCI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Herbert , Martin KaFai Lau , Song Liu , Alexei Starovoitov Subject: [PATCH 4.19 66/72] bpf: udp: Avoid calling reuseports bpf_prog from udp_gro Date: Tue, 2 Jul 2019 10:02:07 +0200 Message-Id: <20190702080128.065178436@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080124.564652899@linuxfoundation.org> References: <20190702080124.564652899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin KaFai Lau commit 257a525fe2e49584842c504a92c27097407f778f upstream. When the commit a6024562ffd7 ("udp: Add GRO functions to UDP socket") added udp[46]_lib_lookup_skb to the udp_gro code path, it broke the reuseport_select_sock() assumption that skb->data is pointing to the transport header. This patch follows an earlier __udp6_lib_err() fix by passing a NULL skb to avoid calling the reuseport's bpf_prog. Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket") Cc: Tom Herbert Signed-off-by: Martin KaFai Lau Acked-by: Song Liu Signed-off-by: Alexei Starovoitov Signed-off-by: Greg Kroah-Hartman --- net/ipv4/udp.c | 6 +++++- net/ipv6/udp.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -542,7 +542,11 @@ static inline struct sock *__udp4_lib_lo struct sock *udp4_lib_lookup_skb(struct sk_buff *skb, __be16 sport, __be16 dport) { - return __udp4_lib_lookup_skb(skb, sport, dport, &udp_table); + const struct iphdr *iph = ip_hdr(skb); + + return __udp4_lib_lookup(dev_net(skb->dev), iph->saddr, sport, + iph->daddr, dport, inet_iif(skb), + inet_sdif(skb), &udp_table, NULL); } EXPORT_SYMBOL_GPL(udp4_lib_lookup_skb); --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -282,7 +282,7 @@ struct sock *udp6_lib_lookup_skb(struct return __udp6_lib_lookup(dev_net(skb->dev), &iph->saddr, sport, &iph->daddr, dport, inet6_iif(skb), - inet6_sdif(skb), &udp_table, skb); + inet6_sdif(skb), &udp_table, NULL); } EXPORT_SYMBOL_GPL(udp6_lib_lookup_skb);