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

Commit 1698034a authored by Liangliang Lu's avatar Liangliang Lu Committed by Pratham Pratap
Browse files

msm: usb_bam: replace %p with %pK



Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with
0's.

Debugging Note : &pK prints only Zeros as address. If you need actual
address information, write 0 to kptr_restrict.
echo 0 > /proc/sys/kernel/kptr_restrict

Change-Id: If3e3a7d5c737b8b7e2c2f78e2814747db4a770cd
Signed-off-by: default avatarLiangliang Lu <luliang@codeaurora.org>
parent 739b514f
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -234,10 +234,10 @@ void msm_bam_set_hsic_host_dev(struct device *dev)
	if (dev) {
		/* Hold the device until allowing lpm */
		info[HSIC_CTRL].in_lpm = false;
		log_event_dbg("%s: Getting hsic device %p\n", __func__, dev);
		log_event_dbg("%s: Getting hsic device %pK\n", __func__, dev);
		pm_runtime_get(dev);
	} else if (host_info[HSIC_CTRL].dev) {
		log_event_dbg("%s: Try Putting hsic device %p, lpm:%d\n",
		log_event_dbg("%s: Try Putting hsic device %pK, lpm:%d\n",
				__func__, host_info[HSIC_CTRL].dev,
				info[HSIC_CTRL].in_lpm);
		/* Just release previous device if not already done */
@@ -822,7 +822,7 @@ static bool _hsic_host_bam_resume_core(void)

	/* Exit from "full suspend" in case of hsic host */
	if (host_info[HSIC_CTRL].dev && info[HSIC_CTRL].in_lpm) {
		log_event_dbg("%s: Getting hsic device %p\n", __func__,
		log_event_dbg("%s: Getting hsic device %pK\n", __func__,
			host_info[HSIC_CTRL].dev);
		pm_runtime_get(host_info[HSIC_CTRL].dev);
		info[HSIC_CTRL].in_lpm = false;
@@ -836,7 +836,7 @@ static void _hsic_host_bam_suspend_core(void)
	log_event_dbg("%s: enter\n", __func__);

	if (host_info[HSIC_CTRL].dev && !info[HSIC_CTRL].in_lpm) {
		log_event_dbg("%s: Putting hsic host device %p\n", __func__,
		log_event_dbg("%s: Putting hsic host device %pK\n", __func__,
			host_info[HSIC_CTRL].dev);
		pm_runtime_put(host_info[HSIC_CTRL].dev);
		info[HSIC_CTRL].in_lpm = true;
@@ -1735,7 +1735,7 @@ static bool check_pipes_empty(enum usb_ctrl bam_type, u8 src_idx, u8 dst_idx)
	/* If we have any remaints in the pipes we don't go to sleep */
	prod_pipe = ctx->usb_bam_sps.sps_pipes[src_idx];
	cons_pipe = ctx->usb_bam_sps.sps_pipes[dst_idx];
	log_event_dbg("prod_pipe=%p, cons_pipe=%p\n", prod_pipe, cons_pipe);
	log_event_dbg("prod_pipe=%pK, cons_pipe=%pK\n", prod_pipe, cons_pipe);

	if (!cons_pipe || (!prod_pipe &&
			prod_pipe_connect->pipe_type == USB_BAM_PIPE_BAM2BAM)) {
@@ -2101,7 +2101,7 @@ static bool msm_bam_host_lpm_ok(enum usb_ctrl bam_type)
		}

		/* HSIC host will go now to lpm */
		log_event_dbg("%s: vote for suspend hsic %p\n",
		log_event_dbg("%s: vote for suspend hsic %pK\n",
			__func__, host_info[bam_type].dev);

		for (i = 0; i < ctx->max_connections; i++) {
@@ -2460,7 +2460,7 @@ static void usb_bam_work(struct work_struct *w)
			if (pipe_iter->bam_type == pipe_connect->bam_type &&
			    pipe_iter->dir == PEER_PERIPHERAL_TO_USB &&
			    pipe_iter->enabled) {
				log_event_dbg("%s: Register wakeup on pipe %p\n",
				log_event_dbg("%s: Register wakeup on pipe %pK\n",
					__func__, pipe_iter);
				__usb_bam_register_wake_cb(
					pipe_connect->bam_type, i,