Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp448680pxb; Thu, 9 Sep 2021 04:50:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiYvdC7Ibs3gTRQSof5Ja4rutATZ65+5yjQTQrjr3CB+BLjmW7JL22B5Q1agB2Sh+ABwXT X-Received: by 2002:a02:6a2e:: with SMTP id l46mr2444431jac.73.1631188246840; Thu, 09 Sep 2021 04:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188246; cv=none; d=google.com; s=arc-20160816; b=Y8pvI5OmvjKn7i1Nd8S2Ykaj+0FxogpxVgasJMpgNp+5HLbuqVglFbPMYZvCJa3xH9 HYLUnjU93Dzavb61Iv1v/FTV+2efcOhoHshYLfNNvRQpInkRRz2NuCbrqOye1dH9nTS4 F6jOnZJECecbm/CKqSfCo5NcpFIThong7GGis5NrSPjZkzBX8xOaFoxKdRJTg2DvPaPL 3Qcs07g+IU9kxpHIM/rUyhJoQpVFRzJS/fMhGAyzWu12MA/VpB7S247sUlh3qMeEylhq TgF3Hwly4E6RMTQrO9/9tjZcdd4lLfBksZchQV9IzBee1r/4QvkhJpwMC/FG9GbSgrl+ fCRA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4f13hde6ehJku7YotL3bQ9e27MsqHPIaIOyqwlbezZA=; b=HyRgh4VMsEplJEnsttmY+aEZtoZm1gA+0q8G8tHTOo3xbDMqOu28PAAO8QcadX5YHm k5LmdfRrzL4pAQIC2TF5XcTidcLF/9FNbCd0Rstl77o6D716fOcDi6IYqZDFYBhMz1oJ OivqKdGFjk7dX6zxU8xMuq1WqukYMF3uXNUapc8w2jiGJ9ny2FhybaonWcT4k4nmRHoG lGqOeg3x1M5Ozsp0BiNDhfRBAAqo86YirI6ETl8o0ZqsJEs5OBn+qHCjY6EoBH8ZQCJH ppte/QDZMwAWmANEywCPPPYLeFv/PVrOTOCnv9gcMAL8ht/R3sUeORNRUb0eGzq5+Xc7 rnxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=inkHa5UY; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si1813429ile.172.2021.09.09.04.50.34; Thu, 09 Sep 2021 04:50:46 -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=@kernel.org header.s=k20201202 header.b=inkHa5UY; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236784AbhIILug (ORCPT + 99 others); Thu, 9 Sep 2021 07:50:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:46218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241326AbhIILq5 (ORCPT ); Thu, 9 Sep 2021 07:46:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0107861205; Thu, 9 Sep 2021 11:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187789; bh=ze7B5FV3b/CWQmkaH2nhTOx865klHkNYpzxXSArr3fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=inkHa5UYAz+xgzQu54sKatwC/8OPWlCSTG8rhAuhUGg80sMTMlHiFOJUsWdTKWWau ZmTEDAoO+IHU2YIHn9SlyAvQAI/GyHwtEradbYXrKJaIQ+UF0vVkjEjQ8erQP7Aqpo wILaEY8ehmBjiBaduPjOuMukOpilj1ipN7G6QWwcE8hjkHARI3rZfeGqvwn7cLN3j1 ZUi9h0GwTGHYBLEtRylgND6OEx9OeLJURZyMVKn9hmSa7HgAmPWeAx8OqoBxE+ZLrX ft/oqQZ11MPX3CF7tfjJx1yApN0ku5K/yI/rWaYu7uNG/YqBd3sqFBTjd8ebFZrybW AhIFRYquFHLCQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pablo Neira Ayuso , Yajun Deng , Sasha Levin , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 096/252] netfilter: nft_compat: use nfnetlink_unicast() Date: Thu, 9 Sep 2021 07:38:30 -0400 Message-Id: <20210909114106.141462-96-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Neira Ayuso [ Upstream commit 241d1af4c11a75d4c17ecc0193a6ab60553efbfc ] Use nfnetlink_unicast() which already translates EAGAIN to ENOBUFS, since EAGAIN is reserved to report missing module dependencies to the nfnetlink core. e0241ae6ac59 ("netfilter: use nfnetlink_unicast() forgot to update this spot. Reported-by: Yajun Deng Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_compat.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c index 639c337c885b..272bcdb1392d 100644 --- a/net/netfilter/nft_compat.c +++ b/net/netfilter/nft_compat.c @@ -683,14 +683,12 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb, goto out_put; } - ret = netlink_unicast(info->sk, skb2, NETLINK_CB(skb).portid, - MSG_DONTWAIT); - if (ret > 0) - ret = 0; + ret = nfnetlink_unicast(skb2, info->net, NETLINK_CB(skb).portid); out_put: rcu_read_lock(); module_put(THIS_MODULE); - return ret == -EAGAIN ? -ENOBUFS : ret; + + return ret; } static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = { -- 2.30.2