summaryrefslogtreecommitdiff
path: root/net/qrtr
diff options
context:
space:
mode:
authorArun Kumar Neelakantam <aneela@codeaurora.org>2018-07-04 19:49:32 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-24 13:12:36 +0200
commit865c4f9a0c336c1d24d09f1d792e1060b1b6e850 (patch)
tree99677f5259ae67e44e83cce0c06f5bff3792a1c2 /net/qrtr
parent8823c73bd719e74378dd77bc0d894815d0ef4102 (diff)
net: qrtr: Broadcast messages only from control port
[ Upstream commit fdf5fd3975666804118e62c69de25dc85cc0909c ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/qrtr')
-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 ae5ac175b2be..7b670a9a375e 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -621,6 +621,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 {