Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22507
b: refs/heads/master
c: bb00307
h: refs/heads/master
i:
  22505: 4800da8
  22503: 25f6ce2
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Mar 22, 2006
1 parent 50f5aec commit d4cc6fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8aad38752e81d1d4de67e3d8e2524618ce7c9276
refs/heads/master: bb0030797f55c9996ea1cebd16b65750ceb7e4fd
7 changes: 4 additions & 3 deletions trunk/security/keys/process_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
#include <linux/keyctl.h>
#include <linux/fs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include "internal.h"

/* session keyring create vs join semaphore */
static DECLARE_MUTEX(key_session_sem);
static DEFINE_MUTEX(key_session_mutex);

/* the root user's tracking struct */
struct key_user root_key_user = {
Expand Down Expand Up @@ -711,7 +712,7 @@ long join_session_keyring(const char *name)
}

/* allow the user to join or create a named keyring */
down(&key_session_sem);
mutex_lock(&key_session_mutex);

/* look for an existing keyring of this name */
keyring = find_keyring_by_name(name, 0);
Expand All @@ -737,7 +738,7 @@ long join_session_keyring(const char *name)
key_put(keyring);

error2:
up(&key_session_sem);
mutex_unlock(&key_session_mutex);
error:
return ret;

Expand Down
19 changes: 10 additions & 9 deletions trunk/security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
#include <linux/mutex.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/security.h>
Expand Down Expand Up @@ -44,7 +45,7 @@ static int __init checkreqprot_setup(char *str)
__setup("checkreqprot=", checkreqprot_setup);


static DECLARE_MUTEX(sel_sem);
static DEFINE_MUTEX(sel_mutex);

/* global data for booleans */
static struct dentry *bool_dir = NULL;
Expand Down Expand Up @@ -230,7 +231,7 @@ static ssize_t sel_write_load(struct file * file, const char __user * buf,
ssize_t length;
void *data = NULL;

down(&sel_sem);
mutex_lock(&sel_mutex);

length = task_has_security(current, SECURITY__LOAD_POLICY);
if (length)
Expand Down Expand Up @@ -262,7 +263,7 @@ static ssize_t sel_write_load(struct file * file, const char __user * buf,
else
length = count;
out:
up(&sel_sem);
mutex_unlock(&sel_mutex);
vfree(data);
return length;
}
Expand Down Expand Up @@ -714,7 +715,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
int cur_enforcing;
struct inode *inode;

down(&sel_sem);
mutex_lock(&sel_mutex);

ret = -EFAULT;

Expand Down Expand Up @@ -759,7 +760,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
*ppos = end;
ret = count;
out:
up(&sel_sem);
mutex_unlock(&sel_mutex);
if (page)
free_page((unsigned long)page);
return ret;
Expand All @@ -773,7 +774,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
int new_value;
struct inode *inode;

down(&sel_sem);
mutex_lock(&sel_mutex);

length = task_has_security(current, SECURITY__SETBOOL);
if (length)
Expand Down Expand Up @@ -812,7 +813,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
length = count;

out:
up(&sel_sem);
mutex_unlock(&sel_mutex);
if (page)
free_page((unsigned long) page);
return length;
Expand All @@ -831,7 +832,7 @@ static ssize_t sel_commit_bools_write(struct file *filep,
ssize_t length = -EFAULT;
int new_value;

down(&sel_sem);
mutex_lock(&sel_mutex);

length = task_has_security(current, SECURITY__SETBOOL);
if (length)
Expand Down Expand Up @@ -869,7 +870,7 @@ static ssize_t sel_commit_bools_write(struct file *filep,
length = count;

out:
up(&sel_sem);
mutex_unlock(&sel_mutex);
if (page)
free_page((unsigned long) page);
return length;
Expand Down
9 changes: 5 additions & 4 deletions trunk/security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <linux/in.h>
#include <linux/sched.h>
#include <linux/audit.h>
#include <asm/semaphore.h>
#include <linux/mutex.h>

#include "flask.h"
#include "avc.h"
#include "avc_ss.h"
Expand All @@ -48,9 +49,9 @@ static DEFINE_RWLOCK(policy_rwlock);
#define POLICY_RDUNLOCK read_unlock(&policy_rwlock)
#define POLICY_WRUNLOCK write_unlock_irq(&policy_rwlock)

static DECLARE_MUTEX(load_sem);
#define LOAD_LOCK down(&load_sem)
#define LOAD_UNLOCK up(&load_sem)
static DEFINE_MUTEX(load_mutex);
#define LOAD_LOCK mutex_lock(&load_mutex)
#define LOAD_UNLOCK mutex_unlock(&load_mutex)

static struct sidtab sidtab;
struct policydb policydb;
Expand Down

0 comments on commit d4cc6fd

Please sign in to comment.