|
@@ -1373,7 +1373,8 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
|
dst_pid = addr->nl_pid;
|
|
dst_pid = addr->nl_pid;
|
|
dst_group = ffs(addr->nl_groups);
|
|
dst_group = ffs(addr->nl_groups);
|
|
err = -EPERM;
|
|
err = -EPERM;
|
|
- if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
|
|
|
|
|
|
+ if ((dst_group || dst_pid) &&
|
|
|
|
+ !netlink_capable(sock, NL_NONROOT_SEND))
|
|
goto out;
|
|
goto out;
|
|
} else {
|
|
} else {
|
|
dst_pid = nlk->dst_pid;
|
|
dst_pid = nlk->dst_pid;
|
|
@@ -2147,6 +2148,7 @@ static void __init netlink_add_usersock_entry(void)
|
|
rcu_assign_pointer(nl_table[NETLINK_USERSOCK].listeners, listeners);
|
|
rcu_assign_pointer(nl_table[NETLINK_USERSOCK].listeners, listeners);
|
|
nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
|
|
nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
|
|
nl_table[NETLINK_USERSOCK].registered = 1;
|
|
nl_table[NETLINK_USERSOCK].registered = 1;
|
|
|
|
+ nl_table[NETLINK_USERSOCK].nl_nonroot = NL_NONROOT_SEND;
|
|
|
|
|
|
netlink_table_ungrab();
|
|
netlink_table_ungrab();
|
|
}
|
|
}
|