Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2568161lkm; Mon, 20 Sep 2021 18:56:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5XUmAXjAO+lW6b35GefR7jRz9xVr4OZlaqb92lar4Yt9WW6b6fIQSCx4dB6GmYi9uL7k6 X-Received: by 2002:a5d:8505:: with SMTP id q5mr20924133ion.53.1632188996239; Mon, 20 Sep 2021 18:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188996; cv=none; d=google.com; s=arc-20160816; b=pUdDpKFLXX4uwRiQyPViz2wgqOCq4zKfXrJrQm7ZDIOG2aaq7ArxQFQ67vKJWLV1No MGCdFKqX/2ZfrETC4ugnW2BaFtWu3M3iz+Mhw7RBn/QS08U6yrmjznX1606hOMlrRfQM tpagPzPlhKrC6/HBkalEkN6yrqoreUrvzeCfOAQ4LOgvF/xx9o1DpZBRtm5YaZbhTmeh X1Nbqr1S6NbP9WC0X2FrF0diki3z+eAFCix8n01CSjNLhX4U9j+wfA0YsyT2V94QJmym I/0LX0uQBmK48R/BDPywDMBKilB8Jskda97L1EN0on/aBW9+4lGwPzf9v2+QPw3K9dvN PVFA== 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:dkim-signature; bh=caTP2VWItTq1qQxYUvodhNk/CY4d1uf716+WDYKNWhQ=; b=z/7lgiE+T32Hmv7bX7sIKvRgUpjflqT2eywN9DhaMhHhNzCjIxLvJofMx4W5KdQ0uI KqG1pSKzWF56DhrpDK0RTnlM7J7lVp0SKfqLpCGkP5iHnBaJRbl3Vp8Bi6F4pJU77P1G WolWYnh3gJWcZ8zIKQwXrbq8y20Pwjv0GN6Py8eB0iM/9hVns3oU9Gcya9fAEMZERCUE u0MJPyfC7fYWI4OaOmIY+dK6nPqT+PGiF9h9+GE3X+Cs2gQrubUEMXwPOKNs2U1y9vi+ sOPsAV37is5i+Nle+X14Agtxe7fjX1p4EK79Jv2qcJWX8cMyxVzJstjB7vddZMQ4Tci0 jNSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Crg+3sIo; 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=pass (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 z6si3155498iom.65.2021.09.20.18.49.45; Mon, 20 Sep 2021 18:49:56 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Crg+3sIo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355396AbhITR4V (ORCPT + 99 others); Mon, 20 Sep 2021 13:56:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354588AbhITRui (ORCPT ); Mon, 20 Sep 2021 13:50:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D841761880; Mon, 20 Sep 2021 17:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157916; bh=CKGk5DMQB0Ej3NiAMtZARtfrYAtpgmsWv53+pidWk+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Crg+3sIoqt19U//3ki4Qu7hz4u6aQZnlpOfQczeXE4QkIoiveqs1RmsEdwKv/oNY3 1LJCrfMr7d03tdtvO8pK+UveeKWfqifdQdKmBe4/ccogyt7T4NFsgH1lqWyh99UA8b lBrwP2McIQB0JreWtnIR4wLSXmssFCyw32wrrLuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonghong Song , Yajun Deng , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 179/293] netlink: Deal with ESRCH error in nlmsg_notify() Date: Mon, 20 Sep 2021 18:42:21 +0200 Message-Id: <20210920163939.404821797@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Yajun Deng [ Upstream commit fef773fc8110d8124c73a5e6610f89e52814637d ] Yonghong Song report: The bpf selftest tc_bpf failed with latest bpf-next. The following is the command to run and the result: $ ./test_progs -n 132 [ 40.947571] bpf_testmod: loading out-of-tree module taints kernel. test_tc_bpf:PASS:test_tc_bpf__open_and_load 0 nsec test_tc_bpf:PASS:bpf_tc_hook_create(BPF_TC_INGRESS) 0 nsec test_tc_bpf:PASS:bpf_tc_hook_create invalid hook.attach_point 0 nsec test_tc_bpf_basic:PASS:bpf_obj_get_info_by_fd 0 nsec test_tc_bpf_basic:PASS:bpf_tc_attach 0 nsec test_tc_bpf_basic:PASS:handle set 0 nsec test_tc_bpf_basic:PASS:priority set 0 nsec test_tc_bpf_basic:PASS:prog_id set 0 nsec test_tc_bpf_basic:PASS:bpf_tc_attach replace mode 0 nsec test_tc_bpf_basic:PASS:bpf_tc_query 0 nsec test_tc_bpf_basic:PASS:handle set 0 nsec test_tc_bpf_basic:PASS:priority set 0 nsec test_tc_bpf_basic:PASS:prog_id set 0 nsec libbpf: Kernel error message: Failed to send filter delete notification test_tc_bpf_basic:FAIL:bpf_tc_detach unexpected error: -3 (errno 3) test_tc_bpf:FAIL:test_tc_internal ingress unexpected error: -3 (errno 3) The failure seems due to the commit cfdf0d9ae75b ("rtnetlink: use nlmsg_notify() in rtnetlink_send()") Deal with ESRCH error in nlmsg_notify() even the report variable is zero. Reported-by: Yonghong Song Signed-off-by: Yajun Deng Link: https://lore.kernel.org/r/20210719051816.11762-1-yajun.deng@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/netlink/af_netlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index ac3fe507bc1c..b0fd268ed65e 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2498,13 +2498,15 @@ int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, /* errors reported via destination sk->sk_err, but propagate * delivery errors if NETLINK_BROADCAST_ERROR flag is set */ err = nlmsg_multicast(sk, skb, exclude_portid, group, flags); + if (err == -ESRCH) + err = 0; } if (report) { int err2; err2 = nlmsg_unicast(sk, skb, portid); - if (!err || err == -ESRCH) + if (!err) err = err2; } -- 2.30.2