lkml.org 
[lkml]   [2009]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/4] security/selinux: decrement sizeof size in strncmp
    On Thu, 12 Nov 2009, Casey Schaufler wrote:

    > I strongly suggest that this is not what is wanted.
    > strcmp(x,y)
    > and
    > strncmp(x,y,sizeof(y))
    >
    > are functionally equivalent and strcmp has a bad reputation in
    > the security community because it is associated with potential
    > buffer overrun issues.

    Do you see potential for a buffer overrun in this case?

    The strings being compared are "sysfs" and the name field of 'struct
    file_system_type'. The kernel code elsewhere assumes the latter string to
    be a valid zero-terminated string, and we should, too.


    - James
    --
    James Morris
    <jmorris@namei.org>


    \
     
     \ /
      Last update: 2009-11-12 22:45    [W:2.627 / U:0.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site