Thread (8 messages) flat view 8 messages, 4 authors, 2018-09-20

Re: [PATCH] netfilter: nf_tables: add SECMARK support

From: Florian Westphal <fw@strlen.de>
Date: 2018-09-20 09:45:14
Also in: linux-security-module, lkml, netfilter-devel, selinux

Christian Göttsche [off-list ref] wrote:
quoted
Fixes should go into nf.git whereas feature goes to nf-next.git.
No, that should not be a unroll fix.
Currently there are no objects registered by the main nf_tables
module, so for nft_secmark_obj_type I had to introduce this new logic.
I see, ok.
quoted
quoted
quoted
+   if (err) {
+           if (err == -EINVAL)
+                   pr_notice_ratelimited("invalid security context \'%s\'\n", priv->ctx);
+           else
+                   pr_notice_ratelimited("unable to convert security context \'%s\': %d\n", priv->ctx, -err);
+           return;
+   }
Please remove these printks(), they do not really help as user can't
take any action anyway.
Aren't they helpful?
"invalid security context" can pop up if someone supplies an invalid
SELinux context (nft add secmark inet filter sshtag
\"this_is_invalid\") and uses it
Can't that be caught at ->init() time?
We can then reject this via plain -EINVAL.

No need for printk because caller knows which expression/object caused
the error.
"unable to convert security context" can pop up if no LSM is enabled
Can that be done at ->init() time when we can still reject the (invalid)
rule?
"unable to map security context" should never happen, but one never knows
Ok, but what is user supposed to do?
This just causes perpetual spew of warnings in the kernel ring buffer.
"unable to obtain relabeling permission" can pop up if e.g. the
SELinux permission "kernel_t ssh_server_packet:packet relabelto" is
missing
Makes sense, but this will need to be a plain
return -EPERM, this function can only be used in process context.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help