{17/17} - nopage-range-fix.patch (CVE-2008-0007) - series for stable kernel
Subsystems (5)
Signature · 2 lines
Thanks, Oliver
commit 7a848b2ce457a41a97ec059af9658cfccb551e60
Author: Nick Piggin <[email protected]> Date: Mon Jan 28 21:19:34 2008 +0100
Subject: insufficient range checks of certain fault handlers (CVE-2008-0007)
References: 353207
Patch-upstream: not yet
This patch is a security fix for CVE-2008-0007. See bugzilla for details.
drivers/char/drm/drm_vm.c +2 -0
@@ -520,6 +520,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) vma->vm_ops = &drm_vm_dma_ops; vma->vm_flags |=VM_RESERVED ;/* Don't swap */ + vma->vm_flags |=VM_DONTEXPAND ; vma->vm_file = filp;/* Needed for drm_vm_open() */ drm_vm_open_locked (vma);
@@ -669,6 +670,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)return -EINVAL ;/* This should never happen. */ } vma->vm_flags |=VM_RESERVED ;/* Don't swap */ + vma->vm_flags |=VM_DONTEXPAND ; vma->vm_file = filp;/* Needed for drm_vm_open() */ drm_vm_open_locked (vma);
drivers/char/mspec.c +1 -1
@@ -265,7 +265,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma, int type) vdata->refcnt =ATOMIC_INIT (1 ); vma->vm_private_data = vdata; - vma->vm_flags |= (VM_IO |VM_LOCKED |VM_RESERVED |VM_PFNMAP ); + vma->vm_flags |= (VM_IO |VM_LOCKED |VM_RESERVED |VM_PFNMAP |VM_DONTEXPAND );if (vdata->type ==MSPEC_FETCHOP || vdata->type ==MSPEC_UNCACHED ) vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); vma->vm_ops = &mspec_vm_ops;
kernel/relay.c +1 -0
@@ -91,6 +91,7 @@ int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma)return -EINVAL ; vma->vm_ops = &relay_file_mmap_ops; + vma->vm_flags |=VM_DONTEXPAND ; vma->vm_private_data = buf; buf->chan->cb->buf_mapped (buf, filp);
mm/mmap.c +1 -1
@@ -2157,7 +2157,7 @@ int install_special_mapping(struct mm_struct *mm, vma->vm_start = addr; vma->vm_end = addr + len; - vma->vm_flags = vm_flags | mm->def_flags; + vma->vm_flags = vm_flags | mm->def_flags |VM_DONTEXPAND ; vma->vm_page_prot = protection_map[vma->vm_flags &7 ]; vma->vm_ops = &special_mapping_vmops;
sound/oss/emu10k1/audio.c +1 -1
@@ -1111,7 +1111,7 @@ static int emu10k1_audio_mmap(struct file *file, struct vm_area_struct *vma)if (pgoffset + n_pages > max_pages)return -EINVAL ; - vma->vm_flags |=VM_RESERVED ; + vma->vm_flags |=VM_RESERVED |VM_DONTEXPAND ; vma->vm_ops = &emu10k1_mm_ops; vma->vm_private_data = wave_dev;return 0 ;
sound/oss/via82cxxx_audio.c +6 -8
@@ -2104,6 +2104,7 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma, {struct via_info *card = vma->vm_private_data;struct via_channel *chan = &card->ch_out; +unsigned long max_bufs;struct page *dmapage;unsigned long pgoff;int rd, wr;
@@ -2127,14 +2128,11 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma, rd = card->ch_in.is_mapped; wr = card->ch_out.is_mapped; -#ifndef VIA_NDEBUG - { -unsigned long max_bufs = chan->frag_number; -if (rd && wr) max_bufs *=2 ; -/* via_dsp_mmap() should ensure this */ -assert (pgoff < max_bufs); - } -#endif + max_bufs = chan->frag_number; +if (rd && wr) + max_bufs *=2 ; +if (pgoff >= max_bufs) +return NOPAGE_SIGBUS ;/* if full-duplex (read+write) and we have two sets of bufs, * then the playback buffers come first, sez soundcard.c */
sound/usb/usx2y/usX2Yhwdep.c +1 -1
@@ -88,7 +88,7 @@ static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct v us428->us428ctls_sharedmem->CtlSnapShotLast =-2 ; } area->vm_ops = &us428ctls_vm_ops; - area->vm_flags |=VM_RESERVED ; + area->vm_flags |=VM_RESERVED |VM_DONTEXPAND ; area->vm_private_data = hw->private_data;return 0 ; }
sound/usb/usx2y/usx2yhwdeppcm.c +1 -1
@@ -728,7 +728,7 @@ static int snd_usX2Y_hwdep_pcm_mmap(struct snd_hwdep * hw, struct file *filp, streturn -ENODEV ; } area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; - area->vm_flags |=VM_RESERVED ; + area->vm_flags |=VM_RESERVED |VM_DONTEXPAND ; area->vm_private_data = hw->private_data;return 0 ; }