[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Not possible to compile kernel with woody



>>>>> "JB" == Jakob Borg <jb@replicant.nu> writes:

    JB> However, trying to run "make {,old,x,menu}config" in
    JB> newly distributed (non-patched) kernels (I tried 2.2.15 and
    JB> 2.3.99pre8) fails with a segfault. 

  I finally got fed up with this and chased it down.

--- bash-2.04/unwind_prot.c.orig        Tue May 23 18:07:51 2000
+++ bash-2.04/unwind_prot.c     Tue May 23 18:08:17 2000
@@ -300,7 +300,7 @@
       if (value == 0)
        bzero ((char *)s->desired_setting, size);
       else
-       FASTCOPY (value, (char *)s->desired_setting, size);
+       FASTCOPY (var, (char *)s->desired_setting, size);
     }
   else
     s->desired_setting = value;

  Simple, neh? Ha! In terms of hours spent per changed characters in
patch, this ranks in my all time top ten. I'm also not entirely sure
that it's correct, as I would have expected something this simple to
cause a lot more problems.

  If I /was/ certain, I would delicately and with all due respect
suggest that the hoops that the unwind protection code jumps through
w.r.t. sizeof(int)-sized data elements are either too much or too
little.

  Too much, since that special case obscured this buglet. Too little,
since if you're concerned about speed, you could extend the principle
out to special casing size <= sizeof(long) and using a union in
the appropriate place.

  I was going to submit a patch to do the above, but having spent a
little too long burrowing around in 35-stack-frame-deep coredumps and
dealing with a foreign frame unwinding system whilst in pursuit of
something that, at first blush, looks dead on for being a simple
buffer overrun, I'm going to bed. I have a headache.

m.



Reply to: