scs: Report SCS usage in bytes rather than number of entries
PATCH 1/1 scs: Report SCS usage in bytes rather than number of entries
Fix the SCS debug usage check so that we report the number of bytes usedm, rather than the number of entries.
Fixes 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging")
Reported-by Sami Tolvanen <[email protected]>
Signed-off-by Will Deacon <[email protected]>
--- kernel/scs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/scs.c +1 -1
@@ -74,7 +74,7 @@ static void scs_check_usage(struct task_struct *tsk)for (p =task_scs (tsk); p <__scs_magic (tsk); ++p) {if (!READ_ONCE_NOCHECK (*p))break ; - used++; + used +=sizeof (*p); }while (used > curr) {
Signature · 1 line
2.27.0.rc2.251.g90737beb825-goog
Quoted 2 lines · Will Deacon
Fix the SCS debug usage check so that we report the number of bytes usedm, rather than the number of entries.
typo: used
Quoted 4 lines
Fixes 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging")Reported-by Sami Tolvanen <[email protected]>Signed-off-by Will Deacon <[email protected]>
Reviewed-by Kees Cook <[email protected]>
Signature · 1 line
Kees Cook
Quoted 4 lines · Kees Cook
Quoted 2 lines · Will Deacon
Fix the SCS debug usage check so that we report the number of bytes usedm, rather than the number of entries.
Quoted 8 lines
typo: used
Quoted 4 lines
Fixes 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging")Reported-by Sami Tolvanen <[email protected]>Signed-off-by Will Deacon <[email protected]>Reviewed-by Kees Cook <[email protected]>
Cheers, Kees!
Will