* Re: [PATCH 6.6 439/744] splice: remove permission hook from iter_file_splice_write() [not found] ` <20240606131746.563882173@linuxfoundation.org> @ 2024-06-06 14:33 ` Amir Goldstein 2024-06-09 11:00 ` Greg Kroah-Hartman 0 siblings, 1 reply; 4+ messages in thread From: Amir Goldstein @ 2024-06-06 14:33 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: stable, patches, Jan Kara, Josef Bacik, Christian Brauner, Sasha Levin, linux-fsdevel On Thu, Jun 6, 2024 at 5:18 PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > 6.6-stable review patch. If anyone has any objections, please let me know. I have objections and I wrote them when Sasha posted the patch for review: https://lore.kernel.org/stable/CAOQ4uxgx7Qe=+Nn7LhPWAzFK3n=qsFC8U++U5XBaLUiTA+EqLw@mail.gmail.com/ Where did this objection get lost? Thanks, Amir. > > ------------------ > > From: Amir Goldstein <amir73il@gmail.com> > > [ Upstream commit d53471ba6f7ae97a4e223539029528108b705af1 ] > > All the callers of ->splice_write(), (e.g. do_splice_direct() and > do_splice()) already check rw_verify_area() for the entire range > and perform all the other checks that are in vfs_write_iter(). > > Instead of creating another tiny helper for special caller, just > open-code it. > > This is needed for fanotify "pre content" events. > > Suggested-by: Jan Kara <jack@suse.cz> > Reviewed-by: Josef Bacik <josef@toxicpanda.com> > Signed-off-by: Amir Goldstein <amir73il@gmail.com> > Link: https://lore.kernel.org/r/20231122122715.2561213-6-amir73il@gmail.com > Signed-off-by: Christian Brauner <brauner@kernel.org> > Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions") > Signed-off-by: Sasha Levin <sashal@kernel.org> > --- > fs/splice.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/fs/splice.c b/fs/splice.c > index d983d375ff113..a8f97c5e8cf0e 100644 > --- a/fs/splice.c > +++ b/fs/splice.c > @@ -673,10 +673,13 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, > .u.file = out, > }; > int nbufs = pipe->max_usage; > - struct bio_vec *array = kcalloc(nbufs, sizeof(struct bio_vec), > - GFP_KERNEL); > + struct bio_vec *array; > ssize_t ret; > > + if (!out->f_op->write_iter) > + return -EINVAL; > + > + array = kcalloc(nbufs, sizeof(struct bio_vec), GFP_KERNEL); > if (unlikely(!array)) > return -ENOMEM; > > @@ -684,6 +687,7 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, > > splice_from_pipe_begin(&sd); > while (sd.total_len) { > + struct kiocb kiocb; > struct iov_iter from; > unsigned int head, tail, mask; > size_t left; > @@ -733,7 +737,10 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out, > } > > iov_iter_bvec(&from, ITER_SOURCE, array, n, sd.total_len - left); > - ret = vfs_iter_write(out, &from, &sd.pos, 0); > + init_sync_kiocb(&kiocb, out); > + kiocb.ki_pos = sd.pos; > + ret = call_write_iter(out, &kiocb, &from); > + sd.pos = kiocb.ki_pos; > if (ret <= 0) > break; > > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 6.6 439/744] splice: remove permission hook from iter_file_splice_write() 2024-06-06 14:33 ` [PATCH 6.6 439/744] splice: remove permission hook from iter_file_splice_write() Amir Goldstein @ 2024-06-09 11:00 ` Greg Kroah-Hartman 0 siblings, 0 replies; 4+ messages in thread From: Greg Kroah-Hartman @ 2024-06-09 11:00 UTC (permalink / raw) To: Amir Goldstein Cc: stable, patches, Jan Kara, Josef Bacik, Christian Brauner, Sasha Levin, linux-fsdevel On Thu, Jun 06, 2024 at 05:33:17PM +0300, Amir Goldstein wrote: > On Thu, Jun 6, 2024 at 5:18 PM Greg Kroah-Hartman > <gregkh@linuxfoundation.org> wrote: > > > > 6.6-stable review patch. If anyone has any objections, please let me know. > > I have objections and I wrote them when Sasha posted the patch for review: > > https://lore.kernel.org/stable/CAOQ4uxgx7Qe=+Nn7LhPWAzFK3n=qsFC8U++U5XBaLUiTA+EqLw@mail.gmail.com/ > > Where did this objection get lost? Don't know, sorry. Now dropped, thanks for letting me know. greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20240606131746.528729378@linuxfoundation.org>]
* Re: [PATCH 6.6 438/744] ovl: add helper ovl_file_modified() [not found] ` <20240606131746.528729378@linuxfoundation.org> @ 2024-06-06 14:41 ` Amir Goldstein 2024-06-09 11:04 ` Greg Kroah-Hartman 0 siblings, 1 reply; 4+ messages in thread From: Amir Goldstein @ 2024-06-06 14:41 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: stable, patches, Sasha Levin, linux-fsdevel, Miklos Szeredi On Thu, Jun 6, 2024 at 5:18 PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > 6.6-stable review patch. If anyone has any objections, please let me know. > As I wrote here: https://lore.kernel.org/stable/CAOQ4uxj6y0TJs9ZEzGCY4UkqUc1frcEOZsnP4UnWvGtQX89mRA@mail.gmail.com/ No objection to this patch, but this patch in itself is useless for stable. It is being backported as Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions") and I think the decision to backport 7c98f7cb8fda is wrong. I think that the Fixes: tag in 7c98f7cb8fda is misleading to think that this is a bug fix - it is not. I wonder how my feedback on Sasha's series got lost? Thanks, Amir. > ------------------ > > From: Amir Goldstein <amir73il@gmail.com> > > [ Upstream commit c002728f608183449673818076380124935e6b9b ] > > A simple wrapper for updating ovl inode size/mtime, to conform > with ovl_file_accessed(). > > Signed-off-by: Amir Goldstein <amir73il@gmail.com> > Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions") > Signed-off-by: Sasha Levin <sashal@kernel.org> > --- > fs/overlayfs/file.c | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > > diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c > index 8be4dc050d1ed..9fd88579bfbfb 100644 > --- a/fs/overlayfs/file.c > +++ b/fs/overlayfs/file.c > @@ -235,6 +235,12 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) > return ret; > } > > +static void ovl_file_modified(struct file *file) > +{ > + /* Update size/mtime */ > + ovl_copyattr(file_inode(file)); > +} > + > static void ovl_file_accessed(struct file *file) > { > struct inode *inode, *upperinode; > @@ -290,10 +296,8 @@ static void ovl_aio_cleanup_handler(struct ovl_aio_req *aio_req) > struct kiocb *orig_iocb = aio_req->orig_iocb; > > if (iocb->ki_flags & IOCB_WRITE) { > - struct inode *inode = file_inode(orig_iocb->ki_filp); > - > kiocb_end_write(iocb); > - ovl_copyattr(inode); > + ovl_file_modified(orig_iocb->ki_filp); > } > > orig_iocb->ki_pos = iocb->ki_pos; > @@ -403,7 +407,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) > ovl_iocb_to_rwf(ifl)); > file_end_write(real.file); > /* Update size */ > - ovl_copyattr(inode); > + ovl_file_modified(file); > } else { > struct ovl_aio_req *aio_req; > > @@ -489,7 +493,7 @@ static ssize_t ovl_splice_write(struct pipe_inode_info *pipe, struct file *out, > > file_end_write(real.file); > /* Update size */ > - ovl_copyattr(inode); > + ovl_file_modified(out); > revert_creds(old_cred); > fdput(real); > > @@ -570,7 +574,7 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len > revert_creds(old_cred); > > /* Update size */ > - ovl_copyattr(inode); > + ovl_file_modified(file); > > fdput(real); > > @@ -654,7 +658,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in, > revert_creds(old_cred); > > /* Update size */ > - ovl_copyattr(inode_out); > + ovl_file_modified(file_out); > > fdput(real_in); > fdput(real_out); > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 6.6 438/744] ovl: add helper ovl_file_modified() 2024-06-06 14:41 ` [PATCH 6.6 438/744] ovl: add helper ovl_file_modified() Amir Goldstein @ 2024-06-09 11:04 ` Greg Kroah-Hartman 0 siblings, 0 replies; 4+ messages in thread From: Greg Kroah-Hartman @ 2024-06-09 11:04 UTC (permalink / raw) To: Amir Goldstein Cc: stable, patches, Sasha Levin, linux-fsdevel, Miklos Szeredi On Thu, Jun 06, 2024 at 05:41:35PM +0300, Amir Goldstein wrote: > On Thu, Jun 6, 2024 at 5:18 PM Greg Kroah-Hartman > <gregkh@linuxfoundation.org> wrote: > > > > 6.6-stable review patch. If anyone has any objections, please let me know. > > > > As I wrote here: > https://lore.kernel.org/stable/CAOQ4uxj6y0TJs9ZEzGCY4UkqUc1frcEOZsnP4UnWvGtQX89mRA@mail.gmail.com/ > > No objection to this patch, but this patch in itself is useless for stable. > It is being backported as > Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions") > and I think the decision to backport 7c98f7cb8fda is wrong. > I think that the Fixes: tag in 7c98f7cb8fda is misleading to think that this > is a bug fix - it is not. THanks for the review, now dropped from both 6.9 and 6.6 queues. greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-09 11:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240606131732.440653204@linuxfoundation.org>
[not found] ` <20240606131746.563882173@linuxfoundation.org>
2024-06-06 14:33 ` [PATCH 6.6 439/744] splice: remove permission hook from iter_file_splice_write() Amir Goldstein
2024-06-09 11:00 ` Greg Kroah-Hartman
[not found] ` <20240606131746.528729378@linuxfoundation.org>
2024-06-06 14:41 ` [PATCH 6.6 438/744] ovl: add helper ovl_file_modified() Amir Goldstein
2024-06-09 11:04 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).