Skip to content
Snippets Groups Projects
  1. Oct 11, 2010
  2. Aug 31, 2010
  3. Aug 29, 2010
  4. Aug 28, 2010
  5. Aug 27, 2010
    • Julia Lawall's avatar
      net/ipv4: Eliminate kstrdup memory leak · c34186ed
      Julia Lawall authored
      The string clone is only used as a temporary copy of the argument val
      within the while loop, and so it should be freed before leaving the
      function.  The call to strsep, however, modifies clone, so a pointer to the
      front of the string is kept in saved_clone, to make it possible to free it.
      
      The sematic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/
      
      )
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E;
      identifier l;
      statement S;
      @@
      
      *x= \(kasprintf\|kstrdup\)(...);
      ...
      if (x == NULL) S
      ... when != kfree(x)
          when != E = x
      if (...) {
        <... when != kfree(x)
      * goto l;
        ...>
      * return ...;
      }
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c34186ed
    • Eric Paris's avatar
      fsnotify: drop two useless bools in the fnsotify main loop · 92b4678e
      Eric Paris authored
      
      The fsnotify main loop has 2 bools which indicated if we processed the
      inode or vfsmount mark in that particular pass through the loop.  These
      bool can we replaced with the inode_group and vfsmount_group variables
      and actually make the code a little easier to understand.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      92b4678e
    • Eric Paris's avatar
      fsnotify: fix list walk order · f72adfd5
      Eric Paris authored
      
      Marks were stored on the inode and vfsmonut mark list in order from
      highest memory address to lowest memory address.  The code to walk those
      lists thought they were in order from lowest to highest with
      unpredictable results when trying to match up marks from each.  It was
      possible that extra events would be sent to userspace when inode
      marks ignoring events wouldn't get matched with the vfsmount marks.
      
      This problem only affected fanotify when using both vfsmount and inode
      marks simultaneously.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      f72adfd5
Loading