From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF2EC4727F for ; Tue, 29 Sep 2020 11:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE6B02065C for ; Tue, 29 Sep 2020 11:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380430; bh=YyTHnaHcQzf24/k/Rb3DPJ5xGybphhRFbp5wDu/aL44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VPJgRoBppxvqRFyH2iY2WCKqytcn+4m2jMlUdvbgL8EfWzKiT4xbcLDhODx4PJNTz 1qVjOzA9Ox4qu4jumaBv1PFxoGsSPP1J5xZPukqBkzH4RFR06iAztmMQ2rUusTkhso DtfsZ4an7Ivxz8WybmO0BR2RykS9neMMGijooGSQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731406AbgI2Lx0 (ORCPT ); Tue, 29 Sep 2020 07:53:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:47470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730881AbgI2LrA (ORCPT ); Tue, 29 Sep 2020 07:47:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 E956B206F7; Tue, 29 Sep 2020 11:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380020; bh=YyTHnaHcQzf24/k/Rb3DPJ5xGybphhRFbp5wDu/aL44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/UYDPgON9gHTHffAvkXscyqxazNKJupgGmcMG89YLlB7qAaUQEspPDyA/e83xikK CLHGxdiFhhlwTxmBWAVhEcMtdVY6KwxlFtU4e4xZObJGqaLJOgQaKlOzlLGh43ookN pWNOjekbE92nn53sai00kdTFgZyunf+SRtMVMe/Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Sutter , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.8 32/99] netfilter: nft_meta: use socket user_ns to retrieve skuid and skgid Date: Tue, 29 Sep 2020 13:01:15 +0200 Message-Id: <20200929105931.310039891@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105929.719230296@linuxfoundation.org> References: <20200929105929.719230296@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: Pablo Neira Ayuso [ Upstream commit 0c92411bb81de9bc516d6924f50289d8d5f880e5 ] ... instead of using init_user_ns. Fixes: 96518518cc41 ("netfilter: add nftables") Tested-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_meta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index 7bc6537f3ccb5..b37bd02448d8c 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c @@ -147,11 +147,11 @@ nft_meta_get_eval_skugid(enum nft_meta_keys key, switch (key) { case NFT_META_SKUID: - *dest = from_kuid_munged(&init_user_ns, + *dest = from_kuid_munged(sock_net(sk)->user_ns, sock->file->f_cred->fsuid); break; case NFT_META_SKGID: - *dest = from_kgid_munged(&init_user_ns, + *dest = from_kgid_munged(sock_net(sk)->user_ns, sock->file->f_cred->fsgid); break; default: -- 2.25.1