提交 333ed746 编写于 作者: W Will Deacon

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: 5bbaf9d1 ("scs: Add support for stack usage debugging")
Reported-by: NSami Tolvanen <samitolvanen@google.com>
Reviewed-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NWill Deacon <will@kernel.org>
上级 082af5ec
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册