1. 30 11月, 2011 3 次提交
    • D
      isdn: make sure strings are null terminated · 746ae30f
      Dan Carpenter 提交于
      These strings come from the user.  We strcpy() them inside
      cf_command() so we should check that they are NULL terminated and
      return an error if not.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      746ae30f
    • P
      netlabel: Fix build problems when IPv6 is not enabled · 1281bc25
      Paul Moore 提交于
      A recent fix to the the NetLabel code caused build problem with
      configurations that did not have IPv6 enabled; see below:
      
       netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
       netlabel_kapi.c:165:4:
        error: implicit declaration of function 'netlbl_af6list_add'
      
      This patch fixes this problem by making the IPv6 specific code conditional
      on the IPv6 configuration flags as we done in the rest of NetLabel and the
      network stack as a whole.  We have to move some variable declarations
      around as a result so things may not be quite as pretty, but at least it
      builds cleanly now.
      
      Some additional IPv6 conditionals were added to the NetLabel code as well
      for the sake of consistency.
      Reported-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Acked-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1281bc25
    • X
      sctp: better integer overflow check in sctp_auth_create_key() · c89304b8
      Xi Wang 提交于
      The check from commit 30c2235c is incomplete and cannot prevent
      cases like key_len = 0x80000000 (INT_MAX + 1).  In that case, the
      left-hand side of the check (INT_MAX - key_len), which is unsigned,
      becomes 0xffffffff (UINT_MAX) and bypasses the check.
      
      However this shouldn't be a security issue.  The function is called
      from the following two code paths:
      
       1) setsockopt()
      
       2) sctp_auth_asoc_set_secret()
      
      In case (1), sca_keylength is never going to exceed 65535 since it's
      bounded by a u16 from the user API.  As such, the key length will
      never overflow.
      
      In case (2), sca_keylength is computed based on the user key (1 short)
      and 2 * key_vector (3 shorts) for a total of 7 * USHRT_MAX, which still
      will not overflow.
      
      In other words, this overflow check is not really necessary.  Just
      make it more correct.
      Signed-off-by: NXi Wang <xi.wang@gmail.com>
      Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c89304b8
  2. 29 11月, 2011 4 次提交
  3. 28 11月, 2011 1 次提交
  4. 27 11月, 2011 11 次提交
  5. 26 11月, 2011 1 次提交
  6. 25 11月, 2011 1 次提交
  7. 24 11月, 2011 10 次提交
  8. 23 11月, 2011 7 次提交
  9. 22 11月, 2011 2 次提交
    • P
      netfilter: nf_conntrack: make event callback registration per-netns · 70e9942f
      Pablo Neira Ayuso 提交于
      This patch fixes an oops that can be triggered following this recipe:
      
      0) make sure nf_conntrack_netlink and nf_conntrack_ipv4 are loaded.
      1) container is started.
      2) connect to it via lxc-console.
      3) generate some traffic with the container to create some conntrack
         entries in its table.
      4) stop the container: you hit one oops because the conntrack table
         cleanup tries to report the destroy event to user-space but the
         per-netns nfnetlink socket has already gone (as the nfnetlink
         socket is per-netns but event callback registration is global).
      
      To fix this situation, we make the ctnl_notifier per-netns so the
      callback is registered/unregistered if the container is
      created/destroyed.
      
      Alex Bligh and Alexey Dobriyan originally proposed one small patch to
      check if the nfnetlink socket is gone in nfnetlink_has_listeners,
      but this is a very visited path for events, thus, it may reduce
      performance and it looks a bit hackish to check for the nfnetlink
      socket only to workaround this situation. As a result, I decided
      to follow the bigger path choice, which seems to look nicer to me.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Reported-by: NAlex Bligh <alex@alex.org.uk>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      70e9942f
    • D
      caif: fix endian conversion in cffrml_transmit() · f23aa625
      Dan Carpenter 提交于
      The "tmp" variable here is used to store the result of cpu_to_le16()
      so it should be an __le16 instead of an int.  We want the high bits
      set and the current code works on little endian systems but not on
      big endian systems.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f23aa625