git: 88a29d89ebab - main - lindebugfs: Zero the linux_file structure before use.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 11 Mar 2022 16:42:44 UTC
The branch main has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=88a29d89ebab1ed60607c3dab73143c3b59a0f83
commit 88a29d89ebab1ed60607c3dab73143c3b59a0f83
Author: Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-03-11 16:29:54 +0000
Commit: Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-03-11 16:41:33 +0000
lindebugfs: Zero the linux_file structure before use.
This avoids clients using garbage values on the stack and makes
debugging easier.
MFC after: 1 week
Sponsored by: NVIDIA Networking
---
sys/compat/lindebugfs/lindebugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c
index 8eaa41412fd2..9507cded9ebd 100644
--- a/sys/compat/lindebugfs/lindebugfs.c
+++ b/sys/compat/lindebugfs/lindebugfs.c
@@ -117,7 +117,7 @@ static int
debugfs_fill(PFS_FILL_ARGS)
{
struct dentry_meta *d;
- struct linux_file lf;
+ struct linux_file lf = {};
struct seq_file *sf;
struct vnode vn;
void *buf;
@@ -139,7 +139,6 @@ debugfs_fill(PFS_FILL_ARGS)
len = sbuf_len(sb);
}
off = 0;
- lf.private_data = NULL;
rc = d->dm_fops->open(&vn, &lf);
if (rc < 0) {
#ifdef INVARIANTS