aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/timerlist.py
diff options
context:
space:
mode:
authorStephen Brennan <[email protected]>2021-09-01 10:51:41 -0700
committerAl Viro <[email protected]>2021-09-07 15:56:16 -0400
commit0766ec82e5fb26fc5dc6d592bc61865608bdc651 (patch)
treeddc2d8422eab2d84d23f6ac91e8a3a89b15cee36 /scripts/gdb/linux/timerlist.py
parent4b93c544e90e2b28326182d31ee008eb80e02074 (diff)
namei: Fix use after free in kern_path_locked
In 0ee50b47532a ("namei: change filename_parentat() calling conventions"), filename_parentat() was made to always call putname() on the filename before returning, and kern_path_locked() was migrated to this calling convention. However, kern_path_locked() uses the "last" parameter to lookup and potentially create a new dentry. The last parameter contains the last component of the path and points within the filename, which was recently freed at the end of filename_parentat(). Thus, when kern_path_locked() calls __lookup_hash(), it is using the filename after it has already been freed. In other words, these calling conventions had been wrong for the only remaining caller of filename_parentat(). Everything else is using __filename_parentat(), which does not drop the reference; so should kern_path_locked(). Switch kern_path_locked() to use of __filename_parentat() and move getting/dropping struct filename into wrapper. Remove filename_parentat(), now that we have no remaining callers. Fixes: 0ee50b47532a ("namei: change filename_parentat() calling conventions") Link: https://lore.kernel.org/linux-fsdevel/[email protected]/ Link: https://lore.kernel.org/linux-fsdevel/[email protected]/ Cc: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Reported-by: [email protected] Signed-off-by: Stephen Brennan <[email protected]> Co-authored-by: Dmitry Kadashev <[email protected]> Signed-off-by: Al Viro <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions