aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_printf.c
diff options
context:
space:
mode:
authorAntonio Borneo <[email protected]>2022-07-19 12:28:31 +0000
committerPetr Mladek <[email protected]>2022-07-21 13:32:52 +0000
commite3c8d33e0d62175c31ca7ab7ab01b18f0b6318d3 (patch)
tree6e2693311ac5b129dfaf3fb80b142d70498f2c81 /lib/test_printf.c
parentlib/test_printf.c: split write-beyond-buffer check in two (diff)
downloadkernel-e3c8d33e0d62175c31ca7ab7ab01b18f0b6318d3.tar.gz
kernel-e3c8d33e0d62175c31ca7ab7ab01b18f0b6318d3.zip
scripts/gdb: fix 'lx-dmesg' on 32 bits arch
The type atomic_long_t can have size 4 or 8 bytes, depending on CONFIG_64BIT; it's only content, the field 'counter', is either an int or a s64 value. Current code incorrectly uses the fixed size utils.read_u64() to read the field 'counter' inside atomic_long_t. On 32 bits architectures reading the last element 'tail_id' of the struct prb_desc_ring: struct prb_desc_ring { ... atomic_long_t tail_id; }; causes the utils.read_u64() to access outside the boundary of the struct and the gdb command 'lx-dmesg' exits with error: Python Exception <class 'IndexError'>: index out of range Error occurred in Python: index out of range Query the really used atomic_long_t counter type size. Link: https://lore.kernel.org/r/[email protected] Fixes: e60768311af8 ("scripts/gdb: update for lockless printk ringbuffer") Signed-off-by: Antonio Borneo <[email protected]> [[email protected]: Query the really used atomic_long_t counter type size] Tested-by: Antonio Borneo <[email protected]> Reviewed-by: John Ogness <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_printf.c')
0 files changed, 0 insertions, 0 deletions