Bug 164979 - CAN-2005-2098 Error during attempt to join key management session can leave semaphore pinned
CAN-2005-2098 Error during attempt to join key management session can leave s...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: David Howells
Brian Brock
: Security
Depends On:
Blocks: 156322 164988
  Show dependency treegraph
Reported: 2005-08-03 06:15 EDT by David Howells
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2005-514
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-05 09:48:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Key management session error handling bugfix (417 bytes, patch)
2005-08-03 06:20 EDT, David Howells
no flags Details | Diff

  None (edit)
Description David Howells 2005-08-03 06:15:57 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)

Description of problem:
If a request is made to join a named session keyring, but that keyring does 
not exist, then if the syscall fails to allocate a keyring it'll return an 
error without dropping the semaphore it was holding. 
This can only be encountered in a few ways: ENOMEM, key quota full, empty 
keyring name or keyring name too long; most of which are unlikely, 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. keyctl session "" /bin/true   
2. Any valid keyctl session command 

Actual Results:  Command (2) hangs in the D state. 

Expected Results:  Command (2) should exit with an error or go into the new session as 

Additional info:

Any user can use this command. Whilst the keyctl program could be made to 
validate the argument to prevent accidental incurment, it's still possible to 
suffer from ENOMEM and EDQUOT errors, and it's possible to bypass keyctl 
entirely and invoke the keyctl() system call directly.
Comment 1 David Howells 2005-08-03 06:20:18 EDT
Created attachment 117393 [details]
Key management session error handling bugfix

This patch makes the KEYCTL_JOIN_SESSION_KEYRING error handling always release
the semaphore
Comment 2 Mark J. Cox (Product Security) 2005-08-03 06:39:52 EDT
Easy unprivileged user DoS, so CAN-2005-2098
Comment 6 Mark J. Cox (Product Security) 2005-08-10 07:57:49 EDT
We sent this to security@kernel.org on 20050803 and it was fixed upstream 20050804
Comment 8 Red Hat Bugzilla 2005-10-05 09:48:05 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.