Commit 0c92411b authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nft_meta: use socket user_ns to retrieve skuid and skgid

... instead of using init_user_ns.

Fixes: 96518518 ("netfilter: add nftables")
Tested-by: default avatarPhil Sutter <phil@nwl.cc>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 526e81b9
...@@ -147,11 +147,11 @@ nft_meta_get_eval_skugid(enum nft_meta_keys key, ...@@ -147,11 +147,11 @@ nft_meta_get_eval_skugid(enum nft_meta_keys key,
switch (key) { switch (key) {
case NFT_META_SKUID: 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); sock->file->f_cred->fsuid);
break; break;
case NFT_META_SKGID: 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); sock->file->f_cred->fsgid);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment