ksmbd: limit read/write/trans buffer size not to exceed MAX_STREAM_PROT_LEN
Subsystems (2)
Namjae Jeon
maintainerPATCH v2 1/1 ksmbd: limit read/write/trans buffer size not to exceed MAX_STREAM_PROT_LEN
ksmbd limit read/write/trans buffer size not to exceed maximum stream protocol length(0x00FFFFFF).
---
v2:
- change 8MB limitation to MAX_STREAM_PROT_LEN.
fs/ksmbd/smb2ops.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ksmbd/smb2ops.c +3 -0
@@ -284,6 +284,7 @@ int init_smb3_11_server(struct ksmbd_conn *conn)void init_smb2_max_read_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_read_size = sz; smb30_server_values.max_read_size = sz; smb302_server_values.max_read_size = sz;
@@ -292,6 +293,7 @@ void init_smb2_max_read_size(unsigned int sz)void init_smb2_max_write_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_write_size = sz; smb30_server_values.max_write_size = sz; smb302_server_values.max_write_size = sz;
@@ -300,6 +302,7 @@ void init_smb2_max_write_size(unsigned int sz)void init_smb2_max_trans_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_trans_size = sz; smb30_server_values.max_trans_size = sz; smb302_server_values.max_trans_size = sz;
Signature · 1 line
2.25.1
2021년 10월 8일 (금) 오후 12:29, Namjae Jeon <[email protected]>님이 작성:
Quoted 23 lines
ksmbd limit read/write/trans buffer size not to exceed maximum stream protocol length(0x00FFFFFF).
Cc Tom Talpey <[email protected]>Cc Ronnie Sahlberg <[email protected]>Cc Ralph Böhme <[email protected]>Cc Hyunchul Lee <[email protected]>Cc Steve French <[email protected]>Cc Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v2:
- change 8MB limitation toMAX_STREAM_PROT_LEN.fs/ksmbd/smb2ops.c | 3 +++ 1 file changed, 3 insertions(+)fs/ksmbd/smb2ops.c +0
-0
fs/ksmbd/smb2ops.c int init_smb3_11_server(struct ksmbd_conn *conn) · line 287
Quoted 4 lines
fs/ksmbd/smb2ops.c +1
-0@@ -284,6 +284,7 @@ int init_smb3_11_server(struct ksmbd_conn *conn)void init_smb2_max_read_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN );
If the maximum read size is MAX_STREAM_PROT_LEN, couldn't headers + data exceed MAX_STREAM_PROT_LEN?
Quoted 22 lines
fs/ksmbd/smb2ops.c +2
-1smb21_server_values.max_read_size = sz; smb30_server_values.max_read_size = sz; smb302_server_values.max_read_size = sz;@@ -292,6 +293,7 @@ void init_smb2_max_read_size(unsigned int sz)void init_smb2_max_write_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_write_size = sz; smb30_server_values.max_write_size = sz; smb302_server_values.max_write_size = sz;@@ -300,6 +302,7 @@ void init_smb2_max_write_size(unsigned int sz)void init_smb2_max_trans_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_trans_size = sz; smb30_server_values.max_trans_size = sz; smb302_server_values.max_trans_size = sz; --2.25.1
Signature · 2 lines
Thanks, Hyunchul
Namjae Jeon
maintainer2021-10-11 21:28 GMT+09:00, Hyunchul Lee <[email protected]>:
Quoted 25 lines
2021년 10월 8일 (금) 오후 12:29, Namjae Jeon <[email protected]>님이 작성:
Quoted 24 lines
ksmbd limit read/write/trans buffer size not to exceed maximum stream protocol length(0x00FFFFFF).
Cc Tom Talpey <[email protected]>Cc Ronnie Sahlberg <[email protected]>Cc Ralph Böhme <[email protected]>Cc Hyunchul Lee <[email protected]>Cc Steve French <[email protected]>Cc Sergey Senozhatsky <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
v2:
- change 8MB limitation toMAX_STREAM_PROT_LEN.fs/ksmbd/smb2ops.c | 3 +++ 1 file changed, 3 insertions(+)fs/ksmbd/smb2ops.c +0
-0@@ -284,6 +284,7 @@ int init_smb3_11_server(struct ksmbd_conn *conn)
Quoted 6 lines
fs/ksmbd/smb2ops.c int init_smb3_11_server(struct ksmbd_conn *conn) · line 287
Quoted 3 lines
fs/ksmbd/smb2ops.c +1
-0void init_smb2_max_read_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN );If the maximum read size is
MAX_STREAM_PROT_LEN, couldn't headers + data exceedMAX_STREAM_PROT_LEN?
Right, I will fix it on v3.
Thanks!
Quoted 29 lines
Quoted 21 lines
fs/ksmbd/smb2ops.c +2
-1smb21_server_values.max_read_size = sz; smb30_server_values.max_read_size = sz; smb302_server_values.max_read_size = sz;@@ -292,6 +293,7 @@ void init_smb2_max_read_size(unsigned int sz)void init_smb2_max_write_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_write_size = sz; smb30_server_values.max_write_size = sz; smb302_server_values.max_write_size = sz;@@ -300,6 +302,7 @@ void init_smb2_max_write_size(unsigned int sz)void init_smb2_max_trans_size (unsigned int sz) { + sz =min_t (u32, sz,MAX_STREAM_PROT_LEN ); smb21_server_values.max_trans_size = sz; smb30_server_values.max_trans_size = sz; smb302_server_values.max_trans_size = sz; --Quoted 2 lines
2.25.1
--
Thanks,
Hyunchul