Commit Graph

12 Commits

Author SHA1 Message Date
Patrick Tjin cb5589c60c msm: ipc_socket: fix leak of kernel memory to userspace
Limit the size of copy to the minimum of what was asked
for or the number of results returned to prevent leaking of
uninitialized kernel memory to userspace.

Bug: 24157888

Signed-off-by: Patrick Tjin <pattjin@google.com>
Change-Id: I941298dbd222dca1601c66ba96a56bfdda9e8243
2015-10-15 21:27:35 +00:00
Atish Kumar Patra 2107c58280 net: ipc_router: Fix socket reference in IPC Router
The socket associated with an IPC Router port can be released before
the port is released. This leads to an use after free bug in cases
where the socket is closed while a packet is in flight.

Fix the use after free scenario by holding a sock reference during
creation of the port and releasing that in release port function.

CRs-Fixed: 811335
Change-Id: I638cc59e3b4e2347107e5ac19f233b0f7b9dd7b0
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
2015-05-04 22:44:28 -07:00
Karthikeyan Ramasubramanian e6b4403d6c net: ipc_router: Add support for blocking send
Add support for blocking sends that enables the sender to wait for
the resume transmit signal from a remote endpoint.

Change-Id: Id7a27ccda4d07b14a81e1a4ec4429785df3c31c6
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-09-11 16:02:28 -06:00
Karthikeyan Ramasubramanian 3b7149ac47 net: ipc_router: Update the receive operation to be blocking by default
Update the receive operation to be blocking by default and use MSG_DONTWAIT
flag to enable non-blocking receive operation.

Change-Id: I4d460ac3a57cbca4bd9756b42326805927d601ff
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-09-11 16:02:18 -06:00
Karthikeyan Ramasubramanian 225f4ea2c8 net: ipc_router: Add support for connect system call
Enable support for connect system call, so that the destination address is
stored as part of the port. Subsequently the clients of IPC Router can use
send and recv system calls in addition to sendto and recvfrom.

Reset any connection between the local port and remote port if the remote
port exits either voluntarily or due to subsystem restart.

Change-Id: Icf45934a1fc9d01ff96f2a7a47359b66ac22ccbd
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-09-11 16:02:12 -06:00
Eric Holmberg 9f4800553d msm: ipc_logging: add client version support
If clients use custom serialization functions, then they may need to
define a version for deserialization support for log extraction.

Add client version support.

Change-Id: Id135f06d4142de39275b5d0caab88708d5496b5e
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
2014-05-27 13:56:54 -06:00
Zaheerulla Meer bb6521ef1c net: ipc: Add common string for IPC Router error message
IPC Router logs error messages to kernel log. These error messages
do not have a common string to search for in kernel logs which makes
it difficult to identify the IPC Router error message while debugging
issues.

Add a common string as a part of error message printed from IPC Router.

Change-Id: Ie87e4bdb215fe7d7ef4c5788a77f862e312f80f2
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
2014-04-08 11:27:39 +05:30
Steven Cahail de5c5c76c6 drivers: qcom: ipc: Initialize PIL handle in error case
When loading either a non-modem image or when PIL returns an error,
the PIL handle is left uninitialized. This results in a kernel
panic when the handle is used to do a PIL unload.

Initialize the pil handle in this error case to avoid kernel panic.

CRs-Fixed: 636748
Change-Id: I83fb2ff822851e0b5a35cb32b440671b46068d85
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
2014-03-21 15:36:20 -06:00
Steven Cahail 79354076b9 msm: ipc: Add single-threaded workqueue for PIL voting
IPC Router votes for the modem by default to ensure that the modem is
loaded so QMI services can be discovered. However, this causes a large
delay measured in seconds for the first client to bind to an IPC Router
socket. For clients that do not need the modem, this delay is
unnecessary.

Move the PIL loading to a single-threaded workqueue to load the modem
and maintain reference counting asynchronously.

Change-Id: I2a2a375fa4538442e5a16465935a07ba1d7437b8
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
2014-03-18 13:42:08 -06:00
Karthikeyan Ramasubramanian 4c18b54ec3 net: ipc_router: Add support for COMPAT operations
Add support for compat_ioctl, compat_getsockopt, compat_setsockopt
operations to ensure compatibility for applications that require it.

Change-Id: I792577c0ea96fee27f47acb480bc1129a0eb2803
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-02-05 09:34:08 -08:00
Karthikeyan Ramasubramanian 2770987287 net: ipc_router: Fix format specifiers in debug statements
%zu is the correct printk format specifier when printing size_t types.

Update printks to use %zu for size_t type variables.

Change-Id: I550b7853aeb1bdaaadf23ecfa9e1383b7f15ad89
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-01-20 18:26:28 -07:00
Karthikeyan Ramasubramanian ab9df0516e msm: ipc: Support multi-platform
Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in generic functionality
directories instead of specific mach directories.

Move IPC Router Core and Security drivers to the net/ipc_router location
to support multi-platform.

Move IPC Router SMD & HSIC transport(XPRT) drivers to the drivers/soc/qcom
location.

Change-Id: I770227f66dcb776b26086426f509568f991db757
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2014-01-13 13:51:09 -07:00