mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

The caller of cap_enable_effective() expects negative error code. Fix it. Before: failed to restore CAP_SYS_ADMIN: -1, Unknown error -1 After: failed to restore CAP_SYS_ADMIN: -3, No such process failed to restore CAP_SYS_ADMIN: -22, Invalid argument Signed-off-by: Feng Yang <yangfeng@kylinos.cn> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20250305022234.44932-1-yangfeng59949@163.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
20 lines
379 B
C
20 lines
379 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __CAP_HELPERS_H
|
|
#define __CAP_HELPERS_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/capability.h>
|
|
#include <errno.h>
|
|
|
|
#ifndef CAP_PERFMON
|
|
#define CAP_PERFMON 38
|
|
#endif
|
|
|
|
#ifndef CAP_BPF
|
|
#define CAP_BPF 39
|
|
#endif
|
|
|
|
int cap_enable_effective(__u64 caps, __u64 *old_caps);
|
|
int cap_disable_effective(__u64 caps, __u64 *old_caps);
|
|
|
|
#endif
|