Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319964pxb; Mon, 20 Sep 2021 18:43:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2BSyIelP5L3I68fE+gosmaANRfbPa2C9ac2+69Xz2yD4cx1IhpKbVhyWp2uIcU/VzvCuk X-Received: by 2002:a92:d40d:: with SMTP id q13mr19762340ilm.161.1632188608064; Mon, 20 Sep 2021 18:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188608; cv=none; d=google.com; s=arc-20160816; b=FKqGGy0lAf7HPbdfLaNW8Q3I9F4Bjz58nMoH2w11JnW8YNz2Z+C90p4mmX0DzeQtQ0 iZkl/2BNEEOdkI3zYCAIzJ7XHPDdQQVXASqefnJEXFjIHJIOSDVKVWbJgek9QKS7fX1q FlJSHEFeCQs4yOSDVWX6RXjRG6pp3q4ch2JI85dRVrnjq2fdjyf1dK0EzRTLcr43XX8L yk12ZvXwhGufjGcg6F3UnqmTMjBWi3Ll7R2IkZlF/mHwPyi7hNyGULPD8oi8cl8+jxTu ZVSYf45CPKbV9svEc72tQ2YFsa3Y341NsEPQ4rDoP7C7NvHdyBUYYEn02cVIKHEqlOAy Oysg== 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=Z7sqcwxrbxkZRLjOoWnURhBlkZOXNzDAcNmv9Bwscgg=; b=LqIoi0mIbLEohGb9kyR9VAg2iUe02LZuq/LksfsxXGYZvvvLB0ZsOB8lNa0MB5cOgN /9ASNij+2zJWB7VQoXvP6qIxpn4vnkt5yyw+uX8mePFzQNqXd9N66zHe+xMGK3dvxYbf jKbpJ5jp6FURJCEHhsZdZpgOTci8JgLCPi3l8sQju9Z9wxpneqcnxgfLEl4H6e9NjFSC UE5AvH23L0JwFlXEF3b1b5tFC2MpZT4o7D7CzQIz5utM5v7B/tvV/pdN8NF2QLiySr6W xez0H70S2lY9W3daWMrbCQ6oXMB9HHyeT8deWs/CmoJp43nZfWLEYOPT4w2ybDOFrZes UOsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1PMBStUC; 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 q12si3287953jac.12.2021.09.20.18.43.15; Mon, 20 Sep 2021 18:43:28 -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=1PMBStUC; 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 S242207AbhITQ5T (ORCPT + 99 others); Mon, 20 Sep 2021 12:57:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbhITQwi (ORCPT ); Mon, 20 Sep 2021 12:52:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D5F061284; Mon, 20 Sep 2021 16:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156597; bh=J6b5laIYzgvwjPghl7bOg/QG7dQIDmTLFo6W8I6TZSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1PMBStUCxfy08wUsYkfE7DcncwsUB49Hb2sFGUZMqmQqGm2WoZ3NDj1UMWjCLp/7Q 6KTAeb4pZ2kCRsH/326ZF3eu/UHC9KKlheLKqyn6ShbsCvJNTvofORdENrVIQajz+1 8+CNDXGP/rsyqm0vh0iyaXpqwzayzxerND8oVOnQ= 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.4 089/133] netlink: Deal with ESRCH error in nlmsg_notify() Date: Mon, 20 Sep 2021 18:42:47 +0200 Message-Id: <20210920163915.557713691@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 c20c41801845..260cba93a2cf 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2405,13 +2405,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