Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2753314imj; Mon, 11 Feb 2019 08:00:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IaF5AX6pWDO2S1i6I5g1qzPCqYwJKGaK+8WwIp4nNx4uknQRUw6hS4JOamNTNtlhOGqmlgN X-Received: by 2002:a65:6151:: with SMTP id o17mr16882736pgv.285.1549900804338; Mon, 11 Feb 2019 08:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900804; cv=none; d=google.com; s=arc-20160816; b=QSnXM0JtR8jdrsyd5gmQo9XmSq8Tz4wjtarH7ZhO+LcbMsfSwDHbX6vx+crMSzhHun 4oIipfb4sLMytMjpbZB+abAPWuWYXgCr0PglApEvZu85kwtdOmw50fbQaBIYPrsfiXde FaPxPLXcVzL8QTNnInkCWJss/PSjc/cRdb1JnKUlePli/c1VxCtp+o8/0wMw3JMC7nDX 3rNld0iyI2AhNcPTTeHa2+QY6jpyFCEJJk9OEAOql/+IK3dgDAcrzTobqu811Y2NjBhg N3IVbmJJr9ju64zXuPqXplZLA3o942cU36W/1pCQSIwSb/EYRp8cTo+qAXNnURtt+8u8 TKhQ== 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=x8fRkI8aXGqu3/6ygol8+dPNEy4EHY1l9PUsNFUWKFc=; b=Ws6Fr+wfFfk2bYNN7lzfTkVjxeEndmJlbk9TLlUPYXdTgxuEU17TXXSnUMbYtSVm7C LTwnUBg7zLTrmQSi30LFsKC3sJSdtTQXXsmJY3P60YJ2D5UTv/5wM6sPjygmUcKHfopl +baaIgkQOptyIJ1c+SS6vIV/EQNOv6I5K5Wehf4JUuj8Auv8hfM4JMtNBHwTMOipl0gj 1MXo0UzG+qzRNVllR63irdCTVS5aHmRcWPmvjmCj7IVKvG/pw83LqaxWZbqwFaoACgsT Ut2+JA0QD2ye9Y6hHEakU/9T+yKeWngmlny8CsehKVn3ocS46SOR33AAsBXOI1f9RYRx lswA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vwr1N55q; 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 c8si8898380pgq.300.2019.02.11.07.59.48; Mon, 11 Feb 2019 08:00:04 -0800 (PST) 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=vwr1N55q; 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 S1730494AbfBKOcf (ORCPT + 99 others); Mon, 11 Feb 2019 09:32:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:39894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730481AbfBKOc3 (ORCPT ); Mon, 11 Feb 2019 09:32:29 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 8842F20675; Mon, 11 Feb 2019 14:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895549; bh=xuuzD71YPxiHxw7eQoS1mHaU3ehuv8O/LOwqZGM97+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vwr1N55qG8J9u91QwSIDeJ/cCnMciVJyv5w7qhns/sSh4QvcmY3/NSzDBKbldfrbf jAgLevZQMSK0JeOLfPJFi6Azd27Z6UKH+lG/H0ut/uVuHm/QlSyW8xGeM93Su7jTT0 MaiSAvEVkT6XXrrxnxW+3SJtLf4rO84mHsK14e1M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Fastabend , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.20 240/352] bpf: sk_msg, zap ingress queue on psock down Date: Mon, 11 Feb 2019 15:17:47 +0100 Message-Id: <20190211141902.437732082@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a136678c0bdbb650daff5df5eec1dab960e074a7 ] In addition to releasing any cork'ed data on a psock when the psock is removed we should also release any skb's in the ingress work queue. Otherwise the skb's eventually get free'd but late in the tear down process so we see the WARNING due to non-zero sk_forward_alloc. void sk_stream_kill_queues(struct sock *sk) { ... WARN_ON(sk->sk_forward_alloc); ... } Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- net/core/skmsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/skmsg.c b/net/core/skmsg.c index b7dbb3c976cd..fc7d59f1c57c 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -575,6 +575,7 @@ void sk_psock_drop(struct sock *sk, struct sk_psock *psock) { rcu_assign_sk_user_data(sk, NULL); sk_psock_cork_free(psock); + sk_psock_zap_ingress(psock); sk_psock_restore_proto(sk, psock); write_lock_bh(&sk->sk_callback_lock); -- 2.19.1