Hello! On Tue, Aug 31, 2021 at 9:37 PM Pavel Tikhomirov <[email protected]> wrote: > Please take a look on OPT_SUBTYPE and OPT_SOURCE options, do we actually > need strncpy here?
Formally, сheck if (param->size > FUSE_KIO_NAME) must be enough. But better be safe than sorry. In this particular context we have no idea that param->size is correlated to actual string length. You may believe to caller, I would not. > vfs_parse_fs_string with it's kmemdup_nul already > puts null-terminated string in param.string, similarly null-terminated > string is provided by sys_fsconfig with strndup_user(_value, 256); Wrong! If you copy OPT_SUBTYPE or OPT_SOURCE to a buffer you use strncpy limited to sizeof of your local buffer no matter what is written on that fence :-) _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
