aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/lists.py
diff options
context:
space:
mode:
authorColin Ian King <[email protected]>2016-09-26 10:31:51 +0200
committerIngo Molnar <[email protected]>2016-09-26 11:13:17 +0200
commit8b44f00f8c952ab6eb658090383571b2ec7d253f (patch)
tree572c6fa32b6e3b0b49735b874e2c905320d3a0ba /scripts/gdb/linux/lists.py
parent6fae257f0b294d7abe7adfb08277bfd5472ed717 (diff)
x86/RAS/mce_amd_inj: Fix signed wrap around when decrementing index 'i'
Change predecrement compare to post decrement compare to avoid an unsigned integer wrap-around comparisomn when decrementing in the while loop. For example, if the debugfs_create_file() fails when 'i' is zero, the current situation will predecrement 'i' in the while loop, wrapping 'i' to the maximum signed integer and cause multiple out of bounds reads on dfs_fls[i].d as the loop interates to zero. Also, as Borislav Petkov suggested, return -ENODEV rather than -ENOMEM on the error condition. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Yazen Ghannam <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/lists.py')
0 files changed, 0 insertions, 0 deletions