summaryrefslogtreecommitdiffstats
path: root/net/qrtr/qrtr.c
diff options
context:
space:
mode:
authorArun Kumar Neelakantam <aneela@codeaurora.org>2018-07-04 16:19:32 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-05 13:20:03 +0200
commitfdf5fd3975666804118e62c69de25dc85cc0909c (patch)
tree4a849a70c8d014520efa5373590e816a0a2b46ad /net/qrtr/qrtr.c
parentipv6: make ipv6_renew_options() interrupt/kernel safe (diff)
downloadlinux-fdf5fd3975666804118e62c69de25dc85cc0909c.tar.xz
linux-fdf5fd3975666804118e62c69de25dc85cc0909c.zip
net: qrtr: Broadcast messages only from control port
The broadcast node id should only be sent with the control port id. Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr/qrtr.c')
-rw-r--r--net/qrtr/qrtr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 2aa07b547b16..7ffc9a3a7dd4 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -764,6 +764,10 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
node = NULL;
if (addr->sq_node == QRTR_NODE_BCAST) {
enqueue_fn = qrtr_bcast_enqueue;
+ if (addr->sq_port != QRTR_PORT_CTRL) {
+ release_sock(sk);
+ return -ENOTCONN;
+ }
} else if (addr->sq_node == ipc->us.sq_node) {
enqueue_fn = qrtr_local_enqueue;
} else {