> From: Denis V. Lunev <[email protected]> > > Since commit 23abb203a41a ("ve/vtty: fix use-after-free on concurrent > tty close and reopen") vtty_open_master() refuses a pair whose slave > count has dropped to zero: the last CT-side close has committed to the > final close, and the pair stays in the vtty map only until > release_tty() runs. The refusal is -EBUSY, the errno which already > means a console is attached, so userspace cannot tell a pair that is > about to go from one that is taken, and vzctl gives up: > > Error opening CT tty: Device or resource busy > > The window opens whenever the last process in the CT closes its tty: > getty respawn, login with autologin, SAK. "vzctl console" run right > after "vzctl start --wait" hits it. > > Return -EAGAIN for the dying pair. Nothing else on the > VE_CONFIGURE_OPEN_TTY path returns -EAGAIN, so it can only mean "try > again", which is what vzctl will do. An in-CT open of such a pair gets > -EAGAIN from tty_reopen() and tty_open() retries it the same way. > Retrying inside vtty_open_master() instead would have to drop tty_mutex > for release_tty() to progress, and the global vtty context with it. > > Let ve_vtty_stress accept -EAGAIN as an expected open error. > > Fixes: 23abb203a41a ("ve/vtty: fix use-after-free on concurrent tty close and > reopen") > > https://virtuozzo.atlassian.net/browse/VSTOR-152365 > Feature: tty: virtual Container console > Signed-off-by: Denis V. Lunev <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.vzint.dev/#/patchset/[email protected]?part=1 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
