Bug 165092

Summary: Bugs in kernel key managment syscall interface
Product: Red Hat Enterprise Linux 4 Reporter: David Howells <dhowells>
Component: kernelAssignee: David Howells <dhowells>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: jbaron
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2006-0132 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-07 19:29:38 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:    
Bug Blocks: 168429    
Attachments:
Description Flags
Key management syscall interface fixes none

Description David Howells 2005-08-04 10:24:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)

Description of problem:
The testsuite for the key management utilities found five non-critical bugs in  
the key management syscall code:  
  
 (1) add_key() returns 0 rather than EINVAL if the key type is "".  
  
 (2) request_key() returns ENOKEY rather than EPERM if the key type begins  
with a ".".  
  
 (3) Key revocation always returns 0, even if it fails.  
  
 (4) Key read can return EAGAIN rather than EACCES under some circumstances.  
  
 (5) request_key() never adds the key to the destination keyring supplied.  

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


How reproducible:
Always

Steps to Reproduce:
(1) keyctl add "" a a @p 
 
(2) keyctl request ".user" a  
 
(3) keyctl revoke @t  
 
(4) keyctl add user a a @s; keyctl setperm <keyid> 0x150000; keyctl print  
<keyid>  
 
(5) keyctl request2 user debug:hello hello @u; keyctl list @u  

Actual Results:  (1)  Succeeds, indicating key ID 0.   
   
(2) Fails with "request_key: Requested key not available".  
  
(3) Succeeds silently.  
  
(4) Fails with "keyctl_read_alloc: Resource temporarily unavailable".  
  
(5) Prints the key ID and then says "keyring is empty" or, at least, the 
listing doesn't include the specified key ID. 

Expected Results:  (1) Fail with "add_key: No such device" 
 
(2) Fail with "request_key: Operation not permitted" 
 
(3) Fail with "keyctl_revoke: Requested key not available". 
 
(4) Fail with "keyctl_read_alloc: Permission denied". 
 
(5) Should show the new key ID in the keyring. 

Additional info:

These are tested for by the RHTS keyring testsuite.

Comment 1 David Howells 2005-08-04 10:27:14 UTC
Created attachment 117436 [details]
Key management syscall interface fixes

This patch fixes the aforementioned bugs in the key management interface.

Comment 5 Red Hat Bugzilla 2006-03-07 19:29:38 UTC
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.

http://rhn.redhat.com/errata/RHSA-2006-0132.html