mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
Revert "FROMLIST: fuse: Use daemon creds in passthrough mode"
This reverts commit 9ee350d7ec.
Change-Id: I2131f083bacdb759c061c0d0127ce0e26882104f
Signed-off-by: Alessio Balsini <balsini@google.com>
This commit is contained in:
@@ -182,13 +182,10 @@ struct fuse_release_args;
|
||||
|
||||
/**
|
||||
* Reference to lower filesystem file for read/write operations handled in
|
||||
* passthrough mode.
|
||||
* This struct also tracks the credentials to be used for handling read/write
|
||||
* operations.
|
||||
* passthrough mode
|
||||
*/
|
||||
struct fuse_passthrough {
|
||||
struct file *filp;
|
||||
struct cred *cred;
|
||||
};
|
||||
|
||||
/** FUSE specific file data */
|
||||
|
||||
@@ -67,7 +67,6 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
|
||||
struct iov_iter *iter)
|
||||
{
|
||||
ssize_t ret;
|
||||
const struct cred *old_cred;
|
||||
struct file *fuse_filp = iocb_fuse->ki_filp;
|
||||
struct fuse_file *ff = fuse_filp->private_data;
|
||||
struct file *passthrough_filp = ff->passthrough.filp;
|
||||
@@ -75,7 +74,6 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
|
||||
if (!iov_iter_count(iter))
|
||||
return 0;
|
||||
|
||||
old_cred = override_creds(ff->passthrough.cred);
|
||||
if (is_sync_kiocb(iocb_fuse)) {
|
||||
ret = vfs_iter_read(passthrough_filp, iter, &iocb_fuse->ki_pos,
|
||||
iocb_to_rw_flags(iocb_fuse->ki_flags));
|
||||
@@ -93,7 +91,6 @@ ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
|
||||
if (ret != -EIOCBQUEUED)
|
||||
fuse_aio_cleanup_handler(aio_req);
|
||||
}
|
||||
revert_creds(old_cred);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -102,7 +99,6 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
|
||||
struct iov_iter *iter)
|
||||
{
|
||||
ssize_t ret;
|
||||
const struct cred *old_cred;
|
||||
struct file *fuse_filp = iocb_fuse->ki_filp;
|
||||
struct fuse_file *ff = fuse_filp->private_data;
|
||||
struct inode *fuse_inode = file_inode(fuse_filp);
|
||||
@@ -114,7 +110,6 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
|
||||
|
||||
inode_lock(fuse_inode);
|
||||
|
||||
old_cred = override_creds(ff->passthrough.cred);
|
||||
if (is_sync_kiocb(iocb_fuse)) {
|
||||
file_start_write(passthrough_filp);
|
||||
ret = vfs_iter_write(passthrough_filp, iter, &iocb_fuse->ki_pos,
|
||||
@@ -142,7 +137,6 @@ ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
|
||||
fuse_aio_cleanup_handler(aio_req);
|
||||
}
|
||||
out:
|
||||
revert_creds(old_cred);
|
||||
inode_unlock(fuse_inode);
|
||||
|
||||
return ret;
|
||||
@@ -180,7 +174,6 @@ int fuse_passthrough_open(struct fuse_dev *fud,
|
||||
return -ENOMEM;
|
||||
|
||||
passthrough->filp = passthrough_filp;
|
||||
passthrough->cred = prepare_creds();
|
||||
|
||||
idr_preload(GFP_KERNEL);
|
||||
spin_lock(&fc->passthrough_req_lock);
|
||||
@@ -238,8 +231,4 @@ void fuse_passthrough_release(struct fuse_passthrough *passthrough)
|
||||
fput(passthrough->filp);
|
||||
passthrough->filp = NULL;
|
||||
}
|
||||
if (passthrough->cred) {
|
||||
put_cred(passthrough->cred);
|
||||
passthrough->cred = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user