file: Rename __close_fd_get_file close_fd_get_file
ANBZ: #6478 [ Upstream commit9fe83c43e7
] The function close_fd_get_file is explicitly a variant of __close_fd[1]. Now that __close_fd has been renamed close_fd, rename close_fd_get_file to be consistent with close_fd. When __alloc_fd, __close_fd and __fd_install were introduced the double underscore indicated that the function took a struct files_struct parameter. The function __close_fd_get_file never has so the naming has always been inconsistent. This just cleans things up so there are not any lingering mentions or references __close_fd left in the code. [1]80cd795630
("binder: fix use-after-free due to ksys_close() during fdget()") Link: https://lkml.kernel.org/r/20201120231441.29911-23-ebiederm@xmission.com Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Acked-by: Zelin Deng <zelin.deng@linux.alibaba.com> Acked-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/2195
This commit is contained in:
parent
103ef8a79a
commit
7396a6f69f
|
@ -2230,7 +2230,7 @@ static void binder_deferred_fd_close(int fd)
|
||||||
if (!twcb)
|
if (!twcb)
|
||||||
return;
|
return;
|
||||||
init_task_work(&twcb->twork, binder_do_fd_close);
|
init_task_work(&twcb->twork, binder_do_fd_close);
|
||||||
__close_fd_get_file(fd, &twcb->file);
|
close_fd_get_file(fd, &twcb->file);
|
||||||
if (twcb->file) {
|
if (twcb->file) {
|
||||||
filp_close(twcb->file, current->files);
|
filp_close(twcb->file, current->files);
|
||||||
task_work_add(current, &twcb->twork, TWA_RESUME);
|
task_work_add(current, &twcb->twork, TWA_RESUME);
|
||||||
|
|
|
@ -780,11 +780,11 @@ int __close_range(unsigned fd, unsigned max_fd, unsigned int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* variant of __close_fd that gets a ref on the file for later fput.
|
* variant of close_fd that gets a ref on the file for later fput.
|
||||||
* The caller must ensure that filp_close() called on the file, and then
|
* The caller must ensure that filp_close() called on the file, and then
|
||||||
* an fput().
|
* an fput().
|
||||||
*/
|
*/
|
||||||
int __close_fd_get_file(unsigned int fd, struct file **res)
|
int close_fd_get_file(unsigned int fd, struct file **res)
|
||||||
{
|
{
|
||||||
struct files_struct *files = current->files;
|
struct files_struct *files = current->files;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
|
|
|
@ -4652,7 +4652,7 @@ static int io_close(struct io_kiocb *req, unsigned int issue_flags)
|
||||||
|
|
||||||
/* might be already done during nonblock submission */
|
/* might be already done during nonblock submission */
|
||||||
if (!close->put_file) {
|
if (!close->put_file) {
|
||||||
ret = __close_fd_get_file(close->fd, &close->put_file);
|
ret = close_fd_get_file(close->fd, &close->put_file);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return (ret == -ENOENT) ? -EBADF : ret;
|
return (ret == -ENOENT) ? -EBADF : ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ extern void __fd_install(struct files_struct *files,
|
||||||
extern int __close_fd(struct files_struct *files,
|
extern int __close_fd(struct files_struct *files,
|
||||||
unsigned int fd);
|
unsigned int fd);
|
||||||
extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags);
|
extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags);
|
||||||
extern int __close_fd_get_file(unsigned int fd, struct file **res);
|
extern int close_fd_get_file(unsigned int fd, struct file **res);
|
||||||
extern int unshare_fd(unsigned long unshare_flags, unsigned int max_fds,
|
extern int unshare_fd(unsigned long unshare_flags, unsigned int max_fds,
|
||||||
struct files_struct **new_fdp);
|
struct files_struct **new_fdp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue