summaryrefslogtreecommitdiff
path: root/kernel/scs.c
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-06-03 12:16:37 +0100
committerWill Deacon <will@kernel.org>2020-06-04 16:14:56 +0100
commit333ed74689b8fca097574124fef7fa0e3d7f79d4 (patch)
treeb4f2b452c5671951f96d01eaf5bccc8e5995f5a7 /kernel/scs.c
parent082af5ec5080b028f7d0846a6c27cbb87f288205 (diff)
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: 5bbaf9d1fcb9 ("scs: Add support for stack usage debugging") Reported-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'kernel/scs.c')
-rw-r--r--kernel/scs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/scs.c b/kernel/scs.c
index 222a7a9ad543..5d4d9bbdec36 100644
--- a/kernel/scs.c
+++ b/kernel/scs.c
@@ -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) {