Andrew Morton wrote:

> 
> Parfait found a large number of real kernel bugs, so we hope that
> people will run it regularly.  To help those people in their project it
> would be good to a) report false positives to the parfait developers
> and b) rework the kernel code to make the false positives go away, so
> people don't keep reporting and "fixing" them.
> 


My recommendation is to fix this as follows because you really don't
want to walk off either end of the array because it will cause kgdb to
fail internally.

Roel, does this satisfy Parfait?

The original fix you provided did not check the other end of the
array, which is actually a case that is plausible if gdb were to send
"junk" via a gdb serial request.  Either way should generate a stack
dump to the console so as to debug kgdb's internal failure.

---
 kernel/kgdb.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -541,12 +541,19 @@ static struct task_struct *getthread(str
         */
        if (tid == 0 || tid == -1)
                tid = -atomic_read(&kgdb_active) - 2;
-       if (tid < 0) {
+       if (tid < -1 && tid > -NR_CPUS - 2) {
                if (kgdb_info[-tid - 2].task)
                        return kgdb_info[-tid - 2].task;
                else
                        return idle_task(-tid - 2);
        }
+       if (tid <= 0) {
+               printk(KERN_ERR "KGDB: Internal thread select error\n")
+               dump_stack();
+               return NULL;
+       }
 
        /*
         * find_task_by_pid_ns() does not take the tasklist lock anymore

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to