diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2013-02-01 13:18:35 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2013-02-22 18:56:10 +0900 |
commit | 4f3d78640de4573ced186edd3a09b1247d981edf (patch) | |
tree | acd4f84b14a34a44ac4faf6a9fb2f782eb2f7f79 /netlink_msg.h | |
parent | 70aba57df0f4a0ee800e7ba3694dbd9b6302a470 (diff) | |
download | android_external_android-clat-4f3d78640de4573ced186edd3a09b1247d981edf.tar.gz android_external_android-clat-4f3d78640de4573ced186edd3a09b1247d981edf.tar.bz2 android_external_android-clat-4f3d78640de4573ced186edd3a09b1247d981edf.zip |
Ensure netlink messages come from the kernel.
Currently clatd accepts all netlink messages without validating
that they come from the kernel. This could allow another app to
spoof these messages. Fix this by connecting the socket to the
kernel so that no other process can send it messages.
Bug: 7664960
Change-Id: I994641ea13cfd07fb25ccf52fcbbf5d1c9633ec4
Diffstat (limited to 'netlink_msg.h')
-rw-r--r-- | netlink_msg.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/netlink_msg.h b/netlink_msg.h index bc85b2d..13e1f28 100644 --- a/netlink_msg.h +++ b/netlink_msg.h @@ -25,5 +25,6 @@ struct nl_msg *nlmsg_alloc_rtmsg(uint16_t type, uint16_t flags, struct rtmsg *rt void send_netlink_msg(struct nl_msg *msg, struct nl_cb *callbacks); void send_ifaddrmsg(uint16_t type, uint16_t flags, struct ifaddrmsg *ifa, struct nl_cb *callbacks); int netlink_sendrecv(struct nl_msg *msg); +int netlink_set_kernel_only(struct nl_sock *nl_sk); #endif |