mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-17 16:36:45 -04:00
smb/client: check if SMB1 DOS/SRV error mapping arrays are sorted
Although the arrays are sorted at build time, verify the ordering again when cifs.ko is loaded to avoid potential regressions introduced by future script changes. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
committed by
Steve French
parent
95e6b73409
commit
8c028dd086
@@ -219,6 +219,10 @@ static int __init __array ## _is_sorted(void) \
|
||||
|
||||
/* ntstatus_to_dos_map_is_sorted */
|
||||
DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus);
|
||||
/* mapping_table_ERRDOS_is_sorted */
|
||||
DEFINE_CHECK_SORT_FUNC(mapping_table_ERRDOS, smb_err);
|
||||
/* mapping_table_ERRSRV_is_sorted */
|
||||
DEFINE_CHECK_SORT_FUNC(mapping_table_ERRSRV, smb_err);
|
||||
|
||||
int __init smb1_init_maperror(void)
|
||||
{
|
||||
@@ -228,6 +232,14 @@ int __init smb1_init_maperror(void)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = mapping_table_ERRDOS_is_sorted();
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = mapping_table_ERRSRV_is_sorted();
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user