1. 08 4月, 2013 15 次提交
    • M
      tipc: fix info leaks via msg_name in recv_msg/recv_stream · 60085c3d
      Mathias Krause 提交于
      The code in set_orig_addr() does not initialize all of the members of
      struct sockaddr_tipc when filling the sockaddr info -- namely the union
      is only partly filled. This will make recv_msg() and recv_stream() --
      the only users of this function -- leak kernel stack memory as the
      msg_name member is a local variable in net/socket.c.
      
      Additionally to that both recv_msg() and recv_stream() fail to update
      the msg_namelen member to 0 while otherwise returning with 0, i.e.
      "success". This is the case for, e.g., non-blocking sockets. This will
      lead to a 128 byte kernel stack leak in net/socket.c.
      
      Fix the first issue by initializing the memory of the union with
      memset(0). Fix the second one by setting msg_namelen to 0 early as it
      will be updated later if we're going to fill the msg_name member.
      
      Cc: Jon Maloy <jon.maloy@ericsson.com>
      Cc: Allan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60085c3d
    • M
      rose: fix info leak via msg_name in rose_recvmsg() · 4a184233
      Mathias Krause 提交于
      The code in rose_recvmsg() does not initialize all of the members of
      struct sockaddr_rose/full_sockaddr_rose when filling the sockaddr info.
      Nor does it initialize the padding bytes of the structure inserted by
      the compiler for alignment. This will lead to leaking uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix the issue by initializing the memory used for sockaddr info with
      memset(0).
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a184233
    • M
      NFC: llcp: fix info leaks via msg_name in llcp_sock_recvmsg() · d26d6504
      Mathias Krause 提交于
      The code in llcp_sock_recvmsg() does not initialize all the members of
      struct sockaddr_nfc_llcp when filling the sockaddr info. Nor does it
      initialize the padding bytes of the structure inserted by the compiler
      for alignment.
      
      Also, if the socket is in state LLCP_CLOSED or is shutting down during
      receive the msg_namelen member is not updated to 0 while otherwise
      returning with 0, i.e. "success". The msg_namelen update is also
      missing for stream and seqpacket sockets which don't fill the sockaddr
      info.
      
      Both issues lead to the fact that the code will leak uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix the first issue by initializing the memory used for sockaddr info
      with memset(0). Fix the second one by setting msg_namelen to 0 early.
      It will be updated later if we're going to fill the msg_name member.
      
      Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
      Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d26d6504
    • M
      netrom: fix info leak via msg_name in nr_recvmsg() · 3ce5efad
      Mathias Krause 提交于
      In case msg_name is set the sockaddr info gets filled out, as
      requested, but the code fails to initialize the padding bytes of
      struct sockaddr_ax25 inserted by the compiler for alignment. Also
      the sax25_ndigis member does not get assigned, leaking four more
      bytes.
      
      Both issues lead to the fact that the code will leak uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix both issues by initializing the memory with memset(0).
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ce5efad
    • M
      llc: Fix missing msg_namelen update in llc_ui_recvmsg() · c77a4b9c
      Mathias Krause 提交于
      For stream sockets the code misses to update the msg_namelen member
      to 0 and therefore makes net/socket.c leak the local, uninitialized
      sockaddr_storage variable to userland -- 128 bytes of kernel stack
      memory. The msg_namelen update is also missing for datagram sockets
      in case the socket is shutting down during receive.
      
      Fix both issues by setting msg_namelen to 0 early. It will be
      updated later if we're going to fill the msg_name member.
      
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c77a4b9c
    • M
      l2tp: fix info leak in l2tp_ip6_recvmsg() · b860d3cc
      Mathias Krause 提交于
      The L2TP code for IPv6 fails to initialize the l2tp_conn_id member of
      struct sockaddr_l2tpip6 and therefore leaks four bytes kernel stack
      in l2tp_ip6_recvmsg() in case msg_name is set.
      
      Initialize l2tp_conn_id with 0 to avoid the info leak.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b860d3cc
    • M
      iucv: Fix missing msg_namelen update in iucv_sock_recvmsg() · a5598bd9
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set the msg_namelen member to 0 and therefore makes
      net/socket.c leak the local, uninitialized sockaddr_storage variable
      to userland -- 128 bytes of kernel stack memory.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about iucv_sock_recvmsg() not filling the msg_name in case it was set.
      
      Cc: Ursula Braun <ursula.braun@de.ibm.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5598bd9
    • M
      irda: Fix missing msg_namelen update in irda_recvmsg_dgram() · 5ae94c0d
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set the msg_namelen member to 0 and therefore makes
      net/socket.c leak the local, uninitialized sockaddr_storage variable
      to userland -- 128 bytes of kernel stack memory.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about irda_recvmsg_dgram() not filling the msg_name in case it was
      set.
      
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ae94c0d
    • M
      caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg() · 2d6fbfe7
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set the msg_namelen member to 0 and therefore makes
      net/socket.c leak the local, uninitialized sockaddr_storage variable
      to userland -- 128 bytes of kernel stack memory.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about caif_seqpkt_recvmsg() not filling the msg_name in case it was
      set.
      
      Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d6fbfe7
    • M
      Bluetooth: SCO - Fix missing msg_namelen update in sco_sock_recvmsg() · c8c49917
      Mathias Krause 提交于
      If the socket is in state BT_CONNECT2 and BT_SK_DEFER_SETUP is set in
      the flags, sco_sock_recvmsg() returns early with 0 without updating the
      possibly set msg_namelen member. This, in turn, leads to a 128 byte
      kernel stack leak in net/socket.c.
      
      Fix this by updating msg_namelen in this case. For all other cases it
      will be handled in bt_sock_recvmsg().
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8c49917
    • M
      Bluetooth: RFCOMM - Fix missing msg_namelen update in rfcomm_sock_recvmsg() · e11e0455
      Mathias Krause 提交于
      If RFCOMM_DEFER_SETUP is set in the flags, rfcomm_sock_recvmsg() returns
      early with 0 without updating the possibly set msg_namelen member. This,
      in turn, leads to a 128 byte kernel stack leak in net/socket.c.
      
      Fix this by updating msg_namelen in this case. For all other cases it
      will be handled in bt_sock_stream_recvmsg().
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e11e0455
    • M
      Bluetooth: fix possible info leak in bt_sock_recvmsg() · 4683f42f
      Mathias Krause 提交于
      In case the socket is already shutting down, bt_sock_recvmsg() returns
      with 0 without updating msg_namelen leading to net/socket.c leaking the
      local, uninitialized sockaddr_storage variable to userland -- 128 bytes
      of kernel stack memory.
      
      Fix this by moving the msg_namelen assignment in front of the shutdown
      test.
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4683f42f
    • M
      ax25: fix info leak via msg_name in ax25_recvmsg() · ef3313e8
      Mathias Krause 提交于
      When msg_namelen is non-zero the sockaddr info gets filled out, as
      requested, but the code fails to initialize the padding bytes of struct
      sockaddr_ax25 inserted by the compiler for alignment. Additionally the
      msg_namelen value is updated to sizeof(struct full_sockaddr_ax25) but is
      not always filled up to this size.
      
      Both issues lead to the fact that the code will leak uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix both issues by initializing the memory with memset(0).
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef3313e8
    • M
      atm: update msg_namelen in vcc_recvmsg() · 9b3e617f
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set the msg_namelen member to 0 and therefore makes
      net/socket.c leak the local, uninitialized sockaddr_storage variable
      to userland -- 128 bytes of kernel stack memory.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about vcc_recvmsg() not filling the msg_name in case it was set.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9b3e617f
    • C
      ipv6/tcp: Stop processing ICMPv6 redirect messages · 50a75a89
      Christoph Paasch 提交于
      Tetja Rediske found that if the host receives an ICMPv6 redirect message
      after sending a SYN+ACK, the connection will be reset.
      
      He bisected it down to 093d04d4 (ipv6: Change skb->data before using
      icmpv6_notify() to propagate redirect), but the origin of the bug comes
      from ec18d9a2 (ipv6: Add redirect support to all protocol icmp error
      handlers.). The bug simply did not trigger prior to 093d04d4, because
      skb->data did not point to the inner IP header and thus icmpv6_notify
      did not call the correct err_handler.
      
      This patch adds the missing "goto out;" in tcp_v6_err. After receiving
      an ICMPv6 Redirect, we should not continue processing the ICMP in
      tcp_v6_err, as this may trigger the removal of request-socks or setting
      sk_err(_soft).
      Reported-by: NTetja Rediske <tetja@tetja.de>
      Signed-off-by: NChristoph Paasch <christoph.paasch@uclouvain.be>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50a75a89
  2. 06 4月, 2013 10 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 53f63189
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix erroneous sock_orphan() leading to crashes and double
          kfree_skb() in NFC protocol.  From Thierry Escande and Samuel Ortiz.
      
       2) Fix use after free in remain-on-channel mac80211 code, from Johannes
          Berg.
      
       3) nf_reset() needs to reset the NF tracing cookie, otherwise we can
          leak it from one namespace into another.  Fix from Gao Feng and
          Patrick McHardy.
      
       4) Fix overflow in channel scanning array of mwifiex driver, from Stone
          Piao.
      
       5) Fix loss of link after suspend/shutdown in r8169, from Hayes Wang.
      
       6) Synchronization of unicast address lists to the undelying device
          doesn't work because whether to sync is maintained as a boolean
          rather than a true count.  Fix from Vlad Yasevich.
      
       7) Fix corruption of TSO packets in atl1e by limiting the segmented
          packet length.  From Hannes Frederic Sowa.
      
       8) Revert bogus AF_UNIX credential passing change and fix the
          coalescing issue properly, from Eric W Biederman.
      
       9) Changes of ipv4 address lifetime settings needs to generate a
          notification, from Jiri Pirko.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits)
        netfilter: don't reset nf_trace in nf_reset()
        net: ipv4: notify when address lifetime changes
        ixgbe: fix registration order of driver and DCA nofitication
        af_unix: If we don't care about credentials coallesce all messages
        Revert "af_unix: dont send SCM_CREDENTIAL when dest socket is NULL"
        bonding: remove sysfs before removing devices
        atl1e: limit gso segment size to prevent generation of wrong ip length fields
        net: count hw_addr syncs so that unsync works properly.
        r8169: fix auto speed down issue
        netfilter: ip6t_NPT: Fix translation for non-multiple of 32 prefix lengths
        mwifiex: limit channel number not to overflow memory
        NFC: microread: Fix build failure due to a new MEI bus API
        iwlwifi: dvm: fix the passive-no-RX workaround
        netfilter: nf_conntrack: fix error return code
        NFC: llcp: Keep the connected socket parent pointer alive
        mac80211: fix idle handling sequence
        netfilter: nfnetlink_acct: return -EINVAL if object name is empty
        netfilter: nfnetlink_queue: fix error return code in nfnetlink_queue_init()
        netfilter: reset nf_trace in nf_reset
        mac80211: fix remain-on-channel cancel crash
        ...
      53f63189
    • P
      netfilter: don't reset nf_trace in nf_reset() · 124dff01
      Patrick McHardy 提交于
      Commit 130549fe ("netfilter: reset nf_trace in nf_reset") added code
      to reset nf_trace in nf_reset(). This is wrong and unnecessary.
      
      nf_reset() is used in the following cases:
      
      - when passing packets up the the socket layer, at which point we want to
        release all netfilter references that might keep modules pinned while
        the packet is queued. nf_trace doesn't matter anymore at this point.
      
      - when encapsulating or decapsulating IPsec packets. We want to continue
        tracing these packets after IPsec processing.
      
      - when passing packets through virtual network devices. Only devices on
        that encapsulate in IPv4/v6 matter since otherwise nf_trace is not
        used anymore. Its not entirely clear whether those packets should
        be traced after that, however we've always done that.
      
      - when passing packets through virtual network devices that make the
        packet cross network namespace boundaries. This is the only cases
        where we clearly want to reset nf_trace and is also what the
        original patch intended to fix.
      
      Add a new function nf_reset_trace() and use it in dev_forward_skb() to
      fix this properly.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      124dff01
    • L
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 6cfa9238
      Linus Torvalds 提交于
      Pull MIPS fixes from Ralf Baechle:
       "Fixes for a number of small glitches in various corners of the MIPS
        tree.  No particular areas is standing out.
      
        With this applied all MIPS defconfigs are building fine.  No merge
        conflicts are expected."
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: Delete definition of SA_RESTORER.
        MIPS: Fix ISA level which causes secondary cache init bypassing and more
        MIPS: Fix build error cavium-octeon without CONFIG_SMP
        MIPS: Kconfig: Rename SNIPROM too
        MIPS: Alchemy: Fix typo "CONFIG_DEBUG_PCI"
        MIPS: Unbreak function tracer for 64-bit kernel.
      6cfa9238
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes · 00fa6fe9
      Linus Torvalds 提交于
      Pull GFS2 fixes from Steven Whitehouse:
       "There are two patches which fix up a couple of minor issues in the DLM
        interface code, a missing error path in gfs2_rs_alloc(), one patch
        which fixes a problem during "withdraw" and a fix for discards/FITRIM
        when using 4k sector sized devices."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes:
        GFS2: Issue discards in 512b sectors
        GFS2: Fix unlock of fcntl locks during withdrawn state
        GFS2: return error if malloc failed in gfs2_rs_alloc()
        GFS2: use memchr_inv
        GFS2: use kmalloc for lvb bitmap
      00fa6fe9
    • M
      firmware,IB/qib: revert firmware file move · ff802e31
      Mike Marciniszyn 提交于
      Commit e2eed58b ("IB/qib: change QLogic to Intel") moved a firmware
      file potentially breaking the ABI.
      
      This patch reverts that aspect of the fix as well as reverting the
      firmware name as used in qib.
      Reported-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ff802e31
    • L
      Merge tag 'spi-fix-v3.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc · e0a77f26
      Linus Torvalds 提交于
      Pull spi fixes from Mark Brown:
       "A bunch of small driver fixes plus a fix for error handling in the
        core - nothing too exciting overall."
      
      * tag 'spi-fix-v3.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc:
        spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts
        spi: Unlock a spinlock before calling into the controller driver.
        spi/s3c64xx: modified error interrupt handling and init
        spi/bcm63xx: don't disable non enabled clocks in probe error path
        spi/bcm63xx: Remove unused variable
        spi: slink-tegra20: move runtime pm calls to transfer_one_message
      e0a77f26
    • B
      GFS2: Issue discards in 512b sectors · b2c87cae
      Bob Peterson 提交于
      This patch changes GFS2's discard issuing code so that it calls
      function sb_issue_discard rather than blkdev_issue_discard. The
      code was calling blkdev_issue_discard and specifying the correct
      sector offset and sector size, but blkdev_issue_discard expects
      these values to be in terms of 512 byte sectors, even if the native
      sector size for the device is different. Calling sb_issue_discard
      with the BLOCK size instead ensures the correct block-to-512b-sector
      translation. I verified that "minlen" is specified in blocks, so
      comparing it to a number of blocks is correct.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b2c87cae
    • J
      Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR" · e24b0bfa
      Johan Hovold 提交于
      This reverts commit 0ef1594c.
      
      This patch introduced a few races which cannot be easily fixed with a
      small follow-up patch. Furthermore, the SoC with the broken hardware
      register, which this patch intended to add support for, can only be used
      with device trees, which this driver currently does not support.
      
      [ Here is the discussion that led to this "revert" patch:
        https://lkml.org/lkml/2013/4/3/176 ]
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e24b0bfa
    • L
      Merge tag 'fbdev-fixes-3.9-rc6' of git://gitorious.org/linux-omap-dss2/linux · c4c80f63
      Linus Torvalds 提交于
      Pull fbdev fixes from Tomi Valkeinen:
       "Fix uvesafb crash bug and typoed flag name in fbmon's new videomode
        code"
      
      * tag 'fbdev-fixes-3.9-rc6' of git://gitorious.org/linux-omap-dss2/linux:
        video:uvesafb: Fix dereference NULL pointer code path
        fbmon: use VESA_DMT_VSYNC_HIGH to fix typo
      c4c80f63
    • L
      Merge tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 8f09aacf
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "This contains slightly more volumes than usual at this stage, mostly
        because of my vacation in the last week.  Nothing to scare, all small
        and/or trivial fixes:
      
         - Fix loop path handling in ASoC DAPM
         - Some memory handling fixes in ASoC core
         - Fix spear_pcm to adapt to the updated API
         - HD-audio HDMI ELD handling fixes
         - Fix for CM6331 USB-audio SRC change bugs
         - Revert power_save_controller option change due to user-space usage
         - A few other small ASoC and HD-audio fixes"
      
      * tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/generic - fix uninitialized variable
        Revert "ALSA: hda - Allow power_save_controller option override DCAPS"
        ALSA: hda - fix typo in proc output
        ALSA: hda - Enabling Realtek ALC 671 codec
        ALSA: usb: Work around CM6631 sample rate change bug
        ALSA: hda - bug fix on HDMI ELD debug message
        ALSA: hda - bug fix on return value when getting HDMI ELD info
        ASoC: dma-sh7760: Fix compile error
        ASoC: core: fix invalid free of devm_ allocated data
        ASoC: spear_pcm: Update to new pcm_new() API
        ASoC:: max98090: Remove executable bit
        ASoC: dapm: Fix pointer dereference in is_connected_output_ep()
        ASoC: pcm030 audio fabric: remove __init from probe
        ASoC: imx-ssi: Fix occasional AC97 reset failure
        ASoC: core: fix possible memory leak in snd_soc_bytes_put()
        ASoC: wm_adsp: fix possible memory leak in wm_adsp_load_coeff()
        ASoC: dapm: Fix handling of loops
        ASoC: si476x: Add missing break for SNDRV_PCM_FORMAT_S8 switch case
      8f09aacf
  3. 05 4月, 2013 15 次提交