Re: d_path() truncating excessive long path name vulnerability

From: Solar Designer (solar@openwall.com)
Date: 11/28/02

  • Next message: vALDEUx@aol.com: "Security Patch for PortailPHP 0.99"
    Date: Thu, 28 Nov 2002 21:00:41 +0300
    From: Solar Designer <solar@openwall.com>
    To: Paul Szabo <psz@maths.usyd.edu.au>
    
    

    On Wed, Nov 27, 2002 at 01:04:04PM +1100, Paul Szabo wrote:
    > Back in March 2002, Wojciech Purczynski <cliph@isec.pl> wrote (original
    > article at http://online.securityfocus.com/archive/1/264117 ):
    >
    > > Name: Linux kernel
    > > Version: up to 2.2.20 and 2.4.18
    > > ...
    > > In case of excessively long path names d_path kernel internal function
    > > returns truncated trailing components of a path name instead of an error
    > > value. As this function is called by getcwd(2) system call and
    > > do_proc_readlink() function, false information may be returned to
    > > user-space processes.
    >
    > The problem is still present in Debian 2.4.19 kernel. I have not tried 2.5,
    > but see nothing relevant in the Changelogs at http://www.kernel.org/ .

    FWIW, I've included a workaround for this (covering the getcwd(2) case
    only, not other uses of d_path() by the kernel or modules) in 2.2.21-ow1
    patch and it went into 2.2.22 release in September.

    This kind of proves the need for double-checking newer kernel branches
    (2.4.x and 2.5.x currently) for fixes going into what many consider
    stable kernels.

    -- 
    /sd
    


    Relevant Pages

    • Re: RT patch acceptance
      ... judge the complexity of a design for that type of system. ... claim that you cannot judge the complexity of a kernel modification. ... Since the patch in question doesn't actually need that information to ... nanokernel's API up to date with additions to Linux's API that RT people ...
      (Linux-Kernel)
    • Re: inline asm semantics: output constraint width smaller than input
      ... Now in this case the patch you suggest might end up hurting the end result ... The below patch is to build the kernel for x86_64, ... # Device Drivers ... # PCI IDE chipsets support ...
      (Linux-Kernel)
    • [RFC] Making percpu module variables have their own memory.
      ... Someone using the -rt patch found that one of the tracing options caused ... 64K for every CPU to cover all the per_cpu variables used in the kernel ... static void wakeup_softirqd_prio ...
      (Linux-Kernel)
    • Re: This is [Re:] How to improve the quality of the kernel[?].
      ... The -mm kernel already implements what your proposed PTS would do. ... If patch have no TS ID, ... Thus i can apply for example lguest patches and implement and test new ... How many open source projects use Bugzilla and how many use the Debian BTS? ...
      (Linux-Kernel)
    • Re: Documentation - how to apply patches for various trees
      ... >> explanation of the various kernel trees and how to apply their patches. ... +a patch to the kernel or, more specifically, what base kernel a patch for ... +and what new version the patch will change the source tree into. ...
      (Linux-Kernel)