Bug 649614

Summary: kernel: sys_semctl: fix kernel stack leakage
Product: [Other] Security Response Reporter: Eugene Teo (Security Response) <eteo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: arozansk, bhu, cebbert, davej, dhoward, fhrbata, jkacur, jolsa, jpirko, kernel-mgr, kmcmartin, lgoncalv, lwang, plyons, rt-maint, vgoyal, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-04 07:29:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 648721, 648793, 649616, 649617, 649618, 649619, 649620, 649621, 649622    
Bug Blocks:    

Description Eugene Teo (Security Response) 2010-11-04 06:30:11 UTC
The semctl syscall has several code paths that lead to the leakage of
uninitialized kernel stack memory (namely the IPC_INFO, SEM_INFO,
IPC_STAT, and SEM_STAT commands) during the use of the older, obsolete
version of the semid_ds struct.

The copy_semid_to_user() function declares a semid_ds struct on the stack
and copies it back to the user without initializing or zeroing the
"sem_base", "sem_pending", "sem_pending_last", and "undo" pointers,
allowing the leakage of 16 bytes of kernel stack memory.

The code is still reachable on 32-bit systems - when calling semctl()
newer glibc's automatically OR the IPC command with the IPC_64 flag, but
invoking the syscall directly allows users to use the older versions of
the struct.

Upstream commit:
http://git.kernel.org/linus/982f7c2b2e6a28f8f266e075d92e19c0dd4c6e56

Acknowledgements:

Red Hat would like to thank Dan Rosenberg for reporting this issue.

Comment 3 Kurt Seifried 2010-11-04 07:00:16 UTC
Duplicate? https://bugzilla.redhat.com/show_bug.cgi?id=648673

Comment 4 Eugene Teo (Security Response) 2010-11-04 07:28:20 UTC
(In reply to comment #3)
> Duplicate? https://bugzilla.redhat.com/show_bug.cgi?id=648673

Thanks. Lots of infoleak bugs lately.

Comment 5 Eugene Teo (Security Response) 2010-11-04 07:29:22 UTC

*** This bug has been marked as a duplicate of bug 648673 ***