| 1 |
.\" Copyright 2016, Michael Kerrisk <[email protected]> |
| 2 |
.\" Copyright 2016, Eugene Syromyatnikov <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH KEYCTL_REVOKE 2const 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
KEYCTL_REVOKE |
| 10 |
\- |
| 11 |
revoke a key |
| 12 |
.SH LIBRARY |
| 13 |
Standard C library |
| 14 |
.RI ( libc ,\~ \-lc ) |
| 15 |
.SH SYNOPSIS |
| 16 |
.nf |
| 17 |
.BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */" |
| 18 |
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" |
| 19 |
.B #include <unistd.h> |
| 20 |
.P |
| 21 |
.BI "long syscall(SYS_keyctl, KEYCTL_REVOKE, key_serial_t " key ); |
| 22 |
.fi |
| 23 |
.SH DESCRIPTION |
| 24 |
Revoke the key with the ID provided in |
| 25 |
.IR key . |
| 26 |
The key is scheduled for garbage collection; |
| 27 |
it will no longer be findable, |
| 28 |
and will be unavailable for further operations. |
| 29 |
Further attempts to use the key will fail with the error |
| 30 |
.BR EKEYREVOKED . |
| 31 |
.P |
| 32 |
The caller must have |
| 33 |
.I write |
| 34 |
or |
| 35 |
.I setattr |
| 36 |
permission on the key. |
| 37 |
.\" Keys with the KEY_FLAG_KEEP bit set cause an EPERM |
| 38 |
.\" error for KEYCTL_REVOKE. Does this need to be documented? |
| 39 |
.\" David Howells: No significance for user space. |
| 40 |
.SH RETURN VALUE |
| 41 |
On success, |
| 42 |
0 is returned. |
| 43 |
.P |
| 44 |
On error, \-1 is returned, and |
| 45 |
.I errno |
| 46 |
is set to indicate the error. |
| 47 |
.SH VERSIONS |
| 48 |
A wrapper is provided in the |
| 49 |
.I libkeyutils |
| 50 |
library: |
| 51 |
.BR keyctl_revoke (3). |
| 52 |
.SH STANDARDS |
| 53 |
Linux. |
| 54 |
.SH HISTORY |
| 55 |
Linux 2.6.10. |
| 56 |
.SH SEE ALSO |
| 57 |
.BR keyctl (2), |
| 58 |
.BR keyctl_revoke (3) |