Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scst_targ: Fix shift out of bounds #211

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Conversation

lnocturno
Copy link
Contributor

This patch should fix the following UBSAN warning:

UBSAN: shift-out-of-bounds in scst/src/scst_targ.c:3912:6 shift exponent -1 is negative

Call Trace:

show_stack+0x52/0x5c
dump_stack_lvl+0x4a/0x63
dump_stack+0x10/0x16
ubsan_epilogue+0x9/0x36
__ubsan_handle_shift_out_of_bounds.cold+0x61/0xef
scst_process_active_cmd.cold+0xf/0x2d [scst]
scst_process_redirect_cmd+0xd4/0x2e0 [scst]
scst_tgt_cmd_done+0x48/0x70 [scst]
scst_local_targ_xmit_response+0x64/0x220 [scst_local]
scst_process_active_cmd+0x891/0x2140 [scst]
scst_process_redirect_cmd+0xd4/0x2e0 [scst]
scst_cmd_done_local+0x80/0x110 [scst]
dev_user_process_reply+0x597/0x1160 [scst_user]
dev_user_ioctl+0x145/0xb23 [scst_user]
__x64_sys_ioctl+0x95/0xd0
do_syscall_64+0x5c/0xc0
entry_SYSCALL_64_after_hwframe+0x62/0xcc

Reported-by: Rob Turk [email protected]

This patch should fix the following UBSAN warning:

UBSAN: shift-out-of-bounds in scst/src/scst_targ.c:3912:6
shift exponent -1 is negative

Call Trace:
 <TASK>
 show_stack+0x52/0x5c
 dump_stack_lvl+0x4a/0x63
 dump_stack+0x10/0x16
 ubsan_epilogue+0x9/0x36
 __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef
 scst_process_active_cmd.cold+0xf/0x2d [scst]
 scst_process_redirect_cmd+0xd4/0x2e0 [scst]
 scst_tgt_cmd_done+0x48/0x70 [scst]
 scst_local_targ_xmit_response+0x64/0x220 [scst_local]
 scst_process_active_cmd+0x891/0x2140 [scst]
 scst_process_redirect_cmd+0xd4/0x2e0 [scst]
 scst_cmd_done_local+0x80/0x110 [scst]
 dev_user_process_reply+0x597/0x1160 [scst_user]
 dev_user_ioctl+0x145/0xb23 [scst_user]
 __x64_sys_ioctl+0x95/0xd0
 do_syscall_64+0x5c/0xc0
 entry_SYSCALL_64_after_hwframe+0x62/0xcc

Reported-by: Rob Turk <[email protected]>
@lnocturno lnocturno merged commit be9d368 into master Dec 28, 2023
5 checks passed
@lnocturno lnocturno deleted the gleb/3.8/fix_shifting branch December 28, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant