netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Kumar Neelakantam <aneela@codeaurora.org>
To: davem@davemloft.net, bjorn.andersson@linaro.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Arun Kumar Neelakantam <aneela@codeaurora.org>,
	Florian Westphal <fw@strlen.de>,
	Nicolas Dechesne <nicolas.dechesne@linaro.org>,
	Denys Vlasenko <dvlasenk@redhat.com>
Subject: [PATCH 1/2] net: qrtr: Broadcast messages only from control port
Date: Wed,  4 Jul 2018 19:49:32 +0530	[thread overview]
Message-ID: <1530713973-26696-2-git-send-email-aneela@codeaurora.org> (raw)
In-Reply-To: <1530713973-26696-1-git-send-email-aneela@codeaurora.org>

The broadcast node id should only be sent with the control port id.

Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
---
 net/qrtr/qrtr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 2aa07b5..7ffc9a3 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 {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2018-07-04 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 14:19 [PATCH 0/2] net: qrtr: Broadcasting control messages Arun Kumar Neelakantam
2018-07-04 14:19 ` Arun Kumar Neelakantam [this message]
2018-07-04 14:19 ` [PATCH 2/2] net: qrtr: Reset the node and port ID of broadcast messages Arun Kumar Neelakantam
2018-07-05 11:20 ` [PATCH 0/2] net: qrtr: Broadcasting control messages David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530713973-26696-2-git-send-email-aneela@codeaurora.org \
    --to=aneela@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=dvlasenk@redhat.com \
    --cc=fw@strlen.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dechesne@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).