linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Fix oops related to 4xx flush_tlb_page modification
@ 2007-11-09  9:58 Kumar Gala
  2007-11-09 21:11 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2007-11-09  9:58 UTC (permalink / raw)
  To: linuxppc-dev

kmap_atomic calls flush_tlb_page with a NULL VMA and thus we end
up dereferencing a NULL pointer to try and get the context.id.

If the VMA is null use the global pid value of 0.

---
 include/asm-powerpc/tlbflush.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h
index e7b4c0d..5c91081 100644
--- a/include/asm-powerpc/tlbflush.h
+++ b/include/asm-powerpc/tlbflush.h
@@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 				  unsigned long vmaddr)
 {
-	_tlbie(vmaddr, vma->vm_mm->context.id);
+	_tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
 }

 static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
 					 unsigned long vmaddr)
 {
-	_tlbie(vmaddr, vma->vm_mm->context.id);
+	_tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
 }

 static inline void flush_tlb_range(struct vm_area_struct *vma,
-- 
1.5.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [POWERPC] Fix oops related to 4xx flush_tlb_page modification
  2007-11-09  9:58 [PATCH] [POWERPC] Fix oops related to 4xx flush_tlb_page modification Kumar Gala
@ 2007-11-09 21:11 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-09 21:11 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev


On Fri, 2007-11-09 at 03:58 -0600, Kumar Gala wrote:
> kmap_atomic calls flush_tlb_page with a NULL VMA and thus we end
> up dereferencing a NULL pointer to try and get the context.id.
> 
> If the VMA is null use the global pid value of 0.

Ack.

> ---
>  include/asm-powerpc/tlbflush.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h
> index e7b4c0d..5c91081 100644
> --- a/include/asm-powerpc/tlbflush.h
> +++ b/include/asm-powerpc/tlbflush.h
> @@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
>  static inline void flush_tlb_page(struct vm_area_struct *vma,
>  				  unsigned long vmaddr)
>  {
> -	_tlbie(vmaddr, vma->vm_mm->context.id);
> +	_tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
>  }
> 
>  static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
>  					 unsigned long vmaddr)
>  {
> -	_tlbie(vmaddr, vma->vm_mm->context.id);
> +	_tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0);
>  }
> 
>  static inline void flush_tlb_range(struct vm_area_struct *vma,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-09 21:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09  9:58 [PATCH] [POWERPC] Fix oops related to 4xx flush_tlb_page modification Kumar Gala
2007-11-09 21:11 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).