Commit Graph

18 Commits

Author SHA1 Message Date
Arun Kumar Neelakantam 87ff009934 net: ipc_router: Initialize the sockaddr in recvmsg() handler
sockaddr structure is filled with required information only which
results in few memory locations of structure with uninitialized data.

Memset complete structure before using it to remove uninitialized data.

CRs-Fixed: 2274853
Change-Id: I181710bde100fb1553b925d9fdf227af35ff38b5
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-07-27 22:08:44 +02:00
LuK1337 fc9499e55a Import latest Samsung release
* Package version: T713XXU2BQCO

Change-Id: I293d9e7f2df458c512d59b7a06f8ca6add610c99
2017-04-18 03:43:52 +02:00
Arun Kumar Neelakantam 0db05bc8e2 net: ipc_router: fix NULL pointer de-reference issue
Fail cases of accept() system call on AF_MSM_IPC socket family causes
NULL pointer de-reference of sock structure variable in release operation.

Validate the sock structure pointer before using it in release operation.

CRs-Fixed: 1068888
Change-Id: I5637e52be59ea9504ea6ae317394bef0c28c7865
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2016-09-28 22:10:45 -07:00
Arun Kumar Neelakantam 3b1f22ab26 net: ipc_router: fix leak of kernel memory to userspace
The service info structure is allocated with uninitialized memory for the
max number of services and returns the complete structure to the usersapce
resulting in the information leak if lookup operation finds less number of
services than the requested number.

Check the minimum of requested and available services and copy the minimum
information to the user-space.

CRs-Fixed: 965934
Change-Id: Ic97f875855fdc6440c1db1d8d0338ee8b03a9d0a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2016-02-23 22:34:46 -08:00
Atish Kumar Patra baeaf0b61d net: ipc_router: Add write_space callback
Flow control events in IPC Router are posted through a resume_tx
message. For clients that prefer a callback approach, add support
for write_space callback to notify about the flow control events.
The resume_tx message is not posted for such clients.

Change-Id: Iae25fd78f190bc7aeb7311ece68b3be407a1f910
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
2015-03-24 11:13:50 -06:00
Atish Kumar Patra 3da72c23d7 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-03-23 13:04:20 -06:00
Atish Kumar Patra 85b3fa73a3 net: ipc_router: Add MSG_PEEK option to query packet size
Add MSG_PEEK flag handling support to enable clients to query
about a IPCRTR packet size through socket.

Change-Id: Ia8119ceeaba3a8b5a4ef6a0bdc9e6afacfc4a399
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
2015-02-27 17:08:42 -07:00
Atish Kumar Patra 6e2fa211f8 net: ipc_router: Rectify the logging usage
Current ipc_logging usage by IPC Router violates the layering
and interprets the payload as QMI messages.

Fix this usage, by moving all the logging into IPC Router core and
log the first 8 bytes of payload without any interpretation.

Change-Id: Ie5b6e283728a9781797dcdbf793cdbc36aa889b6
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
2015-02-24 19:22:32 -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
Renamed from arch/arm/mach-msm/ipc_socket.c (Browse further)