Keyctl_read_alloc: permission denied

Hi,

I’m attempting to set up a userscript for qutebrowser that involves using the kernel’s key management via keyctl, part of the keyutils package. However, keyctl doesn’t work as intended:

~
λ keyctl add user test payload @u
736202180
~
λ keyctl show @u
Keyring
 466901436 --alswrv   1000 65534  keyring: _uid.1000
 736202180 --alswrv   1000   100   \_ user: test
~
λ keyctl read 736202180
keyctl_read_alloc: Permission denied
~
λ sudo keyctl read 736202180
keyctl_read_alloc: Permission denied

This seems similar to this old systemd bug, but it’s long since resolved. Notably, using @s works perfectly.

What do I do?

1 Like

I’m having this problem too using bwmenu, did you manage how to fix it?

1 Like

I’m also experiencing this. Did you find a fix?

1 Like

Does linking the user keyring to the session keyring work (as suggested here) ?

Making my window manager execute the following on startup did the trick:

keyctl link @u @s