Kernel BUG in r5-rc14 kernel, but blank screen persists

Discuss porting Android to any device.

Kernel BUG in r5-rc14 kernel, but blank screen persists

Postby ZHANG xiangfeng » Mon May 05, 2008 2:55 am

I am porting android m5-rc15 file system to N810. I find a bug in kernel, which would lead to NULL pointer dereference in app_process.

The bug in in file drivers/android/binder.c, function binder_update_page_range(). struct tmp_area in "unmap_vm_area(&tmp_area)" is not initialized if allocate is 0. My new code is like this:
Syntax: [ Download ] [ Hide ]
Using c Syntax Highlighting
  1.   int vm_ins_err_f=0;
  2.  
  3.    ...
  4.  
  5.    if(ret) {
  6.  
  7.        ...
  8.  
  9.    }
  10.  
  11.    //user_page_addr = proc->vma->vm_start + page_addr - proc->buffer;
  12.  
  13.    if(proc->vma == NULL) {
  14.  
  15.       printk(KERN_ERR "binder: %d: binder_alloc_buf failed to map page at %lx in userspace, no vma\n",  proc->pid);
  16.  
  17.       vm_ins_err_f = 1;
  18.  
  19.       goto err_vm_insert_page_failed;
  20.  
  21.    }
  22.  
  23.    user_page_addr = proc->vma->vm_start + page_addr - proc->buffer;
  24.  
  25.    ret = vm_insert_page(proc->vma, user_page_addr, page[0]);
  26.  
  27.    if(ret) {
  28.  
  29.       printk(KERN_ERR "binder: %d: binder_alloc_buf failed to map page at %lx in userspace\n",proc->pid, user_page_addr);
  30.  
  31.       vm_ins_err_f = 1;
  32.  
  33.       goto err_vm_insert_page_failed;
  34.  
  35.    }
  36.  
  37.     ...
  38.  
  39. err_vm_insert_page_failed:
  40.  
  41.    if(vm_ins_err_f==1) {
  42.  
  43.       vm_ins_err_f=2;
  44.  
  45.       unmap_vm_area(&tmp_area);
  46.  
  47.    }
  48.  
  49. }
  50.  
  51. err_map_kernel_failed:
  52.  
  53.    ...
Parsed in 0.004 seconds, using GeSHi 1.0.8.4



After the bug is removed, the problem persists: I still got a blank screen(no red-eye at all).

Anyone succeeded in porting m5 user space to N810?
ZHANG xiangfeng
Once Poster
Once Poster
 
Posts: 1
Joined: Mon May 05, 2008 2:36 am

Top

Return to Porting Android

Who is online

Users browsing this forum: No registered users and 1 guest