Debian Codegraph @

upstream/fedora-44/man2const/KEYCTL_INVALIDATE.2const

raw
1 .\" Copyright 2016, Michael Kerrisk <[email protected]>
2 .\" Copyright 2016, Eugene Syromyatnikov <[email protected]>
3 .\" A very few fragments remain from an earlier version of this page
4 .\" written by David Howells ([email protected])
5 .\" Copyright 2024, Alejandro Colomar <[email protected]>
6 .\"
7 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\"
9 .TH KEYCTL_INVALIDATE 2const 2024-08-21 "Linux man-pages 6.13"
10 .SH NAME
11 KEYCTL_INVALIDATE
12 \-
13 invalidate a key
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ,\~ \-lc )
17 .SH SYNOPSIS
18 .nf
19 .BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */"
20 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
21 .B #include <unistd.h>
22 .P
23 .BI "long syscall(SYS_keyctl, KEYCTL_INVALIDATE, key_serial_t " key );
24 .fi
25 .SH DESCRIPTION
26 Mark a key as invalid.
27 .P
28 The ID of the key to be invalidated is specified in
29 .IR key .
30 .P
31 To invalidate a key,
32 the caller must have
33 .I search
34 permission on the key.
35 .\" CAP_SYS_ADMIN is permitted to invalidate certain special keys
36 .P
37 This operation marks the key as invalid
38 and schedules immediate garbage collection.
39 The garbage collector removes the invalidated key from all keyrings and
40 deletes the key when its reference count reaches zero.
41 After this operation,
42 the key will be ignored by all searches,
43 even if it is not yet deleted.
44 .P
45 Keys that are marked invalid become invisible to normal key operations
46 immediately, though they are still visible in
47 .I /proc/keys
48 (marked with an 'i' flag)
49 until they are actually removed.
50 .SH RETURN VALUE
51 On success,
52 0 is returned.
53 .P
54 On error, \-1 is returned, and
55 .I errno
56 is set to indicate the error.
57 .SH VERSIONS
58 A wrapper is provided in the
59 .I libkeyutils
60 library:
61 .BR keyctl_invalidate (3).
62 .SH STANDARDS
63 Linux.
64 .SH HISTORY
65 Linux 3.5.
66 .\" commit fd75815f727f157a05f4c96b5294a4617c0557da
67 .SH SEE ALSO
68 .BR keyctl (2),
69 .BR keyctl_invalidate (3)