aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-05-09 00:23:40 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2003-05-09 00:23:40 -0700
commitc3a4b4b3584f7e3220f5c7b2ca8c7c81a5f75c8e (patch)
treed5ca3ca251374f946c13b71b1514f393c2317785 /ipc
parent9f8e838958a8a2668a85ceff2738cd35009acb27 (diff)
downloadhistory-c3a4b4b3584f7e3220f5c7b2ca8c7c81a5f75c8e.tar.gz
Annotate IPC system calls with user pointer annotations
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 29684c056882d0..251c822993d988 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -270,7 +270,7 @@ asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
return err;
}
-static inline unsigned long copy_shmid_to_user(void *buf, struct shmid64_ds *in, int version)
+static inline unsigned long copy_shmid_to_user(void __user *buf, struct shmid64_ds *in, int version)
{
switch(version) {
case IPC_64:
@@ -301,7 +301,7 @@ struct shm_setbuf {
mode_t mode;
};
-static inline unsigned long copy_shmid_from_user(struct shm_setbuf *out, void *buf, int version)
+static inline unsigned long copy_shmid_from_user(struct shm_setbuf *out, void __user *buf, int version)
{
switch(version) {
case IPC_64:
@@ -335,7 +335,7 @@ static inline unsigned long copy_shmid_from_user(struct shm_setbuf *out, void *b
}
}
-static inline unsigned long copy_shminfo_to_user(void *buf, struct shminfo64 *in, int version)
+static inline unsigned long copy_shminfo_to_user(void __user *buf, struct shminfo64 *in, int version)
{
switch(version) {
case IPC_64:
@@ -393,7 +393,7 @@ static void shm_get_stat(unsigned long *rss, unsigned long *swp)
}
}
-asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
+asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf)
{
struct shm_setbuf setbuf;
struct shmid_kernel *shp;
@@ -580,7 +580,7 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
case IPC_SET:
{
- if(copy_shmid_from_user (&setbuf, buf, version)) {
+ if (copy_shmid_from_user (&setbuf, buf, version)) {
err = -EFAULT;
goto out;
}
@@ -630,8 +630,12 @@ out:
/*
* Fix shmaddr, allocate descriptor, map shm, add attach descriptor to lists.
+ *
+ * NOTE! Despite the name, this is NOT a direct system call entrypoint. The
+ * "raddr" thing points to kernel space, and there has to be a wrapper around
+ * this.
*/
-asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
+long sys_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
{
struct shmid_kernel *shp;
unsigned long addr;
@@ -745,7 +749,7 @@ out:
* detach and kill segment if marked destroyed.
* The work is done in shm_close.
*/
-asmlinkage long sys_shmdt(char *shmaddr)
+asmlinkage long sys_shmdt(char __user *shmaddr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma, *next;