[PATCH V1 1/4] net: qrtr: Do not send packets before hello negotiation

2020-08-30 Thread Deepak Kumar Singh
From: Chris Lew There is a race where broadcast packets can be sent to a node that has not sent the hello message to the remote processor. This breaks the protocol expectation. Add a status variable to track when the hello packet has been sent. An alternative solution attempted was to remove the

[PATCH V1 2/4] net: qrtr: Add socket mode optimization

2020-08-30 Thread Deepak Kumar Singh
From: Chris Lew A remote endpoint should not need to know when a client socket is freed if the socket never established commnication with the endpoint. Add a mode to keep track of which endpoints a socket communicates with. There are three modes a socket can be in: INIT - Socket has no

[PATCH V1 4/4] net: qrtr: Check function pointer before calling

2020-08-30 Thread Deepak Kumar Singh
From: Arun Kumar Neelakantam sk_error_report callback function called without validating cause the NULL pointer dereference. Validate function pointer before using for error report. --- net/qrtr/qrtr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/qrtr/qrtr.c b/net/q

[PATCH V1 3/4] net: qrtr: Change port allocation to use cyclic idr

2020-08-30 Thread Deepak Kumar Singh
From: Chris Lew There is a race for clients that open sockets before the control port is bound. If a client gets an idr that was allocated before the control port is bound, there is a chance the previous address owner sent lookup packets to the control port. The new address owner will get residua