Commit 9dcb9058 authored by Johan Hovold's avatar Johan Hovold Committed by Wupeng Ma
Browse files

staging: greybus: uart: fix tty use after free

stable inclusion
from stable-v4.19.209
commit a5cfd51f6348e8fd7531461366946039c29c7e69
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9R4D9
CVE: CVE-2021-47358

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a5cfd51f6348e8fd7531461366946039c29c7e69



--------------------------------

commit 92dc0b1f upstream.

User space can hold a tty open indefinitely and tty drivers must not
release the underlying structures until the last user is gone.

Switch to using the tty-port reference counter to manage the life time
of the greybus tty state to avoid use after free after a disconnect.

Fixes: a18e1517 ("greybus: more uart work")
Cc: stable@vger.kernel.org      # 4.9
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210906124538.22358-1-johan@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent 6908dfce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment