linux-next: manual merge of the signal tree with the vfs tree

2013-04-03 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/compat.c
between commit 1fd193fd030a ("switch compat readv/writev variants to
COMPAT_SYSCALL_DEFINE") from the vfs tree and commit 76b021d053ed
("convert vmsplice to COMPAT_SYSCALL_DEFINE") from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/compat.c
index 5058345,b7a89b9..000
--- a/fs/compat.c
+++ b/fs/compat.c
@@@ -1069,26 -1064,195 +1068,6 @@@ asmlinkage long compat_sys_getdents64(u
  }
  #endif /* ! __ARCH_OMIT_COMPAT_SYS_GETDENTS64 */
  
- asmlinkage long
- compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
-   unsigned int nr_segs, unsigned int flags)
- {
-   unsigned i;
-   struct iovec __user *iov;
-   if (nr_segs > UIO_MAXIOV)
-   return -EINVAL;
-   iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
-   for (i = 0; i < nr_segs; i++) {
-   struct compat_iovec v;
-   if (get_user(v.iov_base, [i].iov_base) ||
-   get_user(v.iov_len, [i].iov_len) ||
-   put_user(compat_ptr(v.iov_base), [i].iov_base) ||
-   put_user(v.iov_len, [i].iov_len))
-   return -EFAULT;
-   }
-   return sys_vmsplice(fd, iov, nr_segs, flags);
- }
- 
 -static ssize_t compat_do_readv_writev(int type, struct file *file,
 - const struct compat_iovec __user *uvector,
 - unsigned long nr_segs, loff_t *pos)
 -{
 -  compat_ssize_t tot_len;
 -  struct iovec iovstack[UIO_FASTIOV];
 -  struct iovec *iov = iovstack;
 -  ssize_t ret;
 -  io_fn_t fn;
 -  iov_fn_t fnv;
 -
 -  ret = -EINVAL;
 -  if (!file->f_op)
 -  goto out;
 -
 -  ret = -EFAULT;
 -  if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
 -  goto out;
 -
 -  tot_len = compat_rw_copy_check_uvector(type, uvector, nr_segs,
 - UIO_FASTIOV, iovstack, );
 -  if (tot_len == 0) {
 -  ret = 0;
 -  goto out;
 -  }
 -
 -  ret = rw_verify_area(type, file, pos, tot_len);
 -  if (ret < 0)
 -  goto out;
 -
 -  fnv = NULL;
 -  if (type == READ) {
 -  fn = file->f_op->read;
 -  fnv = file->f_op->aio_read;
 -  } else {
 -  fn = (io_fn_t)file->f_op->write;
 -  fnv = file->f_op->aio_write;
 -  }
 -
 -  if (fnv)
 -  ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
 -  pos, fnv);
 -  else
 -  ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
 -
 -out:
 -  if (iov != iovstack)
 -  kfree(iov);
 -  if ((ret + (type == READ)) > 0) {
 -  if (type == READ)
 -  fsnotify_access(file);
 -  else
 -  fsnotify_modify(file);
 -  }
 -  return ret;
 -}
 -
 -static size_t compat_readv(struct file *file,
 - const struct compat_iovec __user *vec,
 - unsigned long vlen, loff_t *pos)
 -{
 -  ssize_t ret = -EBADF;
 -
 -  if (!(file->f_mode & FMODE_READ))
 -  goto out;
 -
 -  ret = -EINVAL;
 -  if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read))
 -  goto out;
 -
 -  ret = compat_do_readv_writev(READ, file, vec, vlen, pos);
 -
 -out:
 -  if (ret > 0)
 -  add_rchar(current, ret);
 -  inc_syscr(current);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
 -   unsigned long vlen)
 -{
 -  struct fd f = fdget(fd);
 -  ssize_t ret;
 -  loff_t pos;
 -
 -  if (!f.file)
 -  return -EBADF;
 -  pos = f.file->f_pos;
 -  ret = compat_readv(f.file, vec, vlen, );
 -  f.file->f_pos = pos;
 -  fdput(f);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_preadv64(unsigned long fd, const struct compat_iovec __user *vec,
 -  unsigned long vlen, loff_t pos)
 -{
 -  struct fd f;
 -  ssize_t ret;
 -
 -  if (pos < 0)
 -  return -EINVAL;
 -  f = fdget(fd);
 -  if (!f.file)
 -  return -EBADF;
 -  ret = -ESPIPE;
 -  if (f.file->f_mode & FMODE_PREAD)
 -  ret = compat_readv(f.file, vec, vlen, );
 -  fdput(f);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
 -unsigned long vlen, u32 pos_low, u32 pos_high)
 -{
 -  loff_t pos = ((loff_t)pos_high << 32) | pos_low;
 -  return compat_sys_preadv64(fd, vec, vlen, pos);
 -}
 -
 -static size_t 

linux-next: manual merge of the signal tree with the vfs tree

2013-04-03 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got conflicts in
fs/read_write.c and fs/read_write.h between commit 1fd193fd030a ("switch
compat readv/writev variants to COMPAT_SYSCALL_DEFINE") from the vfs tree
and commit 19f4fc3aee18 ("convert sendfile{,64} to
COMPAT_SYSCALL_DEFINE") from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/read_write.c
index e7d7bde,f738e4d..000
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@@ -903,203 -853,8 +887,203 @@@ SYSCALL_DEFINE5(pwritev, unsigned long
return ret;
  }
  
 +#ifdef CONFIG_COMPAT
 +
 +static ssize_t compat_do_readv_writev(int type, struct file *file,
 + const struct compat_iovec __user *uvector,
 + unsigned long nr_segs, loff_t *pos)
 +{
 +  compat_ssize_t tot_len;
 +  struct iovec iovstack[UIO_FASTIOV];
 +  struct iovec *iov = iovstack;
 +  ssize_t ret;
 +  io_fn_t fn;
 +  iov_fn_t fnv;
 +
 +  ret = -EINVAL;
 +  if (!file->f_op)
 +  goto out;
 +
 +  ret = -EFAULT;
 +  if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
 +  goto out;
 +
 +  ret = compat_rw_copy_check_uvector(type, uvector, nr_segs,
 + UIO_FASTIOV, iovstack, );
 +  if (ret <= 0)
 +  goto out;
 +
 +  tot_len = ret;
 +  ret = rw_verify_area(type, file, pos, tot_len);
 +  if (ret < 0)
 +  goto out;
 +
 +  fnv = NULL;
 +  if (type == READ) {
 +  fn = file->f_op->read;
 +  fnv = file->f_op->aio_read;
 +  } else {
 +  fn = (io_fn_t)file->f_op->write;
 +  fnv = file->f_op->aio_write;
 +  file_start_write(file);
 +  }
 +
 +  if (fnv)
 +  ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
 +  pos, fnv);
 +  else
 +  ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
 +
 +  if (type != READ)
 +  file_end_write(file);
 +
 +out:
 +  if (iov != iovstack)
 +  kfree(iov);
 +  if ((ret + (type == READ)) > 0) {
 +  if (type == READ)
 +  fsnotify_access(file);
 +  else
 +  fsnotify_modify(file);
 +  }
 +  return ret;
 +}
 +
 +static size_t compat_readv(struct file *file,
 + const struct compat_iovec __user *vec,
 + unsigned long vlen, loff_t *pos)
 +{
 +  ssize_t ret = -EBADF;
 +
 +  if (!(file->f_mode & FMODE_READ))
 +  goto out;
 +
 +  ret = -EINVAL;
 +  if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read))
 +  goto out;
 +
 +  ret = compat_do_readv_writev(READ, file, vec, vlen, pos);
 +
 +out:
 +  if (ret > 0)
 +  add_rchar(current, ret);
 +  inc_syscr(current);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen)
 +{
 +  struct fd f = fdget(fd);
 +  ssize_t ret;
 +  loff_t pos;
 +
 +  if (!f.file)
 +  return -EBADF;
 +  pos = f.file->f_pos;
 +  ret = compat_readv(f.file, vec, vlen, );
 +  f.file->f_pos = pos;
 +  fdput(f);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE4(preadv64, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen, loff_t, pos)
 +{
 +  struct fd f;
 +  ssize_t ret;
 +
 +  if (pos < 0)
 +  return -EINVAL;
 +  f = fdget(fd);
 +  if (!f.file)
 +  return -EBADF;
 +  ret = -ESPIPE;
 +  if (f.file->f_mode & FMODE_PREAD)
 +  ret = compat_readv(f.file, vec, vlen, );
 +  fdput(f);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen, u32, pos_low, u32, pos_high)
 +{
 +  loff_t pos = ((loff_t)pos_high << 32) | pos_low;
 +  return compat_sys_preadv64(fd, vec, vlen, pos);
 +}
 +
 +static size_t compat_writev(struct file *file,
 +  const struct compat_iovec __user *vec,
 +  unsigned long vlen, loff_t *pos)
 +{
 +  ssize_t ret = -EBADF;
 +
 +  if (!(file->f_mode & FMODE_WRITE))
 +  goto out;
 +
 +  ret = -EINVAL;
 +  if (!file->f_op || (!file->f_op->aio_write && !file->f_op->write))
 +  goto out;
 +
 +  ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos);
 +
 +out:
 +  if (ret > 0)
 +  add_wchar(current, ret);
 +  inc_syscw(current);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
 +   

linux-next: manual merge of the signal tree with the vfs tree

2013-04-03 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got conflicts in
fs/read_write.c and fs/read_write.h between commit 1fd193fd030a (switch
compat readv/writev variants to COMPAT_SYSCALL_DEFINE) from the vfs tree
and commit 19f4fc3aee18 (convert sendfile{,64} to
COMPAT_SYSCALL_DEFINE) from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/read_write.c
index e7d7bde,f738e4d..000
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@@ -903,203 -853,8 +887,203 @@@ SYSCALL_DEFINE5(pwritev, unsigned long
return ret;
  }
  
 +#ifdef CONFIG_COMPAT
 +
 +static ssize_t compat_do_readv_writev(int type, struct file *file,
 + const struct compat_iovec __user *uvector,
 + unsigned long nr_segs, loff_t *pos)
 +{
 +  compat_ssize_t tot_len;
 +  struct iovec iovstack[UIO_FASTIOV];
 +  struct iovec *iov = iovstack;
 +  ssize_t ret;
 +  io_fn_t fn;
 +  iov_fn_t fnv;
 +
 +  ret = -EINVAL;
 +  if (!file-f_op)
 +  goto out;
 +
 +  ret = -EFAULT;
 +  if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
 +  goto out;
 +
 +  ret = compat_rw_copy_check_uvector(type, uvector, nr_segs,
 + UIO_FASTIOV, iovstack, iov);
 +  if (ret = 0)
 +  goto out;
 +
 +  tot_len = ret;
 +  ret = rw_verify_area(type, file, pos, tot_len);
 +  if (ret  0)
 +  goto out;
 +
 +  fnv = NULL;
 +  if (type == READ) {
 +  fn = file-f_op-read;
 +  fnv = file-f_op-aio_read;
 +  } else {
 +  fn = (io_fn_t)file-f_op-write;
 +  fnv = file-f_op-aio_write;
 +  file_start_write(file);
 +  }
 +
 +  if (fnv)
 +  ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
 +  pos, fnv);
 +  else
 +  ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
 +
 +  if (type != READ)
 +  file_end_write(file);
 +
 +out:
 +  if (iov != iovstack)
 +  kfree(iov);
 +  if ((ret + (type == READ))  0) {
 +  if (type == READ)
 +  fsnotify_access(file);
 +  else
 +  fsnotify_modify(file);
 +  }
 +  return ret;
 +}
 +
 +static size_t compat_readv(struct file *file,
 + const struct compat_iovec __user *vec,
 + unsigned long vlen, loff_t *pos)
 +{
 +  ssize_t ret = -EBADF;
 +
 +  if (!(file-f_mode  FMODE_READ))
 +  goto out;
 +
 +  ret = -EINVAL;
 +  if (!file-f_op || (!file-f_op-aio_read  !file-f_op-read))
 +  goto out;
 +
 +  ret = compat_do_readv_writev(READ, file, vec, vlen, pos);
 +
 +out:
 +  if (ret  0)
 +  add_rchar(current, ret);
 +  inc_syscr(current);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen)
 +{
 +  struct fd f = fdget(fd);
 +  ssize_t ret;
 +  loff_t pos;
 +
 +  if (!f.file)
 +  return -EBADF;
 +  pos = f.file-f_pos;
 +  ret = compat_readv(f.file, vec, vlen, pos);
 +  f.file-f_pos = pos;
 +  fdput(f);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE4(preadv64, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen, loff_t, pos)
 +{
 +  struct fd f;
 +  ssize_t ret;
 +
 +  if (pos  0)
 +  return -EINVAL;
 +  f = fdget(fd);
 +  if (!f.file)
 +  return -EBADF;
 +  ret = -ESPIPE;
 +  if (f.file-f_mode  FMODE_PREAD)
 +  ret = compat_readv(f.file, vec, vlen, pos);
 +  fdput(f);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
 +  const struct compat_iovec __user *,vec,
 +  unsigned long, vlen, u32, pos_low, u32, pos_high)
 +{
 +  loff_t pos = ((loff_t)pos_high  32) | pos_low;
 +  return compat_sys_preadv64(fd, vec, vlen, pos);
 +}
 +
 +static size_t compat_writev(struct file *file,
 +  const struct compat_iovec __user *vec,
 +  unsigned long vlen, loff_t *pos)
 +{
 +  ssize_t ret = -EBADF;
 +
 +  if (!(file-f_mode  FMODE_WRITE))
 +  goto out;
 +
 +  ret = -EINVAL;
 +  if (!file-f_op || (!file-f_op-aio_write  !file-f_op-write))
 +  goto out;
 +
 +  ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos);
 +
 +out:
 +  if (ret  0)
 +  add_wchar(current, ret);
 +  inc_syscw(current);
 +  return ret;
 +}
 +
 +COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
 +  const struct 

linux-next: manual merge of the signal tree with the vfs tree

2013-04-03 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/compat.c
between commit 1fd193fd030a (switch compat readv/writev variants to
COMPAT_SYSCALL_DEFINE) from the vfs tree and commit 76b021d053ed
(convert vmsplice to COMPAT_SYSCALL_DEFINE) from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/compat.c
index 5058345,b7a89b9..000
--- a/fs/compat.c
+++ b/fs/compat.c
@@@ -1069,26 -1064,195 +1068,6 @@@ asmlinkage long compat_sys_getdents64(u
  }
  #endif /* ! __ARCH_OMIT_COMPAT_SYS_GETDENTS64 */
  
- asmlinkage long
- compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
-   unsigned int nr_segs, unsigned int flags)
- {
-   unsigned i;
-   struct iovec __user *iov;
-   if (nr_segs  UIO_MAXIOV)
-   return -EINVAL;
-   iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
-   for (i = 0; i  nr_segs; i++) {
-   struct compat_iovec v;
-   if (get_user(v.iov_base, iov32[i].iov_base) ||
-   get_user(v.iov_len, iov32[i].iov_len) ||
-   put_user(compat_ptr(v.iov_base), iov[i].iov_base) ||
-   put_user(v.iov_len, iov[i].iov_len))
-   return -EFAULT;
-   }
-   return sys_vmsplice(fd, iov, nr_segs, flags);
- }
- 
 -static ssize_t compat_do_readv_writev(int type, struct file *file,
 - const struct compat_iovec __user *uvector,
 - unsigned long nr_segs, loff_t *pos)
 -{
 -  compat_ssize_t tot_len;
 -  struct iovec iovstack[UIO_FASTIOV];
 -  struct iovec *iov = iovstack;
 -  ssize_t ret;
 -  io_fn_t fn;
 -  iov_fn_t fnv;
 -
 -  ret = -EINVAL;
 -  if (!file-f_op)
 -  goto out;
 -
 -  ret = -EFAULT;
 -  if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
 -  goto out;
 -
 -  tot_len = compat_rw_copy_check_uvector(type, uvector, nr_segs,
 - UIO_FASTIOV, iovstack, iov);
 -  if (tot_len == 0) {
 -  ret = 0;
 -  goto out;
 -  }
 -
 -  ret = rw_verify_area(type, file, pos, tot_len);
 -  if (ret  0)
 -  goto out;
 -
 -  fnv = NULL;
 -  if (type == READ) {
 -  fn = file-f_op-read;
 -  fnv = file-f_op-aio_read;
 -  } else {
 -  fn = (io_fn_t)file-f_op-write;
 -  fnv = file-f_op-aio_write;
 -  }
 -
 -  if (fnv)
 -  ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
 -  pos, fnv);
 -  else
 -  ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
 -
 -out:
 -  if (iov != iovstack)
 -  kfree(iov);
 -  if ((ret + (type == READ))  0) {
 -  if (type == READ)
 -  fsnotify_access(file);
 -  else
 -  fsnotify_modify(file);
 -  }
 -  return ret;
 -}
 -
 -static size_t compat_readv(struct file *file,
 - const struct compat_iovec __user *vec,
 - unsigned long vlen, loff_t *pos)
 -{
 -  ssize_t ret = -EBADF;
 -
 -  if (!(file-f_mode  FMODE_READ))
 -  goto out;
 -
 -  ret = -EINVAL;
 -  if (!file-f_op || (!file-f_op-aio_read  !file-f_op-read))
 -  goto out;
 -
 -  ret = compat_do_readv_writev(READ, file, vec, vlen, pos);
 -
 -out:
 -  if (ret  0)
 -  add_rchar(current, ret);
 -  inc_syscr(current);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
 -   unsigned long vlen)
 -{
 -  struct fd f = fdget(fd);
 -  ssize_t ret;
 -  loff_t pos;
 -
 -  if (!f.file)
 -  return -EBADF;
 -  pos = f.file-f_pos;
 -  ret = compat_readv(f.file, vec, vlen, pos);
 -  f.file-f_pos = pos;
 -  fdput(f);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_preadv64(unsigned long fd, const struct compat_iovec __user *vec,
 -  unsigned long vlen, loff_t pos)
 -{
 -  struct fd f;
 -  ssize_t ret;
 -
 -  if (pos  0)
 -  return -EINVAL;
 -  f = fdget(fd);
 -  if (!f.file)
 -  return -EBADF;
 -  ret = -ESPIPE;
 -  if (f.file-f_mode  FMODE_PREAD)
 -  ret = compat_readv(f.file, vec, vlen, pos);
 -  fdput(f);
 -  return ret;
 -}
 -
 -asmlinkage ssize_t
 -compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
 -unsigned long vlen, u32 pos_low, u32 pos_high)
 -{
 -  loff_t pos = ((loff_t)pos_high  32) | pos_low;
 -  return compat_sys_preadv64(fd, vec, vlen, pos);
 -}
 -
 -static size_t compat_writev(struct file 

linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/powerpc/kernel/sys_ppc32.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit be6abfa769fa ("powerpc: switch to generic sys_execve()/
kernel_execve()") from the signal tree.

The latter removed removed the function that was modified by the former,
so I did that and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgprL16u9rWqs.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/powerpc/kernel/process.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit be6abfa769fa ("powerpc: switch to generic sys_execve
()/kernel_execve()") from the signal tree.

The latter rewrote the function modified by the former, so I used the
latter and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpmXS6GlFxAM.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/mn10300/kernel/process.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit 8f1597e959a3 ("mn10300: switch to generic sys_execve()") from the
signal tree.

The latter removed the function modified by the former, so I did that and
can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpFd7pouOU5N.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/m68k/kernel/process.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit d878d6dacee2 ("m68k: switch to generic sys_execve()/kernel_execve()")
from the signal tree.

The latter removed the function that the latter modified, so I did that
and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp5RTyAq5xpI.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/frv/kernel/process.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit 460dabab73f2 ("frv: switch to generic sys_execve()") from the
signal tree.

The latter removed the function updated by the former, so I just did that
and can carry the fix as necessary (no action is required).


-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpclYGxelHVo.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/c6x/kernel/process.c between commit 2a5e5beb88c5 ("vfs: define
struct filename and have getname() return it") from the vfs tree and
commit 680a14535c33 ("c6x: switch to generic sys_execve") from the signal
tree.

The latter removes the function modified by the former so I did that and
can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp5Mf08QFuUc.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/c6x/kernel/process.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit 680a14535c33 (c6x: switch to generic sys_execve) from the signal
tree.

The latter removes the function modified by the former so I did that and
can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp5Mf08QFuUc.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/frv/kernel/process.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit 460dabab73f2 (frv: switch to generic sys_execve()) from the
signal tree.

The latter removed the function updated by the former, so I just did that
and can carry the fix as necessary (no action is required).


-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpclYGxelHVo.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/m68k/kernel/process.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit d878d6dacee2 (m68k: switch to generic sys_execve()/kernel_execve())
from the signal tree.

The latter removed the function that the latter modified, so I did that
and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp5RTyAq5xpI.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/mn10300/kernel/process.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit 8f1597e959a3 (mn10300: switch to generic sys_execve()) from the
signal tree.

The latter removed the function modified by the former, so I did that and
can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpFd7pouOU5N.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/powerpc/kernel/process.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit be6abfa769fa (powerpc: switch to generic sys_execve
()/kernel_execve()) from the signal tree.

The latter rewrote the function modified by the former, so I used the
latter and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpmXS6GlFxAM.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-11 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in
arch/powerpc/kernel/sys_ppc32.c between commit 2a5e5beb88c5 (vfs: define
struct filename and have getname() return it) from the vfs tree and
commit be6abfa769fa (powerpc: switch to generic sys_execve()/
kernel_execve()) from the signal tree.

The latter removed removed the function that was modified by the former,
so I did that and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgprL16u9rWqs.pgp
Description: PGP signature


linux-next: manual merge of the signal tree with the vfs tree

2012-10-01 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/exec.c
between commit 5b8a94d461a7 ("coredump: move core dump functionality into
its own file") from the vfs tree and commits 282124d18626 ("generic
kernel_execve()") and 38b983b3461e ("generic sys_execve()") from the signal 
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/exec.c
index 48fb26e,50a1270..000
--- a/fs/exec.c
+++ b/fs/exec.c
@@@ -1645,3 -2031,342 +1644,55 @@@ int get_dumpable(struct mm_struct *mm
  {
return __get_dumpable(mm->flags);
  }
+ 
 -static void wait_for_dump_helpers(struct file *file)
 -{
 -  struct pipe_inode_info *pipe;
 -
 -  pipe = file->f_path.dentry->d_inode->i_pipe;
 -
 -  pipe_lock(pipe);
 -  pipe->readers++;
 -  pipe->writers--;
 -
 -  while ((pipe->readers > 1) && (!signal_pending(current))) {
 -  wake_up_interruptible_sync(>wait);
 -  kill_fasync(>fasync_readers, SIGIO, POLL_IN);
 -  pipe_wait(pipe);
 -  }
 -
 -  pipe->readers--;
 -  pipe->writers++;
 -  pipe_unlock(pipe);
 -
 -}
 -
 -
 -/*
 - * umh_pipe_setup
 - * helper function to customize the process used
 - * to collect the core in userspace.  Specifically
 - * it sets up a pipe and installs it as fd 0 (stdin)
 - * for the process.  Returns 0 on success, or
 - * PTR_ERR on failure.
 - * Note that it also sets the core limit to 1.  This
 - * is a special value that we use to trap recursive
 - * core dumps
 - */
 -static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 -{
 -  struct file *files[2];
 -  struct fdtable *fdt;
 -  struct coredump_params *cp = (struct coredump_params *)info->data;
 -  struct files_struct *cf = current->files;
 -  int err = create_pipe_files(files, 0);
 -  if (err)
 -  return err;
 -
 -  cp->file = files[1];
 -
 -  sys_close(0);
 -  fd_install(0, files[0]);
 -  spin_lock(>file_lock);
 -  fdt = files_fdtable(cf);
 -  __set_open_fd(0, fdt);
 -  __clear_close_on_exec(0, fdt);
 -  spin_unlock(>file_lock);
 -
 -  /* and disallow core files too */
 -  current->signal->rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 -
 -  return 0;
 -}
 -
 -void do_coredump(long signr, int exit_code, struct pt_regs *regs)
 -{
 -  struct core_state core_state;
 -  struct core_name cn;
 -  struct mm_struct *mm = current->mm;
 -  struct linux_binfmt * binfmt;
 -  const struct cred *old_cred;
 -  struct cred *cred;
 -  int retval = 0;
 -  int flag = 0;
 -  int ispipe;
 -  bool need_nonrelative = false;
 -  static atomic_t core_dump_count = ATOMIC_INIT(0);
 -  struct coredump_params cprm = {
 -  .signr = signr,
 -  .regs = regs,
 -  .limit = rlimit(RLIMIT_CORE),
 -  /*
 -   * We must use the same mm->flags while dumping core to avoid
 -   * inconsistency of bit flags, since this flag is not protected
 -   * by any locks.
 -   */
 -  .mm_flags = mm->flags,
 -  };
 -
 -  audit_core_dumps(signr);
 -
 -  binfmt = mm->binfmt;
 -  if (!binfmt || !binfmt->core_dump)
 -  goto fail;
 -  if (!__get_dumpable(cprm.mm_flags))
 -  goto fail;
 -
 -  cred = prepare_creds();
 -  if (!cred)
 -  goto fail;
 -  /*
 -   * We cannot trust fsuid as being the "true" uid of the process
 -   * nor do we know its entire history. We only know it was tainted
 -   * so we dump it as root in mode 2, and only into a controlled
 -   * environment (pipe handler or fully qualified path).
 -   */
 -  if (__get_dumpable(cprm.mm_flags) == SUID_DUMPABLE_SAFE) {
 -  /* Setuid core dump mode */
 -  flag = O_EXCL;  /* Stop rewrite attacks */
 -  cred->fsuid = GLOBAL_ROOT_UID;  /* Dump root private */
 -  need_nonrelative = true;
 -  }
 -
 -  retval = coredump_wait(exit_code, _state);
 -  if (retval < 0)
 -  goto fail_creds;
 -
 -  old_cred = override_creds(cred);
 -
 -  /*
 -   * Clear any false indication of pending signals that might
 -   * be seen by the filesystem code called to write the core file.
 -   */
 -  clear_thread_flag(TIF_SIGPENDING);
 -
 -  ispipe = format_corename(, signr);
 -
 -  if (ispipe) {
 -  int dump_count;
 -  char **helper_argv;
 -
 -  if (ispipe < 0) {
 -  printk(KERN_WARNING "format_corename failed\n");
 -  printk(KERN_WARNING "Aborting core\n");
 -  goto fail_corename;
 -  }
 -
 -  if (cprm.limit == 1) {
 -  /* See umh_pipe_setup() which sets RLIMIT_CORE = 1.
 -  

linux-next: manual merge of the signal tree with the vfs tree

2012-10-01 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/exec.c
between commit 5b8a94d461a7 (coredump: move core dump functionality into
its own file) from the vfs tree and commits 282124d18626 (generic
kernel_execve()) and 38b983b3461e (generic sys_execve()) from the signal 
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/exec.c
index 48fb26e,50a1270..000
--- a/fs/exec.c
+++ b/fs/exec.c
@@@ -1645,3 -2031,342 +1644,55 @@@ int get_dumpable(struct mm_struct *mm
  {
return __get_dumpable(mm-flags);
  }
+ 
 -static void wait_for_dump_helpers(struct file *file)
 -{
 -  struct pipe_inode_info *pipe;
 -
 -  pipe = file-f_path.dentry-d_inode-i_pipe;
 -
 -  pipe_lock(pipe);
 -  pipe-readers++;
 -  pipe-writers--;
 -
 -  while ((pipe-readers  1)  (!signal_pending(current))) {
 -  wake_up_interruptible_sync(pipe-wait);
 -  kill_fasync(pipe-fasync_readers, SIGIO, POLL_IN);
 -  pipe_wait(pipe);
 -  }
 -
 -  pipe-readers--;
 -  pipe-writers++;
 -  pipe_unlock(pipe);
 -
 -}
 -
 -
 -/*
 - * umh_pipe_setup
 - * helper function to customize the process used
 - * to collect the core in userspace.  Specifically
 - * it sets up a pipe and installs it as fd 0 (stdin)
 - * for the process.  Returns 0 on success, or
 - * PTR_ERR on failure.
 - * Note that it also sets the core limit to 1.  This
 - * is a special value that we use to trap recursive
 - * core dumps
 - */
 -static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 -{
 -  struct file *files[2];
 -  struct fdtable *fdt;
 -  struct coredump_params *cp = (struct coredump_params *)info-data;
 -  struct files_struct *cf = current-files;
 -  int err = create_pipe_files(files, 0);
 -  if (err)
 -  return err;
 -
 -  cp-file = files[1];
 -
 -  sys_close(0);
 -  fd_install(0, files[0]);
 -  spin_lock(cf-file_lock);
 -  fdt = files_fdtable(cf);
 -  __set_open_fd(0, fdt);
 -  __clear_close_on_exec(0, fdt);
 -  spin_unlock(cf-file_lock);
 -
 -  /* and disallow core files too */
 -  current-signal-rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 -
 -  return 0;
 -}
 -
 -void do_coredump(long signr, int exit_code, struct pt_regs *regs)
 -{
 -  struct core_state core_state;
 -  struct core_name cn;
 -  struct mm_struct *mm = current-mm;
 -  struct linux_binfmt * binfmt;
 -  const struct cred *old_cred;
 -  struct cred *cred;
 -  int retval = 0;
 -  int flag = 0;
 -  int ispipe;
 -  bool need_nonrelative = false;
 -  static atomic_t core_dump_count = ATOMIC_INIT(0);
 -  struct coredump_params cprm = {
 -  .signr = signr,
 -  .regs = regs,
 -  .limit = rlimit(RLIMIT_CORE),
 -  /*
 -   * We must use the same mm-flags while dumping core to avoid
 -   * inconsistency of bit flags, since this flag is not protected
 -   * by any locks.
 -   */
 -  .mm_flags = mm-flags,
 -  };
 -
 -  audit_core_dumps(signr);
 -
 -  binfmt = mm-binfmt;
 -  if (!binfmt || !binfmt-core_dump)
 -  goto fail;
 -  if (!__get_dumpable(cprm.mm_flags))
 -  goto fail;
 -
 -  cred = prepare_creds();
 -  if (!cred)
 -  goto fail;
 -  /*
 -   * We cannot trust fsuid as being the true uid of the process
 -   * nor do we know its entire history. We only know it was tainted
 -   * so we dump it as root in mode 2, and only into a controlled
 -   * environment (pipe handler or fully qualified path).
 -   */
 -  if (__get_dumpable(cprm.mm_flags) == SUID_DUMPABLE_SAFE) {
 -  /* Setuid core dump mode */
 -  flag = O_EXCL;  /* Stop rewrite attacks */
 -  cred-fsuid = GLOBAL_ROOT_UID;  /* Dump root private */
 -  need_nonrelative = true;
 -  }
 -
 -  retval = coredump_wait(exit_code, core_state);
 -  if (retval  0)
 -  goto fail_creds;
 -
 -  old_cred = override_creds(cred);
 -
 -  /*
 -   * Clear any false indication of pending signals that might
 -   * be seen by the filesystem code called to write the core file.
 -   */
 -  clear_thread_flag(TIF_SIGPENDING);
 -
 -  ispipe = format_corename(cn, signr);
 -
 -  if (ispipe) {
 -  int dump_count;
 -  char **helper_argv;
 -
 -  if (ispipe  0) {
 -  printk(KERN_WARNING format_corename failed\n);
 -  printk(KERN_WARNING Aborting core\n);
 -  goto fail_corename;
 -  }
 -
 -  if (cprm.limit == 1) {
 -  /* See umh_pipe_setup() which sets RLIMIT_CORE = 1.
 - 

Re: linux-next: manual merge of the signal tree with the vfs tree

2012-09-28 Thread Al Viro
On Fri, Sep 28, 2012 at 03:56:39PM +1000, Stephen Rothwell wrote:
> Hi Al,
> 
> Today's linux-next merge of the signal tree got a conflict in fs/exec.c
> between commit 5b8a94d461a7 ("coredump: move core dump functionality into
> its own file") from the vfs tree and commits 70446600fa12 ("arm:
> introduce ret_from_kernel_execve(), switch to generic kernel_execve()")
> and 5e41814a7d8b ("arm: get rid of execve wrapper, switch to generic
> execve() implementation") from the signal tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).
> 
> BTW, Al, you have that vfs tree commit (and others) authored by you ...

Gyah...  Will fix ASAP; sorry, guys.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the signal tree with the vfs tree

2012-09-28 Thread Al Viro
On Fri, Sep 28, 2012 at 03:56:39PM +1000, Stephen Rothwell wrote:
 Hi Al,
 
 Today's linux-next merge of the signal tree got a conflict in fs/exec.c
 between commit 5b8a94d461a7 (coredump: move core dump functionality into
 its own file) from the vfs tree and commits 70446600fa12 (arm:
 introduce ret_from_kernel_execve(), switch to generic kernel_execve())
 and 5e41814a7d8b (arm: get rid of execve wrapper, switch to generic
 execve() implementation) from the signal tree.
 
 I fixed it up (see below) and can carry the fix as necessary (no action
 is required).
 
 BTW, Al, you have that vfs tree commit (and others) authored by you ...

Gyah...  Will fix ASAP; sorry, guys.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the signal tree with the vfs tree

2012-09-27 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/exec.c
between commit 5b8a94d461a7 ("coredump: move core dump functionality into
its own file") from the vfs tree and commits 70446600fa12 ("arm:
introduce ret_from_kernel_execve(), switch to generic kernel_execve()")
and 5e41814a7d8b ("arm: get rid of execve wrapper, switch to generic
execve() implementation") from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

BTW, Al, you have that vfs tree commit (and others) authored by you ...
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/exec.c
index 48fb26e,df8b282..000
--- a/fs/exec.c
+++ b/fs/exec.c
@@@ -1645,3 -2031,345 +1644,58 @@@ int get_dumpable(struct mm_struct *mm
  {
return __get_dumpable(mm->flags);
  }
+ 
 -static void wait_for_dump_helpers(struct file *file)
 -{
 -  struct pipe_inode_info *pipe;
 -
 -  pipe = file->f_path.dentry->d_inode->i_pipe;
 -
 -  pipe_lock(pipe);
 -  pipe->readers++;
 -  pipe->writers--;
 -
 -  while ((pipe->readers > 1) && (!signal_pending(current))) {
 -  wake_up_interruptible_sync(>wait);
 -  kill_fasync(>fasync_readers, SIGIO, POLL_IN);
 -  pipe_wait(pipe);
 -  }
 -
 -  pipe->readers--;
 -  pipe->writers++;
 -  pipe_unlock(pipe);
 -
 -}
 -
 -
 -/*
 - * umh_pipe_setup
 - * helper function to customize the process used
 - * to collect the core in userspace.  Specifically
 - * it sets up a pipe and installs it as fd 0 (stdin)
 - * for the process.  Returns 0 on success, or
 - * PTR_ERR on failure.
 - * Note that it also sets the core limit to 1.  This
 - * is a special value that we use to trap recursive
 - * core dumps
 - */
 -static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 -{
 -  struct file *files[2];
 -  struct fdtable *fdt;
 -  struct coredump_params *cp = (struct coredump_params *)info->data;
 -  struct files_struct *cf = current->files;
 -  int err = create_pipe_files(files, 0);
 -  if (err)
 -  return err;
 -
 -  cp->file = files[1];
 -
 -  sys_close(0);
 -  fd_install(0, files[0]);
 -  spin_lock(>file_lock);
 -  fdt = files_fdtable(cf);
 -  __set_open_fd(0, fdt);
 -  __clear_close_on_exec(0, fdt);
 -  spin_unlock(>file_lock);
 -
 -  /* and disallow core files too */
 -  current->signal->rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 -
 -  return 0;
 -}
 -
 -void do_coredump(long signr, int exit_code, struct pt_regs *regs)
 -{
 -  struct core_state core_state;
 -  struct core_name cn;
 -  struct mm_struct *mm = current->mm;
 -  struct linux_binfmt * binfmt;
 -  const struct cred *old_cred;
 -  struct cred *cred;
 -  int retval = 0;
 -  int flag = 0;
 -  int ispipe;
 -  bool need_nonrelative = false;
 -  static atomic_t core_dump_count = ATOMIC_INIT(0);
 -  struct coredump_params cprm = {
 -  .signr = signr,
 -  .regs = regs,
 -  .limit = rlimit(RLIMIT_CORE),
 -  /*
 -   * We must use the same mm->flags while dumping core to avoid
 -   * inconsistency of bit flags, since this flag is not protected
 -   * by any locks.
 -   */
 -  .mm_flags = mm->flags,
 -  };
 -
 -  audit_core_dumps(signr);
 -
 -  binfmt = mm->binfmt;
 -  if (!binfmt || !binfmt->core_dump)
 -  goto fail;
 -  if (!__get_dumpable(cprm.mm_flags))
 -  goto fail;
 -
 -  cred = prepare_creds();
 -  if (!cred)
 -  goto fail;
 -  /*
 -   * We cannot trust fsuid as being the "true" uid of the process
 -   * nor do we know its entire history. We only know it was tainted
 -   * so we dump it as root in mode 2, and only into a controlled
 -   * environment (pipe handler or fully qualified path).
 -   */
 -  if (__get_dumpable(cprm.mm_flags) == SUID_DUMPABLE_SAFE) {
 -  /* Setuid core dump mode */
 -  flag = O_EXCL;  /* Stop rewrite attacks */
 -  cred->fsuid = GLOBAL_ROOT_UID;  /* Dump root private */
 -  need_nonrelative = true;
 -  }
 -
 -  retval = coredump_wait(exit_code, _state);
 -  if (retval < 0)
 -  goto fail_creds;
 -
 -  old_cred = override_creds(cred);
 -
 -  /*
 -   * Clear any false indication of pending signals that might
 -   * be seen by the filesystem code called to write the core file.
 -   */
 -  clear_thread_flag(TIF_SIGPENDING);
 -
 -  ispipe = format_corename(, signr);
 -
 -  if (ispipe) {
 -  int dump_count;
 -  char **helper_argv;
 -
 -  if (ispipe < 0) {
 -  printk(KERN_WARNING "format_corename failed\n");
 -  printk(KERN_WARNING "Aborting core\n");
 -   

linux-next: manual merge of the signal tree with the vfs tree

2012-09-27 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the signal tree got a conflict in fs/exec.c
between commit 5b8a94d461a7 (coredump: move core dump functionality into
its own file) from the vfs tree and commits 70446600fa12 (arm:
introduce ret_from_kernel_execve(), switch to generic kernel_execve())
and 5e41814a7d8b (arm: get rid of execve wrapper, switch to generic
execve() implementation) from the signal tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

BTW, Al, you have that vfs tree commit (and others) authored by you ...
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/exec.c
index 48fb26e,df8b282..000
--- a/fs/exec.c
+++ b/fs/exec.c
@@@ -1645,3 -2031,345 +1644,58 @@@ int get_dumpable(struct mm_struct *mm
  {
return __get_dumpable(mm-flags);
  }
+ 
 -static void wait_for_dump_helpers(struct file *file)
 -{
 -  struct pipe_inode_info *pipe;
 -
 -  pipe = file-f_path.dentry-d_inode-i_pipe;
 -
 -  pipe_lock(pipe);
 -  pipe-readers++;
 -  pipe-writers--;
 -
 -  while ((pipe-readers  1)  (!signal_pending(current))) {
 -  wake_up_interruptible_sync(pipe-wait);
 -  kill_fasync(pipe-fasync_readers, SIGIO, POLL_IN);
 -  pipe_wait(pipe);
 -  }
 -
 -  pipe-readers--;
 -  pipe-writers++;
 -  pipe_unlock(pipe);
 -
 -}
 -
 -
 -/*
 - * umh_pipe_setup
 - * helper function to customize the process used
 - * to collect the core in userspace.  Specifically
 - * it sets up a pipe and installs it as fd 0 (stdin)
 - * for the process.  Returns 0 on success, or
 - * PTR_ERR on failure.
 - * Note that it also sets the core limit to 1.  This
 - * is a special value that we use to trap recursive
 - * core dumps
 - */
 -static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 -{
 -  struct file *files[2];
 -  struct fdtable *fdt;
 -  struct coredump_params *cp = (struct coredump_params *)info-data;
 -  struct files_struct *cf = current-files;
 -  int err = create_pipe_files(files, 0);
 -  if (err)
 -  return err;
 -
 -  cp-file = files[1];
 -
 -  sys_close(0);
 -  fd_install(0, files[0]);
 -  spin_lock(cf-file_lock);
 -  fdt = files_fdtable(cf);
 -  __set_open_fd(0, fdt);
 -  __clear_close_on_exec(0, fdt);
 -  spin_unlock(cf-file_lock);
 -
 -  /* and disallow core files too */
 -  current-signal-rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 -
 -  return 0;
 -}
 -
 -void do_coredump(long signr, int exit_code, struct pt_regs *regs)
 -{
 -  struct core_state core_state;
 -  struct core_name cn;
 -  struct mm_struct *mm = current-mm;
 -  struct linux_binfmt * binfmt;
 -  const struct cred *old_cred;
 -  struct cred *cred;
 -  int retval = 0;
 -  int flag = 0;
 -  int ispipe;
 -  bool need_nonrelative = false;
 -  static atomic_t core_dump_count = ATOMIC_INIT(0);
 -  struct coredump_params cprm = {
 -  .signr = signr,
 -  .regs = regs,
 -  .limit = rlimit(RLIMIT_CORE),
 -  /*
 -   * We must use the same mm-flags while dumping core to avoid
 -   * inconsistency of bit flags, since this flag is not protected
 -   * by any locks.
 -   */
 -  .mm_flags = mm-flags,
 -  };
 -
 -  audit_core_dumps(signr);
 -
 -  binfmt = mm-binfmt;
 -  if (!binfmt || !binfmt-core_dump)
 -  goto fail;
 -  if (!__get_dumpable(cprm.mm_flags))
 -  goto fail;
 -
 -  cred = prepare_creds();
 -  if (!cred)
 -  goto fail;
 -  /*
 -   * We cannot trust fsuid as being the true uid of the process
 -   * nor do we know its entire history. We only know it was tainted
 -   * so we dump it as root in mode 2, and only into a controlled
 -   * environment (pipe handler or fully qualified path).
 -   */
 -  if (__get_dumpable(cprm.mm_flags) == SUID_DUMPABLE_SAFE) {
 -  /* Setuid core dump mode */
 -  flag = O_EXCL;  /* Stop rewrite attacks */
 -  cred-fsuid = GLOBAL_ROOT_UID;  /* Dump root private */
 -  need_nonrelative = true;
 -  }
 -
 -  retval = coredump_wait(exit_code, core_state);
 -  if (retval  0)
 -  goto fail_creds;
 -
 -  old_cred = override_creds(cred);
 -
 -  /*
 -   * Clear any false indication of pending signals that might
 -   * be seen by the filesystem code called to write the core file.
 -   */
 -  clear_thread_flag(TIF_SIGPENDING);
 -
 -  ispipe = format_corename(cn, signr);
 -
 -  if (ispipe) {
 -  int dump_count;
 -  char **helper_argv;
 -
 -  if (ispipe  0) {
 -  printk(KERN_WARNING format_corename failed\n);
 -  printk(KERN_WARNING Aborting core\n);
 -