diff options
Diffstat (limited to 'pkg/sentry/fs/dirent.go')
-rw-r--r-- | pkg/sentry/fs/dirent.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fs/dirent.go b/pkg/sentry/fs/dirent.go index 4c0d1b7ef..4c0482036 100644 --- a/pkg/sentry/fs/dirent.go +++ b/pkg/sentry/fs/dirent.go @@ -458,6 +458,12 @@ func (d *Dirent) walk(ctx context.Context, root *Dirent, name string, walkMayUnl if !IsDir(d.Inode.StableAttr) { return nil, syscall.ENOTDIR } + + // The component must be less than NAME_MAX. + if len(name) > linux.NAME_MAX { + return nil, syscall.ENAMETOOLONG + } + if name == "" || name == "." { d.IncRef() return d, nil |