Re: No need for 2.4.23 - How to do it?
On Sun, 2003-12-07 at 16:12, Thomas H. George wrote:
> On Sun, Dec 07, 2003 at 12:35:06AM +0100, Andreas Goesele wrote:
> > Mark C <lists@funkypenguin.net> writes:
> >
> > > same here from the debian sources, but with a few added patches,
> > > there is no need to download a new kernel, just get the source you have
> > > for the currently running kernel, apply this patch:
> > >
> > > ---------------------- cut ---------------------
> > > --- 1.31/mm/mmap.c Fri Sep 12 06:44:06 2003
> > > +++ 1.32/mm/mmap.c Thu Oct 2 01:18:19 2003
> > > @@ -1041,6 +1041,9 @@
> > > if (!len)
> > > return addr;
> > >
> > > + if ((addr + len) > TASK_SIZE || (addr + len) < addr)
> > > + return -EINVAL;
> > > +
> > > /*
> > > * mlock MCL_FUTURE?
> > > */
> > > ---------------------- cut ---------------------
> > >
> > > and recompile, this was taken originally from, Debian Planet.
> >
> > With 2.4.21 I get:
> >
> > $ patch -p1 < mm.patch
> > patching file mm/mmap.c
> > Hunk #1 FAILED at 1041.
> > 1 out of 1 hunk FAILED -- saving rejects to file mm/mmap.c.rej
> >
> > In mmap.c.rej I find:
> >
> >
> > **************
> > *** 1041,1046 ****
> > if (!len)
> > return addr;
> >
> > /*
> > * mlock MCL_FUTURE?
> > */
> > --- 1041,1049 ----
> > if (!len)
> > return addr;
> >
> > + if ((addr + len) > TASK_SIZE || (addr + len) < addr)
> > + return -EINVAL;
> > +
> > /*
> > * mlock MCL_FUTURE?
> > */
> >
> > What am I doing wrong?
> >
> > Andreas Goesele
> >
> > --
> > Omnis enim res, quae dando non deficit, dum habetur et non datur,
> > nondum habetur, quomodo habenda est.
> > Augustinus, De doctrina christiana
> >
> I would like to apply this patch but have no idea how to do it. I
> frequently compile kernels from the already patched kernel-source's so
> kernel-source-2.4.22 is on hand. Are there instructions somewhere which
> show step-by-step how and where to insert the above instructions?
If patch fails, the reason is probably that the code being patched does
not look sufficiently like the original code *in* the patch for patch to
recognise which lines are to be changed. The solution is to edit the
relevant file yourself (mm/mmap.c), go to the indicated source lines
(1041,1046) and look for where to make the change. Just insert the
lines marked with + in the right place.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And if thy hand offend thee, cut it off; it is better
for thee to enter into life maimed, than having two
hands to go into hell, into the fire that never shall
be quenched." Mark 9:43
Reply to: