29 Jun, 2006

1 commit

  • The recent vsnprintf() fix introduced an off-by-one, and it's now
    possible to overrun the target buffer by one byte.

    The "end" pointer points to past the end of the buffer, so if we
    have to truncate the result, it needs to be done though "end[-1]".

    [ This is just an alternate and simpler patch to one proposed by Andrew
    and Jeremy, who actually noticed the problem ]

    Acked-by: Andrew Morton
    Acked-by: Jeremy Fitzhardinge
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

26 Jun, 2006

2 commits

  • Implement kasprintf, a kernel version of asprintf. This allocates the
    memory required for the formatted string, including the trailing '\0'.
    Returns NULL on allocation failure.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • This change allows callers to use a 0-byte buffer and a NULL buffer pointer
    with vsnprintf, so it can be used to determine how large the resulting
    formatted string will be.

    Previously the code effectively treated a size of 0 as a size of 4G (on
    32-bit systems), with other checks preventing it from actually trying to
    emit the string - but the terminal \0 would still be written, which would
    crash if the buffer is NULL.

    This change changes the boundary check so that 'end' points to the putative
    location of the terminal '\0', which is only written if size > 0.

    vsnprintf still allows the buffer size to be set very large, to allow
    unbounded buffer sizes (to implement sprintf, etc).

    [akpm@osdl.org: fix long-vs-longlong confusion]
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     

31 Oct, 2005

1 commit

  • I recently picked up my older work to remove unnecessary #includes of
    sched.h, starting from a patch by Dave Jones to not include sched.h
    from module.h. This reduces the number of indirect includes of sched.h
    by ~300. Another ~400 pointless direct includes can be removed after
    this disentangling (patch to follow later).
    However, quite a few indirect includes need to be fixed up for this.

    In order to feed the patches through -mm with as little disturbance as
    possible, I've split out the fixes I accumulated up to now (complete for
    i386 and x86_64, more archs to follow later) and post them before the real
    patch. This way this large part of the patch is kept simple with only
    adding #includes, and all hunks are independent of each other. So if any
    hunk rejects or gets in the way of other patches, just drop it. My scripts
    will pick it up again in the next round.

    Signed-off-by: Tim Schmielau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

24 Aug, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds