Bug 1075655

Summary: Failures in keyutils from new testcases in keyutils testsuite
Product: Red Hat Enterprise Linux 5 Reporter: David Howells <dhowells>
Component: keyutilsAssignee: David Howells <dhowells>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.11   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1075652 Environment:
Last Closed: 2014-03-12 17:56:27 UTC Type: Bug
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: 1075652    
Bug Blocks:    

Description David Howells 2014-03-12 14:18:51 UTC
+++ This bug was initially created as a clone of Bug #1075652 +++

Description of problem:

The keyutils testsuite has some new tests that show up some bugs in older versions of the keyutils package.

Firstly, the keyctl/show/valid test now checks that the output follows down through a set of nested keyrings more than two deep:

http://git.kernel.org/cgit/linux/kernel/git/dhowells/keyutils.git/commit/?id=67e435c3f1810bc0902698ea4ac4a85b4aef7e4f

Secondly, the keyctl/padd/useradd test now checks the size of the payload we can submit through "keyctl add ...".

The first is fixed here:

http://git.kernel.org/cgit/linux/kernel/git/dhowells/keyutils.git/commit/?id=96bae1cc9b062f669ed4ac322807e77e12d1b8fc

and the second here:

http://git.kernel.org/cgit/linux/kernel/git/dhowells/keyutils.git/commit/?id=df5cab5362695b92896a41a86556e9dad156419d

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

keyutils-1.2-1

How reproducible:


Steps to Reproduce:
1. The keyctl/show/valid failure:
Do the following:

    a=@s
    a=`keyctl newring foo $a`
    a=`keyctl newring foo $a`
    a=`keyctl newring foo $a`
    a=`keyctl newring foo $a`
    a=`keyctl newring foo $a`
    keyctl show

This should display five keyrings called 'foo' nested inside each other, with the first nested inside a keyring called '_ses'.  If it shows fewer levels, it doesn't work.

2. The keyctl/padd/useradd failure:
Do the following:

    dd if=/dev/zero bs=$((1024*1024-1)) count=1 | \
        strace -eadd_key keyctl padd user a @s

And make sure that the fourth argument to add_key() is 0xfffff.  If the command fails without calling add_key() or it truncates the buffer, then it didn't work.