Bug 790367

Summary: ccache keyring test fails on s390
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: kernelAssignee: David Howells <dhowells>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: brueckner, dhowells, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, nalin, nathaniel
Target Milestone: ---   
Target Release: ---   
Hardware: s390   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-2.6.42.7-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 795095 (view as bug list) Environment:
Last Closed: 2012-02-21 02:22:48 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: 795095    
Attachments:
Description Flags
Fix to enable 32-bit s390 keyctl() syscall in s390x kernel none

Description Dan Horák 2012-02-14 10:51:30 UTC
The ccache keyring test fails on s390 (32-bit) and I've traced it down to keyctl_clear() returning "Function not implemented" (-ENOSYS). Same version passes the test on s390x (64-bit).

Version-Release number of selected component (if applicable):
krb5-1.10-3.fc17

Actual results:
make[2]: Entering directory `/builddir/build/BUILD/krb5-1.10/src/lib/krb5/ccache'
gcc   -I../../../include -I../../../include -I./ccapi  -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -I/usr/include/et -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10 -I/usr/include/et -fPIC -fno-strict-aliasing -fstack-protector-all -Wall -Wcast-align -Wshadow -Wmissing-prototypes -Wno-format-zero-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Werror=uninitialized -Werror=declaration-after-statement -Werror=variadic-macros -Werror-implicit-function-declaration -pthread -c t_cc.c
gcc -L../../../lib  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10 -I/usr/include/et -fPIC -fno-strict-aliasing -fstack-protector-all -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,relro  -o t_cc t_cc.o -lkrb5 -lk5crypto -lcom_err -lkrb5support  -lkeyutils  -lresolv -lselinux  -ldl
KRB5_CONFIG=./t_krb5.conf ; export KRB5_CONFIG ;\
LD_LIBRARY_PATH=`echo -L../../../lib | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;   ./t_cc
Testing miscellaneous error conditions
initialize: Function not implemented 
Starting test on /tmp/cctest.50892
Test on /tmp/cctest.50892 passed
Starting test on KEYRING:/tmp/cctest.50892
make[2]: Leaving directory `/builddir/build/BUILD/krb5-1.10/src/lib/krb5/ccache'
make[2]: *** [check-unix] Error 1


with debug=1 in t_cc.c and DEBUG=1 in cc_keyring.c the output looks like

<mock-chroot>[root@devel1 ccache]# ./t_cc
register_mem override went ok
Testing miscellaneous error conditions
Starting test on /tmp/cctest.52078
init_creds went ok
resolve went ok
context=0x55fd8088, name=0x7fe2f570, id=0x55fd8c30
initialize went ok
get_name went ok
get_type went ok
copying type went ok
store went ok
get_principal went ok
realm_compare went ok
principal_compare went ok
set_flags went ok
start_seq_get went ok
Calling next_cred
next_cred went ok
Calling next_cred
next_cred: ok at end
end_seq_get went ok
close went ok
resolve2 went ok
resolve of new cache went ok
initialize of id2 went ok
copy_creds went ok
destroy new cache went ok
destroy went ok
new_unique went ok
initialize went ok
store went ok
destroy id2 went ok
init_creds went ok
resolve went ok
context=0x55fd8088, name=0x7fe2f570, id=0x55fd8eb8
initialize went ok
get_name went ok
get_type went ok
copying type went ok
store went ok
get_principal went ok
realm_compare went ok
principal_compare went ok
set_flags went ok
start_seq_get went ok
Calling next_cred
next_cred went ok
Calling next_cred
next_cred: ok at end
end_seq_get went ok
close went ok
resolve2 went ok
resolve of new cache went ok
initialize of id2 went ok
copy_creds went ok
destroy new cache went ok
destroy went ok
new_unique went ok
initialize went ok
store went ok
destroy id2 went ok
Test on /tmp/cctest.52078 passed
krb5_krcc_resolve: entered with name '/tmp/cctest.52078'
krb5_krcc_get_ring_ids: entered
krb5_krcc_get_ring_ids: returning -3:-2:-1
krb5_krcc_resolve: searching ring -3 for residual '/tmp/cctest.52078'
krb5_krcc_resolve: new keyring '/tmp/cctest.52078', key 312765468, added to keyring -3
krb5_krcc_resolve: ring_id 312765468, princ_id 0, nkeys 0
krb5_krcc_close: entered
Starting test on KEYRING:/tmp/cctest.52078
init_creds went ok
krb5_krcc_resolve: entered with name '/tmp/cctest.52078'
krb5_krcc_get_ring_ids: entered
krb5_krcc_get_ring_ids: returning -3:-2:-1
krb5_krcc_resolve: searching ring -3 for residual '/tmp/cctest.52078'
krb5_krcc_resolve: new keyring '/tmp/cctest.52078', key 234103543, added to keyring -3
krb5_krcc_resolve: ring_id 234103543, princ_id 0, nkeys 0
resolve went ok
context=0x55fd8088, name=0x7fe2f570, id=0x55fd8ec8
krb5_krcc_initialize: entered
krb5_krcc_clearcache: ring_id 234103543, princ_id 0, numkeys is 0
keyctl_clear: Function not implemented
initialize: Function not implemented 


Same version on s390x:
make[2]: Entering directory `/builddir/build/BUILD/krb5-1.10/src/lib/krb5/ccache'
gcc   -I../../../include -I../../../include -I./ccapi  -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -I/usr/include/et -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -f
stack-protector --param=ssp-buffer-size=4 -m64 -march=z9-109 -mtune=z10 -I/usr/include/et -fPIC -fno-strict-aliasing -fstack-protector-all -Wall -Wcast-align -Wshadow
 -Wmissing-prototypes -Wno-format-zero-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparenthese
s -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Werror=uninitialized -Werror=declaration-after-statemen
t -Werror=variadic-macros -Werror-implicit-function-declaration -pthread -c t_cc.c
gcc -L../../../lib  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -march=z9-109 -mtune=z10 -I/usr/include/e
t -fPIC -fno-strict-aliasing -fstack-protector-all -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,relro  -o t_cc t_cc.o -lkrb5 -lk5crypto -lcom_err -lkrb5support  -lkeyutils  -l
resolv -lselinux  -ldl
KRB5_CONFIG=./t_krb5.conf ; export KRB5_CONFIG ;\
LD_LIBRARY_PATH=`echo -L../../../lib | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;   ./t_cc
Testing miscellaneous error conditions
Starting test on /tmp/cctest.27455
Test on /tmp/cctest.27455 passed
Starting test on KEYRING:/tmp/cctest.27455
Test on KEYRING:/tmp/cctest.27455 passed
Starting test on MEMORY:/tmp/cctest.27455
Test on MEMORY:/tmp/cctest.27455 passed
Starting test on FILE:/tmp/cctest.27455
Test on FILE:/tmp/cctest.27455 passed



I must say that s390/s390x was always different than eg. x86 for 1.10, eg. krb5-1.10-0.fc17.beta1.2 returned "unregistered type" for the KEYRING test, see below (build logs from http://s390.koji.fedoraproject.org/koji/buildinfo?buildID=99209). And if I see correctly then the test-suite was first enabled in the %check section in krb5-1.10.

make[2]: Entering directory `/builddir/build/BUILD/krb5-1.10-beta1/src/lib/krb5/ccache'
gcc   -I../../../include -I../../../include -I./ccapi  -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -I/usr/include/et -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10 -I/usr/include/et -fPIC -fno-strict-aliasing -fstack-protector-all -Wall -Wcast-align -Wshadow -Wmissing-prototypes -Wno-format-zero-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Werror=uninitialized -Werror=declaration-after-statement -Werror=variadic-macros -Werror-implicit-function-declaration -pthread -c t_cc.c
gcc -L../../../lib  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10 -I/usr/include/et -fPIC -fno-strict-aliasing -fstack-protector-all -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,relro  -o t_cc t_cc.o -lkrb5 -lk5crypto -lcom_err -lkrb5support  -lcrypto -lkeyutils  -lresolv -lselinux  -ldl
KRB5_CONFIG=./t_krb5.conf ; export KRB5_CONFIG ;\
LD_LIBRARY_PATH=`echo -L../../../lib | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;   ./t_cc
Testing miscellaneous error conditions
Checking on credential type: Key has been revoked KEYRING:
Starting test on /tmp/cctest.25291
Test on /tmp/cctest.25291 passed
Skiping KEYRING: test - unregistered type
Starting test on MEMORY:/tmp/cctest.25291
Test on MEMORY:/tmp/cctest.25291 passed
Starting test on FILE:/tmp/cctest.25291
Test on FILE:/tmp/cctest.25291 passed

Comment 1 Dan Horák 2012-02-14 11:20:55 UTC
It could be a problem of keyctl interaction with kernel, because keyctl in s390 chroot running on top of F-15 (kernel 2.6.41) also fails

<mock-chroot>[root@devel1 /]# keyctl show
Session Keyring
Unable to dump key: Function not implemented

Comment 2 Dan Horák 2012-02-14 11:27:42 UTC
And from running keyutils.s390 on s390x (Fedora 16)

[root@devel4 ~]# keyctl show
Session Keyring
-3: key inaccessible (Function not implemented)

switching to keyutils ...

Comment 3 Dan Horák 2012-02-14 11:30:03 UTC
[root@devel4 ~]# strace keyctl show
execve("/bin/keyctl", ["keyctl", "show"], [/* 21 vars */]) = 0
brk(0)                                  = 0xa5b000
mmap(0x1000, 12884901922, PROT_NONE, MAP_FILE, 0, 0) = 0x7d537000
mmap(0x2000, 12884901922, PROT_NONE, MAP_FILE, 0, 0) = 0x7d535000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open(0xffffffff7d554714, O_RDONLY|O_CLOEXEC) = 3
SYS_197(0x3, 0x3ff7f957210, 0x3ff7f957210, 0x3ff7d55a8d4, 0x3ff00400761, 0x7d55a868, 0x7d55a8f0, 0x7d55a86c, 0, 0x3ff7d55a8d8, 0x3ff7d559fb0, 0x7d552d78, 0xfd549290, 0x7f957108, 0x3fffd0626f0, 0, 0, 0, 0, 0, 0, 0, 0x3, 0, 0x404b000000000000, 0, 0x41341ff000000000, 0, 0, 0, 0, 0) = 0
mmap(0x88eb, 4294967298, PROT_NONE, MAP_FILE, 0, 0) = 0x7d52c000
close(3)                                = 0
open("/lib/libkeyutils.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, 0x3ff7f9573ac, 4393751544320)   = 512
SYS_197(0x3, 0x3ff7f9572a0, 0x3ff7f9572a0, 0x3ff7d55a8d4, 0x3ff7d55a8f0, 0x7d55a000, 0x7d55a8f0, 0, 0, 0x3ff7d55a8d8, 0x3ff7d559fb0, 0x7d552d78, 0xfd53fd2e, 0x7f957128, 0x3fffd0626f0, 0, 0, 0, 0, 0, 0, 0, 0x3, 0, 0x404b000000000000, 0, 0x41341ff000000000, 0, 0, 0, 0, 0) = 0
mmap(0x2160, 21474838530, PROT_NONE, MAP_FILE, 0, 0) = 0x7d529000
mmap(0x7d52b00000001000, 12884903954, 0x2000 /* PROT_??? */, MAP_FILE, 0, 0) = 0x7d52b000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, 0x3ff7f957394, 4393751544320)   = 512
SYS_197(0x3, 0x3ff7f957288, 0x3ff7f957288, 0x3ff7d55a8d4, 0x3ff7d55a8f0, 0x7d55a000, 0x7d55a8f0, 0, 0, 0x3ff7d55a8d8, 0x3ff7d559fb0, 0x7d552d78, 0xfd53fd2e, 0x7f957110, 0x3fffd0626f0, 0, 0, 0, 0, 0, 0, 0, 0x3, 0, 0x404b000000000000, 0, 0x41341ff000000000, 0, 0, 0, 0, 0) = 0
mmap(0x17f718, 21474838530, PROT_NONE, MAP_FILE|MAP_FIXED|MAP_ANONYMOUS|MAP_POPULATE|MAP_NONBLOCK|MAP_DENYWRITE|MAP_LOCKED|0x7d5400c0, 2102733912, 0xfd54f08a7f957090) = 0x7d3a9000
mmap(0x7d52300000003000, 12884903954, 0x179000 /* PROT_??? */, MAP_FILE|MAP_FIXED|MAP_ANONYMOUS|MAP_POPULATE|MAP_NONBLOCK|MAP_DENYWRITE|MAP_LOCKED|0x7d5400c0, 2102733912, 0xfd54f08a7f957090) = 0x7d523000
mmap(0x7d52600000002718, 12884901938, PROT_NONE, MAP_FILE|MAP_FIXED|MAP_ANONYMOUS|MAP_POPULATE|MAP_NONBLOCK|MAP_DENYWRITE|MAP_LOCKED|0x7d5400c0, 2102733912, 0xfd54f08a7f957090) = 0x7d526000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, 0x3ff7f957304, 4393751544320)   = 512
SYS_197(0x3, 0x3ff7f9571f8, 0x3ff7f9571f8, 0x3ff7d55a8d4, 0x3ff7d536198, 0x7d55a000, 0x7d536198, 0, 0, 0x3ff7d55a8d8, 0x3ff7d559fb0, 0x7d552d78, 0xfd53fd2e, 0x7f957080, 0x3fffd0626f0, 0, 0, 0, 0, 0, 0, 0, 0x3, 0, 0x404b000000000000, 0, 0x41341ff000000000, 0, 0, 0, 0, 0) = 0
mmap(0x40a4, 21474838530, PROT_NONE, MAP_FILE, 0, 0) = 0x7d3a4000
mmap(0x7d3a700000002000, 12884903954, 0x2000 /* PROT_??? */, MAP_FILE, 0, 0) = 0x7d3a7000
close(3)                                = 0
mmap(0x1000, 12884901922, PROT_NONE, MAP_FILE, 2140501536, 0x7f957788) = 0x7d3a3000
mprotect(0x7d523000, 4393751552000, PROT_READ) = 0
mprotect(0x7d3a7000, 4393751547904, PROT_READ) = 0
mprotect(0x7d559000, 4393751547904, PROT_READ) = 0
munmap(0x7d52c000, 4393751578859)       = 0
geteuid()                               = 0
getegid()                               = 0
getgroups(0, 0x3ff00000000)             = 1
brk(0)                                  = 0xa5b000
brk(0xa7c000)                           = 0xa7c000
brk(0)                                  = 0xa7c000
getgroups(1, [?] 0x3ff00a5b008)         = 1
SYS_197(0x1, 0x3ff7f957768, 0x3ff7f957768, 0x3ff7d528498, 0x3ff00000000, 0xf, 0xf, 0x7d525aa0, 0, 0x3ffffffffc4, 0x3ff7d525000, 0x7d4ea0b8, 0xfd4119f4, 0x7f957660, 0x7d3a38e0fd0626f0, 0, 0, 0, 0, 0, 0, 0, 0x1, 0, 0x404b000000000000, 0, 0x41341ff000000000, 0, 0, 0, 0, 0) = 0
mmap(0x1000, 12884901922, PROT_NONE, MAP_FILE|MAP_FIXED|MAP_NORESERVE|MAP_NONBLOCK|MAP_GROWSDOWN|MAP_EXECUTABLE|MAP_LOCKED|0x7f940640, 2102617816, 0x7d5364407f957844) = 0x7d534000
write(1, 0x3ff7d534000, 4393751543824Session Keyring
)  = 16
keyctl(0x6, 0x3fffffffffd, 0x3ff00000000, 0x3ff00000000, 0x3ff00403bf8) = -1 ENOSYS (Function not implemented)
write(1, 0x3ff7d534000, 4393751543856-3: key inaccessible (Function not implemented)
)  = 48
exit_group(0)                           = ?

Comment 4 Dan Horák 2012-02-14 12:21:32 UTC
I've swapped strace to 32-bit package and here is the result

[root@devel4 ~]# strace keyctl show
execve("/bin/keyctl", ["keyctl", "show"], [/* 21 vars */]) = 0
brk(0)                                  = 0x5ed000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7d5e8000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7d5e6000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=35051, ...}) = 0
mmap(NULL, 35051, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7d5dd000
close(3)                                = 0
open("/lib/libkeyutils.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\26\0\0\0\1\0\0\r\330\0\0\0004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=9844, ...}) = 0
mmap(NULL, 8544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7d5da000
mmap(0x7d5dc000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7d5dc000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\26\0\0\0\1\0\1\274\264\0\0\0004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1787456, ...}) = 0
mmap(NULL, 1570584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7d45a000
mmap(0x7d5d4000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x179000) = 0x7d5d4000
mmap(0x7d5d7000, 10008, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7d5d7000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\26\0\0\0\1\0\0\v\274\0\0\0004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=17668, ...}) = 0
mmap(NULL, 16548, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7d455000
mmap(0x7d458000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7d458000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7d454000
mprotect(0x7d5d4000, 8192, PROT_READ)   = 0
mprotect(0x7d458000, 4096, PROT_READ)   = 0
mprotect(0x7d60a000, 4096, PROT_READ)   = 0
munmap(0x7d5dd000, 35051)               = 0
geteuid()                               = 0
getegid()                               = 0
getgroups(0, NULL)                      = 1
brk(0)                                  = 0x5ed000
brk(0x60e000)                           = 0x60e000
brk(0)                                  = 0x60e000
getgroups(1, [0])                       = 1
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7d5e5000
write(1, "Session Keyring\n", 16Session Keyring
)       = 16
keyctl(0x6, 0xfffffffd, 0, 0, 0x403bf8) = -1 ENOSYS (Function not implemented)
write(1, "-3: key inaccessible (Function n"..., 48-3: key inaccessible (Function not implemented)
) = 48
exit_group(0)                           = ?

Comment 5 Dan Horák 2012-02-14 12:23:07 UTC
The 32-bit wrapper is included in the kernel if I see correctly

[root@devel4 boot]# grep sys_keyctl /boot/System.map-3.1.9-1.fc16.s390x 
000000000011f18c T compat_sys_keyctl_wrapper
000000000017d010 W compat_sys_keyctl
0000000000392014 T sys_keyctl

[root@devel4 boot]# uname -a
Linux devel4.s390.bos.redhat.com 3.1.9-1.fc16.s390x #1 SMP Fri Jan 20 08:19:37 UTC 2012 s390x s390x s390x GNU/Linux

Comment 6 David Howells 2012-02-14 13:26:27 UTC
If I do:

[root@devel4 ~]# grep COMPAT /boot/config-3.1.9-1.fc16.s390x 
# CONFIG_COMPAT_BRK is not set
CONFIG_BLOCK_COMPAT=y
CONFIG_COMPAT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_COMPAT_BINFMT_ELF=y
# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set

I don't see CONFIG_KEYS_COMPAT mentioned - which means that compat_sys_keyctl() is not compiled in.  The compat versions of add_key() and request_key() only have asm-based compat wrappers in arch/s390/kernel/compat_wrapper.S and those jump directly to the main routines.

The problem appears to be that arch/s390/Kconfig does not invoke KEYS_COMPAT, unlike the x86 and powerpc versions.

Comment 7 David Howells 2012-02-14 13:37:11 UTC
Created attachment 561908 [details]
Fix to enable 32-bit s390 keyctl() syscall in s390x kernel

Comment 8 Dan Horák 2012-02-14 14:41:35 UTC
I've rebuilt the kernel with the patch and it's fixed

[root@devel4 ~]# uname -a
Linux devel4.s390.bos.redhat.com 3.2.6-3.fc16.s390x #1 SMP Tue Feb 14 09:14:02 EST 2012 s390x s390x s390x GNU/Linux
(reverse-i-search)`ke': ma^C
[root@devel4 ~]# keyctl show
Session Keyring
       -3 --alswrv      0     0  keyring: _ses
427096187 --alswrv      0    -1   \_ keyring: _uid.0
[root@devel4 ~]# rpm -q keyutils
keyutils-1.5.2-1.fc16.s390

Comment 9 Dan Horák 2012-02-14 15:08:45 UTC
one more component switch :-)

Comment 10 Josh Boyer 2012-02-14 15:22:49 UTC
I applied the patch from comment #8 to rawhide and f17.  Should be in a f17/rawhide soon.

Comment 11 David Howells 2012-02-14 15:44:38 UTC
I've posted the patch upstream.

Comment 12 Fedora Update System 2012-02-16 13:23:00 UTC
kernel-3.3.0-0.rc3.git6.2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/kernel-3.3.0-0.rc3.git6.2.fc17

Comment 13 Fedora Update System 2012-02-16 19:26:20 UTC
Package kernel-3.3.0-0.rc3.git6.2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-3.3.0-0.rc3.git6.2.fc17'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-1820/kernel-3.3.0-0.rc3.git6.2.fc17
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2012-02-17 20:13:34 UTC
kernel-3.3.0-0.rc3.git7.2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/kernel-3.3.0-0.rc3.git7.2.fc17

Comment 15 Fedora Update System 2012-02-21 02:22:48 UTC
kernel-3.3.0-0.rc3.git7.2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2012-02-21 03:14:08 UTC
kernel-3.2.7-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/kernel-3.2.7-1.fc16

Comment 17 Fedora Update System 2012-02-21 04:11:42 UTC
kernel-2.6.42.7-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.42.7-1.fc15

Comment 18 Fedora Update System 2012-02-23 02:26:18 UTC
kernel-3.2.7-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2012-02-25 08:40:24 UTC
kernel-2.6.42.7-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.