diff mbox series

[01/27] aio: fix failure to put the file pointer

Message ID 20181130165646.27341-2-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show
Series [01/27] aio: fix failure to put the file pointer | expand

Commit Message

Jens Axboe Nov. 30, 2018, 4:56 p.m. UTC
If the ioprio capability check fails, we return without putting
the file pointer.

Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/aio.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bart Van Assche Nov. 30, 2018, 5:07 p.m. UTC | #1
On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote:
> If the ioprio capability check fails, we return without putting
> the file pointer.
> 
> Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>  fs/aio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/aio.c b/fs/aio.c
> index b984918be4b7..205390c0c1bb 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
>  		ret = ioprio_check_cap(iocb->aio_reqprio);
>  		if (ret) {
>  			pr_debug("aio ioprio check cap error: %d\n", ret);
> +			fput(req->ki_filp);
>  			return ret;
>  		}

Since this patch fixes a bug that was introduced in kernel v4.18, does this
patch need a "Cc: stable" tag?

Thanks,

Bart.
Jens Axboe Nov. 30, 2018, 5:08 p.m. UTC | #2
On 11/30/18 10:07 AM, Bart Van Assche wrote:
> On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote:
>> If the ioprio capability check fails, we return without putting
>> the file pointer.
>>
>> Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
>> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>> ---
>>  fs/aio.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/aio.c b/fs/aio.c
>> index b984918be4b7..205390c0c1bb 100644
>> --- a/fs/aio.c
>> +++ b/fs/aio.c
>> @@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
>>  		ret = ioprio_check_cap(iocb->aio_reqprio);
>>  		if (ret) {
>>  			pr_debug("aio ioprio check cap error: %d\n", ret);
>> +			fput(req->ki_filp);
>>  			return ret;
>>  		}
> 
> Since this patch fixes a bug that was introduced in kernel v4.18, does this
> patch need a "Cc: stable" tag?

The fixes should take care of that by itself, I hope.
Bart Van Assche Nov. 30, 2018, 5:24 p.m. UTC | #3
On Fri, 2018-11-30 at 10:08 -0700, Jens Axboe wrote:
> On 11/30/18 10:07 AM, Bart Van Assche wrote:
> > On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote:
> > > If the ioprio capability check fails, we return without putting
> > > the file pointer.
> > > 
> > > Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
> > > Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> > > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > > Signed-off-by: Jens Axboe <axboe@kernel.dk>
> > > ---
> > >  fs/aio.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/fs/aio.c b/fs/aio.c
> > > index b984918be4b7..205390c0c1bb 100644
> > > --- a/fs/aio.c
> > > +++ b/fs/aio.c
> > > @@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
> > >  		ret = ioprio_check_cap(iocb->aio_reqprio);
> > >  		if (ret) {
> > >  			pr_debug("aio ioprio check cap error: %d\n", ret);
> > > +			fput(req->ki_filp);
> > >  			return ret;
> > >  		}
> > 
> > Since this patch fixes a bug that was introduced in kernel v4.18, does this
> > patch need a "Cc: stable" tag?
> 
> The fixes should take care of that by itself, I hope.

Hi Jens,

My understanding is that patches that have a "Cc: stable" tag are guaranteed to
be integrated in a stable kernel sooner or later. Without that tag it depends on
the stable kernel maintainer whether or not these patches get picked up. I think
the "AUTOSEL" tag Sasha Levin uses indicates that a patch was picked up for one
of his stable kernels and that it did not have a "Cc: stable" tag. I'm not sure
Greg KH picks up patches that only have a "Fixes:" tag but no "Cc: stable" tag.

Bart.
diff mbox series

Patch

diff --git a/fs/aio.c b/fs/aio.c
index b984918be4b7..205390c0c1bb 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1436,6 +1436,7 @@  static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
 		ret = ioprio_check_cap(iocb->aio_reqprio);
 		if (ret) {
 			pr_debug("aio ioprio check cap error: %d\n", ret);
+			fput(req->ki_filp);
 			return ret;
 		}