aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-notifier-error-inject.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <[email protected]>2018-07-17 10:58:10 +0200
committerGreg Kroah-Hartman <[email protected]>2018-07-21 08:39:25 +0200
commit1481ecf1941a35a3e82d0f3e8fe9a2bdce28ee6f (patch)
tree5c40b71e228ac1ab106c899c60dd40217c4eb424 /lib/netdev-notifier-error-inject.c
parentfefe287e4bf6ee23a5d9422a0a49de5389acc712 (diff)
serial: sh-sci: Fix use-after-free on subsequent port startup
sci_request_irq() checks port->irqstr[j] for a NULL pointer, to decide if a fallback interrupt name string should be allocated or not. While this string is freed during port shutdown, the pointer is not zeroed. Hence on a subsequent startup of the port, it will still be pointing to the freed memory, leading to e.g. WARNING: CPU: 0 PID: 404 at fs/proc/generic.c:388 __proc_create+0xbc/0x260 name len 0 or to a crash (the latter is more likely with CONFIG_DEBUG_SLAB=y, due to the poisoning of freed memory). Instead of zeroeing the pointer at multiple places, preinitialize port->irqstr[j] to zero to fix this. Fixes: 8b0bbd956228ae87 ("serial: sh-sci: Add support for R7S9210") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Ulrich Hecht <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions