1. 08 12月, 2011 1 次提交
  2. 07 12月, 2011 5 次提交
    • A
      fix apparmor dereferencing potentially freed dentry, sanitize __d_path() API · 02125a82
      Al Viro 提交于
      __d_path() API is asking for trouble and in case of apparmor d_namespace_path()
      getting just that.  The root cause is that when __d_path() misses the root
      it had been told to look for, it stores the location of the most remote ancestor
      in *root.  Without grabbing references.  Sure, at the moment of call it had
      been pinned down by what we have in *path.  And if we raced with umount -l, we
      could have very well stopped at vfsmount/dentry that got freed as soon as
      prepend_path() dropped vfsmount_lock.
      
      It is safe to compare these pointers with pre-existing (and known to be still
      alive) vfsmount and dentry, as long as all we are asking is "is it the same
      address?".  Dereferencing is not safe and apparmor ended up stepping into
      that.  d_namespace_path() really wants to examine the place where we stopped,
      even if it's not connected to our namespace.  As the result, it looked
      at ->d_sb->s_magic of a dentry that might've been already freed by that point.
      All other callers had been careful enough to avoid that, but it's really
      a bad interface - it invites that kind of trouble.
      
      The fix is fairly straightforward, even though it's bigger than I'd like:
      	* prepend_path() root argument becomes const.
      	* __d_path() is never called with NULL/NULL root.  It was a kludge
      to start with.  Instead, we have an explicit function - d_absolute_root().
      Same as __d_path(), except that it doesn't get root passed and stops where
      it stops.  apparmor and tomoyo are using it.
      	* __d_path() returns NULL on path outside of root.  The main
      caller is show_mountinfo() and that's precisely what we pass root for - to
      skip those outside chroot jail.  Those who don't want that can (and do)
      use d_path().
      	* __d_path() root argument becomes const.  Everyone agrees, I hope.
      	* apparmor does *NOT* try to use __d_path() or any of its variants
      when it sees that path->mnt is an internal vfsmount.  In that case it's
      definitely not mounted anywhere and dentry_path() is exactly what we want
      there.  Handling of sysctl()-triggered weirdness is moved to that place.
      	* if apparmor is asked to do pathname relative to chroot jail
      and __d_path() tells it we it's not in that jail, the sucker just calls
      d_absolute_path() instead.  That's the other remaining caller of __d_path(),
      BTW.
              * seq_path_root() does _NOT_ return -ENAMETOOLONG (it's stupid anyway -
      the normal seq_file logics will take care of growing the buffer and redoing
      the call of ->show() just fine).  However, if it gets path not reachable
      from root, it returns SEQ_SKIP.  The only caller adjusted (i.e. stopped
      ignoring the return value as it used to do).
      Reviewed-by: NJohn Johansen <john.johansen@canonical.com>
      ACKed-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      02125a82
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · b835c0f4
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: Silence seq_scale() unused warning
        ipv4:correct description for tcp_max_syn_backlog
        pasemi_mac: Fix building as module
        netback: Fix alert message.
        r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
        r8169: Rx FIFO overflow fixes.
        ipv4: Fix peer validation on cached lookup.
        ipv4: make sure RTO_ONLINK is saved in routing cache
        iwlwifi: change the default behavior of watchdog timer
        iwlwifi: do not re-configure HT40 after associated
        iwlagn: fix HW crypto for TX-only keys
        Revert "mac80211: clear sta.drv_priv on reconfiguration"
        mac80211: fill rate filter for internal scan requests
        cfg80211: amend regulatory NULL dereference fix
        cfg80211: fix race on init and driver registration
      b835c0f4
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 091c0f86
      Linus Torvalds 提交于
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ftrace: Fix hash record accounting bug
        perf: Fix parsing of __print_flags() in TP_printk()
        jump_label: jump_label_inc may return before the code is patched
        ftrace: Remove force undef config value left for testing
        tracing: Restore system filter behavior
        tracing: fix event_subsystem ref counting
      091c0f86
    • S
      net: Silence seq_scale() unused warning · 68109090
      Stephen Boyd 提交于
      On a CONFIG_NET=y build
      
      net/core/secure_seq.c:22: warning: 'seq_scale' defined but not
      used
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68109090
    • P
      ipv4:correct description for tcp_max_syn_backlog · 99b53bdd
      Peter Pan(潘卫平) 提交于
      Since commit c5ed63d6(tcp: fix three tcp sysctls tuning),
      sysctl_max_syn_backlog is determined by tcp_hashinfo->ehash_mask,
      and the minimal value is 128, and it will increase in proportion to the
      memory of machine.
      The original description for tcp_max_syn_backlog and sysctl_max_syn_backlog
      are out of date.
      
      Changelog:
      V2: update description for sysctl_max_syn_backlog
      Signed-off-by: NWeiping Pan <panweiping3@gmail.com>
      Reviewed-by: NShan Wei <shanwei88@gmail.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99b53bdd
  3. 06 12月, 2011 29 次提交
  4. 05 12月, 2011 5 次提交