mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
vfs: Fix refcounting of filenames in fs_parser
Fix an overput in which filename_lookup() unconditionally drops a ref to the filename it was given, but this isn't taken account of in the caller, fs_lookup_param(). Addresses-Coverity-ID: 1443811 ("Use after free") Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
c3aabf0780
commit
7cdfa44227
@ -268,6 +268,7 @@ int fs_lookup_param(struct fs_context *fc,
|
||||
return invalf(fc, "%s: not usable as path", param->key);
|
||||
}
|
||||
|
||||
f->refcnt++; /* filename_lookup() drops our ref. */
|
||||
ret = filename_lookup(param->dirfd, f, flags, _path, NULL);
|
||||
if (ret < 0) {
|
||||
errorf(fc, "%s: Lookup failure for '%s'", param->key, f->name);
|
||||
|
Loading…
Reference in New Issue
Block a user