Bug 65372 (CVE-2005-0178)

Summary: VUL-0: CVE-2005-0178: kernel: tty/setsid race
Product: [Novell Products] SUSE Security Incidents Reporter: Marcus Meissner <meissner>
Component: IncidentsAssignee: Karsten Keil <karsten.keil>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Minor    
Priority: P3 - Medium CC: security-team
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: CVE-2005-0178: CVSS v2 Base Score: 6.2 (AV:L/AC:H/Au:N/C:C/I:C/A:C)
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: setsid-tty-locking
correct patch
patch for SLES9 SP1

Description Marcus Meissner 2005-02-01 17:39:10 UTC
20050110 tty/setsid race                                                         
        Alan Cox committed a patch to 2.6 to "Use the existing "tty_sem" to      
        protect against the process tty changes too.", this was included         
        in 2.6.10-ac4.                                                           
                                                                                        Patch 
available at:                                                      
                                                                                 
+http://linux.bkbits.net:8080/linux-2.6/cset@41ddda70CWJb5nNL71T4MOlG2sMG8A      
              
                                         
CAN-2005-0178
Comment 1 Marcus Meissner 2005-02-01 17:39:11 UTC
<!-- SBZ_reproduce  -->
n/a
Comment 2 Marcus Meissner 2005-02-01 17:40:19 UTC
Created attachment 28091 [details]
setsid-tty-locking
Comment 3 Olaf Kirch 2005-04-11 12:28:19 UTC
Pavel, 
 
can you please review this patch to see whether it breaks anything, 
and if this is indeed what is in mainline ATM? 
 
If the patch is good, please commit it to all kernel branches for 
the next security update. That would be 
 
kernel-source-26:  SLES9_SP1, SLES9_SP2, SL92, HEAD 
kernel-source:     SLEC8, SL82, HEAD 
 
The vulnerability this is supposed to fix is CAN-2005-0178; see 
http://cve.mitre.org. 
Comment 4 Pavel Machek 2005-04-11 17:03:19 UTC
Security problem with priority=Minor... "Interesting". I'm by no means tty
expert (and I fear that my try to commit to 7 different branches would result
with at least 5 of them broken).
Comment 5 Pavel Machek 2005-04-11 17:13:38 UTC
I did a small investigation, and it seems to be the same solution as in current
linus's bk.
Comment 6 Pavel Machek 2005-04-11 21:54:32 UTC
I'm sorry, I will not be able to do this one.

I'm on quite a slow link, and for some strange reason, getting SLES9_SP2_BRANCH\
takes >4hours (it is not yet done). It is not even saturating GPRS link. Just
\getting those 6 repositories (I already have HEAD) would take few days :-(.

[I did cp -a of HEAD, then update -r SLES9_SP2_BRANCH. Perhaps I should have
do\ne update from empty tree?]

Comment 7 Marcus Meissner 2005-04-12 15:33:20 UTC
back to okir to find some other developer...  
Comment 8 Olaf Kirch 2005-04-12 15:37:08 UTC
Not so quick, please :) 
 
I think Pavel is working on improving his connectivity right now. 
Correct me if I'm wrong. 
Comment 9 Olaf Kirch 2005-04-14 12:48:50 UTC
Handing over to Karsten who was just volunteered. 
Comment 10 Karsten Keil 2005-04-14 16:00:54 UTC
Created attachment 34500 [details]
correct patch

The patch was incomplete, for sys.c the tty.h was missing.
Comment 11 Karsten Keil 2005-04-14 21:08:03 UTC
Hmm, do you really want to back it to SLES9, this will be a major change,  
in SLES9 kernel no tty_sem exist, so we have to backport the complete  
tty stuff, not only this extention of using the semaphore. 
 
I didn't look at 2.4 based kernel yet, but I think that these need a big  
backport too.  
  
For 9.2 the patches are ready now, but need some testing, mbuilds are done.   
Comment 12 Marcus Meissner 2005-04-15 07:33:57 UTC
i would appreciate an evaluation by you on how critical security or bugwise 
this is for our customers. 
 
if this is just a rare race condition  and/or not exploitable secuzrity wise 
i have now problems to leave this as a "fix in stable" problem 
Comment 13 Karsten Keil 2005-04-15 08:11:49 UTC
I simple do not know enough about the tty stuff to do such a evaluation, 
this is also my issue to fix it for the old releases, tty code is spread 
all over the kernel, not only in driver/char/tty, so it is difficult to find a 
correct patchset without breaking something. 
 
I still evaluate the changes in the tty stuff from SLES9 -->9.3 and try to 
isolate a patch. 
 
I also do not have any idea, how security relevant this is. 
 
Comment 14 Karsten Keil 2005-04-15 12:42:30 UTC
OK, it seems that a backport for SLES9 is not too intrusive. I already have a 
patch, but it would be the best if someone else can review it. 
Comment 15 Karsten Keil 2005-04-15 12:45:18 UTC
Created attachment 34570 [details]
patch for SLES9 SP1
Comment 16 Karsten Keil 2005-04-20 11:46:39 UTC
I have tested the patch with SP2 beta1 and see no problems related to tty, I 
also have a backport for 2.4 ready. 
But I still do not understand enough about tty to make real tests, e.g. 
test the securety issue or stress test the locking, I only test if I can still 
login and logout. 
 
So anybody else should decide how we are going further. 
 
Comment 17 Ludwig Nussel 2005-05-19 10:30:29 UTC
Seems we got stuck again. What does this patch protect against? What kind of 
nasty thing is possible if this patch is missing? 
Comment 18 Karsten Keil 2005-05-19 10:47:11 UTC
This is my problem too, I have no idea how to test the patches and I also do 
not know, how to trigger the problem which should be fixed by this stuff. 
The URL from comment #3 was also not helpful in this matter (or I'm to stupid 
to find the correct place). 
Comment 19 Marcus Meissner 2005-06-07 11:50:46 UTC
since we are not comfortable with this fix  
and it has only minor implications (if any at all)  
  
I think we can have this fixed via upstream in later kernel versions.  
  
So my decision: fixed in STABLE.   
Comment 20 Thomas Biege 2009-10-13 21:02:31 UTC
CVE-2005-0178: CVSS v2 Base Score: 6.2 (AV:L/AC:H/Au:N/C:C/I:C/A:C)