Re: [PATCH v2 17/35] sanitize handling of long-term internal mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 23, 2025 at 09:18:33AM -0700, Linus Torvalds wrote:

> I'm not objecting to the patch, and I don't really even have a
> solution: many of the existing cases actually do need the more
> complicated vfs_parse_fs_string() interface because they don't want
> that simple 'strlen()' for size.

I don't know...  7 callers with explicit strlen():
drivers/gpu/drm/i915/gem/i915_gemfs.c:16:       return vfs_parse_fs_string(fc, key, val, strlen(val));
drivers/gpu/drm/v3d/v3d_gemfs.c:12:     return vfs_parse_fs_string(fc, key, val, strlen(val));
fs/namespace.c:1284:            ret = vfs_parse_fs_string(fc, "source",
fs/namespace.c:3799:            err = vfs_parse_fs_string(fc, "subtype",
fs/namespace.c:3802:            err = vfs_parse_fs_string(fc, "source", name, strlen(name));
fs/nfs/fs_context.c:1230:                       ret = vfs_parse_fs_string(fc, "context",
kernel/trace/trace.c:10280:     ret = vfs_parse_fs_string(fc, "source",

3 callers that could as well use strlen(), except that some of them need
to cope with NULL (using 0 for length in that case):
fs/fs_context.c:230:                    ret = vfs_parse_fs_string(fc, key, value, v_len);
fs/nfs/namespace.c:293:         ret = vfs_parse_fs_string(fc, "source", p, buffer + 4096 - p);
fs/smb/client/fs_context.c:785:         ret = vfs_parse_fs_string(fc, key, value, len);

1 caller that really does need len < strlen(s):
fs/afs/mntpt.c:140:                     ret = vfs_parse_fs_string(fc, "source", content, size - 1);

> I just feel that at a minimum you shouldn't implement add_param()
> twice, because some other users *would* want to do that.
> 
> So I wish you had made that a real helper - which would obviously then
> also force a naming change ("fs_context_add_param()".

May the bikeshedding commence ;-)

> Or maybe even go further and some helper to doi that
> "fs_context_for_mount()" _with_ a list of param's to be added?

Vararg, presumably?

> I do think that could be done later (separately), but wanted to just
> mention this because I reacted to this patch.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux