diff mbox series

[1/3] ceph: fix error path in ceph_readdir()

Message ID 20220304161403.19295-2-lhenriques@suse.de (mailing list archive)
State New, archived
Headers show
Series ceph: minor fixes and encrypted snapshot names | expand

Commit Message

Luis Henriques March 4, 2022, 4:14 p.m. UTC
This was introduced by commit

  "ceph: add support to readdir for encrypted filenames"

It will eventually leak the fscrypt_str names in this error path.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
 fs/ceph/dir.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jeff Layton March 4, 2022, 6:17 p.m. UTC | #1
On Fri, 2022-03-04 at 16:14 +0000, Luís Henriques wrote:
> This was introduced by commit
> 
>   "ceph: add support to readdir for encrypted filenames"
> 
> It will eventually leak the fscrypt_str names in this error path.
> 
> Signed-off-by: Luís Henriques <lhenriques@suse.de>
> ---
>  fs/ceph/dir.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 44395aae7259..0bcb677d2199 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -500,7 +500,6 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx)
>  					       next_offset);
>  			if (err) {
>  				ceph_mdsc_put_request(dfi->last_readdir);
> -				return err;
>  				goto out;
>  			}
>  		} else if (req->r_reply_info.dir_end) {

This doesn't seem to apply to the current wip-fscrypt tree. Are you
working against an older branch, perhaps?
Luis Henriques March 5, 2022, 2:30 p.m. UTC | #2
Jeff Layton <jlayton@kernel.org> writes:

> On Fri, 2022-03-04 at 16:14 +0000, Luís Henriques wrote:
>> This was introduced by commit
>> 
>>   "ceph: add support to readdir for encrypted filenames"
>> 
>> It will eventually leak the fscrypt_str names in this error path.
>> 
>> Signed-off-by: Luís Henriques <lhenriques@suse.de>
>> ---
>>  fs/ceph/dir.c | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
>> index 44395aae7259..0bcb677d2199 100644
>> --- a/fs/ceph/dir.c
>> +++ b/fs/ceph/dir.c
>> @@ -500,7 +500,6 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx)
>>  					       next_offset);
>>  			if (err) {
>>  				ceph_mdsc_put_request(dfi->last_readdir);
>> -				return err;
>>  				goto out;
>>  			}
>>  		} else if (req->r_reply_info.dir_end) {
>
> This doesn't seem to apply to the current wip-fscrypt tree. Are you
> working against an older branch, perhaps?

I thought I was on an up-to-date branch but obviously I was wrong.  I'll
rebase the patches.  Sorry.

Cheers,
diff mbox series

Patch

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 44395aae7259..0bcb677d2199 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -500,7 +500,6 @@  static int ceph_readdir(struct file *file, struct dir_context *ctx)
 					       next_offset);
 			if (err) {
 				ceph_mdsc_put_request(dfi->last_readdir);
-				return err;
 				goto out;
 			}
 		} else if (req->r_reply_info.dir_end) {