[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251230110225.3655707-2-ekansh.gupta@oss.qualcomm.com>
Date: Tue, 30 Dec 2025 16:32:23 +0530
From: Ekansh Gupta <ekansh.gupta@....qualcomm.com>
To: srini@...nel.org, linux-arm-msm@...r.kernel.org
Cc: gregkh@...uxfoundation.org, quic_bkumar@...cinc.com,
linux-kernel@...r.kernel.org, quic_chennak@...cinc.com,
dri-devel@...ts.freedesktop.org, arnd@...db.de,
dmitry.baryshkov@....qualcomm.com, stable@...nel.org
Subject: [PATCH v3 1/3] misc: fastrpc: Sanitize address logging and remove tabs
Avoid printing raw addresses in driver logs by using %p for remote
buffer addresses. This reduces the risk of information leaks and
conforms to kernel logging guidelines. Remove tabs in dev_*
messages.
Fixes: 2419e55e532d ("misc: fastrpc: add mmap/unmap support")
Cc: stable@...nel.org
Signed-off-by: Ekansh Gupta <ekansh.gupta@....qualcomm.com>
---
drivers/misc/fastrpc.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index ee652ef01534..408fe47e9db7 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1830,13 +1830,13 @@ static int fastrpc_req_munmap_impl(struct fastrpc_user *fl, struct fastrpc_buf *
err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc,
&args[0]);
if (!err) {
- dev_dbg(dev, "unmmap\tpt 0x%09lx OK\n", buf->raddr);
+ dev_dbg(dev, "unmap OK: raddr=%p\n", (void *)(unsigned long)buf->raddr);
spin_lock(&fl->lock);
list_del(&buf->node);
spin_unlock(&fl->lock);
fastrpc_buf_free(buf);
} else {
- dev_err(dev, "unmmap\tpt 0x%09lx ERROR\n", buf->raddr);
+ dev_err(dev, "unmap error: raddr=%p\n", (void *)(unsigned long)buf->raddr);
}
return err;
@@ -1861,8 +1861,8 @@ static int fastrpc_req_munmap(struct fastrpc_user *fl, char __user *argp)
spin_unlock(&fl->lock);
if (!buf) {
- dev_err(dev, "mmap\t\tpt 0x%09llx [len 0x%08llx] not in list\n",
- req.vaddrout, req.size);
+ dev_err(dev, "buffer not found: addr=%p [len=0x%08llx]\n",
+ (void *)(unsigned long)req.vaddrout, req.size);
return -EINVAL;
}
@@ -1959,8 +1959,8 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
goto err_assign;
}
- dev_dbg(dev, "mmap\t\tpt 0x%09lx OK [len 0x%08llx]\n",
- buf->raddr, buf->size);
+ dev_dbg(dev, "mmap OK: raddr=%p [len=0x%08llx]\n",
+ (void *)(unsigned long)buf->raddr, buf->size);
return 0;
@@ -2006,7 +2006,8 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me
err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc,
&args[0]);
if (err) {
- dev_err(dev, "unmmap\tpt fd = %d, 0x%09llx error\n", map->fd, map->raddr);
+ dev_err(dev, "unmap error: fd=%d, raddr=%p\n",
+ map->fd, (void *)(unsigned long)map->raddr);
return err;
}
fastrpc_map_put(map);
@@ -2074,8 +2075,8 @@ static int fastrpc_req_mem_map(struct fastrpc_user *fl, char __user *argp)
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_MEM_MAP, 3, 1);
err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc, &args[0]);
if (err) {
- dev_err(dev, "mem mmap error, fd %d, vaddr %llx, size %lld\n",
- req.fd, req.vaddrin, map->len);
+ dev_err(dev, "mem mmap error: fd=%d, vaddrin=%p, size=%lld\n",
+ req.fd, (void *)(unsigned long)req.vaddrin, map->len);
goto err_invoke;
}
--
2.34.1
Powered by blists - more mailing lists