1. 26 7月, 2013 12 次提交
    • E
      SELinux: fix selinuxfs policy file on big endian systems · b138004e
      Eric Paris 提交于
      The /sys/fs/selinux/policy file is not valid on big endian systems like
      ppc64 or s390.  Let's see why:
      
      static int hashtab_cnt(void *key, void *data, void *ptr)
      {
      	int *cnt = ptr;
      	*cnt = *cnt + 1;
      
      	return 0;
      }
      
      static int range_write(struct policydb *p, void *fp)
      {
      	size_t nel;
      [...]
      	/* count the number of entries in the hashtab */
      	nel = 0;
      	rc = hashtab_map(p->range_tr, hashtab_cnt, &nel);
      	if (rc)
      		return rc;
      	buf[0] = cpu_to_le32(nel);
      	rc = put_entry(buf, sizeof(u32), 1, fp);
      
      So size_t is 64 bits.  But then we pass a pointer to it as we do to
      hashtab_cnt.  hashtab_cnt thinks it is a 32 bit int and only deals with
      the first 4 bytes.  On x86_64 which is little endian, those first 4
      bytes and the least significant, so this works out fine.  On ppc64/s390
      those first 4 bytes of memory are the high order bits.  So at the end of
      the call to hashtab_map nel has a HUGE number.  But the least
      significant 32 bits are all 0's.
      
      We then pass that 64 bit number to cpu_to_le32() which happily truncates
      it to a 32 bit number and does endian swapping.  But the low 32 bits are
      all 0's.  So no matter how many entries are in the hashtab, big endian
      systems always say there are 0 entries because I screwed up the
      counting.
      
      The fix is easy.  Use a 32 bit int, as the hashtab_cnt expects, for nel.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      b138004e
    • S
      SELinux: Enable setting security contexts on rootfs inodes. · 5c73fceb
      Stephen Smalley 提交于
      rootfs (ramfs) can support setting of security contexts
      by userspace due to the vfs fallback behavior of calling
      the security module to set the in-core inode state
      for security.* attributes when the filesystem does not
      provide an xattr handler.  No xattr handler required
      as the inodes are pinned in memory and have no backing
      store.
      
      This is useful in allowing early userspace to label individual
      files within a rootfs while still providing a policy-defined
      default via genfs.
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      5c73fceb
    • W
      SELinux: Increase ebitmap_node size for 64-bit configuration · a767f680
      Waiman Long 提交于
      Currently, the ebitmap_node structure has a fixed size of 32 bytes. On
      a 32-bit system, the overhead is 8 bytes, leaving 24 bytes for being
      used as bitmaps. The overhead ratio is 1/4.
      
      On a 64-bit system, the overhead is 16 bytes. Therefore, only 16 bytes
      are left for bitmap purpose and the overhead ratio is 1/2. With a
      3.8.2 kernel, a boot-up operation will cause the ebitmap_get_bit()
      function to be called about 9 million times. The average number of
      ebitmap_node traversal is about 3.7.
      
      This patch increases the size of the ebitmap_node structure to 64
      bytes for 64-bit system to keep the overhead ratio at 1/4. This may
      also improve performance a little bit by making node to node traversal
      less frequent (< 2) as more bits are available in each node.
      Signed-off-by: NWaiman Long <Waiman.Long@hp.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      a767f680
    • W
      SELinux: Reduce overhead of mls_level_isvalid() function call · fee71142
      Waiman Long 提交于
      While running the high_systime workload of the AIM7 benchmark on
      a 2-socket 12-core Westmere x86-64 machine running 3.10-rc4 kernel
      (with HT on), it was found that a pretty sizable amount of time was
      spent in the SELinux code. Below was the perf trace of the "perf
      record -a -s" of a test run at 1500 users:
      
        5.04%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit
        1.96%            ls  [kernel.kallsyms]     [k] mls_level_isvalid
        1.95%            ls  [kernel.kallsyms]     [k] find_next_bit
      
      The ebitmap_get_bit() was the hottest function in the perf-report
      output.  Both the ebitmap_get_bit() and find_next_bit() functions
      were, in fact, called by mls_level_isvalid(). As a result, the
      mls_level_isvalid() call consumed 8.95% of the total CPU time of
      all the 24 virtual CPUs which is quite a lot. The majority of the
      mls_level_isvalid() function invocations come from the socket creation
      system call.
      
      Looking at the mls_level_isvalid() function, it is checking to see
      if all the bits set in one of the ebitmap structure are also set in
      another one as well as the highest set bit is no bigger than the one
      specified by the given policydb data structure. It is doing it in
      a bit-by-bit manner. So if the ebitmap structure has many bits set,
      the iteration loop will be done many times.
      
      The current code can be rewritten to use a similar algorithm as the
      ebitmap_contains() function with an additional check for the
      highest set bit. The ebitmap_contains() function was extended to
      cover an optional additional check for the highest set bit, and the
      mls_level_isvalid() function was modified to call ebitmap_contains().
      
      With that change, the perf trace showed that the used CPU time drop
      down to just 0.08% (ebitmap_contains + mls_level_isvalid) of the
      total which is about 100X less than before.
      
        0.07%            ls  [kernel.kallsyms]     [k] ebitmap_contains
        0.05%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit
        0.01%            ls  [kernel.kallsyms]     [k] mls_level_isvalid
        0.01%            ls  [kernel.kallsyms]     [k] find_next_bit
      
      The remaining ebitmap_get_bit() and find_next_bit() functions calls
      are made by other kernel routines as the new mls_level_isvalid()
      function will not call them anymore.
      
      This patch also improves the high_systime AIM7 benchmark result,
      though the improvement is not as impressive as is suggested by the
      reduction in CPU time spent in the ebitmap functions. The table below
      shows the performance change on the 2-socket x86-64 system (with HT
      on) mentioned above.
      
      +--------------+---------------+----------------+-----------------+
      |   Workload   | mean % change | mean % change  | mean % change   |
      |              | 10-100 users  | 200-1000 users | 1100-2000 users |
      +--------------+---------------+----------------+-----------------+
      | high_systime |     +0.1%     |     +0.9%      |     +2.6%       |
      +--------------+---------------+----------------+-----------------+
      Signed-off-by: NWaiman Long <Waiman.Long@hp.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      fee71142
    • P
      selinux: remove the BUG_ON() from selinux_skb_xfrm_sid() · bed4d7ef
      Paul Moore 提交于
      Remove the BUG_ON() from selinux_skb_xfrm_sid() and propogate the
      error code up to the caller.  Also check the return values in the
      only caller function, selinux_skb_peerlbl_sid().
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      bed4d7ef
    • P
      selinux: cleanup the XFRM header · d1b17b09
      Paul Moore 提交于
      Remove the unused get_sock_isec() function and do some formatting
      fixes.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      d1b17b09
    • P
      selinux: cleanup selinux_xfrm_decode_session() · e2193695
      Paul Moore 提交于
      Some basic simplification.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      e2193695
    • P
      4baabeec
    • P
      selinux: cleanup selinux_xfrm_sock_rcv_skb() and selinux_xfrm_postroute_last() · eef9b416
      Paul Moore 提交于
      Some basic simplification and comment reformatting.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      eef9b416
    • P
      selinux: cleanup selinux_xfrm_policy_lookup() and selinux_xfrm_state_pol_flow_match() · 96484348
      Paul Moore 提交于
      Do some basic simplification and comment reformatting.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      96484348
    • P
      selinux: cleanup and consolidate the XFRM alloc/clone/delete/free code · ccf17cc4
      Paul Moore 提交于
      The SELinux labeled IPsec code state management functions have been
      long neglected and could use some cleanup and consolidation.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      ccf17cc4
    • P
      lsm: split the xfrm_state_alloc_security() hook implementation · 2e5aa866
      Paul Moore 提交于
      The xfrm_state_alloc_security() LSM hook implementation is really a
      multiplexed hook with two different behaviors depending on the
      arguments passed to it by the caller.  This patch splits the LSM hook
      implementation into two new hook implementations, which match the
      LSM hooks in the rest of the kernel:
      
       * xfrm_state_alloc
       * xfrm_state_alloc_acquire
      
      Also included in this patch are the necessary changes to the SELinux
      code; no other LSMs are affected.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      2e5aa866
  2. 01 7月, 2013 3 次提交
    • L
      Linux 3.10 · 8bb495e3
      Linus Torvalds 提交于
      8bb495e3
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · f0277dce
      Linus Torvalds 提交于
      Pull another powerpc fix from Benjamin Herrenschmidt:
       "I mentioned that while we had fixed the kernel crashes, EEH error
        recovery didn't always recover...  It appears that I had a fix for
        that already in powerpc-next (with a stable CC).
      
        I cherry-picked it today and did a few tests and it seems that things
        now work quite well.  The patch is also pretty simple, so I see no
        reason to wait before merging it."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/eeh: Fix fetching bus for single-dev-PE
      f0277dce
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 4b483802
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "This is a set of seven bug fixes.  Several fcoe fixes for locking
        problems, initiator issues and a VLAN API change, all of which could
        eventually lead to data corruption, one fix for a qla2xxx locking
        problem which could lead to multiple completions of the same request
        (and subsequent data corruption) and a use after free in the ipr
        driver.  Plus one minor MAINTAINERS file update"
      
      (only six bugfixes in this pull, since I had already pulled the fcoe API
      fix directly from Robert Love)
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        [SCSI] ipr: Avoid target_destroy accessing memory after it was freed
        [SCSI] qla2xxx: Fix for locking issue between driver ISR and mailbox routines
        MAINTAINERS: Fix fcoe mailing list
        libfc: extend ex_lock to protect all of fc_seq_send
        libfc: Correct check for initiator role
        libfcoe: Fix Conflicting FCFs issue in the fabric
      4b483802
  3. 30 6月, 2013 12 次提交
  4. 29 6月, 2013 2 次提交
    • A
      UBIFS: fix a horrid bug · 605c912b
      Artem Bityutskiy 提交于
      Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
      mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
      in the middle of 'ubifs_readdir()'.
      
      This means that 'file->private_data' can be freed while 'ubifs_readdir()' uses
      it, and this is a very bad bug: not only 'ubifs_readdir()' can return garbage,
      but this may corrupt memory and lead to all kinds of problems like crashes an
      security holes.
      
      This patch fixes the problem by using the 'file->f_version' field, which
      '->llseek()' always unconditionally sets to zero. We set it to 1 in
      'ubifs_readdir()' and whenever we detect that it became 0, we know there was a
      seek and it is time to clear the state saved in 'file->private_data'.
      
      I tested this patch by writing a user-space program which runds readdir and
      seek in parallell. I could easily crash the kernel without these patches, but
      could not crash it with these patches.
      
      Cc: stable@vger.kernel.org
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      605c912b
    • A
      UBIFS: prepare to fix a horrid bug · 33f1a63a
      Artem Bityutskiy 提交于
      Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
      mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
      in the middle of 'ubifs_readdir()'.
      
      First of all, this means that 'file->private_data' can be freed while
      'ubifs_readdir()' uses it.  But this particular patch does not fix the problem.
      This patch is only a preparation, and the fix will follow next.
      
      In this patch we make 'ubifs_readdir()' stop using 'file->f_pos' directly,
      because 'file->f_pos' can be changed by '->llseek()' at any point. This may
      lead 'ubifs_readdir()' to returning inconsistent data: directory entry names
      may correspond to incorrect file positions.
      
      So here we introduce a local variable 'pos', read 'file->f_pose' once at very
      the beginning, and then stick to 'pos'. The result of this is that when
      'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of
      'ubifs_readdir()', the latter "wins".
      
      Cc: stable@vger.kernel.org
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      33f1a63a
  5. 28 6月, 2013 4 次提交
    • A
      mn10300: Use early_param() to parse "mem=" parameter · e3f12a53
      Akira Takeuchi 提交于
      This fixes the problem that "init=" options may not be passed to kernel
      correctly.
      
      parse_mem_cmdline() of mn10300 arch gets rid of "mem=" string from
      redboot_command_line. Then init_setup() parses the "init=" options from
      static_command_line, which is a copy of redboot_command_line, and keeps
      the pointer to the init options in execute_command variable.
      
      Since the commit 026cee00 upstream (params: <level>_initcall-like kernel
      parameters), static_command_line becomes overwritten by saved_command_line at
      do_initcall_level(). Notice that saved_command_line is a command line
      which includes "mem=" string.
      
      As a result, execute_command may point to weird string by the length of
      "mem=" parameter.
      I noticed this problem when using the command line like this:
      
          mem=128M console=ttyS0,115200 init=/bin/sh
      
      Here is the processing flow of command line parameters.
          start_kernel()
            setup_arch(&command_line)
               parse_mem_cmdline(cmdline_p)
                 * strcpy(boot_command_line, redboot_command_line);
                 * Remove "mem=xxx" from redboot_command_line.
                 * *cmdline_p = redboot_command_line;
            setup_command_line(command_line) <-- command_line is redboot_command_line
              * strcpy(saved_command_line, boot_command_line)
              * strcpy(static_command_line, command_line)
            parse_early_param()
              strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
              parse_early_options(tmp_cmdline);
                parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param);
            parse_args("Booting ..", static_command_line, ...);
              init_setup() <-- save the pointer in execute_command
            rest_init()
              kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
      
      At this point, execute_command points to "/bin/sh" string.
      
          kernel_init()
            kernel_init_freeable()
              do_basic_setup()
                do_initcalls()
                  do_initcall_level()
                    (*) strcpy(static_command_line, saved_command_line);
      
      Here, execute_command gets to point to "200" string !!
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      e3f12a53
    • A
      mn10300: Allow to pass array name to get_user() · c6dc9f0a
      Akira Takeuchi 提交于
      This fixes the following compile error:
      
      CC block/scsi_ioctl.o
      block/scsi_ioctl.c: In function 'sg_scsi_ioctl':
      block/scsi_ioctl.c:449: error: invalid initializer
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c6dc9f0a
    • D
    • T
      powerpc/eeh: Add eeh_dev to the cache during boot · 1abd6018
      Thadeu Lima de Souza Cascardo 提交于
      commit f8f7d63f ("powerpc/eeh: Trace eeh
      device from I/O cache") broke EEH on pseries for devices that were
      present during boot and have not been hotplugged/DLPARed.
      
      eeh_check_failure will get the eeh_dev from the cache, and will get
      NULL. eeh_addr_cache_build adds the addresses to the cache, but eeh_dev
      for the giving pci_device is not set yet. Just reordering the call to
      eeh_addr_cache_insert_dev works fine. The ordering is similar to the one
      in eeh_add_device_late.
      Signed-off-by: NThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Acked-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1abd6018
  6. 27 6月, 2013 7 次提交
    • J
      rbd: send snapshot context with writes · d2d1f17a
      Josh Durgin 提交于
      Sending the right snapshot context with each write is required for
      snapshots to work. Due to the ordering of calls, the snapshot context
      is never set for any requests. This causes writes to the current
      version of the image to be reflected in all snapshots, which are
      supposed to be read-only.
      
      This happens because rbd_osd_req_format_write() sets the snapshot
      context based on obj_request->img_request. At this point, however,
      obj_request->img_request has not been set yet, to the snapshot context
      is set to NULL. Fix this by moving rbd_img_obj_request_add(), which
      sets obj_request->img_request, before the osd request formatting
      calls.
      
      This resolves:
          http://tracker.ceph.com/issues/5465Reported-by: NKarol Jurak <karol.jurak@gmail.com>
      Signed-off-by: NJosh Durgin <josh.durgin@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      Reviewed-by: NAlex Elder <elder@linaro.org>
      d2d1f17a
    • J
      Merge tag 'fcoe1' into fixes · a9e94ec3
      James Bottomley 提交于
      This patch fixes a critical bug that was introduced in 3.9
      related to VLAN tagging FCoE frames.
      a9e94ec3
    • J
      Merge tag 'fcoe' into fixes · 36a27968
      James Bottomley 提交于
      3.10 fixes
      36a27968
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 98b6ed0f
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Found via trinity:
      
          If you connect up an ipv6 socket to an ipv4 mapped address then an
          ipv6 one, sendmsg() can croak because ip6_sk_dst_check() assumes the
          route cached in the socket is an ipv6 one.  In this case there is an
          ipv4 route attached, so it gets stomped on.
      
          Reported by Dave Jones and Hannes Frederic Sowa, fixed by Eric
          Dumazet.
      
       2) AF_KEY notifications leak some kernel memory to userspace, fix from
          Mathias Krause.
      
       3) DLCI calls __dev_get_by_name() without proper locking, and dlci_del
          doesn't validate that the device being deleted is actually a DLCI
          one.  Fixes from Li Zefan.
      
       4) Length check on bluetooth l2cap information responses is wrong, each
          response type has a different lenth, so we should make sure it's in
          a given range rather than enforce one single valid length.  From
          Jaganath Kanakkassery.
      
       5) Receive FIFO overflow is really easy to trigger in stress scenerios
          in the sh_eth driver, but the event isn't being handled properly at
          all.  Specifically, the mask of error interrupts doesn't include the
          event so we never clear it, resulting in the driver becomming wedged
          processing an interrupt that never gets cleared.
      
          Fix from Sergei Shtylyov.
      
       6) qlcnic sleeps while holding a spinlock, use mdelay() instead of
          msleep().  From Shahed Shaikh.
      
       7) Missing curly braces causes SIP netfilter NAT module to always drop
          packets.  Fix from Balazs Peter Odor.
      
       8) ipt_ULOG in netfilter passes the wrong value to timer setup, causing
          the timer to dereference crap when it fires.  Fix from Gao Feng.
      
       9) Missing RCU protection around txq->axq_acq traversal in
          ath_txq_schedule().  Fix from Felix Fietkau.
      
      10) Idle state transition test in ath9k_htc_config() is reversed, fix
          from Sujith Manoharan.
      
      11) IPV6 forwarding handles unicast Router Alert packets incorrectly.
          It tests the wrong option state.  Previously opt->ra being non-zero
          indicated a router alert marking in the SKB, but now it's indicated
          by a bit in opt->flags.  Fix from YOSHIFUJI Hideaki.
      
      12) SKB leak in GRE tunnel GSO handling, from Eric Dumazet.
      
      13) get_user_pages_fast() error handling in TUN and MACVTAP use the same
          local variable for the base index and the loop iterator for page
          traversal, oops! Fix from Michael S Tsirkin.
      
      14) ipv6_get_lladdr() can fail, and we must therefore check it's return
          value in inet6_set_iftoken().  For from Hannes Frederic Sowa.
      
      15) If you change an interface name and meanwhile can sneak in something
          that looks up the name (like SO_BINDTODEVICE or SIOCGIFNAME) we can
          deadlock with CONFIG_PREEMPT=n.  Fix this by providing a helper
          function that properly uses raw_seqcount_begin().  From Nicolas
          Schichan.
      
      16) Chain noise calibration test is inverted in iwlwifi, fix from
          Nikolay Martynov.
      
      17) Properly set TX iwlwifi descriptor flags for back requests.  Fix
          from Emmanuel Grumbach.
      
      18) We can't assume skb_transport_header() is set in xt_TCPOPTSTRAP
          module, fix from Pablo Neira Ayuso.
      
      19) Some crummy APs don't provide the proper High Throughput info in
          association response frames.  Add a workaround by assume we'll use
          whatever is in the beacon/probe.  Fix from Johannes Berg.
      
      20) mac80211 call to rate_idx_match_mask() swaps two arguments (mask and
          channel width).  Fix from Simon Wunderlich.
      
      21) xt_TCPMSS (like xt_TCPOPTSTRAP) must not try to handle fragmented
          frames.  Fix from Phil Oester.
      
      22) Fix rate control regression causing iwlwifi/iwlegacy chips to use
          1Mbit/s on pre-11n networks.  From Moshe Benji and Stanslaw Gruszka.
      
      23) Disable brcmsmac power-save functions, they cause regressions.  From
          Arend van Spriel.
      
      24) Enforce a sane minimum MTU in l2cap_build_cmd() otherwise we can
          easily crash.  Fix from Anderson Lizardo.
      
      25) If a learning packet arrives during vxlan_stop() we crash, easily
          fixed by checking netif_running().  From Stephen Hemminger.
      
      26) Static vxlan FDB entries should not be migrated, also from Stephen.
      
      27) skb_clone() failures not handled in vxlan_xmit(), oops.  Also from
          Stephen.
      
      28) Add minimal driver for AR816x/AR817x ethernet chips, from Johannes
          Berg.
      
      29) Fix regression in userspace VLAN acceleration control, added by the
          802.1ad support changes.  Fix from Fernando Luis Vazquez Cao.
      
      30) Interval selection for MLD queries in the bridging code was
          reversed.  Fix from Linus Lüssing.
      
      31) ipv6's ndisc_send_redirect() erroneously writes to the packet we
          received not the packet we are building to send out.  Fix from
          Matthias Schiffer.
      
      32) Don't free netdev before unregistering it, in usb_8dev can driver.
          From Marc Kleine-Budde.
      
      33) Fix nl80211 attribute buffer races, from Johannes Berg.
      
      34) Although netlink_diag.h is under uapi/ it isn't present in Kbuild.
          From Stephen Hemminger.
      
      35) Wrong address and family passed to MD5 key lookups in TCP, from
          Aydin Arik.
      
      36) phy_type attribute created by SFC driver should not be writable.
          From Ben Hutchings.
      
      37) Receive/Transmit queue allocations in pxa168_eth and mv643xx_eth
          should use kzalloc().  Otherwise if setup fails half-way, we'll
          dereference garbage when trying to teardown the rings.  From Lubomir
          Rintel.
      
      38) Fix double-allocation of dst (resulting in unfreeable net device) in
          ipv6's init_loopback().  From Gao Feng.
      
      39) Fix fragmentation handling SKB leak in netfilter conntrack, we were
          freeing the wrong skb pointer.  From Phil Oester.
      
      40) Don't report "-1" (SPEED_UNKNOWN) in bond_miimon_commit(), from
          Nikolay Aleksandrov.
      
      41) davinci_cpdma doesn't check for DMA mapping errors, letting the
          device scribble to random addresses.  From Sebastian Siewior.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
        dlci: validate the net device in dlci_del()
        dlci: acquire rtnl_lock before calling __dev_get_by_name()
        af_key: fix info leaks in notify messages
        ipv6: ip6_sk_dst_check() must not assume ipv6 dst
        net: fix kernel deadlock with interface rename and netdev name retrieval.
        net/tg3: Avoid delay during MMIO access
        ipv6: check return value of ipv6_get_lladdr
        macvtap: fix recovery from gup errors
        tun: fix recovery from gup errors
        gre: fix a possible skb leak
        ipv6: Process unicast packet with Router Alert by checking flag in skb.
        ath9k_htc: Handle IDLE state transition properly
        ath9k: fix an RCU issue in calling ieee80211_get_tx_rates
        netfilter: ipt_ULOG: fix incorrect setting of ulog timer
        netfilter: ctnetlink: send event when conntrack label was modified
        netfilter: nf_nat_sip: fix mangling
        qlcnic: Do not sleep while holding spinlock
        drivers: net: cpsw: fix compilation error with cpsw driver
        tcp: doc : fix the syncookies default value
        sh_eth: fix misreporting of transmit abort
        ...
      98b6ed0f
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 1a506e47
      Linus Torvalds 提交于
      Pull i915 drm fixes from Dave Airlie:
       "These should be the last two fixes for i915, one is for a fence leak
        killing X on some older GPUs, and one is a late regression partial
        revert for an swiotlb/xen/i915 interaction, Konrad has promised to
        figure out the proper answer, and this patch is the best thing to do
        at this stage to avoid regressing"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/i915: make compact dma scatter lists creation work with SWIOTLB backend.
        drm/i915: Restore fences after resume and GPU resets
      1a506e47
    • Z
      dlci: validate the net device in dlci_del() · 578a1310
      Zefan Li 提交于
      We triggered an oops while running trinity with 3.4 kernel:
      
      BUG: unable to handle kernel paging request at 0000000100000d07
      IP: [<ffffffffa0109738>] dlci_ioctl+0xd8/0x2d4 [dlci]
      PGD 640c0d067 PUD 0
      Oops: 0000 [#1] PREEMPT SMP
      CPU 3
      ...
      Pid: 7302, comm: trinity-child3 Not tainted 3.4.24.09+ 40 Huawei Technologies Co., Ltd. Tecal RH2285          /BC11BTSA
      RIP: 0010:[<ffffffffa0109738>]  [<ffffffffa0109738>] dlci_ioctl+0xd8/0x2d4 [dlci]
      ...
      Call Trace:
        [<ffffffff8137c5c3>] sock_ioctl+0x153/0x280
        [<ffffffff81195494>] do_vfs_ioctl+0xa4/0x5e0
        [<ffffffff8118354a>] ? fget_light+0x3ea/0x490
        [<ffffffff81195a1f>] sys_ioctl+0x4f/0x80
        [<ffffffff81478b69>] system_call_fastpath+0x16/0x1b
      ...
      
      It's because the net device is not a dlci device.
      Reported-by: NLi Jinyue <lijinyue@huawei.com>
      Signed-off-by: NLi Zefan <lizefan@huawei.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      578a1310
    • Z
      dlci: acquire rtnl_lock before calling __dev_get_by_name() · 11eb2645
      Zefan Li 提交于
      Otherwise the net device returned can be freed at anytime.
      Signed-off-by: NLi Zefan <lizefan@huawei.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11eb2645