[kernel] r9232 - in dists/sid/linux-2.6/debian: . patches/bugfix/hppa patches/series

Dann Frazier dannf at alioth.debian.org
Mon Jul 30 17:23:35 UTC 2007


Author: dannf
Date: Mon Jul 30 17:23:35 2007
New Revision: 9232

Log:
* [hppa] Use generic compat_sys_getdents (closes: #431773)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/use-generic-compat_sys_getdents.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/4

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Mon Jul 30 17:23:35 2007
@@ -1,8 +1,12 @@
 linux-2.6 (2.6.22-4) UNRELEASED; urgency=low
 
+  [ Sven Luther ]
   * [powerpc] Added Genesi Efika support.
 
- -- Sven Luther <sven at powerlinux.fr>  Sun, 29 Jul 2007 15:11:31 +0200
+  [ dann frazier ]
+  * [hppa] Use generic compat_sys_getdents (closes: #431773)
+
+ -- dann frazier <dannf at debian.org>  Mon, 30 Jul 2007 11:23:31 -0600
 
 linux-2.6 (2.6.22-3) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/hppa/use-generic-compat_sys_getdents.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/hppa/use-generic-compat_sys_getdents.patch	Mon Jul 30 17:23:35 2007
@@ -0,0 +1,184 @@
+From 0deea67e075b5152d427426583500b8d9cf0a56c Mon Sep 17 00:00:00 2001
+From: Kyle McMartin <kyle at parisc-linux.org>
+Date: Fri, 29 Jun 2007 03:38:10 -0400
+Subject: [PARISC] Use compat_sys_getdents
+
+Switch to using the generic compat_sys_getdents instead of a
+homebrew one.
+
+Signed-off-by: Kyle McMartin <kyle at parisc-linux.org>
+---
+ arch/parisc/kernel/sys_parisc32.c  |  141 ------------------------------------
+ arch/parisc/kernel/syscall_table.S |    4 +-
+ 2 files changed, 1 insertions(+), 144 deletions(-)
+
+diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
+index bb23ff7..2989c66 100644
+--- a/arch/parisc/kernel/sys_parisc32.c
++++ b/arch/parisc/kernel/sys_parisc32.c
+@@ -285,147 +285,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
+ 	return err;
+ }
+ 
+-struct linux32_dirent {
+-	u32		d_ino;
+-	compat_off_t	d_off;
+-	u16		d_reclen;
+-	char		d_name[1];
+-};
+-
+-struct old_linux32_dirent {
+-	u32	d_ino;
+-	u32	d_offset;
+-	u16	d_namlen;
+-	char	d_name[1];
+-};
+-
+-struct getdents32_callback {
+-	struct linux32_dirent __user * current_dir;
+-	struct linux32_dirent __user * previous;
+-	int count;
+-	int error;
+-};
+-
+-struct readdir32_callback {
+-	struct old_linux32_dirent __user * dirent;
+-	int count;
+-};
+-
+-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
+-static int filldir32 (void *__buf, const char *name, int namlen,
+-			loff_t offset, u64 ino, unsigned int d_type)
+-{
+-	struct linux32_dirent __user * dirent;
+-	struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
+-	int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
+-	u32 d_ino;
+-
+-	buf->error = -EINVAL;	/* only used if we fail.. */
+-	if (reclen > buf->count)
+-		return -EINVAL;
+-	d_ino = ino;
+-	if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
+-		return -EOVERFLOW;
+-	dirent = buf->previous;
+-	if (dirent)
+-		put_user(offset, &dirent->d_off);
+-	dirent = buf->current_dir;
+-	buf->previous = dirent;
+-	put_user(d_ino, &dirent->d_ino);
+-	put_user(reclen, &dirent->d_reclen);
+-	copy_to_user(dirent->d_name, name, namlen);
+-	put_user(0, dirent->d_name + namlen);
+-	dirent = ((void __user *)dirent) + reclen;
+-	buf->current_dir = dirent;
+-	buf->count -= reclen;
+-	return 0;
+-}
+-
+-asmlinkage long
+-sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
+-{
+-	struct file * file;
+-	struct linux32_dirent __user * lastdirent;
+-	struct getdents32_callback buf;
+-	int error;
+-
+-	error = -EFAULT;
+-	if (!access_ok(VERIFY_WRITE, dirent, count))
+-		goto out;
+-
+-	error = -EBADF;
+-	file = fget(fd);
+-	if (!file)
+-		goto out;
+-
+-	buf.current_dir = (struct linux32_dirent __user *) dirent;
+-	buf.previous = NULL;
+-	buf.count = count;
+-	buf.error = 0;
+-
+-	error = vfs_readdir(file, filldir32, &buf);
+-	if (error < 0)
+-		goto out_putf;
+-	error = buf.error;
+-	lastdirent = buf.previous;
+-	if (lastdirent) {
+-		if (put_user(file->f_pos, &lastdirent->d_off))
+-			error = -EFAULT;
+-		else
+-			error = count - buf.count;
+-	}
+-
+-out_putf:
+-	fput(file);
+-out:
+-	return error;
+-}
+-
+-static int fillonedir32(void * __buf, const char * name, int namlen,
+-			loff_t offset, u64 ino, unsigned int d_type)
+-{
+-	struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
+-	struct old_linux32_dirent __user * dirent;
+-	u32 d_ino;
+-
+-	if (buf->count)
+-		return -EINVAL;
+-	d_ino = ino;
+-	if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
+-		return -EOVERFLOW;
+-	buf->count++;
+-	dirent = buf->dirent;
+-	put_user(d_ino, &dirent->d_ino);
+-	put_user(offset, &dirent->d_offset);
+-	put_user(namlen, &dirent->d_namlen);
+-	copy_to_user(dirent->d_name, name, namlen);
+-	put_user(0, dirent->d_name + namlen);
+-	return 0;
+-}
+-
+-asmlinkage long
+-sys32_readdir (unsigned int fd, void __user * dirent, unsigned int count)
+-{
+-	int error;
+-	struct file * file;
+-	struct readdir32_callback buf;
+-
+-	error = -EBADF;
+-	file = fget(fd);
+-	if (!file)
+-		goto out;
+-
+-	buf.count = 0;
+-	buf.dirent = dirent;
+-
+-	error = vfs_readdir(file, fillonedir32, &buf);
+-	if (error >= 0)
+-		error = buf.count;
+-	fput(file);
+-out:
+-	return error;
+-}
+-
+ /*** copied from mips64 ***/
+ /*
+  * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
+diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
+index 627f3c2..2540786 100644
+--- a/arch/parisc/kernel/syscall_table.S
++++ b/arch/parisc/kernel/syscall_table.S
+@@ -222,9 +222,7 @@
+ 	ENTRY_SAME(setfsgid)
+ 	/* I think this might work */
+ 	ENTRY_SAME(llseek)		/* 140 */
+-	/* struct linux_dirent has longs, like 'unsigned long d_ino' which
+-	 * almost definitely should be 'ino_t d_ino' but it's too late now */
+-	ENTRY_DIFF(getdents)
++	ENTRY_COMP(getdents)
+ 	/* it is POSSIBLE that select will be OK because even though fd_set
+ 	 * contains longs, the macros and sizes are clever. */
+ 	ENTRY_COMP(select)
+-- 
+1.5.2.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/4
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/4	(original)
+++ dists/sid/linux-2.6/debian/patches/series/4	Mon Jul 30 17:23:35 2007
@@ -25,3 +25,4 @@
 + features/powerpc/efika/11675_mpc5200_rtc_driver.patch
 + features/powerpc/efika/11861_mpc52xx_sparse_fixes.patch
 + features/powerpc/efika/12626_mpx5200_uart_drop_port_lock_across_tty_flip_buffer_call.patch
++ bugfix/hppa/use-generic-compat_sys_getdents.patch



More information about the Kernel-svn-changes mailing list