1. 29 May, 2014 40 commits
    • Andy King's avatar
      vsock: Make transport the proto owner · 368986ee
      Andy King authored
      [ Upstream commit 2c4a336e ]
      
      Right now the core vsock module is the owner of the proto family. This
      means there's nothing preventing the transport module from unloading if
      there are open sockets, which results in a panic. Fix that by allowing
      the transport to be the owner, which will refcount it properly.
      
      Includes version bump to 1.0.1.0-k
      
      Passes checkpatch this time, I swear...
      Acked-by: default avatarDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: default avatarAndy King <acking@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      368986ee
    • Liu Yu's avatar
      tcp_cubic: fix the range of delayed_ack · e78282a5
      Liu Yu authored
      [ Upstream commit 0cda345d ]
      
      commit b9f47a3a (tcp_cubic: limit delayed_ack ratio to prevent
      divide error) try to prevent divide error, but there is still a little
      chance that delayed_ack can reach zero. In case the param cnt get
      negative value, then ratio+cnt would overflow and may happen to be zero.
      As a result, min(ratio, ACK_RATIO_LIMIT) will calculate to be zero.
      
      In some old kernels, such as 2.6.32, there is a bug that would
      pass negative param, which then ultimately leads to this divide error.
      
      commit 5b35e1e6 (tcp: fix tcp_trim_head() to adjust segment count
      with skb MSS) fixed the negative param issue. However,
      it's safe that we fix the range of delayed_ack as well,
      to make sure we do not hit a divide by zero.
      
      CC: Stephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarLiu Yu <allanyuliu@tencent.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e78282a5
    • Vlad Yasevich's avatar
      Revert "macvlan : fix checksums error when we are in bridge mode" · 04adf0fb
      Vlad Yasevich authored
      [ Upstream commit f114890c ]
      
      This reverts commit 12a2856b.
      The commit above doesn't appear to be necessary any more as the
      checksums appear to be correctly computed/validated.
      
      Additionally the above commit breaks kvm configurations where
      one VM is using a device that support checksum offload (virtio) and
      the other VM does not.
      In this case, packets leaving virtio device will have CHECKSUM_PARTIAL
      set.  The packets is forwarded to a macvtap that has offload features
      turned off.  Since we use CHECKSUM_UNNECESSARY, the host does does not
      update the checksum and thus a bad checksum is passed up to
      the guest.
      
      CC: Daniel Lezcano <daniel.lezcano@free.fr>
      CC: Patrick McHardy <kaber@trash.net>
      CC: Andrian Nord <nightnord@gmail.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Jason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      04adf0fb
    • Vlad Yasevich's avatar
      mactap: Fix checksum errors for non-gso packets in bridge mode · e8d41427
      Vlad Yasevich authored
      [ Upstream commit cbdb0427 ]
      
      The following is a problematic configuration:
      
       VM1: virtio-net device connected to macvtap0@eth0
       VM2: e1000 device connect to macvtap1@eth0
      
      The problem is is that virtio-net supports checksum offloading
      and thus sends the packets to the host with CHECKSUM_PARTIAL set.
      On the other hand, e1000 does not support any acceleration.
      
      For small TCP packets (and this includes the 3-way handshake),
      e1000 ends up receiving packets that only have a partial checksum
      set.  This causes TCP to fail checksum validation and to drop
      packets.  As a result tcp connections can not be established.
      
      Commit 3e4f8b78
      	macvtap: Perform GSO on forwarding path.
      fixes this issue for large packets wthat will end up undergoing GSO.
      This commit adds a check for the non-GSO case and attempts to
      compute the checksum for partially checksummed packets in the
      non-GSO case.
      
      CC: Daniel Lezcano <daniel.lezcano@free.fr>
      CC: Patrick McHardy <kaber@trash.net>
      CC: Andrian Nord <nightnord@gmail.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Jason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e8d41427
    • Oliver Hartkopp's avatar
      slip: fix spinlock variant · 742bc1c6
      Oliver Hartkopp authored
      [ Upstream commit ddcde142 ]
      
      With commit cc9fa74e ("slip/slcan: added locking in wakeup function") a
      formerly missing locking was added to slip.c and slcan.c by Andre Naujoks.
      
      Alexander Stein contributed the fix 367525c8 ("can: slcan: Fix spinlock
      variant") as the kernel lock debugging advised to use spin_lock_bh() instead
      of just using spin_lock().
      
      This fix has to be applied to the same code section in slip.c for the same
      reason too.
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      742bc1c6
    • Bjørn Mork's avatar
      net: qmi_wwan: add a number of Dell devices · 692e923e
      Bjørn Mork authored
      [ Upstream commit 6f10c5d1 ]
      
      Dan writes:
      
      "The Dell drivers use the same configuration for PIDs:
      
      81A2: Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card
      81A3: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card
      81A4: Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card
      81A8: Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card
      81A9: Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card
      
      These devices are all clearly Sierra devices, but are also definitely
      Gobi-based.  The A8 might be the MC7700/7710 and A9 is likely a MC7750.
      
      >From DellGobi5kSetup.exe from the Dell drivers:
      
      usbif0: serial/firmware loader?
      usbif2: nmea
      usbif3: modem/ppp
      usbif8: net/QMI"
      Reported-by: default avatarAceLan Kao <acelan.kao@canonical.com>
      Reported-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      692e923e
    • Bjørn Mork's avatar
      net: qmi_wwan: add a number of CMOTech devices · 66bafbb2
      Bjørn Mork authored
      [ Upstream commit 41be7d90 ]
      
      A number of older CMOTech modems are based on Qualcomm
      chips and exporting a QMI/wwan function.
      Reported-by: default avatarLars Melin <larsm17@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      66bafbb2
    • Bjørn Mork's avatar
      net: qmi_wwan: add Alcatel L800MA · ea942a5c
      Bjørn Mork authored
      [ Upstream commit 75573660 ]
      
      Device interface layout:
      0: ff/ff/ff - serial
      1: ff/00/00 - serial AT+PPP
      2: ff/ff/ff - QMI/wwan
      3: 08/06/50 - storage
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ea942a5c
    • Bjørn Mork's avatar
      net: qmi_wwan: add Olivetti Olicard 500 · 39e5bd5d
      Bjørn Mork authored
      [ Upstream commit efc0b25c ]
      
      Device interface layout:
      0: ff/ff/ff - serial
      1: ff/ff/ff - serial AT+PPP
      2: 08/06/50 - storage
      3: ff/ff/ff - serial
      4: ff/ff/ff - QMI/wwan
      Reported-by: default avatarJulio Araujo <julio.araujo@wllctel.com.br>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      39e5bd5d
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless MC7305/MC7355 · f4d5e369
      Bjørn Mork authored
      [ Upstream commit 9214224e ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f4d5e369
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless MC73xx · d2945a5a
      Bjørn Mork authored
      [ Upstream commit 1c138607 ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d2945a5a
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless EM7355 · 728d25ed
      Bjørn Mork authored
      [ Upstream commit b85f5dea ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      728d25ed
    • Xufeng Zhang's avatar
      sctp: reset flowi4_oif parameter on route lookup · 90f00d5d
      Xufeng Zhang authored
      [ Upstream commit 85350871 ]
      
      commit 813b3b5d (ipv4: Use caller's on-stack flowi as-is
      in output route lookups.) introduces another regression which
      is very similar to the problem of commit e6b45241 (ipv4: reset
      flowi parameters on route connect) wants to fix:
      Before we call ip_route_output_key() in sctp_v4_get_dst() to
      get a dst that matches a bind address as the source address,
      we have already called this function previously and the flowi
      parameters have been initialized including flowi4_oif, so when
      we call this function again, the process in __ip_route_output_key()
      will be different because of the setting of flowi4_oif, and we'll
      get a networking device which corresponds to the inputted flowi4_oif
      as the output device, this is wrong because we'll never hit this
      place if the previously returned source address of dst match one
      of the bound addresses.
      
      To reproduce this problem, a vlan setting is enough:
        # ifconfig eth0 up
        # route del default
        # vconfig add eth0 2
        # vconfig add eth0 3
        # ifconfig eth0.2 10.0.1.14 netmask 255.255.255.0
        # route add default gw 10.0.1.254 dev eth0.2
        # ifconfig eth0.3 10.0.0.14 netmask 255.255.255.0
        # ip rule add from 10.0.0.14 table 4
        # ip route add table 4 default via 10.0.0.254 src 10.0.0.14 dev eth0.3
        # sctp_darn -H 10.0.0.14 -P 36422 -h 10.1.4.134 -p 36422 -s -I
      You'll detect that all the flow are routed to eth0.2(10.0.1.254).
      Signed-off-by: default avatarXufeng Zhang <xufeng.zhang@windriver.com>
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      90f00d5d
    • Toshiaki Makita's avatar
      bridge: Handle IFLA_ADDRESS correctly when creating bridge device · c07ff541
      Toshiaki Makita authored
      [ Upstream commit 30313a3d ]
      
      When bridge device is created with IFLA_ADDRESS, we are not calling
      br_stp_change_bridge_id(), which leads to incorrect local fdb
      management and bridge id calculation, and prevents us from receiving
      frames on the bridge device.
      Reported-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c07ff541
    • Kumar Sundararajan's avatar
      ipv6: fib: fix fib dump restart · f0b511ca
      Kumar Sundararajan authored
      [ Upstream commit 1c265854 ]
      
      When the ipv6 fib changes during a table dump, the walk is
      restarted and the number of nodes dumped are skipped. But the existing
      code doesn't advance to the next node after a node is skipped. This can
      cause the dump to loop or produce lots of duplicates when the fib
      is modified during the dump.
      
      This change advances the walk to the next node if the current node is
      skipped after a restart.
      Signed-off-by: default avatarKumar Sundararajan <kumar@fb.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f0b511ca
    • David Gibson's avatar
      rtnetlink: Only supply IFLA_VF_PORTS information when RTEXT_FILTER_VF is set · e63f88ce
      David Gibson authored
      [ Upstream commit c53864fd ]
      
      Since 115c9b81 (rtnetlink: Fix problem with
      buffer allocation), RTM_NEWLINK messages only contain the IFLA_VFINFO_LIST
      attribute if they were solicited by a GETLINK message containing an
      IFLA_EXT_MASK attribute with the RTEXT_FILTER_VF flag.
      
      That was done because some user programs broke when they received more data
      than expected - because IFLA_VFINFO_LIST contains information for each VF
      it can become large if there are many VFs.
      
      However, the IFLA_VF_PORTS attribute, supplied for devices which implement
      ndo_get_vf_port (currently the 'enic' driver only), has the same problem.
      It supplies per-VF information and can therefore become large, but it is
      not currently conditional on the IFLA_EXT_MASK value.
      
      Worse, it interacts badly with the existing EXT_MASK handling.  When
      IFLA_EXT_MASK is not supplied, the buffer for netlink replies is fixed at
      NLMSG_GOODSIZE.  If the information for IFLA_VF_PORTS exceeds this, then
      rtnl_fill_ifinfo() returns -EMSGSIZE on the first message in a packet.
      netlink_dump() will misinterpret this as having finished the listing and
      omit data for this interface and all subsequent ones.  That can cause
      getifaddrs(3) to enter an infinite loop.
      
      This patch addresses the problem by only supplying IFLA_VF_PORTS when
      IFLA_EXT_MASK is supplied with the RTEXT_FILTER_VF flag set.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e63f88ce
    • David Gibson's avatar
      rtnetlink: Warn when interface's information won't fit in our packet · 5a6aea7c
      David Gibson authored
      [ Upstream commit 973462bb ]
      
      Without IFLA_EXT_MASK specified, the information reported for a single
      interface in response to RTM_GETLINK is expected to fit within a netlink
      packet of NLMSG_GOODSIZE.
      
      If it doesn't, however, things will go badly wrong,  When listing all
      interfaces, netlink_dump() will incorrectly treat -EMSGSIZE on the first
      message in a packet as the end of the listing and omit information for
      that interface and all subsequent ones.  This can cause getifaddrs(3) to
      enter an infinite loop.
      
      This patch won't fix the problem, but it will WARN_ON() making it easier to
      track down what's going wrong.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarJiri Pirko <jpirko@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5a6aea7c
    • Andrew Lutomirski's avatar
      net: Fix ns_capable check in sock_diag_put_filterinfo · 6bebcc8d
      Andrew Lutomirski authored
      [ Upstream commit 78541c1d ]
      
      The caller needs capabilities on the namespace being queried, not on
      their own namespace.  This is a security bug, although it likely has
      only a minor impact.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6bebcc8d
    • Vlad Yasevich's avatar
      net: sctp: cache auth_enable per endpoint · 88830f22
      Vlad Yasevich authored
      [ Upstream commit b14878cc ]
      
      Currently, it is possible to create an SCTP socket, then switch
      auth_enable via sysctl setting to 1 and crash the system on connect:
      
      Oops[#1]:
      CPU: 0 PID: 0 Comm: swapper Not tainted 3.14.1-mipsgit-20140415 #1
      task: ffffffff8056ce80 ti: ffffffff8055c000 task.ti: ffffffff8055c000
      [...]
      Call Trace:
      [<ffffffff8043c4e8>] sctp_auth_asoc_set_default_hmac+0x68/0x80
      [<ffffffff8042b300>] sctp_process_init+0x5e0/0x8a4
      [<ffffffff8042188c>] sctp_sf_do_5_1B_init+0x234/0x34c
      [<ffffffff804228c8>] sctp_do_sm+0xb4/0x1e8
      [<ffffffff80425a08>] sctp_endpoint_bh_rcv+0x1c4/0x214
      [<ffffffff8043af68>] sctp_rcv+0x588/0x630
      [<ffffffff8043e8e8>] sctp6_rcv+0x10/0x24
      [<ffffffff803acb50>] ip6_input+0x2c0/0x440
      [<ffffffff8030fc00>] __netif_receive_skb_core+0x4a8/0x564
      [<ffffffff80310650>] process_backlog+0xb4/0x18c
      [<ffffffff80313cbc>] net_rx_action+0x12c/0x210
      [<ffffffff80034254>] __do_softirq+0x17c/0x2ac
      [<ffffffff800345e0>] irq_exit+0x54/0xb0
      [<ffffffff800075a4>] ret_from_irq+0x0/0x4
      [<ffffffff800090ec>] rm7k_wait_irqoff+0x24/0x48
      [<ffffffff8005e388>] cpu_startup_entry+0xc0/0x148
      [<ffffffff805a88b0>] start_kernel+0x37c/0x398
      Code: dd0900b8  000330f8  0126302d <dcc60000> 50c0fff1  0047182a  a48306a0
      03e00008  00000000
      ---[ end trace b530b0551467f2fd ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      What happens while auth_enable=0 in that case is, that
      ep->auth_hmacs is initialized to NULL in sctp_auth_init_hmacs()
      when endpoint is being created.
      
      After that point, if an admin switches over to auth_enable=1,
      the machine can crash due to NULL pointer dereference during
      reception of an INIT chunk. When we enter sctp_process_init()
      via sctp_sf_do_5_1B_init() in order to respond to an INIT chunk,
      the INIT verification succeeds and while we walk and process
      all INIT params via sctp_process_param() we find that
      net->sctp.auth_enable is set, therefore do not fall through,
      but invoke sctp_auth_asoc_set_default_hmac() instead, and thus,
      dereference what we have set to NULL during endpoint
      initialization phase.
      
      The fix is to make auth_enable immutable by caching its value
      during endpoint initialization, so that its original value is
      being carried along until destruction. The bug seems to originate
      from the very first days.
      
      Fix in joint work with Daniel Borkmann.
      Reported-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Tested-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      88830f22
    • Ivan Vecera's avatar
      tg3: update rx_jumbo_pending ring param only when jumbo frames are enabled · 6341e247
      Ivan Vecera authored
      The patch fixes a problem with dropped jumbo frames after usage of
      'ethtool -G ... rx'.
      
      Scenario:
      1. ip link set eth0 up
      2. ethtool -G eth0 rx N # <- This zeroes rx-jumbo
      3. ip link set mtu 9000 dev eth0
      
      The ethtool command set rx_jumbo_pending to zero so any received jumbo
      packets are dropped and you need to use 'ethtool -G eth0 rx-jumbo N'
      to workaround the issue.
      The patch changes the logic so rx_jumbo_pending value is changed only if
      jumbo frames are enabled (MTU > 1500).
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Acked-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6341e247
    • dingtianhong's avatar
      vlan: Fix lockdep warning when vlan dev handle notification · 059590c8
      dingtianhong authored
      [ Upstream commit dc8eaaa0 ]
      
      When I open the LOCKDEP config and run these steps:
      
      modprobe 8021q
      vconfig add eth2 20
      vconfig add eth2.20 30
      ifconfig eth2 xx.xx.xx.xx
      
      then the Call Trace happened:
      
      [32524.386288] =============================================
      [32524.386293] [ INFO: possible recursive locking detected ]
      [32524.386298] 3.14.0-rc2-0.7-default+ #35 Tainted: G           O
      [32524.386302] ---------------------------------------------
      [32524.386306] ifconfig/3103 is trying to acquire lock:
      [32524.386310]  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff814275f4>] dev_mc_sync+0x64/0xb0
      [32524.386326]
      [32524.386326] but task is already holding lock:
      [32524.386330]  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff8141af83>] dev_set_rx_mode+0x23/0x40
      [32524.386341]
      [32524.386341] other info that might help us debug this:
      [32524.386345]  Possible unsafe locking scenario:
      [32524.386345]
      [32524.386350]        CPU0
      [32524.386352]        ----
      [32524.386354]   lock(&vlan_netdev_addr_lock_key/1);
      [32524.386359]   lock(&vlan_netdev_addr_lock_key/1);
      [32524.386364]
      [32524.386364]  *** DEADLOCK ***
      [32524.386364]
      [32524.386368]  May be due to missing lock nesting notation
      [32524.386368]
      [32524.386373] 2 locks held by ifconfig/3103:
      [32524.386376]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81431d42>] rtnl_lock+0x12/0x20
      [32524.386387]  #1:  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff8141af83>] dev_set_rx_mode+0x23/0x40
      [32524.386398]
      [32524.386398] stack backtrace:
      [32524.386403] CPU: 1 PID: 3103 Comm: ifconfig Tainted: G           O 3.14.0-rc2-0.7-default+ #35
      [32524.386409] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
      [32524.386414]  ffffffff81ffae40 ffff8800d9625ae8 ffffffff814f68a2 ffff8800d9625bc8
      [32524.386421]  ffffffff810a35fb ffff8800d8a8d9d0 00000000d9625b28 ffff8800d8a8e5d0
      [32524.386428]  000003cc00000000 0000000000000002 ffff8800d8a8e5f8 0000000000000000
      [32524.386435] Call Trace:
      [32524.386441]  [<ffffffff814f68a2>] dump_stack+0x6a/0x78
      [32524.386448]  [<ffffffff810a35fb>] __lock_acquire+0x7ab/0x1940
      [32524.386454]  [<ffffffff810a323a>] ? __lock_acquire+0x3ea/0x1940
      [32524.386459]  [<ffffffff810a4874>] lock_acquire+0xe4/0x110
      [32524.386464]  [<ffffffff814275f4>] ? dev_mc_sync+0x64/0xb0
      [32524.386471]  [<ffffffff814fc07a>] _raw_spin_lock_nested+0x2a/0x40
      [32524.386476]  [<ffffffff814275f4>] ? dev_mc_sync+0x64/0xb0
      [32524.386481]  [<ffffffff814275f4>] dev_mc_sync+0x64/0xb0
      [32524.386489]  [<ffffffffa0500cab>] vlan_dev_set_rx_mode+0x2b/0x50 [8021q]
      [32524.386495]  [<ffffffff8141addf>] __dev_set_rx_mode+0x5f/0xb0
      [32524.386500]  [<ffffffff8141af8b>] dev_set_rx_mode+0x2b/0x40
      [32524.386506]  [<ffffffff8141b3cf>] __dev_open+0xef/0x150
      [32524.386511]  [<ffffffff8141b177>] __dev_change_flags+0xa7/0x190
      [32524.386516]  [<ffffffff8141b292>] dev_change_flags+0x32/0x80
      [32524.386524]  [<ffffffff8149ca56>] devinet_ioctl+0x7d6/0x830
      [32524.386532]  [<ffffffff81437b0b>] ? dev_ioctl+0x34b/0x660
      [32524.386540]  [<ffffffff814a05b0>] inet_ioctl+0x80/0xa0
      [32524.386550]  [<ffffffff8140199d>] sock_do_ioctl+0x2d/0x60
      [32524.386558]  [<ffffffff81401a52>] sock_ioctl+0x82/0x2a0
      [32524.386568]  [<ffffffff811a7123>] do_vfs_ioctl+0x93/0x590
      [32524.386578]  [<ffffffff811b2705>] ? rcu_read_lock_held+0x45/0x50
      [32524.386586]  [<ffffffff811b39e5>] ? __fget_light+0x105/0x110
      [32524.386594]  [<ffffffff811a76b1>] SyS_ioctl+0x91/0xb0
      [32524.386604]  [<ffffffff815057e2>] system_call_fastpath+0x16/0x1b
      
      ========================================================================
      
      The reason is that all of the addr_lock_key for vlan dev have the same class,
      so if we change the status for vlan dev, the vlan dev and its real dev will
      hold the same class of addr_lock_key together, so the warning happened.
      
      we should distinguish the lock depth for vlan dev and its real dev.
      
      v1->v2: Convert the vlan_netdev_addr_lock_key to an array of eight elements, which
      	could support to add 8 vlan id on a same vlan dev, I think it is enough for current
      	scene, because a netdev's name is limited to IFNAMSIZ which could not hold 8 vlan id,
      	and the vlan dev would not meet the same class key with its real dev.
      
      	The new function vlan_dev_get_lockdep_subkey() will return the subkey and make the vlan
      	dev could get a suitable class key.
      
      v2->v3: According David's suggestion, I use the subclass to distinguish the lock key for vlan dev
      	and its real dev, but it make no sense, because the difference for subclass in the
      	lock_class_key doesn't mean that the difference class for lock_key, so I use lock_depth
      	to distinguish the different depth for every vlan dev, the same depth of the vlan dev
      	could have the same lock_class_key, I import the MAX_LOCK_DEPTH from the include/linux/sched.h,
      	I think it is enough here, the lockdep should never exceed that value.
      
      v3->v4: Add a huge array of locking keys will waste static kernel memory and is not a appropriate method,
      	we could use _nested() variants to fix the problem, calculate the depth for every vlan dev,
      	and use the depth as the subclass for addr_lock_key.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      059590c8
    • Nicolas Dichtel's avatar
      ip6_gre: don't allow to remove the fb_tunnel_dev · 3565e185
      Nicolas Dichtel authored
      [ Upstream commit 54d63f78 ]
      
      It's possible to remove the FB tunnel with the command 'ip link del ip6gre0' but
      this is unsafe, the module always supposes that this device exists. For example,
      ip6gre_tunnel_lookup() may use it unconditionally.
      
      Let's add a rtnl handler for dellink, which will never remove the FB tunnel (we
      let ip6gre_destroy_tunnels() do the job).
      
      Introduced by commit c12b395a ("gre: Support GRE over IPv6").
      
      CC: Dmitry Kozlov <xeb@mail.ru>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3565e185
    • Mathias Krause's avatar
      filter: prevent nla extensions to peek beyond the end of the message · dd6e370c
      Mathias Krause authored
      [ Upstream commit 05ab8f26 ]
      
      The BPF_S_ANC_NLATTR and BPF_S_ANC_NLATTR_NEST extensions fail to check
      for a minimal message length before testing the supplied offset to be
      within the bounds of the message. This allows the subtraction of the nla
      header to underflow and therefore -- as the data type is unsigned --
      allowing far to big offset and length values for the search of the
      netlink attribute.
      
      The remainder calculation for the BPF_S_ANC_NLATTR_NEST extension is
      also wrong. It has the minuend and subtrahend mixed up, therefore
      calculates a huge length value, allowing to overrun the end of the
      message while looking for the netlink attribute.
      
      The following three BPF snippets will trigger the bugs when attached to
      a UNIX datagram socket and parsing a message with length 1, 2 or 3.
      
       ,-[ PoC for missing size check in BPF_S_ANC_NLATTR ]--
       | ld	#0x87654321
       | ldx	#42
       | ld	#nla
       | ret	a
       `---
      
       ,-[ PoC for the same bug in BPF_S_ANC_NLATTR_NEST ]--
       | ld	#0x87654321
       | ldx	#42
       | ld	#nlan
       | ret	a
       `---
      
       ,-[ PoC for wrong remainder calculation in BPF_S_ANC_NLATTR_NEST ]--
       | ; (needs a fake netlink header at offset 0)
       | ld	#0
       | ldx	#42
       | ld	#nlan
       | ret	a
       `---
      
      Fix the first issue by ensuring the message length fulfills the minimal
      size constrains of a nla header. Fix the second bug by getting the math
      for the remainder calculation right.
      
      Fixes: 4738c1db ("[SKFILTER]: Add SKF_ADF_NLATTR instruction")
      Fixes: d214c753 ("filter: add SKF_AD_NLATTR_NEST to look for nested..")
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      dd6e370c
    • Julian Anastasov's avatar
      ipv4: return valid RTA_IIF on ip route get · d3fe9147
      Julian Anastasov authored
      [ Upstream commit 91146153 ]
      
      Extend commit 13378cad
      ("ipv4: Change rt->rt_iif encoding.") from 3.6 to return valid
      RTA_IIF on 'ip route get ... iif DEVICE' instead of rt_iif 0
      which is displayed as 'iif *'.
      
      inet_iif is not appropriate to use because skb_iif is not set.
      Use the skb->dev->ifindex instead.
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d3fe9147
    • Nicolas Dichtel's avatar
      vti: don't allow to add the same tunnel twice · 8e41d3a0
      Nicolas Dichtel authored
      [ Upstream commit 8d89dcdf ]
      
      Before the patch, it was possible to add two times the same tunnel:
      ip l a vti1 type vti remote 10.16.0.121 local 10.16.0.249 key 41
      ip l a vti2 type vti remote 10.16.0.121 local 10.16.0.249 key 41
      
      It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
      argument dev->type, which was set only later (when calling ndo_init handler
      in register_netdevice()). Let's set this type in the setup handler, which is
      called before newlink handler.
      
      Introduced by commit b9959fd3 ("vti: switch to new ip tunnel code").
      
      CC: Cong Wang <amwang@redhat.com>
      CC: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      8e41d3a0
    • Nicolas Dichtel's avatar
      gre: don't allow to add the same tunnel twice · d6f8502e
      Nicolas Dichtel authored
      [ Upstream commit 5a455275 ]
      
      Before the patch, it was possible to add two times the same tunnel:
      ip l a gre1 type gre remote 10.16.0.121 local 10.16.0.249
      ip l a gre2 type gre remote 10.16.0.121 local 10.16.0.249
      
      It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
      argument dev->type, which was set only later (when calling ndo_init handler
      in register_netdevice()). Let's set this type in the setup handler, which is
      called before newlink handler.
      
      Introduced by commit c5441932 ("GRE: Refactor GRE tunneling code.").
      
      CC: Pravin B Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d6f8502e
    • Eric Dumazet's avatar
      ipv6: Limit mtu to 65575 bytes · 0e6961b3
      Eric Dumazet authored
      [ Upstream commit 30f78d8e ]
      
      Francois reported that setting big mtu on loopback device could prevent
      tcp sessions making progress.
      
      We do not support (yet ?) IPv6 Jumbograms and cook corrupted packets.
      
      We must limit the IPv6 MTU to (65535 + 40) bytes in theory.
      
      Tested:
      
      ifconfig lo mtu 70000
      netperf -H ::1
      
      Before patch : Throughput :   0.05 Mbits
      
      After patch : Throughput : 35484 Mbits
      Reported-by: default avatarFrancois WELLENREITER <f.wellenreiter@gmail.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0e6961b3
    • Toshiaki Makita's avatar
      bridge: Fix double free and memory leak around br_allowed_ingress · 262cacfb
      Toshiaki Makita authored
      [ Upstream commit eb707618 ]
      
      br_allowed_ingress() has two problems.
      
      1. If br_allowed_ingress() is called by br_handle_frame_finish() and
      vlan_untag() in br_allowed_ingress() fails, skb will be freed by both
      vlan_untag() and br_handle_frame_finish().
      
      2. If br_allowed_ingress() is called by br_dev_xmit() and
      br_allowed_ingress() fails, the skb will not be freed.
      
      Fix these two problems by freeing the skb in br_allowed_ingress()
      if it fails.
      Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      262cacfb
    • Thomas Richter's avatar
      bonding: Remove debug_fs files when module init fails · 2a0fe092
      Thomas Richter authored
      [ Upstream commit db298686 ]
      
      Remove the bonding debug_fs entries when the
      module initialization fails. The debug_fs
      entries should be removed together with all other
      already allocated resources.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
      Signed-off-by: default avatarJay Vosburgh <j.vosburgh@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2a0fe092
    • Florian Westphal's avatar
      net: core: don't account for udp header size when computing seglen · 6a80e19b
      Florian Westphal authored
      [ Upstream commit 6d39d589 ]
      
      In case of tcp, gso_size contains the tcpmss.
      
      For UFO (udp fragmentation offloading) skbs, gso_size is the fragment
      payload size, i.e. we must not account for udp header size.
      
      Otherwise, when using virtio drivers, a to-be-forwarded UFO GSO packet
      will be needlessly fragmented in the forward path, because we think its
      individual segments are too large for the outgoing link.
      
      Fixes: fe6cc55f ("net: ip, ipv6: handle gso skbs in forwarding path")
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Reported-by: default avatarTobias Brunner <tobias@strongswan.org>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6a80e19b
    • Dmitry Petukhov's avatar
      l2tp: take PMTU from tunnel UDP socket · 528738eb
      Dmitry Petukhov authored
      [ Upstream commit f34c4a35 ]
      
      When l2tp driver tries to get PMTU for the tunnel destination, it uses
      the pointer to struct sock that represents PPPoX socket, while it
      should use the pointer that represents UDP socket of the tunnel.
      Signed-off-by: default avatarDmitry Petukhov <dmgenp@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      528738eb
    • Daniel Borkmann's avatar
      net: sctp: test if association is dead in sctp_wake_up_waiters · 56849123
      Daniel Borkmann authored
      [ Upstream commit 1e1cdf8a ]
      
      In function sctp_wake_up_waiters(), we need to involve a test
      if the association is declared dead. If so, we don't have any
      reference to a possible sibling association anymore and need
      to invoke sctp_write_space() instead, and normally walk the
      socket's associations and notify them of new wmem space. The
      reason for special casing is that otherwise, we could run
      into the following issue when a sctp_primitive_SEND() call
      from sctp_sendmsg() fails, and tries to flush an association's
      outq, i.e. in the following way:
      
      sctp_association_free()
      `-> list_del(&asoc->asocs)         <-- poisons list pointer
          asoc->base.dead = true
          sctp_outq_free(&asoc->outqueue)
          `-> __sctp_outq_teardown()
           `-> sctp_chunk_free()
            `-> consume_skb()
             `-> sctp_wfree()
              `-> sctp_wake_up_waiters() <-- dereferences poisoned pointers
                                             if asoc->ep->sndbuf_policy=0
      
      Therefore, only walk the list in an 'optimized' way if we find
      that the current association is still active. We could also use
      list_del_init() in addition when we call sctp_association_free(),
      but as Vlad suggests, we want to trap such bugs and thus leave
      it poisoned as is.
      
      Why is it safe to resolve the issue by testing for asoc->base.dead?
      Parallel calls to sctp_sendmsg() are protected under socket lock,
      that is lock_sock()/release_sock(). Only within that path under
      lock held, we're setting skb/chunk owner via sctp_set_owner_w().
      Eventually, chunks are freed directly by an association still
      under that lock. So when traversing association list on destruction
      time from sctp_wake_up_waiters() via sctp_wfree(), a different
      CPU can't be running sctp_wfree() while another one calls
      sctp_association_free() as both happens under the same lock.
      Therefore, this can also not race with setting/testing against
      asoc->base.dead as we are guaranteed for this to happen in order,
      under lock. Further, Vlad says: the times we check asoc->base.dead
      is when we've cached an association pointer for later processing.
      In between cache and processing, the association may have been
      freed and is simply still around due to reference counts. We check
      asoc->base.dead under a lock, so it should always be safe to check
      and not race against sctp_association_free(). Stress-testing seems
      fine now, too.
      
      Fixes: cd253f9f357d ("net: sctp: wake up all assocs if sndbuf policy is per socket")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Vlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      56849123
    • Daniel Borkmann's avatar
      net: sctp: wake up all assocs if sndbuf policy is per socket · 13d6a70c
      Daniel Borkmann authored
      [ Upstream commit 52c35bef ]
      
      SCTP charges chunks for wmem accounting via skb->truesize in
      sctp_set_owner_w(), and sctp_wfree() respectively as the
      reverse operation. If a sender runs out of wmem, it needs to
      wait via sctp_wait_for_sndbuf(), and gets woken up by a call
      to __sctp_write_space() mostly via sctp_wfree().
      
      __sctp_write_space() is being called per association. Although
      we assign sk->sk_write_space() to sctp_write_space(), which
      is then being done per socket, it is only used if send space
      is increased per socket option (SO_SNDBUF), as SOCK_USE_WRITE_QUEUE
      is set and therefore not invoked in sock_wfree().
      
      Commit 4c3a5bda ("sctp: Don't charge for data in sndbuf
      again when transmitting packet") fixed an issue where in case
      sctp_packet_transmit() manages to queue up more than sndbuf
      bytes, sctp_wait_for_sndbuf() will never be woken up again
      unless it is interrupted by a signal. However, a still
      remaining issue is that if net.sctp.sndbuf_policy=0, that is
      accounting per socket, and one-to-many sockets are in use,
      the reclaimed write space from sctp_wfree() is 'unfairly'
      handed back on the server to the association that is the lucky
      one to be woken up again via __sctp_write_space(), while
      the remaining associations are never be woken up again
      (unless by a signal).
      
      The effect disappears with net.sctp.sndbuf_policy=1, that
      is wmem accounting per association, as it guarantees a fair
      share of wmem among associations.
      
      Therefore, if we have reclaimed memory in case of per socket
      accounting, wake all related associations to a socket in a
      fair manner, that is, traverse the socket association list
      starting from the current neighbour of the association and
      issue a __sctp_write_space() to everyone until we end up
      waking ourselves. This guarantees that no association is
      preferred over another and even if more associations are
      taken into the one-to-many session, all receivers will get
      messages from the server and are not stalled forever on
      high load. This setting still leaves the advantage of per
      socket accounting in touch as an association can still use
      up global limits if unused by others.
      
      Fixes: 4eb701df ("[SCTP] Fix SCTP sendbuffer accouting.")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Vlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      13d6a70c
    • Jani Nikula's avatar
      drm/i915/tv: fix gen4 composite s-video tv-out · 007f639e
      Jani Nikula authored
      commit e1f23f3d upstream.
      
      This is *not* bisected, but the likely regression is
      
      commit c3561438
      Author: Zhao Yakui <yakui.zhao@intel.com>
      Date:   Tue Nov 24 09:48:48 2009 +0800
      
          drm/i915: Don't set up the TV port if it isn't in the BIOS table.
      
      The commit does not check for all TV device types that might be present
      in the VBT, disabling TV out for the missing ones. Add composite
      S-video.
      Reported-and-tested-by: default avatarMatthew Khouzam <matthew.khouzam@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73362Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      007f639e
    • Alex Deucher's avatar
      946a34f2
    • Alex Deucher's avatar
      drm/radeon: call drm_edid_to_eld when we update the edid · 65ee719c
      Alex Deucher authored
      commit 16086279 upstream.
      
      This needs to be done to update some of the fields in
      the connector structure used by the audio code.
      
      Noticed by several users on irc.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      65ee719c
    • Maarten Lankhorst's avatar
      drm/qxl: unset a pointer in sync_obj_unref · 657ac32e
      Maarten Lankhorst authored
      commit 41ccec35 upstream.
      
      This fixes a BUG_ON(bo->sync_obj != NULL); in ttm_bo_release_list.
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      657ac32e
    • Thomas Hellstrom's avatar
      drm/vmwgfx: Make sure user-space can't DMA across buffer object boundaries v2 · e826b6c6
      Thomas Hellstrom authored
      commit cbd75e97 upstream.
      
      We already check that the buffer object we're accessing is registered with
      the file. Now also make sure that we can't DMA across buffer object boundaries.
      
      v2: Code commenting update.
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e826b6c6
    • Christopher Friedt's avatar
      drm/vmwgfx: correct fb_fix_screeninfo.line_length · e30112b5
      Christopher Friedt authored
      commit aa6de142 upstream.
      
      Previously, the vmwgfx_fb driver would allow users to call FBIOSET_VINFO, but it would not adjust
      the FINFO properly, resulting in distorted screen rendering. The patch corrects that behaviour.
      
      See https://bugs.gentoo.org/show_bug.cgi?id=494794 for examples.
      Signed-off-by: default avatarChristopher Friedt <chrisfriedt@gmail.com>
      Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e30112b5
    • Thomas Bächler's avatar
      fs: Don't return 0 from get_anon_bdev · c36604fe
      Thomas Bächler authored
      commit a2a4dc49 upstream.
      
      Commit 9e30cc95 removed an internal mount. This
      has the side-effect that rootfs now has FSID 0. Many
      userspace utilities assume that st_dev in struct stat
      is never 0, so this change breaks a number of tools in
      early userspace.
      
      Since we don't know how many userspace programs are affected,
      make sure that FSID is at least 1.
      
      References: http://article.gmane.org/gmane.linux.kernel/1666905
      References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557Signed-off-by: default avatarThomas Bächler <thomas@archlinux.org>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Tested-by: default avatarAlexandre Demers <alexandre.f.demers@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c36604fe