lkml.org 
[lkml]   [2007]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
    On Fri, 1 Jun 2007 15:41:48 -0700 (PDT)
    Christoph Lameter <clameter@sgi.com> wrote:

    > On Fri, 1 Jun 2007, Andrew Morton wrote:
    >
    > > > I should make SLUB put poisoning values in unused areas of a kmalloced
    > > > object?
    > >
    > > hm, I hadn't thought of it that way actually. I was thinking it was
    > > specific to kmalloc(0) but as you point out, the situation is
    > > generalisable.
    >
    > Right it could catch a lot of other bugs as well.
    >
    > > Yes, if someone does kmalloc(42) and we satisfy the allocation from the
    > > size-64 slab, we should poison and then check the allegedly-unused 22
    > > bytes.
    > >
    > > Please ;)
    > >
    > > (vaguely stunned that we didn't think of doing this years ago).
    >
    > Well there are architectural problems. We determine the power of two slab
    > at compile time. The object size information is currently not available in
    > the binary :=).
    >
    > > It'll be a large patch, I expect?
    >
    > Ummm... Yes. We need to switch off the compile time power of two slab
    > calculation. Then I need to have some way of storing the object size in
    > the metainformation of each object. Changes a lot of function calls.

    Oh well. Don't lose any sleep over it ;)

    <loses sleep>

    We could store the size of the allocation in the allocated object? Just
    add four bytes to the user's request, then pick the appropriate cache based
    on that, then put the user's `size' at the tail of the resulting allocation?

    So a kmalloc(62) would get upped to 66, so we allocate from size-128
    and put the number 62 at bytes 124-127 and we poison bytes 62-123?
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-06-02 01:05    [W:3.030 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site