mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
smb: server: handle readdir_info_level_struct_sz() error
early exit in smb2_populate_readdir_entry() if the requested info_level is unknown. Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
254f49634e
commit
ab4ad35e58
|
|
@ -3946,7 +3946,13 @@ static int smb2_populate_readdir_entry(struct ksmbd_conn *conn, int info_level,
|
|||
goto free_conv_name;
|
||||
}
|
||||
|
||||
struct_sz = readdir_info_level_struct_sz(info_level) + conv_len;
|
||||
struct_sz = readdir_info_level_struct_sz(info_level);
|
||||
if (struct_sz == -EOPNOTSUPP) {
|
||||
rc = -EINVAL;
|
||||
goto free_conv_name;
|
||||
}
|
||||
|
||||
struct_sz += conv_len;
|
||||
next_entry_offset = ALIGN(struct_sz, KSMBD_DIR_INFO_ALIGNMENT);
|
||||
d_info->last_entry_off_align = next_entry_offset - struct_sz;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user