Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2878018pxu; Sat, 19 Dec 2020 05:06:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/2XEWVnH0ILaNsAmtx12q8oYl3bMhKEbD7+5oFuP9iTU0GDxm24kbpLOWpFVZS3mTAluF X-Received: by 2002:a17:906:ce2b:: with SMTP id sd11mr8383867ejb.334.1608383164028; Sat, 19 Dec 2020 05:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383164; cv=none; d=google.com; s=arc-20160816; b=fY9bXX/EdVXfqDP5z/JQIYnj9FkO0MZMi8WkhLzGLNZ63c+0YJ7i8wY4nqwGk1xoIz FOpXni06NFxapdvRDRS/6zQI94QHx5J5gj5wNbxwSgcPx6YvoYzm8x0wsDL0pnEXHlfP AO85peqejbQWhy7rz29xEefoQXTUj3HpeZFHKVVmeXw+sEVGDZg1zlsHvZK507We47rB 1jqlONTCHXzCdhROygxVYfXTe8SDzOKkw4PnWBynShlme2xL1D/HOh3bBjL3ovJuLeWi xuVf3k+IZggS7geAug9T49RXt11LehJLHIu4O6KebfY6pax1JaTiKcWXr9VZd+cBb9eD QHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=q/ALtjQq7+CQ6GOLjlRo/7jatgOLCSrVYd+9cUkTMug=; b=wNx7BaaILIf5RyYp6HRxpdchM8Bw+2ftaWvWQlCZS7vkb81/3Pb1O+Wd4qw7reueSr S0aO8Y7kCFHVCq6hZniFC7a1RfZqAGCJfe1FAIG079G6J4l+NzNJ1HOZyLu7pRB/ad5V q+XxahsZzWlSgLMKqQGBbXULNozO1fpURqnUV/DrFylvoUGMejHTJDpFGHUWod/2aTL2 g02JymadKLPmFuAfVTWMDdFShA+1t/30PX2Gw7H2nvTDksOkLU3FihoqPj8Nfjix4Gb0 oHyDoDfmWx67RhTDCUGltz11fTOLK1fVe0zdYfITr+eBFtBLXgIBXJHfBuRTNvNcnOr+ 5vuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si9430921edq.123.2020.12.19.05.05.41; Sat, 19 Dec 2020 05:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgLSNEM (ORCPT + 99 others); Sat, 19 Dec 2020 08:04:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:51314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728649AbgLSND7 (ORCPT ); Sat, 19 Dec 2020 08:03:59 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , Xin Long , "David S. Miller" Subject: [PATCH 5.4 07/34] udp: fix the proto value passed to ip_protocol_deliver_rcu for the segments Date: Sat, 19 Dec 2020 14:03:04 +0100 Message-Id: <20201219125341.738014350@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xin Long [ Upstream commit 10c678bd0a035ac2c64a9b26b222f20556227a53 ] Guillaume noticed that: for segments udp_queue_rcv_one_skb() returns the proto, and it should pass "ret" unmodified to ip_protocol_deliver_rcu(). Otherwize, with a negtive value passed, it will underflow inet_protos. This can be reproduced with IPIP FOU: # ip fou add port 5555 ipproto 4 # ethtool -K eth1 rx-gro-list on Fixes: cf329aa42b66 ("udp: cope with UDP GRO packet misdirection") Reported-by: Guillaume Nault Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2117,7 +2117,7 @@ static int udp_queue_rcv_skb(struct sock __skb_pull(skb, skb_transport_offset(skb)); ret = udp_queue_rcv_one_skb(sk, skb); if (ret > 0) - ip_protocol_deliver_rcu(dev_net(skb->dev), skb, -ret); + ip_protocol_deliver_rcu(dev_net(skb->dev), skb, ret); } return 0; }