Skip to content

Commit 333ed74

Browse files
committed
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 used, rather than the number of entries. Fixes: 5bbaf9d ("scs: Add support for stack usage debugging") Reported-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 082af5e commit 333ed74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/scs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void scs_check_usage(struct task_struct *tsk)
7474
for (p = task_scs(tsk); p < __scs_magic(tsk); ++p) {
7575
if (!READ_ONCE_NOCHECK(*p))
7676
break;
77-
used++;
77+
used += sizeof(*p);
7878
}
7979

8080
while (used > curr) {

0 commit comments

Comments
 (0)