[RAMEN9610-10029][COMMON] media: mfc: fix information leak
authorAyoung Sim <a.sim@samsung.com>
Mon, 3 Dec 2018 07:26:56 +0000 (16:26 +0900)
committerhskang <hs1218.kang@samsung.com>
Fri, 28 Dec 2018 09:54:32 +0000 (18:54 +0900)
This patch doesn't print the pointers and use %pK
instead %p, if it is necessary to show.

Change-Id: I6bb2f272129d707c585bb1a98596e00442418999
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
drivers/media/platform/exynos/mfc/mfc.c
drivers/media/platform/exynos/mfc/mfc_watchdog.c

index e01124b3d0f7d3ec69e2385c6ea0863fa4ffd3c6..acf17a55c57f7adfd4ee230e31696f58ce4b0aa2 100644 (file)
@@ -594,8 +594,8 @@ static int mfc_open(struct file *file)
 
        mfc_perf_init(dev);
        trace_mfc_node_open(ctx->num, dev->num_inst, ctx->type, ctx->is_drm);
-       mfc_info_ctx("MFC open completed [%d:%d] dev = 0x%p, ctx = 0x%p, version = %d\n",
-                       dev->num_drm_inst, dev->num_inst, dev, ctx, MFC_DRIVER_INFO);
+       mfc_info_ctx("MFC open completed [%d:%d] version = %d\n",
+                       dev->num_drm_inst, dev->num_inst, MFC_DRIVER_INFO);
        MFC_TRACE_CTX_LT("[INFO] %s %s opened (ctx:%d, total:%d)\n", ctx->is_drm ? "DRM" : "Normal",
                        mfc_is_decoder_node(node) ? "DEC" : "ENC", ctx->num, dev->num_inst);
        mutex_unlock(&dev->mfc_mutex);
@@ -808,8 +808,7 @@ static int mfc_release(struct file *file)
 
        mfc_perf_print();
 
-       mfc_info_dev("mfc driver release finished [%d:%d], dev = 0x%p\n",
-                       dev->num_drm_inst, dev->num_inst, dev);
+       mfc_info_dev("mfc driver release finished [%d:%d]\n", dev->num_drm_inst, dev->num_inst);
 
        if (mfc_is_work_to_do(dev))
                queue_work(dev->butler_wq, &dev->butler_work);
index df445f258d45a4aae648b17bc689b73a774affc1..cb156a03d73ce2f3993359f8b53191f1a287a74e 100644 (file)
@@ -54,7 +54,7 @@ static void __mfc_dump_regs(struct mfc_dev *dev)
                { 0xC000, 0x84 },
        };
 
-       pr_err("-----------dumping MFC registers (SFR base = 0x%p, dev = 0x%p)\n",
+       pr_err("-----------dumping MFC registers (SFR base = 0x%pK, dev = 0x%pK)\n",
                                dev->regs_base, dev);
 
        if (!mfc_pm_get_pwr_ref_cnt(dev) || !mfc_pm_get_clk_ref_cnt(dev)) {
@@ -245,9 +245,17 @@ void __mfc_dump_buffer_info(struct mfc_dev *dev)
        if (ctx) {
                pr_err("-----------dumping MFC buffer info (fault at: %#x)\n",
                                dev->logging_data->fault_addr);
-               pr_err("common:%#llx~%#llx, instance:%#llx~%#llx, codec:%#llx~%#llx\n",
+               pr_err("Normal FW:%llx~%#llx (common ctx buf:%#llx~%#llx)\n",
+                               dev->fw_buf.daddr, dev->fw_buf.daddr + dev->fw_buf.size,
                                dev->common_ctx_buf.daddr,
-                               dev->common_ctx_buf.daddr + PAGE_ALIGN(0x7800),
+                               dev->common_ctx_buf.daddr + PAGE_ALIGN(0x7800));
+#ifdef CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
+               pr_err("Secure FW:%llx~%#llx (common ctx buf:%#llx~%#llx)\n",
+                               dev->drm_fw_buf.daddr, dev->drm_fw_buf.daddr + dev->drm_fw_buf.size,
+                               dev->drm_common_ctx_buf.daddr,
+                               dev->drm_common_ctx_buf.daddr + PAGE_ALIGN(0x7800));
+#endif
+               pr_err("instance buf:%#llx~%#llx, codec buf:%#llx~%#llx\n",
                                ctx->instance_ctx_buf.daddr,
                                ctx->instance_ctx_buf.daddr + ctx->instance_ctx_buf.size,
                                ctx->codec_buf.daddr,