diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 2 | ||||
-rw-r--r-- | ipc/shm.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index b6cb06451f4b..e4e3f04803ca 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -155,7 +155,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, | |||
155 | spin_lock(&mq_lock); | 155 | spin_lock(&mq_lock); |
156 | if (u->mq_bytes + mq_bytes < u->mq_bytes || | 156 | if (u->mq_bytes + mq_bytes < u->mq_bytes || |
157 | u->mq_bytes + mq_bytes > | 157 | u->mq_bytes + mq_bytes > |
158 | p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur) { | 158 | task_rlimit(p, RLIMIT_MSGQUEUE)) { |
159 | spin_unlock(&mq_lock); | 159 | spin_unlock(&mq_lock); |
160 | kfree(info->messages); | 160 | kfree(info->messages); |
161 | goto out_inode; | 161 | goto out_inode; |
@@ -764,8 +764,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) | |||
764 | if (euid != shp->shm_perm.uid && | 764 | if (euid != shp->shm_perm.uid && |
765 | euid != shp->shm_perm.cuid) | 765 | euid != shp->shm_perm.cuid) |
766 | goto out_unlock; | 766 | goto out_unlock; |
767 | if (cmd == SHM_LOCK && | 767 | if (cmd == SHM_LOCK && !rlimit(RLIMIT_MEMLOCK)) |
768 | !current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) | ||
769 | goto out_unlock; | 768 | goto out_unlock; |
770 | } | 769 | } |
771 | 770 | ||