ceph: fix the buf size and use NAME_SIZE instead
PATCH 1/1 ceph: fix the buf size and use NAME_SIZE instead
From: Xiubo Li <[email protected]>
Since the base64_encrypted file name shouldn't exceed the NAME_SIZE, no need to allocate a buffer from the stack that long.
---
Jeff, you can just squash this into the previous commit.
fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/mds_client.c +1 -1
@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for parent =dget_parent (cur); }else {int len, ret; -char buf[FSCRYPT_BASE64URL_CHARS (NAME_MAX )]; +char buf[NAME_MAX ];/* * Proactively copy name into buf, in case we need to present
Signature · 1 line
2.27.0
Quoted 29 lines · On Wed, Mar 16, 2022 at 9:21 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
Since the
base64_encryptedfile name shouldn't exceed theNAME_SIZE, no need to allocate a buffer from the stack that long.Signed-off-by Xiubo Li <[email protected]>---
Jeff, you can just squash this into the previous commit.
fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +1
-2@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for parent =dget_parent (cur); }else {int len, ret; -char buf[FSCRYPT_BASE64URL_CHARS (NAME_MAX )]; +char buf[NAME_MAX ];/* * Proactively copy name into buf, in case we need to present --
Quoted 2 lines
2.27.0
Makes sense.
Signature · 2 lines
Cheers, Venky
Quoted 19 lines · On Wed, 2022-03-16 at 11:51 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Since the
base64_encryptedfile name shouldn't exceed theNAME_SIZE, no need to allocate a buffer from the stack that long.Signed-off-by Xiubo Li <[email protected]>---
Jeff, you can just squash this into the previous commit.
fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +0
-0
fs/ceph/mds_client.c char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for · line 2585
Quoted 8 lines
fs/ceph/mds_client.c +1
-1@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for parent =dget_parent (cur); }else {int len, ret; -char buf[FSCRYPT_BASE64URL_CHARS (NAME_MAX )]; +char buf[NAME_MAX ];/* * Proactively copy name into buf, in case we need to present
Thanks Xiubo. I folded this into:
ceph: add encrypted fname handling to ceph_mdsc_build_path
...and merged in the other patches you sent earlier today.
I also went ahead and squashed down the readdir patches that you sent yesterday, so that we could get rid of the interim readdir handling that I had originally written.
It might need a bit more cleanup -- some of the deltas in the merged patch probably belong in earlier commits, but it should be ok for now.
Please take a look and make sure I didn't miss anything there.
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 34 lines · Jeff Layton
Quoted 19 lines · On Wed, 2022-03-16 at 11:51 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Since the
base64_encryptedfile name shouldn't exceed theNAME_SIZE, no need to allocate a buffer from the stack that long.Signed-off-by Xiubo Li <[email protected]>---
Jeff, you can just squash this into the previous commit.
fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +0
-0fs/ceph/mds_client.c char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for · line 2585
Quoted 8 lines
fs/ceph/mds_client.c +1
-1@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for parent =dget_parent (cur); }else {int len, ret; -char buf[FSCRYPT_BASE64URL_CHARS (NAME_MAX )]; +char buf[NAME_MAX ];/* * Proactively copy name into buf, in case we need to present Thanks Xiubo. I folded this into:
ceph: add encrypted fname handling to
ceph_mdsc_build_path...and merged in the other patches you sent earlier today.
Quoted 8 lines
I also went ahead and squashed down the readdir patches that you sent yesterday, so that we could get rid of the interim readdir handling that I had originally written.
It might need a bit more cleanup -- some of the deltas in the merged patch probably belong in earlier commits, but it should be ok for now.
Please take a look and make sure I didn't miss anything there.
Sure, will check it today.
- Xiubo
Quoted 34 lines · Jeff Layton
Quoted 19 lines · On Wed, 2022-03-16 at 11:51 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Since the
base64_encryptedfile name shouldn't exceed theNAME_SIZE, no need to allocate a buffer from the stack that long.Signed-off-by Xiubo Li <[email protected]>---
Jeff, you can just squash this into the previous commit.
fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +0
-0fs/ceph/mds_client.c char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for · line 2585
Quoted 8 lines
fs/ceph/mds_client.c +1
-1@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for parent =dget_parent (cur); }else {int len, ret; -char buf[FSCRYPT_BASE64URL_CHARS (NAME_MAX )]; +char buf[NAME_MAX ];/* * Proactively copy name into buf, in case we need to present Thanks Xiubo. I folded this into:
ceph: add encrypted fname handling to
ceph_mdsc_build_path...and merged in the other patches you sent earlier today.
Quoted 8 lines
I also went ahead and squashed down the readdir patches that you sent yesterday, so that we could get rid of the interim readdir handling that I had originally written.
It might need a bit more cleanup -- some of the deltas in the merged patch probably belong in earlier commits, but it should be ok for now.
Please take a look and make sure I didn't miss anything there.
I have gone through the wip-fscrypt, all these look fine.
-- Xiubo