]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
lindebugfs: Zero the linux_file structure before use.
authorHans Petter Selasky <hselasky@FreeBSD.org>
Fri, 11 Mar 2022 16:29:54 +0000 (17:29 +0100)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 17 Mar 2022 12:26:19 +0000 (13:26 +0100)
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

index 8eaa41412fd2e9a9066318339f2895aa11defca9..9507cded9ebd9fc1a89b2a57aa8340d39a340ea4 100644 (file)
@@ -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