From 742b914fcb8270270c81de0f069147dca0a4c480 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Fri, 2 Aug 2024 11:17:25 -0700 Subject: [PATCH] Don't log mount.root because it leads to racy access. I don't think these logs have been useful in the past anyways. Reported-by: syzbot+73ebb3f2046b3352bb94@syzkaller.appspotmail.com PiperOrigin-RevId: 658846904 --- pkg/sentry/vfs/mount.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/sentry/vfs/mount.go b/pkg/sentry/vfs/mount.go index ce0ee0506..fb8721a85 100644 --- a/pkg/sentry/vfs/mount.go +++ b/pkg/sentry/vfs/mount.go @@ -1370,7 +1370,7 @@ func (vfs *VirtualFilesystem) GenerateProcMounts(ctx context.Context, taskRootDi if err != nil { // For some reason we didn't get a path. Log a warning // and run with empty path. - ctx.Warningf("VFS.GenerateProcMounts: error getting pathname for mount root %+v: %v", mnt.root, err) + ctx.Warningf("VFS.GenerateProcMounts: error getting pathname for mount root: %v", err) path = "" } if path == "" { @@ -1437,7 +1437,7 @@ func (vfs *VirtualFilesystem) GenerateProcMountInfo(ctx context.Context, taskRoo if err != nil { // For some reason we didn't get a path. Log a warning // and run with empty path. - ctx.Warningf("VFS.GenerateProcMountInfo: error getting pathname for mount root %+v: %v", mnt.root, err) + ctx.Warningf("VFS.GenerateProcMountInfo: error getting pathname for mount root: %v", err) continue } if pathFromRoot == "" { @@ -1449,7 +1449,7 @@ func (vfs *VirtualFilesystem) GenerateProcMountInfo(ctx context.Context, taskRoo if err != nil { // For some reason we didn't get a path. Log a warning // and run with empty path. - ctx.Warningf("VFS.GenerateProcMountInfo: error getting pathname for mount root %+v: %v", mnt.root, err) + ctx.Warningf("VFS.GenerateProcMountInfo: error getting pathname for mount root: %v", err) continue } if pathFromFS == "" { @@ -1464,7 +1464,7 @@ func (vfs *VirtualFilesystem) GenerateProcMountInfo(ctx context.Context, taskRoo statx, err := vfs.StatAt(ctx, creds, pop, &StatOptions{}) if err != nil { // Well that's not good. Ignore this mount. - ctx.Warningf("VFS.GenerateProcMountInfo: failed to stat mount root %+v: %v", mnt.root, err) + ctx.Warningf("VFS.GenerateProcMountInfo: failed to stat mount root: %v", err) continue }