diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d1f089917a82..f4a4edbff2bd 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -94,6 +94,7 @@ #include #include #include +#include #include "initcalls.h" #include "avc.h" @@ -6272,12 +6273,17 @@ static int selinux_netlink_send(struct sock *sk, struct sk_buff *skb) return rc; } else if (rc == -EINVAL) { /* -EINVAL is a missing msg/perm mapping */ - pr_warn_ratelimited("SELinux: unrecognized netlink" - " message: protocol=%hu nlmsg_type=%hu sclass=%s" - " pid=%d comm=%s\n", - sk->sk_protocol, nlh->nlmsg_type, - secclass_map[sclass - 1].name, - task_pid_nr(current), current->comm); + if (sclass == SECCLASS_NETLINK_TCPDIAG_SOCKET && + nlh->nlmsg_type == DCCPDIAG_GETSOCK) + pr_warn_once("SELinux: DCCP has been removed, pid=%d comm=%s\n", + task_pid_nr(current), current->comm); + else + pr_warn_ratelimited("SELinux: unrecognized netlink" + " message: protocol=%hu nlmsg_type=%hu sclass=%s" + " pid=%d comm=%s\n", + sk->sk_protocol, nlh->nlmsg_type, + secclass_map[sclass - 1].name, + task_pid_nr(current), current->comm); if (enforcing_enabled() && !security_get_allow_unknown()) return rc;