Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2595e1a6 authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ipa: do not remove wwan_ioctl device during SSR



During modem SSR the wwan_ioctl cdev is removed as part of the
cleanup sequence and is recreated during initialization. This is
causing security issues with permissions granted to wwan_ioctl cdev,
since it is created with root permissions, thus preventing access
for IPACM.

The new cleanup sequence is not removing the wwan_ioctl cdev, but
only stops it from sending QMI messages during SSR, and reenables
sending QMI messages in initialization after SSR.

CRs-fixed: 708279
Change-Id: I8f2e6c69f149f8de2cffe8d4d0aab5796f42eef2
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent bb047aa5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ int wan_ioctl_init(void);

void wan_ioctl_stop_qmi_messages(void);

void wan_ioctl_enable_qmi_messages(void);

void wan_ioctl_deinit(void);

extern struct elem_info ipa_init_modem_driver_req_msg_data_v01_ei[];
+12 −5
Original line number Diff line number Diff line
@@ -1654,10 +1654,15 @@ static int ipa_wwan_probe(struct platform_device *pdev)
	if (ret)
		goto setup_dflt_wan_rt_tables_err;

	/* start transport-driver fd ioctl for ipacm */
	if (!atomic_read(&is_ssr)) {
		/* Start transport-driver fd ioctl for ipacm for first init */
		ret = wan_ioctl_init();
		if (ret)
			goto wan_ioctl_init_err;
	} else {
		/* Enable sending QMI messages after SSR */
		wan_ioctl_enable_qmi_messages();
	}

	/* initialize tx/rx enpoint setup */
	memset(&apps_to_ipa_ep_cfg, 0, sizeof(struct ipa_sys_connect_params));
@@ -1815,6 +1820,8 @@ static int ipa_wwan_remove(struct platform_device *pdev)
		IPA_RM_RESOURCE_WWAN_0_PROD, ret);
	free_netdev(ipa_netdevs[0]);
	ipa_netdevs[0] = NULL;
	/* No need to remove wwan_ioctl during SSR */
	if (!atomic_read(&is_ssr))
		wan_ioctl_deinit();
	ipa_del_dflt_wan_rt_tables();
	ipa_del_a7_qmap_hdr();
+5 −0
Original line number Diff line number Diff line
@@ -197,6 +197,11 @@ void wan_ioctl_stop_qmi_messages(void)
	process_ioctl = 0;
}

void wan_ioctl_enable_qmi_messages(void)
{
	process_ioctl = 1;
}

void wan_ioctl_deinit(void)
{
	cdev_del(&wan_ioctl_cdev);