From patchwork Thu Jun 1 14:39:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soheil Hassas Yeganeh X-Patchwork-Id: 769767 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wdqkg5yJxz9s7C for ; Fri, 2 Jun 2017 00:40:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="dx3vTd5V"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751173AbdFAOkJ (ORCPT ); Thu, 1 Jun 2017 10:40:09 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:34902 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdFAOkI (ORCPT ); Thu, 1 Jun 2017 10:40:08 -0400 Received: by mail-it0-f50.google.com with SMTP id f72so40150692ite.0 for ; Thu, 01 Jun 2017 07:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rOsETmZ2lK64ezia6rJ7Sd9j07v7lBH2gmnavhml36Q=; b=dx3vTd5V+UQsDVGtcL3Ay6uJYIYkgSnS+ouf7eowDitc2BwBBBQ6R+qcr+RZNNch3t vVsfxww7G+61PxIv9m0u+b1OH6LrjQ3roNpVwD2xmZcw8pNIGJ1dZFC7z0g7bTAEq2Xr eKVMmouZOHc2p+CHEdghNA4s2UqJpzIvTL1wRpIS7Zc7bKL+B69j95eObKasgnQMx/Z0 CiZ27w3sWA4jl3USQ+wo4dKZXpMuBLx1DAaa+QlZm/Y8aDlt3cfjhGQbTMBKYnyQhTfI 3lximpdyP72/SeQkfgS/eAlT45iLO3dlv0YgVCa6XRSL7vVHgpuuVIQ6hY6anDsiWxIV 5ybA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rOsETmZ2lK64ezia6rJ7Sd9j07v7lBH2gmnavhml36Q=; b=UMmasbysiJXJtXE+tB9CMzYTrdjTvAJu4FXtM1LaaHbccdC0wvI5hdbkavdFWukNF2 fE6eAtepe3EqjeRWLec9euCoBe6J378hFXtYqZhs8aI5bAewmPKgyc4UZI3mwWQ6Mppy T73ukWppDXNecfG8yd7FQPQv3R1cTIbTydcqJg3/JXZpCFqZv8xIrhUuR/Umlqo0d0tN zU3yN85kbkA8lYLNXnJy59vRpGNhIyzo5CN6P0gZY3buOIrSU8K6H+27l7cFx85JuV30 JYmdnBz46OJwbZngBOq15ttI9o9WE5zuX2+OpWGVe0hgnsVdMuzrz797swDzi4Y1gLVb 2ihw== X-Gm-Message-State: AODbwcCVfYBGGualjhihMPTUPirMvlxt2jr7pP2J5IP8DXUtPoFeVly6 tXo+VQCXzyErz5okACySvdd2YQELUG4V X-Received: by 10.36.86.17 with SMTP id o17mr11530747itb.45.1496328007003; Thu, 01 Jun 2017 07:40:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.3.194 with HTTP; Thu, 1 Jun 2017 07:39:26 -0700 (PDT) In-Reply-To: <20170601143141.GB24401@rei.lan> References: <20170601140048.GA24401@rei.lan> <20170601143141.GB24401@rei.lan> From: Soheil Hassas Yeganeh Date: Thu, 1 Jun 2017 10:39:26 -0400 Message-ID: Subject: Re: commit f5f99309 (sock: do not set sk_err in sock_dequeue_err_skb) has broken ping To: Cyril Hrubis Cc: "David S. Miller" , Shmulik Ladkani , Marcelo Ricardo Leitner , Pravin B Shelar , Eric Dumazet , WANG Cong , Yaogong Wang , Steffen Klassert , Al Viro , netdev , linux-kernel@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jun 1, 2017 at 10:31 AM, Cyril Hrubis wrote: > I've started bisecting on v4.11 and see the problem on v4.10 on another > machine, the patch should be there in both cases and the bug is easily > reproducible. Thank you for the confirmation. Could you please try the following patch to see if it fixes your issue? From 3ec438460425d127741b20f03f78644c9e441e8c Mon Sep 17 00:00:00 2001 From: Soheil Hassas Yeganeh Date: Thu, 1 Jun 2017 10:34:09 -0400 Subject: [PATCH net] sock: reset sk_err when the error queue is empty Before f5f99309fa74 (sock: do not set sk_err in sock_dequeue_err_skb), sk_err was reset to 0 upon reading from the error queue when the error queue was empty. Applications, most notably ping, are relying on this behavior to reset sk_err. Reset sk_err when there is no packet left on the error queue. Fixes: f5f99309fa74 (sock: do not set sk_err in sock_dequeue_err_skb) Reported-by: Cyril Hrubis Signed-off-by: Soheil Hassas Yeganeh --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 346d3e85dfbc..5a726161f4e4 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3758,7 +3758,7 @@ struct sk_buff *sock_dequeue_err_skb(struct sock *sk) icmp_next = is_icmp_err_skb(skb_next); spin_unlock_irqrestore(&q->lock, flags); - if (is_icmp_err_skb(skb) && !icmp_next) + if ((is_icmp_err_skb(skb) && !icmp_next) || !skb_next) sk->sk_err = 0; if (skb_next)