Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | security/selinux/avc.c |
static void avc_node_populate(struct avc_node *node, u32 ssid, u32 tsid,
u16 tclass, struct av_decision *avd) {
node->ae.ssid = ssid;
node->ae.tsid = tsid;
node->ae.tclass = tclass;
memcpy(&node->ae.avd, avd, sizeof(node->ae.avd));
} | [
1,
0
] |
Linux Kernel | security/selinux/avc.c |
static inline struct avc_node *avc_search_node(struct selinux_avc *avc,
u32 ssid, u32 tsid, u16 tclass) {
struct avc_node *node, *ret = NULL;
int hvalue;
struct hlist_head *head;
hvalue = avc_hash(ssid, tsid, tclass);
head = &avc->avc_cache.slots[hvalue];
hli... | [
0,
0
] |
Linux Kernel | security/selinux/avc.c | static struct avc_node *avc_lookup(struct selinux_avc *avc, u32 ssid, u32 tsid,
u16 tclass) {
struct avc_node *node;
avc_cache_stats_incr(lookups);
node = avc_search_node(avc, ssid, tsid, tclass);
if (node)
return node;
avc_cache_stats_incr(misses);
return NULL;
} | [
0,
0
] |
Linux Kernel | security/selinux/avc.c |
static int avc_latest_notif_update(struct selinux_avc *avc, int seqno,
int is_insert) {
int ret = 0;
static DEFINE_SPINLOCK(notif_lock);
unsigned long flag;
spin_lock_irqsave(¬if_lock, flag);
if (is_insert) {
if (seqno < avc->avc_cache.latest_notif) {
pr_warn(... | [
1,
0
] |
Linux Kernel | security/selinux/avc.c | static void avc_audit_pre_callback(struct audit_buffer *ab, void *a) {
struct common_audit_data *ad = a;
struct selinux_audit_data *sad = ad->selinux_audit_data;
u32 av = sad->audited;
const char *const *perms;
int i, perm;
audit_log_format(ab, "avc: %s ", sad->denied ? "denied" : "granted");
if (av ==... | [
1,
0
] |
Linux Kernel | security/selinux/avc.c | noinline int slow_avc_audit(struct selinux_state *state, u32 ssid, u32 tsid,
u16 tclass, u32 requested, u32 audited, u32 denied,
int result, struct common_audit_data *a) {
struct common_audit_data stack_data;
struct selinux_audit_data sad;
if (WARN_ON(!tcla... | [
1,
0
] |
Linux Kernel | security/selinux/avc.c | static void avc_flush(struct selinux_avc *avc) {
struct hlist_head *head;
struct avc_node *node;
spinlock_t *lock;
unsigned long flag;
int i;
for (i = 0; i < AVC_CACHE_SLOTS; i++) {
head = &avc->avc_cache.slots[i];
lock = &avc->avc_cache.slots_lock[i];
spin_lock_irqsave(lock, flag);
rcu_r... | [
0,
0
] |
Linux Kernel | security/selinux/avc.c |
u32 avc_policy_seqno(struct selinux_state *state) {
return state->avc->avc_cache.latest_notif;
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_secmark_enabled(void) {
return (selinux_policycap_alwaysnetwork() ||
atomic_read(&selinux_secmark_refcount));
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static inline u32 task_sid_obj(const struct task_struct *task) {
u32 sid;
rcu_read_lock();
sid = cred_sid(__task_cred(task));
rcu_read_unlock();
return sid;
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int __inode_security_revalidate(struct inode *inode,
struct dentry *dentry, bool may_sleep) {
struct inode_security_struct *isec = selinux_inode(inode);
might_sleep_if(may_sleep);
if (selinux_initialized(&selinux_state) &&
isec->initialized != LABEL_INITIALIZE... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static struct inode_security_struct *inode_security_rcu(struct inode *inode,
bool rcu) {
int error;
error = __inode_security_revalidate(inode, NULL, !rcu);
if (error)
return ERR_PTR(error);
return selinux_inode(inode);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_free_mnt_opts(void *mnt_opts) { kfree(mnt_opts); } | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int match_opt_prefix(char *s, int l, char **arg) {
int i;
for (i = 0; i < ARRAY_SIZE(tokens); i++) {
size_t len = tokens[i].len;
if (len > l || memcmp(s, tokens[i].name, len))
continue;
if (tokens[i].has_arg) {
if (len == l || s[len] != '=')
continue;
*arg = s + len + ... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int
may_context_mount_inode_relabel(u32 sid,
struct superblock_security_struct *sbsec,
const struct cred *cred) {
const struct task_security_struct *tsec = selinux_cred(cred);
int rc;
rc = avc_has_perm(&selinux_state, tsec->sid, sbsec->sid, S... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_is_genfs_special_handling(struct super_block *sb) {
return !strcmp(sb->s_type->name, "sysfs") ||
!strcmp(sb->s_type->name, "pstore") ||
!strcmp(sb->s_type->name, "debugfs") ||
!strcmp(sb->s_type->name, "tracefs") ||
!strcmp(sb->s_type->name, "rootfs") ||
... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c | static int sb_check_xattr_support(struct super_block *sb) {
struct superblock_security_struct *sbsec = selinux_superblock(sb);
struct dentry *root = sb->s_root;
struct inode *root_inode = d_backing_inode(root);
u32 sid;
int rc;
if (!(root_inode->i_opflags & IOP_XATTR)) {
pr_warn("SELinux: (dev %s, type... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c | static int sb_finish_set_opts(struct super_block *sb) {
struct superblock_security_struct *sbsec = selinux_superblock(sb);
struct dentry *root = sb->s_root;
struct inode *root_inode = d_backing_inode(root);
int rc = 0;
if (sbsec->behavior == SECURITY_FS_USE_XATTR) {
rc = sb_check_xattr_support(sb);
i... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static inline int default_protocol_dgram(int protocol) {
return (protocol == IPPROTO_IP || protocol == IPPROTO_UDP);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static inline u32 signal_to_av(int sig) {
u32 perm = 0;
switch (sig) {
case SIGCHLD:
perm = PROCESS__SIGCHLD;
break;
case SIGKILL:
/* Cannot be caught or ignored */
perm = PROCESS__SIGKILL;
break;
case SIGSTOP:
/* Cannot be caught or ignored */
perm = PROCESS__SIGSTOP;
break;... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int inode_has_perm(const struct cred *cred, struct inode *inode,
u32 perms, struct common_audit_data *adp) {
struct inode_security_struct *isec;
u32 sid;
validate_creds(cred);
if (unlikely(IS_PRIVATE(inode)))
return 0;
sid = cred_sid(cred);
isec = selinux_inode(inode)... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static inline int dentry_has_perm(const struct cred *cred,
struct dentry *dentry, u32 av) {
struct inode *inode = d_backing_inode(dentry);
struct common_audit_data ad;
ad.type = LSM_AUDIT_DATA_DENTRY;
ad.u.dentry = dentry;
__inode_security_revalidate(inode, dentry, true);
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int file_has_perm(const struct cred *cred, struct file *file, u32 av) {
struct file_security_struct *fsec = selinux_file(file);
struct inode *inode = file_inode(file);
struct common_audit_data ad;
u32 sid = cred_sid(cred);
int rc;
ad.type = LSM_AUDIT_DATA_FILE;
ad.u.file = file;
if (sid != fsec... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_binder_transaction(const struct cred *from,
const struct cred *to) {
u32 mysid = current_sid();
u32 fromsid = cred_sid(from);
u32 tosid = cred_sid(to);
int rc;
if (mysid != fromsid) {
rc = avc_has_perm(&selinux_state, mysid, fromsid, SECCLASS_BIND... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_binder_transfer_binder(const struct cred *from,
const struct cred *to) {
return avc_has_perm(&selinux_state, cred_sid(from), cred_sid(to),
SECCLASS_BINDER, BINDER__TRANSFER, NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_binder_transfer_file(const struct cred *from,
const struct cred *to,
struct file *file) {
u32 sid = cred_sid(to);
struct file_security_struct *fsec = selinux_file(file);
struct dentry *dentry = file->f_path.dentry;... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_ptrace_traceme(struct task_struct *parent) {
return avc_has_perm(&selinux_state, task_sid_obj(parent),
task_sid_obj(current), SECCLASS_PROCESS, PROCESS__PTRACE,
NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_capset(struct cred *new, const struct cred *old,
const kernel_cap_t *effective,
const kernel_cap_t *inheritable,
const kernel_cap_t *permitted) {
return avc_has_perm(&selinux_state, cred_sid(old), cred_sid(new),
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_capable(const struct cred *cred, struct user_namespace *ns,
int cap, unsigned int opts) {
return cred_has_capability(cred, cap, opts, ns == &init_user_ns);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static void selinux_bprm_committed_creds(struct linux_binprm *bprm) {
const struct task_security_struct *tsec = selinux_cred(current_cred());
u32 osid, sid;
int rc;
osid = tsec->osid;
sid = tsec->sid;
if (sid == osid)
return;
rc = avc_has_perm(&selinux_state, osid, sid, SECCLASS_PROCESS,
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static inline int opt_len(const char *s) {
bool open_quote = false;
int len;
char c;
for (len = 0; (c = s[len]) != '\0'; len++) {
if (c == '"')
open_quote = !open_quote;
if (c == ',' && !open_quote)
break;
}
return len;
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_mount(const char *dev_name, const struct path *path,
const char *type, unsigned long flags, void *data) {
const struct cred *cred = current_cred();
if (flags & MS_REMOUNT)
return superblock_has_perm(cred, path->dentry->d_sb, FILESYSTEM__REMOUNT,
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_umount(struct vfsmount *mnt, int flags) {
const struct cred *cred = current_cred();
return superblock_has_perm(cred, mnt->mnt_sb, FILESYSTEM__UNMOUNT, NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_fs_context_parse_param(struct fs_context *fc,
struct fs_parameter *param) {
struct fs_parse_result result;
int opt;
opt = fs_parse(fc, selinux_fs_parameters, param, &result);
if (opt < 0)
return opt;
return selinux_add_opt(opt, param->string,... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *new_dentry) {
return may_link(dir, old_dentry, MAY_LINK);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_unlink(struct inode *dir, struct dentry *dentry) {
return may_link(dir, dentry, MAY_UNLINK);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_rmdir(struct inode *dir, struct dentry *dentry) {
return may_link(dir, dentry, MAY_RMDIR);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_mknod(struct inode *dir, struct dentry *dentry,
umode_t mode, dev_t dev) {
return may_create(dir, dentry, inode_mode_to_security_class(mode));
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_rename(struct inode *old_inode,
struct dentry *old_dentry,
struct inode *new_inode,
struct dentry *new_dentry) {
return may_rename(old_inode, old_dentry, new_inode, new_dentry);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_inode_permission(struct inode *inode, int mask) {
const struct cred *cred = current_cred();
u32 perms;
bool from_access;
bool no_block = mask & MAY_NOT_BLOCK;
struct inode_security_struct *isec;
u32 sid;
struct av_decision avd;
int rc, rc2;
u32 audited, denied;
from_access = mask... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_path_notify(const struct path *path, u64 mask,
unsigned int obj_type) {
int ret;
u32 perm;
struct common_audit_data ad;
ad.type = LSM_AUDIT_DATA_PATH;
ad.u.path = *path;
switch (obj_type) {
case FSNOTIFY_OBJ_TYPE_VFSMOUNT:
perm = FILE__WATCH_MOUNT;
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inode_setsecurity(struct inode *inode, const char *name,
const void *value, size_t size,
int flags) {
struct inode_security_struct *isec = inode_security_novalidate(inode);
struct superblock_security_struct *sbsec;
u32 n... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_inode_getsecid(struct inode *inode, u32 *secid) {
struct inode_security_struct *isec = inode_security_novalidate(inode);
*secid = isec->sid;
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_revalidate_file_permission(struct file *file, int mask) {
const struct cred *cred = current_cred();
struct inode *inode = file_inode(file);
if ((file->f_flags & O_APPEND) && (mask & MAY_WRITE))
mask |= MAY_APPEND;
return file_has_perm(cred, file, file_mask_to_av(inode->i_mode, mask));
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_file_permission(struct file *file, int mask) {
struct inode *inode = file_inode(file);
struct file_security_struct *fsec = selinux_file(file);
struct inode_security_struct *isec;
u32 sid = current_sid();
if (!mask)
return 0;
isec = inode_security(inode);
if (sid == fsec->sid && f... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c | static int ioctl_has_perm(const struct cred *cred, struct file *file,
u32 requested, u16 cmd) {
struct common_audit_data ad;
struct file_security_struct *fsec = selinux_file(file);
struct inode *inode = file_inode(file);
struct inode_security_struct *isec;
struct lsm_ioctlop_audit io... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_file_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
const struct cred *cred = current_cred();
int error = 0;
switch (cmd) {
case FIONREAD:
case FIBMAP:
case FIGETBSZ:
case FS_IOC_GETFLAGS:
case FS_IOC_GETVERSION:
error = file_has_per... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_file_fcntl(struct file *file, unsigned int cmd,
unsigned long arg) {
const struct cred *cred = current_cred();
int err = 0;
switch (cmd) {
case F_SETFL:
if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) {
err = file_has_perm(cred, file, FILE__WRITE)... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_kernel_read_file(struct file *file,
enum kernel_read_file_id id,
bool contents) {
int rc = 0;
switch (id) {
case READING_MODULE:
rc = selinux_kernel_module_from_file(contents ? file : NULL);
break;
default:
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_task_getpgid(struct task_struct *p) {
return avc_has_perm(&selinux_state, current_sid(), task_sid_obj(p),
SECCLASS_PROCESS, PROCESS__GETPGID, NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_task_setrlimit(struct task_struct *p, unsigned int resource,
struct rlimit *new_rlim) {
struct rlimit *old_rlim = p->signal->rlim + resource;
if (old_rlim->rlim_max != new_rlim->rlim_max)
return avc_has_perm(&selinux_state, current_sid(), task_sid_obj(p),
... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_task_to_inode(struct task_struct *p, struct inode *inode) {
struct inode_security_struct *isec = selinux_inode(inode);
u32 sid = task_sid_obj(p);
spin_lock(&isec->lock);
isec->sclass = inode_mode_to_security_class(inode->i_mode);
isec->sid = sid;
isec->initialized = LABEL_INITIALIZED;
... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_socket_listen(struct socket *sock, int backlog) {
return sock_has_perm(sock->sk, SOCKET__LISTEN);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_socket_sendmsg(struct socket *sock, struct msghdr *msg,
int size) {
return sock_has_perm(sock->sk, SOCKET__WRITE);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_socket_setsockopt(struct socket *sock, int level,
int optname) {
int err;
err = sock_has_perm(sock->sk, SOCKET__SETOPT);
if (err)
return err;
return selinux_netlbl_socket_setsockopt(sock, level, optname);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_socket_getpeersec_stream(struct socket *sock,
sockptr_t optval, sockptr_t optlen,
unsigned int len) {
int err = 0;
char *scontext = NULL;
u32 scontext_len;
struct sk_security_struct *sksec = sock->sk->sk_... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_sk_free_security(struct sock *sk) {
struct sk_security_struct *sksec = sk->sk_security;
sk->sk_security = NULL;
selinux_netlbl_sk_security_free(sksec);
kfree(sksec);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_inet_conn_request(const struct sock *sk, struct sk_buff *skb,
struct request_sock *req) {
struct sk_security_struct *sksec = sk->sk_security;
int err;
u16 family = req->rsk_ops->family;
u32 connsid;
u32 peersid;
err = selinux_skb_peerlbl_sid(skb, fam... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static void selinux_inet_conn_established(struct sock *sk,
struct sk_buff *skb) {
u16 family = sk->sk_family;
struct sk_security_struct *sksec = sk->sk_security;
if (family == PF_INET6 && skb->protocol == htons(ETH_P_IP))
family = PF_INET;
selinux_skb_peerlbl_sid(... | [
1,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_secmark_refcount_inc(void) {
atomic_inc(&selinux_secmark_refcount);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_msg_queue_msgctl(struct kern_ipc_perm *msq, int cmd) {
int err;
int perms;
switch (cmd) {
case IPC_INFO:
case MSG_INFO:
return avc_has_perm(&selinux_state, current_sid(), SECINITSID_KERNEL,
SECCLASS_SYSTEM, SYSTEM__IPC_INFO, NULL);
case IPC_STAT:
case MSG_S... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_msg_queue_msgsnd(struct kern_ipc_perm *msq,
struct msg_msg *msg, int msqflg) {
struct ipc_security_struct *isec;
struct msg_security_struct *msec;
struct common_audit_data ad;
u32 sid = current_sid();
int rc;
isec = selinux_ipc(msq);
msec = selinux_m... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_msg_queue_msgrcv(struct kern_ipc_perm *msq,
struct msg_msg *msg,
struct task_struct *target, long type,
int mode) {
struct ipc_security_struct *isec;
struct msg_security_struct *msec;
st... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_getprocattr(struct task_struct *p, const char *name,
char **value) {
const struct task_security_struct *__tsec;
u32 sid;
int error;
unsigned len;
rcu_read_lock();
__tsec = selinux_cred(__task_cred(p));
if (current != p) {
error = avc_has_perm(&selin... | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) {
return security_sid_to_context(&selinux_state, secid, secdata, seclen);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_secctx_to_secid(const char *secdata, u32 seclen,
u32 *secid) {
return security_context_to_sid(&selinux_state, secdata, seclen, secid,
GFP_KERNEL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_inode_invalidate_secctx(struct inode *inode) {
struct inode_security_struct *isec = selinux_inode(inode);
spin_lock(&isec->lock);
isec->initialized = LABEL_INVALID;
spin_unlock(&isec->lock);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | static int selinux_inode_setsecctx(struct dentry *dentry, void *ctx,
u32 ctxlen) {
return __vfs_setxattr_noperm(&init_user_ns, dentry, XATTR_NAME_SELINUX, ctx,
ctxlen, 0);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_bpf_prog(struct bpf_prog *prog) {
u32 sid = current_sid();
struct bpf_security_struct *bpfsec;
bpfsec = prog->aux->security;
return avc_has_perm(&selinux_state, sid, bpfsec->sid, SECCLASS_BPF,
BPF__PROG_RUN, NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static void selinux_bpf_map_free(struct bpf_map *map) {
struct bpf_security_struct *bpfsec = map->security;
map->security = NULL;
kfree(bpfsec);
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_bpf_prog_alloc(struct bpf_prog_aux *aux) {
struct bpf_security_struct *bpfsec;
bpfsec = kzalloc(sizeof(*bpfsec), GFP_KERNEL);
if (!bpfsec)
return -ENOMEM;
bpfsec->sid = current_sid();
aux->security = bpfsec;
return 0;
} | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c |
static int selinux_perf_event_write(struct perf_event *event) {
struct perf_event_security_struct *perfsec = event->security;
u32 sid = current_sid();
return avc_has_perm(&selinux_state, sid, perfsec->sid, SECCLASS_PERF_EVENT,
PERF_EVENT__WRITE, NULL);
}
#endif
#ifdef CONFIG_IO_URING | [
0,
0
] |
Linux Kernel | security/selinux/hooks.c | void selinux_complete_init(void) {
pr_debug("SELinux: Completing initialization.\n");
pr_debug("SELinux: Setting up existing superblocks.\n");
iterate_supers(delayed_superblock_init, NULL);
} | [
0,
0
] |
Linux Kernel | security/selinux/ibpkey.c | static void sel_ib_pkey_insert(struct sel_ib_pkey *pkey) {
unsigned int idx;
idx = sel_ib_pkey_hashfn(pkey->psec.pkey);
list_add_rcu(&pkey->list, &sel_ib_pkey_hash[idx].list);
if (sel_ib_pkey_hash[idx].size == SEL_PKEY_HASH_BKT_LIMIT) {
struct sel_ib_pkey *tail;
tail = list_entry(
rcu_derefere... | [
0,
0
] |
Linux Kernel | security/selinux/ibpkey.c | static int sel_ib_pkey_sid_slow(u64 subnet_prefix, u16 pkey_num, u32 *sid) {
int ret;
struct sel_ib_pkey *pkey;
struct sel_ib_pkey *new = NULL;
unsigned long flags;
spin_lock_irqsave(&sel_ib_pkey_lock, flags);
pkey = sel_ib_pkey_find(subnet_prefix, pkey_num);
if (pkey) {
*sid = pkey->psec.sid;
sp... | [
0,
0
] |
Linux Kernel | security/selinux/ima.c | void selinux_ima_measure_state_locked(struct selinux_state *state) {
char *state_str = NULL;
void *policy = NULL;
size_t policy_len;
int rc = 0;
lockdep_assert_held(&state->policy_mutex);
state_str = selinux_ima_collect_state(state);
if (!state_str) {
pr_err("SELinux: %s: failed to read state.\n", _... | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h | static inline void selinux_netlbl_cache_invalidate(void) { return; } | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h |
static inline void selinux_netlbl_err(struct sk_buff *skb, u16 family,
int error, int gateway) {
return;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h |
static inline int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, u16 family,
u32 *type, u32 *sid) {
*type = NETLBL_NLTYPE_NONE;
*sid = SECSID_NULL;
return 0;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h |
static inline int
selinux_netlbl_sctp_assoc_request(struct sctp_association *asoc,
struct sk_buff *skb) {
return 0;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h | static inline void selinux_netlbl_inet_csk_clone(struct sock *sk, u16 family) {
return;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/netlabel.h | static inline int selinux_netlbl_socket_post_create(struct sock *sk,
u16 family) {
return 0;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/objsec.h | static inline struct task_security_struct *
selinux_cred(const struct cred *cred) {
return cred->security + selinux_blob_sizes.lbs_cred;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/objsec.h |
static inline struct file_security_struct *
selinux_file(const struct file *file) {
return file->f_security + selinux_blob_sizes.lbs_file;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/objsec.h |
static inline struct inode_security_struct *
selinux_inode(const struct inode *inode) {
if (unlikely(!inode->i_security))
return NULL;
return inode->i_security + selinux_blob_sizes.lbs_inode;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h | static inline bool enforcing_enabled(struct selinux_state *state) {
return true;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h |
static inline bool checkreqprot_get(const struct selinux_state *state) {
return READ_ONCE(state->checkreqprot);
} | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h |
static inline void selinux_mark_disabled(struct selinux_state *state) {
WRITE_ONCE(state->disabled, true);
}
#else | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h | static inline bool selinux_disabled(struct selinux_state *state) {
return false;
}
#endif | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h |
static inline bool selinux_policycap_nnp_nosuid_transition(void) {
struct selinux_state *state = &selinux_state;
return READ_ONCE(state->policycap[POLICYDB_CAP_NNP_NOSUID_TRANSITION]);
} | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h |
static inline bool selinux_policycap_ioctl_skip_cloexec(void) {
struct selinux_state *state = &selinux_state;
return READ_ONCE(state->policycap[POLICYDB_CAP_IOCTL_SKIP_CLOEXEC]);
} | [
0,
0
] |
Linux Kernel | security/selinux/include/security.h | static inline int
security_netlbl_secattr_to_sid(struct selinux_state *state,
struct netlbl_lsm_secattr *secattr, u32 *sid) {
return -EIDRM;
} | [
0,
0
] |
Linux Kernel | security/selinux/include/xfrm.h |
static inline int selinux_xfrm_enabled(void) {
return (atomic_read(&selinux_xfrm_refcount) > 0);
} | [
0,
0
] |
Linux Kernel | security/selinux/include/xfrm.h |
static inline void selinux_xfrm_notify_policyload(void) {
struct net *net;
down_read(&net_rwsem);
for_each_net(net) rt_genid_bump_all(net);
up_read(&net_rwsem);
} | [
0,
0
] |
Linux Kernel | security/selinux/include/xfrm.h | static inline int selinux_xfrm_enabled(void) { return 0; } | [
0,
0
] |
Linux Kernel | security/selinux/include/xfrm.h |
static inline int selinux_xfrm_sock_rcv_skb(u32 sk_sid, struct sk_buff *skb,
struct common_audit_data *ad) {
return 0;
} | [
0,
0
] |
Linux Kernel | security/selinux/netif.c | static void sel_netif_destroy(struct sel_netif *netif) {
list_del_rcu(&netif->list);
sel_netif_total--;
kfree_rcu(netif, rcu_head);
} | [
0,
0
] |
Linux Kernel | security/selinux/netif.c | void sel_netif_flush(void) {
int idx;
struct sel_netif *netif;
spin_lock_bh(&sel_netif_lock);
for (idx = 0; idx < SEL_NETIF_HASH_SIZE; idx++)
list_for_each_entry(netif, &sel_netif_hash[idx], list)
sel_netif_destroy(netif);
spin_unlock_bh(&sel_netif_lock);
} | [
0,
0
] |
Linux Kernel | security/selinux/netlabel.c | int selinux_netlbl_skbuff_setsid(struct sk_buff *skb, u16 family, u32 sid) {
int rc;
struct netlbl_lsm_secattr secattr_storage;
struct netlbl_lsm_secattr *secattr = NULL;
struct sock *sk;
sk = skb_to_full_sk(skb);
if (sk != NULL) {
struct sk_security_struct *sksec = sk->sk_security;
if (sksec->nlb... | [
0,
0
] |
Linux Kernel | security/selinux/netlabel.c | void selinux_netlbl_sctp_sk_clone(struct sock *sk, struct sock *newsk) {
struct sk_security_struct *sksec = sk->sk_security;
struct sk_security_struct *newsksec = newsk->sk_security;
newsksec->nlbl_state = sksec->nlbl_state;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.