Bug 741515

Summary: cannot login from serial console since the terminal was locked by plymouth
Product: Red Hat Enterprise Linux 6 Reporter: Masahiro Matsuya <mmatsuya>
Component: plymouthAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: jkoten, kmaiti, syeghiay, tpelka
Target Milestone: rcKeywords: Patch, Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: plymouth-0.8.3-24.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 19:03:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 748554    

Description Masahiro Matsuya 2011-09-27 06:30:55 UTC
Created attachment 525036 [details]
proposed patch

Description of problem:
A customer could not pass more than a single character to the login process.
This situation was so similar to BZ681167.
  https://bugzilla.redhat.com/show_bug.cgi?id=681167
The kernel parameter includes "console=tty0 console=ttyS0,9600", and it doesn't include "rhgb quiet".

First, we tried the following upstream fixes, but this problem was not fixed.

  commit 89096d735f78fab300248962030d6554f9894011
  commit 74ed81c79c37c852d9011159efe1ddbdecb1fb65
  commit bb3be6b60f6f0b8f8cea67b7817210b7e7164043

I checked if ply_terminal_lock() and ply_terminal_unlock() are called for what terminal with debug package. And, I found that ply_terminal_unlock() was not called clearly for /dev/ttyS0.

ply_terminal_lock() and ply_terminal_unlock() are called from ply_terminal_open() and ply_terminal_close().

 ply_terminal_open()
 ...
  -> ply_terminal_unlock, lock

 ply_terminal_close()
 ...
  -> ply_terminal_unlock()

The details plugin has add_text_display() and remove_text_display() functions and those are called when the display with a terminal is added or removed from the linked list. I noticed that add_text_display() calls ply_terminal_open().
But, remove_text_display() doesn't call ply_terminal_close(). As a result, it seems that the terminal keeps to be locked.

I created a proposed patch and confirmed it was fixed.
I will attach the patch.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 6.1

How reproducible:
Always

Steps to Reproduce:
1. got the machine with serial console
2. boot the kernel parameter with "console=tty0 console=ttyS0,9600", and delete "rhgb quiet".
3. boot the machine, and try to login from serial console.
  
Actual results:
cannot login from serial console

Expected results:
can login from serial console

Comment 1 Ray Strode [halfline] 2011-10-12 20:13:44 UTC
This is pretty serious (and regression from 6.0)

Comment 2 Ray Strode [halfline] 2011-10-13 18:03:23 UTC
Thanks for the bug report and patch. I've pushed the following changes upstream which should take care of this problem in a more comprehensive way:

http://cgit.freedesktop.org/plymouth/commit/?id=3a627b78789e0b929095654fdf892725525a183d
http://cgit.freedesktop.org/plymouth/commit/?id=95c3522e92ab31cce9344b1f1f5f6e12c56c6ee3
http://cgit.freedesktop.org/plymouth/commit/?id=b636493e083b1611e362cfd9f5b2608084bd3338
http://cgit.freedesktop.org/plymouth/commit/?id=553c3e86430aab286df3b9586f9c2d2aab789e2a

I also have backported versions of these patches ready.

Comment 11 Ray Strode [halfline] 2011-10-27 21:01:10 UTC
Moving back to assigned. Jiri noticed these fixes are incomplete for systems with encrypted disks.

Comment 12 Ray Strode [halfline] 2011-10-27 21:01:41 UTC
*** Bug 749360 has been marked as a duplicate of this bug. ***

Comment 13 Ray Strode [halfline] 2011-10-27 21:22:33 UTC
The remaining issues should be fixed in -24

Comment 15 errata-xmlrpc 2011-12-06 19:03:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1766.html