[PATCH 03/11] Get rid of verify_area() - everything in sound/.
Convert a bunch of verify_area()'s to access_ok(). Everything in sound/. Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/core/hwdep.c linux-2.6.11-rc1-bk4/sound/core/hwdep.c --- linux-2.6.11-rc1-bk4-orig/sound/core/hwdep.c2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/core/hwdep.c 2005-01-16 22:13:12.0 +0100 @@ -223,7 +223,7 @@ static int snd_hwdep_dsp_load(snd_hwdep_ /* check whether the dsp was already loaded */ if (hw->dsp_loaded & (1 << info.index)) return -EBUSY; - if (verify_area(VERIFY_READ, info.image, info.length)) + if (!access_ok(VERIFY_READ, info.image, info.length)) return -EFAULT; err = hw->ops.dsp_load(hw, ); if (err < 0) diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/core/seq/seq_clientmgr.c linux-2.6.11-rc1-bk4/sound/core/seq/seq_clientmgr.c --- linux-2.6.11-rc1-bk4-orig/sound/core/seq/seq_clientmgr.c2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/core/seq/seq_clientmgr.c 2005-01-16 22:12:38.0 +0100 @@ -375,7 +375,7 @@ static ssize_t snd_seq_read(struct file if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT)) return -ENXIO; - if (verify_area(VERIFY_WRITE, buf, count)) + if (!access_ok(VERIFY_WRITE, buf, count)) return -EFAULT; /* check client structures are in place */ diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/isa/sb/emu8000_patch.c linux-2.6.11-rc1-bk4/sound/isa/sb/emu8000_patch.c --- linux-2.6.11-rc1-bk4-orig/sound/isa/sb/emu8000_patch.c 2004-12-24 22:34:01.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/isa/sb/emu8000_patch.c 2005-01-16 22:07:18.0 +0100 @@ -183,10 +183,10 @@ snd_emu8000_sample_new(snd_emux_t *rec, } if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS) { - if (verify_area(VERIFY_READ, data, sp->v.size)) + if (!access_ok(VERIFY_READ, data, sp->v.size)) return -EFAULT; } else { - if (verify_area(VERIFY_READ, data, sp->v.size * 2)) + if (!access_ok(VERIFY_READ, data, sp->v.size * 2)) return -EFAULT; } diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/oss/btaudio.c linux-2.6.11-rc1-bk4/sound/oss/btaudio.c --- linux-2.6.11-rc1-bk4-orig/sound/oss/btaudio.c 2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/oss/btaudio.c2005-01-16 22:10:49.0 +0100 @@ -558,7 +558,7 @@ static ssize_t btaudio_dsp_read(struct f __s16 __user *dst = (__s16 __user *)(buffer + ret); __s16 avg; int n = ndst>>1; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE, dst, ndst)) { if (0 == ret) ret = -EFAULT; break; @@ -574,7 +574,7 @@ static ssize_t btaudio_dsp_read(struct f __u8 *src = bta->buf_cpu + bta->read_offset; __u8 __user *dst = buffer + ret; int n = ndst; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE, dst, ndst)) { if (0 == ret) ret = -EFAULT; break; @@ -587,7 +587,7 @@ static ssize_t btaudio_dsp_read(struct f __u16 *src = (__u16*)(bta->buf_cpu + bta->read_offset); __u16 __user *dst = (__u16 __user *)(buffer + ret); int n = ndst>>1; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE,dst,ndst)) { if (0 == ret) ret = -EFAULT; break; diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/oss/soundcard.c linux-2.6.11-rc1-bk4/sound/oss/soundcard.c --- linux-2.6.11-rc1-bk4-orig/sound/oss/soundcard.c 2005-01-12 23:26:33.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/oss/soundcard.c 2005-01-16 22:12:12.0 +0100 @@ -341,11 +341,11 @@ static int sound_ioctl(struct inode *ino if (len < 1 || len > 65536 || !p) return -EFAULT; if (_SIOC_DIR(cmd) & _SIOC_WRITE) - if ((err = verify_area(VERIFY_READ, p, len)) < 0) - return err; + if (!access_ok(VERIFY_READ, p, len)) + return -EFAULT; if (_SIOC_DIR(cmd) & _SIOC_READ) - if ((err = verify_area(VERIFY_WRITE, p, len)) < 0) -
[PATCH 03/11] Get rid of verify_area() - everything in sound/.
Convert a bunch of verify_area()'s to access_ok(). Everything in sound/. Signed-off-by: Jesper Juhl [EMAIL PROTECTED] diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/core/hwdep.c linux-2.6.11-rc1-bk4/sound/core/hwdep.c --- linux-2.6.11-rc1-bk4-orig/sound/core/hwdep.c2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/core/hwdep.c 2005-01-16 22:13:12.0 +0100 @@ -223,7 +223,7 @@ static int snd_hwdep_dsp_load(snd_hwdep_ /* check whether the dsp was already loaded */ if (hw-dsp_loaded (1 info.index)) return -EBUSY; - if (verify_area(VERIFY_READ, info.image, info.length)) + if (!access_ok(VERIFY_READ, info.image, info.length)) return -EFAULT; err = hw-ops.dsp_load(hw, info); if (err 0) diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/core/seq/seq_clientmgr.c linux-2.6.11-rc1-bk4/sound/core/seq/seq_clientmgr.c --- linux-2.6.11-rc1-bk4-orig/sound/core/seq/seq_clientmgr.c2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/core/seq/seq_clientmgr.c 2005-01-16 22:12:38.0 +0100 @@ -375,7 +375,7 @@ static ssize_t snd_seq_read(struct file if (!(snd_seq_file_flags(file) SNDRV_SEQ_LFLG_INPUT)) return -ENXIO; - if (verify_area(VERIFY_WRITE, buf, count)) + if (!access_ok(VERIFY_WRITE, buf, count)) return -EFAULT; /* check client structures are in place */ diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/isa/sb/emu8000_patch.c linux-2.6.11-rc1-bk4/sound/isa/sb/emu8000_patch.c --- linux-2.6.11-rc1-bk4-orig/sound/isa/sb/emu8000_patch.c 2004-12-24 22:34:01.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/isa/sb/emu8000_patch.c 2005-01-16 22:07:18.0 +0100 @@ -183,10 +183,10 @@ snd_emu8000_sample_new(snd_emux_t *rec, } if (sp-v.mode_flags SNDRV_SFNT_SAMPLE_8BITS) { - if (verify_area(VERIFY_READ, data, sp-v.size)) + if (!access_ok(VERIFY_READ, data, sp-v.size)) return -EFAULT; } else { - if (verify_area(VERIFY_READ, data, sp-v.size * 2)) + if (!access_ok(VERIFY_READ, data, sp-v.size * 2)) return -EFAULT; } diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/oss/btaudio.c linux-2.6.11-rc1-bk4/sound/oss/btaudio.c --- linux-2.6.11-rc1-bk4-orig/sound/oss/btaudio.c 2005-01-12 23:26:32.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/oss/btaudio.c2005-01-16 22:10:49.0 +0100 @@ -558,7 +558,7 @@ static ssize_t btaudio_dsp_read(struct f __s16 __user *dst = (__s16 __user *)(buffer + ret); __s16 avg; int n = ndst1; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE, dst, ndst)) { if (0 == ret) ret = -EFAULT; break; @@ -574,7 +574,7 @@ static ssize_t btaudio_dsp_read(struct f __u8 *src = bta-buf_cpu + bta-read_offset; __u8 __user *dst = buffer + ret; int n = ndst; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE, dst, ndst)) { if (0 == ret) ret = -EFAULT; break; @@ -587,7 +587,7 @@ static ssize_t btaudio_dsp_read(struct f __u16 *src = (__u16*)(bta-buf_cpu + bta-read_offset); __u16 __user *dst = (__u16 __user *)(buffer + ret); int n = ndst1; - if (0 != verify_area(VERIFY_WRITE,dst,ndst)) { + if (!access_ok(VERIFY_WRITE,dst,ndst)) { if (0 == ret) ret = -EFAULT; break; diff -urp --exclude='*~' linux-2.6.11-rc1-bk4-orig/sound/oss/soundcard.c linux-2.6.11-rc1-bk4/sound/oss/soundcard.c --- linux-2.6.11-rc1-bk4-orig/sound/oss/soundcard.c 2005-01-12 23:26:33.0 +0100 +++ linux-2.6.11-rc1-bk4/sound/oss/soundcard.c 2005-01-16 22:12:12.0 +0100 @@ -341,11 +341,11 @@ static int sound_ioctl(struct inode *ino if (len 1 || len 65536 || !p) return -EFAULT; if (_SIOC_DIR(cmd) _SIOC_WRITE) - if ((err = verify_area(VERIFY_READ, p, len)) 0) - return err; + if (!access_ok(VERIFY_READ, p, len)) + return -EFAULT; if (_SIOC_DIR(cmd) _SIOC_READ) - if ((err = verify_area(VERIFY_WRITE, p, len)) 0) -