Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Marios Makassikis and committed by
Steve French
ab4ad35e 254f4963

+7 -1
+7 -1
fs/smb/server/smb2pdu.c
··· 3946 3946 goto free_conv_name; 3947 3947 } 3948 3948 3949 - struct_sz = readdir_info_level_struct_sz(info_level) + conv_len; 3949 + struct_sz = readdir_info_level_struct_sz(info_level); 3950 + if (struct_sz == -EOPNOTSUPP) { 3951 + rc = -EINVAL; 3952 + goto free_conv_name; 3953 + } 3954 + 3955 + struct_sz += conv_len; 3950 3956 next_entry_offset = ALIGN(struct_sz, KSMBD_DIR_INFO_ALIGNMENT); 3951 3957 d_info->last_entry_off_align = next_entry_offset - struct_sz; 3952 3958