Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1676961pxu; Sun, 6 Dec 2020 03:43:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzO0SkgkLLzruERWrjZ1k5H0LlKD+qAChdT4sE+Wr6agB6P0Vz0ERF5HdI7ru8R9c4vjPtr X-Received: by 2002:a05:6402:180c:: with SMTP id g12mr15659753edy.268.1607255029515; Sun, 06 Dec 2020 03:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607255029; cv=none; d=google.com; s=arc-20160816; b=qZAQoi8CccOz9cg09qtBy75F0sERGPdVfZf9/lGSlKH1YIc7FZ3blcBFAZdxve1T2P go1yMoHOZ47Vpz1gm+V6RcOd7VvFoegcFxr5mZ7PQtC1LPIXoJREfyE6PN+Ji12dStCA os4SsLM4lB6V0NUAK5GJk8PJKZqfPfKGWbpzzeQgpbq7tLaQBiRknzkSVDNgIVtyoNV9 ctfEZfXJBr9eRvflUIVMjMcbBAPetLmqT5MWJsdiHnr18wJm3uxdy5bPTXeJkt80HG0O STM4/NHXnegV4RMqwiiRXTp15h+r0KX3/BxpgSKG6cZouMCboujkwcyXQMHSvsy+7tsO PsOQ== 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=4AForqVxHL7ns552GhvN20owlKpDLz4G4/ood7NZI7s=; b=Gw82YIRE2mrXIq6PB993kykmADse7Xu3AYz3jYRaEhAxryUFnNzu3xR7nL3S8Bfdzx jLLj2KZMhJzMsB8/uvaJ0MlxNlAklNqkzJqB8E5z1aZ0KhCUBKt5x3LGllAZnFG9k9Ff g2S7lFkVXvyRh5wqcuDF8yk/VcvYapc7FRxLN39J3GXzxJuXb4W3GpHmB5ZEGLbmzPQw rmG1RscUxSMrSHabdp6wYz3TLchmVXS+TjfUVcQZZBuovOGxwU3S6gPXoPlHwqPTteAG nxNlGoC06IABc6g1ebYzbKCFwG7eB4EhBpggHVP2yyXZV4hfTbH4/Keg7N27csQ0nRxx +BdQ== 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 g7si177666ejh.224.2020.12.06.03.43.26; Sun, 06 Dec 2020 03:43:49 -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 S1728444AbgLFLkI (ORCPT + 99 others); Sun, 6 Dec 2020 06:40:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:37102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728315AbgLFLkI (ORCPT ); Sun, 6 Dec 2020 06:40:08 -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, Ayush Ranjan , Willem de Bruijn , Soheil Hassas Yeganeh , Jakub Kicinski Subject: [PATCH 4.19 05/32] sock: set sk_err to ee_errno on dequeue from errq Date: Sun, 6 Dec 2020 12:17:05 +0100 Message-Id: <20201206111556.044388601@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206111555.787862631@linuxfoundation.org> References: <20201206111555.787862631@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: Willem de Bruijn [ Upstream commit 985f7337421a811cb354ca93882f943c8335a6f5 ] When setting sk_err, set it to ee_errno, not ee_origin. Commit f5f99309fa74 ("sock: do not set sk_err in sock_dequeue_err_skb") disabled updating sk_err on errq dequeue, which is correct for most error types (origins): - sk->sk_err = err; Commit 38b257938ac6 ("sock: reset sk_err when the error queue is empty") reenabled the behavior for IMCP origins, which do require it: + if (icmp_next) + sk->sk_err = SKB_EXT_ERR(skb_next)->ee.ee_origin; But read from ee_errno. Fixes: 38b257938ac6 ("sock: reset sk_err when the error queue is empty") Reported-by: Ayush Ranjan Signed-off-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Link: https://lore.kernel.org/r/20201126151220.2819322-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4265,7 +4265,7 @@ struct sk_buff *sock_dequeue_err_skb(str if (skb && (skb_next = skb_peek(q))) { icmp_next = is_icmp_err_skb(skb_next); if (icmp_next) - sk->sk_err = SKB_EXT_ERR(skb_next)->ee.ee_origin; + sk->sk_err = SKB_EXT_ERR(skb_next)->ee.ee_errno; } spin_unlock_irqrestore(&q->lock, flags);