From 09fcb3900f1b86efc250b62ee913b57a064d7d8f Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 11 Mar 2022 17:29:54 +0100 Subject: [PATCH] lindebugfs: Zero the linux_file structure before use. This avoids clients using garbage values on the stack and makes debugging easier. Sponsored by: NVIDIA Networking Approved by: re (gjb) (cherry picked from commit 88a29d89ebab1ed60607c3dab73143c3b59a0f83) (cherry picked from commit b5cc52c21d7d34eae93c996cee09e7d2896afa6e) --- 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 -- 2.39.5