aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-04-07 06:28:00 -0400
committerTakashi Iwai <tiwai@suse.de>2012-04-07 06:28:00 -0400
commitc38f62b08d800104fa9b0e9d6e9141459986c06d (patch)
tree1d04d768c8aa0c1a544d1f068317c7beb0101be2 /ipc
parent250f32747e62cb415b85083e247184188f24e566 (diff)
parent8abe05c6eb358967f16bce8a02c88d57c82cfbd6 (diff)
Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: fixes for 3.4 A bunch of driver-specific fixes and one generic fix for the new support for platform DAPM contexts - we were picking the wrong default for the idle_bias_off setting which was meaning we weren't actually achieving any useful runtime PM on platform devices.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/compat.c70
-rw-r--r--ipc/mqueue.c24
-rw-r--r--ipc/msgutil.c2
-rw-r--r--ipc/shm.c2
4 files changed, 74 insertions, 24 deletions
diff --git a/ipc/compat.c b/ipc/compat.c
index 845a28738d3a..a6df704f521e 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -27,6 +27,7 @@
27#include <linux/msg.h> 27#include <linux/msg.h>
28#include <linux/shm.h> 28#include <linux/shm.h>
29#include <linux/syscalls.h> 29#include <linux/syscalls.h>
30#include <linux/ptrace.h>
30 31
31#include <linux/mutex.h> 32#include <linux/mutex.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
@@ -117,6 +118,7 @@ extern int sem_ctls[];
117 118
118static inline int compat_ipc_parse_version(int *cmd) 119static inline int compat_ipc_parse_version(int *cmd)
119{ 120{
121#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
120 int version = *cmd & IPC_64; 122 int version = *cmd & IPC_64;
121 123
122 /* this is tricky: architectures that have support for the old 124 /* this is tricky: architectures that have support for the old
@@ -128,6 +130,10 @@ static inline int compat_ipc_parse_version(int *cmd)
128 *cmd &= ~IPC_64; 130 *cmd &= ~IPC_64;
129#endif 131#endif
130 return version; 132 return version;
133#else
134 /* With the asm-generic APIs, we always use the 64-bit versions. */
135 return IPC_64;
136#endif
131} 137}
132 138
133static inline int __get_compat_ipc64_perm(struct ipc64_perm *p64, 139static inline int __get_compat_ipc64_perm(struct ipc64_perm *p64,
@@ -232,10 +238,9 @@ static inline int put_compat_semid_ds(struct semid64_ds *s,
232 return err; 238 return err;
233} 239}
234 240
235long compat_sys_semctl(int first, int second, int third, void __user *uptr) 241static long do_compat_semctl(int first, int second, int third, u32 pad)
236{ 242{
237 union semun fourth; 243 union semun fourth;
238 u32 pad;
239 int err, err2; 244 int err, err2;
240 struct semid64_ds s64; 245 struct semid64_ds s64;
241 struct semid64_ds __user *up64; 246 struct semid64_ds __user *up64;
@@ -243,10 +248,6 @@ long compat_sys_semctl(int first, int second, int third, void __user *uptr)
243 248
244 memset(&s64, 0, sizeof(s64)); 249 memset(&s64, 0, sizeof(s64));
245 250
246 if (!uptr)
247 return -EINVAL;
248 if (get_user(pad, (u32 __user *) uptr))
249 return -EFAULT;
250 if ((third & (~IPC_64)) == SETVAL) 251 if ((third & (~IPC_64)) == SETVAL)
251 fourth.val = (int) pad; 252 fourth.val = (int) pad;
252 else 253 else
@@ -305,6 +306,18 @@ long compat_sys_semctl(int first, int second, int third, void __user *uptr)
305 return err; 306 return err;
306} 307}
307 308
309#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
310long compat_sys_semctl(int first, int second, int third, void __user *uptr)
311{
312 u32 pad;
313
314 if (!uptr)
315 return -EINVAL;
316 if (get_user(pad, (u32 __user *) uptr))
317 return -EFAULT;
318 return do_compat_semctl(first, second, third, pad);
319}
320
308long compat_sys_msgsnd(int first, int second, int third, void __user *uptr) 321long compat_sys_msgsnd(int first, int second, int third, void __user *uptr)
309{ 322{
310 struct compat_msgbuf __user *up = uptr; 323 struct compat_msgbuf __user *up = uptr;
@@ -353,6 +366,37 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
353out: 366out:
354 return err; 367 return err;
355} 368}
369#else
370long compat_sys_semctl(int semid, int semnum, int cmd, int arg)
371{
372 return do_compat_semctl(semid, semnum, cmd, arg);
373}
374
375long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
376 size_t msgsz, int msgflg)
377{
378 compat_long_t mtype;
379
380 if (get_user(mtype, &msgp->mtype))
381 return -EFAULT;
382 return do_msgsnd(msqid, mtype, msgp->mtext, msgsz, msgflg);
383}
384
385long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
386 size_t msgsz, long msgtyp, int msgflg)
387{
388 long err, mtype;
389
390 err = do_msgrcv(msqid, &mtype, msgp->mtext, msgsz, msgtyp, msgflg);
391 if (err < 0)
392 goto out;
393
394 if (put_user(mtype, &msgp->mtype))
395 err = -EFAULT;
396 out:
397 return err;
398}
399#endif
356 400
357static inline int get_compat_msqid64(struct msqid64_ds *m64, 401static inline int get_compat_msqid64(struct msqid64_ds *m64,
358 struct compat_msqid64_ds __user *up64) 402 struct compat_msqid64_ds __user *up64)
@@ -470,6 +514,7 @@ long compat_sys_msgctl(int first, int second, void __user *uptr)
470 return err; 514 return err;
471} 515}
472 516
517#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
473long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, 518long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
474 void __user *uptr) 519 void __user *uptr)
475{ 520{
@@ -485,6 +530,19 @@ long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
485 uaddr = compat_ptr(third); 530 uaddr = compat_ptr(third);
486 return put_user(raddr, uaddr); 531 return put_user(raddr, uaddr);
487} 532}
533#else
534long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg)
535{
536 unsigned long ret;
537 long err;
538
539 err = do_shmat(shmid, compat_ptr(shmaddr), shmflg, &ret);
540 if (err)
541 return err;
542 force_successful_syscall_return();
543 return (long)ret;
544}
545#endif
488 546
489static inline int get_compat_shmid64_ds(struct shmid64_ds *s64, 547static inline int get_compat_shmid64_ds(struct shmid64_ds *s64,
490 struct compat_shmid64_ds __user *up64) 548 struct compat_shmid64_ds __user *up64)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 86ee272de210..28bd64ddeda3 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -188,30 +188,20 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
188{ 188{
189 struct inode *inode; 189 struct inode *inode;
190 struct ipc_namespace *ns = data; 190 struct ipc_namespace *ns = data;
191 int error;
192 191
193 sb->s_blocksize = PAGE_CACHE_SIZE; 192 sb->s_blocksize = PAGE_CACHE_SIZE;
194 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 193 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
195 sb->s_magic = MQUEUE_MAGIC; 194 sb->s_magic = MQUEUE_MAGIC;
196 sb->s_op = &mqueue_super_ops; 195 sb->s_op = &mqueue_super_ops;
197 196
198 inode = mqueue_get_inode(sb, ns, S_IFDIR | S_ISVTX | S_IRWXUGO, 197 inode = mqueue_get_inode(sb, ns, S_IFDIR | S_ISVTX | S_IRWXUGO, NULL);
199 NULL); 198 if (IS_ERR(inode))
200 if (IS_ERR(inode)) { 199 return PTR_ERR(inode);
201 error = PTR_ERR(inode);
202 goto out;
203 }
204 200
205 sb->s_root = d_alloc_root(inode); 201 sb->s_root = d_make_root(inode);
206 if (!sb->s_root) { 202 if (!sb->s_root)
207 iput(inode); 203 return -ENOMEM;
208 error = -ENOMEM; 204 return 0;
209 goto out;
210 }
211 error = 0;
212
213out:
214 return error;
215} 205}
216 206
217static struct dentry *mqueue_mount(struct file_system_type *fs_type, 207static struct dentry *mqueue_mount(struct file_system_type *fs_type,
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index 5652101cdac0..26143d377c95 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -13,7 +13,9 @@
13#include <linux/security.h> 13#include <linux/security.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/ipc.h> 15#include <linux/ipc.h>
16#include <linux/msg.h>
16#include <linux/ipc_namespace.h> 17#include <linux/ipc_namespace.h>
18#include <linux/utsname.h>
17#include <asm/uaccess.h> 19#include <asm/uaccess.h>
18 20
19#include "util.h" 21#include "util.h"
diff --git a/ipc/shm.c b/ipc/shm.c
index b76be5bda6c2..406c5b208193 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -482,7 +482,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
482 /* hugetlb_file_setup applies strict accounting */ 482 /* hugetlb_file_setup applies strict accounting */
483 if (shmflg & SHM_NORESERVE) 483 if (shmflg & SHM_NORESERVE)
484 acctflag = VM_NORESERVE; 484 acctflag = VM_NORESERVE;
485 file = hugetlb_file_setup(name, size, acctflag, 485 file = hugetlb_file_setup(name, 0, size, acctflag,
486 &shp->mlock_user, HUGETLB_SHMFS_INODE); 486 &shp->mlock_user, HUGETLB_SHMFS_INODE);
487 } else { 487 } else {
488 /* 488 /*