stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 000/171 ] 3.6.11.2-stable review
@ 2013-04-11 20:25 Steven Rostedt
  2013-04-11 20:25 ` [ 001/171 ] IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum" Steven Rostedt
                   ` (170 more replies)
  0 siblings, 171 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 32027 bytes --]


This is the start of the stable review cycle for 3.6.11.2 release.
There are 171 patches in this series, which will be posted as responses
to this one. If anyone has any issues with these being applied, please
let me know.

Responses should be made by Sun Apr 14 2013.
Anything received after that time might be too late.

Al Viro (3):
      Nest rename_lock inside vfsmount_lock
         [7ea600b5314529f9d1b9d6d3c41cb26fce6a7a4a]
      vt: synchronize_rcu() under spinlock is not nice...
         [e8cd81693bbbb15db57d3c9aa7dd90eda4842874]
      saner proc_get_inode() calling conventions
         [d3d009cb965eae7e002ea5badf603ea8f4c34915]

Alan Stern (2):
      usb: gadget: udc-core: fix a regression during gadget driver unbinding
         [511f3c5326eabe1ece35202a404c24c0aeacc246]
      USB: EHCI: fix regression in QH unlinking
         [d714aaf649460cbfd5e82e75520baa856b4fa0a0]

Alex Deucher (3):
      drm/radeon/benchmark: make sure bo blit copy exists before using it
         [fa8d387dc3f62062a6b4afbbb2a3438094fd8584]
      drm/radeon: add support for Richland APUs
         [e4d170633fde379f39a90f8a5e7eb619b5d1144d]
      drm/radeon: add Richland pci ids
         [b75bbaa038ffc426e88ea3df6c4ae11834fc3e4f]

Amit Shah (2):
      virtio: console: add locking around c_ovq operations
         [9ba5c80b1aea8648a3efe5f22dc1f7cacdfbeeb8]
      virtio: console: rename cvq_lock to c_ivq_lock
         [165b1b8bbc17c9469b053bab78b11b7cbce6d161]

Amitkumar Karwar (1):
      mwifiex: fix race when queuing commands
         [00d7ea11ff0783e24fe70778f3141270b561aaa1]

Anatol Pomozov (1):
      loop: prevent bdev freeing while device in use
         [c1681bf8a7b1b98edee8b862a42c19c4e53205fd]

Andrzej Pietrasiewicz (1):
      usb: gadget: ffs: fix enable multiple instances
         [3416905ba058e43112ad7b1b4859797f027f5a07]

Andy Grover (1):
      target/iscsi: Fix mutual CHAP auth on big-endian arches
         [7ac9ad11b2a5cf77a92b58ee6b672ad2fa155eb1]

Ben Hutchings (5):
      sfc: Only use TX push if a single descriptor is to be written
         [fae8563b25f73dc584a07bcda7a82750ff4f7672]
      sfc: Detach net device when stopping queues for reconfiguration
         [29c69a4882641285a854d6d03ca5adbba68c0034]
      sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0
         [c73e787a8db9117d59b5180baf83203a42ecadca]
      sfc: Fix efx_rx_buf_offset() in the presence of swiotlb
         [b590ace09d51cd39744e0f7662c5e4a0d1b5d952]
      sfc: Properly sync RX DMA buffer when it is not the last in the page
         [3a68f19d7afb80f548d016effbc6ed52643a8085]

Bing Zhao (2):
      mwifiex: skip pending commands after function shutdown
         [a3e240cacc93a06bff3313e28938e980d01a2160]
      mwifiex: fix potential out-of-boundary access to ibss rate table
         [5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c]

CQ Tang (1):
      x86-64: Fix the failure case in copy_user_handle_tail()
         [66db3feb486c01349f767b98ebb10b0c3d2d021b]

Chris Mason (1):
      Btrfs: fix race between mmap writes and compression
         [4adaa611020fa6ac65b0ac8db78276af4ec04e63]

Chris Metcalf (1):
      tile: expect new initramfs name from hypervisor file system
         [ff7f3efb9abf986f4ecd8793a9593f7ca4d6431a]

Cong Wang (1):
      8021q: fix a potential use-after-free
         [4a7df340ed1bac190c124c1601bfc10cde9fb4fb]

Daniel Mack (2):
      ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()
         [83ea5d18d74f032a760fecde78c0210f66f7f70c]
      ALSA: snd-usb: mixer: propagate errors up the call chain
         [4d7b86c98e445b075c2c4c3757eb6d3d6efbe72e]

Daniel Pieczko (1):
      sfc: lock TX queues when calling netif_device_detach()
         [c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1]

David Vrabel (1):
      xen/blkback: correctly respond to unknown, non-native requests
         [0e367ae46503cfe7791460c8ba8434a5d60b2bd5]

David Ward (1):
      net/ipv4: Ensure that location of timestamp option is stored
         [4660c7f498c07c43173142ea95145e9dac5a6d14]

Denis V. Lunev (1):
      ipv4: fix definition of FIB_TABLE_HASHSZ
         [5b9e12dbf92b441b37136ea71dac59f05f2673a9]

Dmitry Artamonow (1):
      usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player
         [29f86e66428ee083aec106cca1748dc63d98ce23]

Dmitry Torokhov (1):
      USB: xhci - fix bit definitions for IMAN register
         [f8264340e694604863255cc0276491d17c402390]

Emmanuel Grumbach (1):
      iwlwifi: dvm: don't send HCMD in restart flow
         [2d5d50ee596361566f7f84300117cba7d7672bc5]

Eric Dumazet (7):
      net: add a synchronize_net() in netdev_rx_handler_unregister()
         [00cfec37484761a44a3b6f4675a54caa618210ae]
      aoe: reserve enough headroom on skbs
         [91c5746425aed8f7188a351f1224a26aa232e4b3]
      tcp: preserve ACK clocking in TSO
         [f4541d60a449afd40448b06496dcd510f505928e]
      net: remove a WARN_ON() in net_enable_timestamp()
         [9979a55a833883242e3a29f3596676edd7199c46]
      tcp: dont handle MTU reduction on LISTEN socket
         [0d4f0608619de59fd8169dd8e72aadc28d80e715]
      tcp: fix skb_availroom()
         [16fad69cfe4adbbfa813de516757b87bcae36d93]
      net: qdisc busylock needs lockdep annotations
         [23d3b8bfb8eb20e7d96afa09991e6a5ed1c83164]

Eric Hutter (1):
      ARM: kirkwood: Fix chip-delay for GoFlex Net
         [2992714d431976c4b154875bd18ba61bf4df3b93]

Eric W. Biederman (3):
      ipc: Restrict mounting the mqueue filesystem
         [a636b702ed1805e988ad3d8ff8b52c060f8b341c]
      vfs: Add a mount flag to lock read only bind mounts
         [90563b198e4c6674c63672fae1923da467215f45]
      userns: Don't allow creation if the user is chrooted
         [3151527ee007b73a0ebd296010f1c0454a919c7d]

Felix Fietkau (1):
      ath9k: limit tx path hang check to normal data queues
         [01d4ab96d2e7fceaad204e5a8710ce34e229b8c5]

Hannes Frederic Sowa (4):
      ipv6: don't accept node local multicast traffic from the wire
         [1c4a154e5253687c51123956dfcee9e9dfa8542d]
      ipv6: don't accept multicast traffic with scope 0
         [20314092c1b41894d8c181bf9aa6f022be2416aa]
      atl1e: drop pci-msi support because of packet corruption
         [188ab1b105c96656f6bcfb49d0d8bb1b1936b632]
      inet: limit length of fragment queue hash table bucket lists
         [5a3da1fe9561828d0ca7eca664b16ec2b9bf0055]

Hannes Reinecke (1):
      USB: xhci: correctly enable interrupts
         [00eed9c814cb8f281be6f0f5d8f45025dc0a97eb]

Hong Zhiguo (1):
      ipv6: fix bad free of addrconf_init_net
         [a79ca223e029aa4f09abb337accf1812c900a800]

Ian Abbott (1):
      staging: comedi: s626: fix continuous acquisition
         [e4317ce877a31dbb9d96375391c1c4ad2210d637]

Iestyn C. Elfick (1):
      b43: A fix for DMA transmission sequence errors
         [b251412db99ccd4495ce372fec7daee27bf06923]

J. Bruce Fields (1):
      nfsd4: reject "negative" acl lengths
         [64a817cfbded8674f345d1117b117f942a351a69]

Jan Beulich (1):
      xen-blkback: fix dispatch_rw_block_io() error path
         [0e5e098ac22dae38f957e951b70d3cf73beff0f7]

Jan Kara (2):
      udf: Fix bitmap overflow on large filesystems with small block size
         [89b1f39eb4189de745fae554b0d614d87c8d5c63]
      jbd2: fix use after free in jbd2_journal_dirty_metadata()
         [ad56edad089b56300fd13bb9eeb7d0424d978239]

Jeff Layton (1):
      cifs: ignore everything in SPNEGO blob after mechTypes
         [f853c616883a8de966873a1dab283f1369e275a1]

Jiri Kosina (1):
      HID: usbhid: fix build problem
         [570637dc8eeb2faba06228d497ff40bb019bcc93]

Joerg Roedel (1):
      iommu/amd: Make sure dma_ops are set for hotplug devices
         [c2a2876e863356b092967ea62bebdb4dd663af80]

Johan Hovold (21):
      USB: ti_usb_3410_5052: fix use-after-free in TIOCMIWAIT
         [fc98ab873aa3dbe783ce56a2ffdbbe7c7609521a]
      USB: cypress_m8: fix use-after-free in TIOCMIWAIT
         [356050d8b1e526db093e9d2c78daf49d6bf418e3]
      USB: mct_u232: fix use-after-free in TIOCMIWAIT
         [cf1d24443677a0758cfa88ca40f24858b89261c0]
      USB: ark3116: fix use-after-free in TIOCMIWAIT
         [5018860321dc7a9e50a75d5f319bc981298fb5b7]
      USB: f81232: fix use-after-free in TIOCMIWAIT
         [508f940f1407656076a2e7d8f7fa059b567ecac2]
      USB: io_edgeport: fix use-after-free in TIOCMIWAIT
         [333576255d4cfc53efd056aad438568184b36af6]
      USB: ch341: fix use-after-free in TIOCMIWAIT
         [fa1e11d5231c001c80a479160b5832933c5d35fb]
      USB: ssu100: fix use-after-free in TIOCMIWAIT
         [43a66b4c417ad15f6d2f632ce67ad195bdf999e8]
      USB: spcp8x5: fix use-after-free in TIOCMIWAIT
         [dbcea7615d8d7d58f6ff49d2c5568113f70effe9]
      USB: mos7840: fix use-after-free in TIOCMIWAIT
         [a14430db686b8e459e1cf070a6ecf391515c9ab9]
      USB: pl2303: fix use-after-free in TIOCMIWAIT
         [40509ca982c00c4b70fc00be887509feca0bff15]
      USB: ftdi_sio: fix use-after-free in TIOCMIWAIT
         [71ccb9b01981fabae27d3c98260ea4613207618e]
      USB: oti6858: fix use-after-free in TIOCMIWAIT
         [8edfdab37157d2683e51b8be5d3d5697f66a9f7b]
      USB: io_ti: fix use-after-free in TIOCMIWAIT
         [7b2459690584f239650a365f3411ba2ec1c6d1e0]
      USB: mos7840: fix broken TIOCMIWAIT
         [e670c6af12517d08a403487b1122eecf506021cf]
      USB: quatech2: fix use-after-free in TIOCMIWAIT
         [69f87f40d2b98e8b4ab82a121fd2bd584690b887]
      USB: serial: add modem-status-change wait queue
         [e5b33dc9d16053c2ae4c2c669cf008829530364b]
      USB: io_ti: fix get_icount for two port adapters
         [5492bf3d5655b4954164f69c02955a7fca267611]
      USB: garmin_gps: fix memory leak on disconnect
         [618aa1068df29c37a58045fe940f9106664153fd]
      USB: serial: fix interface refcounting
         [d7971051e4df825e0bc11b995e87bfe86355b8e5]
      USB: cdc-acm: fix device unregistration
         [cb25505fc604292c70fc02143fc102f54c8595f0]

Johannes Berg (1):
      mac80211: always synchronize_net() during station removal
         [27a737ff7cb062fb9cbceba9b44d60aa74862bfa]

Josef Bacik (4):
      Btrfs: fix space leak when we fail to reserve metadata space
         [f4881bc7a83eff263789dd524b7c269d138d4af5]
      Btrfs: don't drop path when printing out tree errors in scrub
         [d8fe29e9dea8d7d61fd140d8779326856478fc62]
      Btrfs: limit the global reserve to 512mb
         [fdf30d1c1b386e1b73116cc7e0fb14e962b763b0]
      Btrfs: use set_nlink if our i_nlink is 0
         [9bf7a4890518186238d2579be16ecc5190a707c0]

Joseph CHANG (1):
      DM9000B: driver initialization upgrade
         [6741f40d198c6a5feb23653a1efd4ca47f93d83d]

Josh Boyer (2):
      HID: usbhid: quirk for MSI GX680R led panel
         [620ae90ed8ca8b6e40cb9e10279b4f5ef9f0ab81]
      HID: usbhid: quirk for Realtek Multi-card reader
         [3d464d9b71ef2f2b40a4bc9dcf06794fd1be9d12]

Julia Lemire (1):
      drm/mgag200: Bug fix: Modified pll algorithm for EH project
         [260b3f1291a75a580d22ce8bfb1499c617272716]

Jussi Kivilinna (1):
      rtlwifi: usb: add missing freeing of skbuff
         [36ef0b473fbf43d5db23eea4616cc1d18cec245f]

Kees Cook (4):
      net/irda: add missing error path release_sock call
         [896ee0eee6261e30c3623be931c3f621428947df]
      tg3: fix length overflow in VPD firmware parsing
         [715230a44310a8cf66fbfb5a46f9a62a9b2de424]
      drm/i915: bounds check execbuffer relocation count
         [3118a4f652c7b12c752f3222af0447008f9b2368]
      drm/i915: restrict kernel address leak in debugfs
         [2563a4524febe8f4a98e717e02436d1aaf672aa2]

Konstantin Holoborodko (1):
      usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD
         [482b0b5d82bd916cc0c55a2abf65bdc69023b843]

Larry Finger (2):
      rtlwifi: rtl8192cu: Fix problem that prevents reassociation
         [9437a248e7cac427c898bdb11bd1ac6844a1ead4]
      rtlwifi: rtl8192cu: Fix schedule while atomic bug splat
         [664899786cb49cb52f620e06ac19c0be524a7cfa]

Linus Torvalds (1):
      vfs,proc: guarantee unique inodes in /proc
         [51f0885e5415b4cc6535e9cdcc5145bfbc134353]

Luis R. Rodriguez (1):
      ath9k: avoid queueing hw check work when suspended
         [7fc0357479eeff4ca808c4d8c09bc7631f576b8d]

Mac Lin (1):
      ARM: cns3xxx: fix mapping of private memory region
         [a3d9052c6296ad3398d3ad649c3c682c3e7ecfa6]

Maciej Żenczykowski (1):
      bnx2x: fix occasional statistics off-by-4GB error
         [b009aac12cd0fe34293c68af8ac48b85be3bd858]

Marc Kleine-Budde (1):
      can: sja1000: fix define conflict on SH
         [f901b6bc404b67d96eca739857c097e022727b71]

Marek Lindner (1):
      batman-adv: verify tt len does not exceed packet len
         [b47506d91259c29b9c75c404737eb6525556f9b4]

Marek Szyprowski (1):
      ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation
         [9d1400cf79afb49584b4873eb22cd5130cb341db]

Mark Rutland (1):
      clockevents: Don't allow dummy broadcast timers
         [a7dc19b8652c862d5b7c4d2339bd3c428bd29c4a]

Masatake YAMATO (2):
      genetlink: trigger BUG_ON if a group name is too long
         [f1e79e208076ffe7bad97158275f1c572c04f5c7]
      thermal: shorten too long mcast group name
         [73214f5d9f33b79918b1f7babddd5c8af28dd23d]

Max.Nekludov@us.elster.com (1):
      ks8851: Fix interpretation of rxlen field.
         [14bc435ea54cb888409efb54fc6b76c13ef530e9]

Michael S. Tsirkin (1):
      vhost/net: fix heads usage of ubuf_info
         [46aa92d1ba162b4b3d6b7102440e459d4e4ee255]

Michal Schmidt (1):
      bnx2x: add missing napi deletion in error path
         [722c6f585088a2c392b4c5d01b87a584bb8fb73f]

Mike Marciniszyn (1):
      IPoIB: Fix send lockup due to missed TX completion
         [1ee9e2aa7b31427303466776f455d43e5e3c9275]

Mikulas Patocka (1):
      dm verity: avoid deadlock
         [3b6b7813b198b578aa7e04e4047ddb8225c37b7f]

Ming Lei (5):
      USB: serial: fix hang when opening port
         [eba0e3c3a0ba7b96f01cbe997680f6a4401a0bfc]
      sysfs: handle failure path correctly for readdir()
         [e5110f411d2ee35bf8d202ccca2e89c633060dca]
      sysfs: fix race between readdir and lseek
         [991f76f837bf22c5bb07261cfd86525a0a96650c]
      Bluetooth: Add support for Dell[QCA 0cf3:817a]
         [ebaf5795ef57a70a042ea259448a465024e2821d]
      Bluetooth: Add support for Dell[QCA 0cf3:0036]
         [d66629c1325399cf080ba8b2fb086c10e5439cdd]

Mirko Lindner (2):
      sky2: Threshold for Pause Packet is set wrong
         [74f9f42c1c1650e74fb464f76644c9041f996851]
      sky2: Receive Overflows not counted
         [9cfe8b156c21cf340b3a10ecb3022fbbc1c39185]

Mugunthan V N (2):
      drivers: net: ethernet: cpsw: use netif_wake_queue() while restarting tx queue
         [b56d6b3fca6d1214dbc9c5655f26e5d4ec04afc8]
      drivers: net: ethernet: davinci_emac: use netif_wake_queue() while restarting tx queue
         [7e51cde276ca820d526c6c21cf8147df595a36bf]

Nicholas Bellinger (1):
      target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os
         [f002a24388cc460c8a9be7d446a9871f7c9d52b6]

Nithin Sujir (1):
      tg3: 5715 does not link up when autoneg off
         [7c6cdead7cc9a99650d15497aae47d7472217eb1]

Paul Moore (1):
      unix: fix a race condition in unix_release()
         [ded34e0fe8fe8c2d595bfa30626654e4b87621e0]

Pavel Emelyanov (1):
      skb: Propagate pfmemalloc on skb from head page only
         [cca7af3889bfa343d33d5e657a38d876abd10e58]

Pawel Wieczorkiewicz (1):
      tty: atmel_serial_probe(): index of atmel_ports[] fix
         [503bded92da283b2f31d87e054c4c6d30c3c2340]

Rafael J. Wysocki (1):
      ACPI: Rework acpi_get_child() to be more efficient
         [33f767d767e9a684e9cd60704d4c049a2014c8d5]

Rafał Miłecki (2):
      b43: N-PHY: use more bits for offset in RSSI calibration
         [2e1253d640eb7f8707d2591c93097c1e9f9c71d5]
      b43: N-PHY: increase initial value of "mind" in RSSI calibration
         [e67dd874e60529dbd2e8232babb1e23479ba2ffa]

Soeren Moch (1):
      USB: EHCI: fix bug in iTD/siTD DMA pool allocation
         [85ecd0322b9a1a9f451d9150e9460ab42fd17219]

Steve Glendinning (1):
      smsc75xx: fix jumbo frame support
         [4c51e53689569398d656e631c17308d9b8e84650]

Steven Rostedt (Red Hat) (7):
      tracing: Prevent buffer overwrite disabled for latency tracers
         [613f04a0f51e6e68ac6fe571ab79da3c0a5eb4da]
      tracing: Keep overwrite in sync between regular and snapshot buffers
         [80902822658aab18330569587cdb69ac1dfdcea8]
      tracing: Protect tracer flags with trace_types_lock
         [69d34da2984c95b33ea21518227e1f9470f11d95]
      tracing: Fix free of probe entry by calling call_rcu_sched()
         [740466bc89ad8bd5afcc8de220f715f62b21e365]
      tracing: Fix race in snapshot swapping
         [2721e72dd10f71a3ba90f59781becf02638aa0d9]
      ppp: Revert backport of "ppp: set qdisc_tx_busylock to avoid LOCKDEP splat"
      IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum"

Takashi Iwai (4):
      drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n()
         [9d1a455b0ca1c2c956b4d9ab212864a8695270f1]
      Revert "drm/i915: try to train DP even harder"
         [3b4f819d5eac94ba8fe5e8c061f6dabfe8d7b22c]
      ALSA: hda - Fix typo in checking IEC958 emphasis bit
         [a686fd141e20244ad75f80ad54706da07d7bb90a]
      ALSA: hda/cirrus - Fix the digital beep registration
         [a86b1a2cd2f81f74e815e07f756edd7bc5b6f034]

Theodore Ts'o (2):
      ext4: fix data=journal fast mount/umount hang
         [2b405bfa84063bfa35621d2d6879f52693c614b0]
      ext4: use atomic64_t for the per-flexbg free_clusters count
         [90ba983f6889e65a3b506b30dc606aa9d1d46cd2]

Tkhai Kirill (1):
      sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option
         [cb29529ea0030e60ef1bbbf8399a43d397a51526]

Torsten Duwe (2):
      KMS: fix EDID detailed timing frame rate
         [c19b3b0f6eed552952845e4ad908dba2113d67b4]
      KMS: fix EDID detailed timing vsync parsing
         [16dad1d743d31a104a849c8944e6b9eb479f6cd7]

Trond Myklebust (4):
      NFSv4.1: Always clear the NFS_INO_LAYOUTCOMMIT in layoutreturn
         [24956804349ca0eadcdde032d65e8c00b4214096]
      NFSv4.1: Fix a race in pNFS layoutcommit
         [a073dbff359f4741013ae4b8395f5364c5e00b48]
      NFSv4: Fix the string length returned by the idmapper
         [cf4ab538f1516606d3ae730dce15d6f33d96b7e1]
      SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked
         [1166fde6a923c30f4351515b6a9a1efc513e7d00]

Veaceslav Falico (5):
      bonding: get netdev_rx_handler_unregister out of locks
         [fcd99434fb5c137274d2e15dd2a6a7455f0f29ff]
      pch_gbe: fix ip_summed checksum reporting on rx
         [76a0e68129d7d24eb995a6871ab47081bbfa0acc]
      bonding: remove already created master sysfs link on failure
         [9fe16b78ee17579cb4f333534cf7043e94c67024]
      bonding: don't call update_speed_duplex() under spinlocks
         [876254ae2758d50dcb08c7bd00caf6a806571178]
      netconsole: don't call __netpoll_cleanup() while atomic
         [3f315bef23075ea8a98a6fe4221a83b83456d970]

Vijay Subramanian (1):
      net: fq_codel: Fix off-by-one error
         [cd68ddd4c29ab523440299f24ff2417fe7a0dca6]

Ville Syrjälä (1):
      drm/i915: Don't clobber crtc->fb when queue_flip fails
         [4a35f83b2b7c6aae3fc0d1c4554fdc99dc33ad07]

Vivek Gautam (1):
      usb: xhci: Fix TRB transfer length macro used for Event TRB.
         [1c11a172cb30492f5f6a82c6e118fdcd9946c34f]

Vlad Yasevich (2):
      rtnetlink: Mask the rta_type when range checking
         [a5b8db91442fce9c9713fcd656c3698f1adde1d6]
      sctp: Use correct sideffect command in duplicate cookie handling
         [f2815633504b442ca0b0605c16bf3d88a3a0fcea]

Vladimir Davydov (1):
      mqueue: sys_mq_open: do not call mnt_drop_write() if read-only
         [38d78e587d4960d0db94add518d27ee74bad2301]

Wanpeng Li (1):
      mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting
         [d00285884c0892bb1310df96bce6056e9ce9b9d9]

Xufeng Zhang (1):
      sctp: don't break the loop while meeting the active_path so as to find the matched transport
         [2317f449af30073cfa6ec8352e4a65a89e357bdd]

Yuchung Cheng (1):
      tcp: undo spurious timeout after SACK reneging
         [7ebe183c6d444ef5587d803b64a1f4734b18c564]

Zheng Liu (1):
      ext4: fix the wrong number of the allocated blocks in ext4_split_extent()
         [3a2256702e47f68f921dfad41b1764d05c572329]

fanchaoting (1):
      pnfs-block: removing DM device maybe cause oops when call dev_remove
         [4376c94618c26225e69e17b7c91169c45a90b292]

nikolay@redhat.com (2):
      bonding: fix disabling of arp_interval and miimon
         [1bc7db16782c2a581fb4d53ca853631050f31611]
      bonding: fix miimon and arp_interval delayed work race conditions
         [fbb0c41b814d497c656fc7be9e35456f139cb2fb]

----
 arch/arm/boot/dts/kirkwood-goflexnet.dts           |    1 +
 arch/arm/mach-cns3xxx/core.c                       |   16 +-
 arch/arm/mach-cns3xxx/include/mach/cns3xxx.h       |   16 +-
 arch/arm/mm/dma-mapping.c                          |    5 +-
 arch/tile/kernel/setup.c                           |   25 ++-
 arch/x86/lib/usercopy_64.c                         |    4 +-
 drivers/acpi/glue.c                                |   35 ++--
 drivers/block/aoe/aoecmd.c                         |    3 +-
 drivers/block/loop.c                               |    9 +-
 drivers/block/xen-blkback/blkback.c                |   38 +++-
 drivers/block/xen-blkback/common.h                 |   25 +++
 drivers/bluetooth/ath3k.c                          |    4 +
 drivers/bluetooth/btusb.c                          |    2 +
 drivers/char/virtio_console.c                      |   22 +-
 drivers/gpu/drm/drm_edid.c                         |    3 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |    2 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c         |   11 +-
 drivers/gpu/drm/i915/intel_display.c               |   11 +-
 drivers/gpu/drm/i915/intel_dp.c                    |   14 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c             |   10 +-
 drivers/gpu/drm/radeon/ni.c                        |   11 +-
 drivers/gpu/drm/radeon/radeon_benchmark.c          |   16 +-
 drivers/hid/hid-ids.h                              |    6 +
 drivers/hid/usbhid/hid-quirks.c                    |    2 +
 drivers/infiniband/ulp/ipoib/ipoib_cm.c            |    8 +-
 drivers/iommu/amd_iommu.c                          |   22 +-
 drivers/md/dm-bufio.c                              |    2 +
 drivers/md/dm-verity.c                             |   39 +++-
 drivers/net/bonding/bond_main.c                    |   97 +++------
 drivers/net/bonding/bond_sysfs.c                   |  121 ++++++-----
 drivers/net/can/sja1000/plx_pci.c                  |    4 +-
 drivers/net/can/sja1000/sja1000.c                  |    6 +-
 drivers/net/can/sja1000/sja1000.h                  |    2 +-
 drivers/net/ethernet/atheros/atl1e/atl1e.h         |    1 -
 drivers/net/ethernet/atheros/atl1e/atl1e_main.c    |   19 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |    1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h  |    3 +-
 drivers/net/ethernet/broadcom/tg3.c                |   15 +-
 drivers/net/ethernet/davicom/dm9000.c              |  214 ++++++++++----------
 drivers/net/ethernet/davicom/dm9000.h              |   11 +-
 drivers/net/ethernet/marvell/sky2.c                |    2 +-
 drivers/net/ethernet/marvell/sky2.h                |    2 +-
 drivers/net/ethernet/micrel/ks8851.c               |    2 +-
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    4 +-
 drivers/net/ethernet/sfc/efx.c                     |   20 +-
 drivers/net/ethernet/sfc/efx.h                     |   13 ++
 drivers/net/ethernet/sfc/net_driver.h              |    4 +-
 drivers/net/ethernet/sfc/nic.c                     |    3 +-
 drivers/net/ethernet/sfc/rx.c                      |   25 ++-
 drivers/net/ethernet/sfc/selftest.c                |    2 +-
 drivers/net/ethernet/ti/cpsw.c                     |    2 +-
 drivers/net/ethernet/ti/davinci_emac.c             |    2 +-
 drivers/net/netconsole.c                           |   15 +-
 drivers/net/ppp/ppp_generic.c                      |    8 -
 drivers/net/usb/smsc75xx.c                         |   12 +-
 drivers/net/wireless/ath/ath9k/link.c              |   29 +--
 drivers/net/wireless/b43/dma.c                     |   65 ++++--
 drivers/net/wireless/b43/phy_n.c                   |    8 +-
 drivers/net/wireless/iwlwifi/dvm/lib.c             |    9 +
 drivers/net/wireless/iwlwifi/dvm/ucode.c           |    4 +-
 drivers/net/wireless/mwifiex/cmdevt.c              |   22 +-
 drivers/net/wireless/mwifiex/join.c                |    7 +-
 drivers/net/wireless/mwifiex/main.h                |    4 +-
 drivers/net/wireless/mwifiex/scan.c                |    8 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c           |   10 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c        |   89 ++++----
 drivers/net/wireless/rtlwifi/usb.c                 |    1 +
 drivers/staging/comedi/drivers/s626.c              |    2 +-
 drivers/target/iscsi/iscsi_target_auth.c           |    5 +-
 drivers/target/target_core_file.h                  |    2 +-
 drivers/tty/serial/atmel_serial.c                  |   11 +-
 drivers/tty/serial/sunsu.c                         |   21 +-
 drivers/tty/vt/vc_screen.c                         |    6 +-
 drivers/usb/class/cdc-acm.c                        |    3 +-
 drivers/usb/core/hcd-pci.c                         |   23 ++-
 drivers/usb/gadget/g_ffs.c                         |    4 +-
 drivers/usb/gadget/udc-core.c                      |    2 +-
 drivers/usb/host/ehci-sched.c                      |    2 +
 drivers/usb/host/ehci-timer.c                      |    2 +-
 drivers/usb/host/xhci-ring.c                       |   24 +--
 drivers/usb/host/xhci.c                            |    3 +-
 drivers/usb/host/xhci.h                            |    8 +-
 drivers/usb/serial/ark3116.c                       |   10 +-
 drivers/usb/serial/ch341.c                         |   11 +-
 drivers/usb/serial/cypress_m8.c                    |   14 +-
 drivers/usb/serial/f81232.c                        |    9 +-
 drivers/usb/serial/ftdi_sio.c                      |   20 +-
 drivers/usb/serial/ftdi_sio_ids.h                  |    7 +
 drivers/usb/serial/garmin_gps.c                    |    7 +-
 drivers/usb/serial/io_edgeport.c                   |   12 +-
 drivers/usb/serial/io_ti.c                         |   13 +-
 drivers/usb/serial/mct_u232.c                      |   13 +-
 drivers/usb/serial/mos7840.c                       |   16 +-
 drivers/usb/serial/oti6858.c                       |   10 +-
 drivers/usb/serial/pl2303.c                        |   11 +-
 drivers/usb/serial/quatech2.c                      |   12 +-
 drivers/usb/serial/spcp8x5.c                       |    9 +-
 drivers/usb/serial/ssu100.c                        |   12 +-
 drivers/usb/serial/ti_usb_3410_5052.c              |   10 +-
 drivers/usb/serial/usb-serial.c                    |    4 +-
 drivers/usb/storage/unusual_devs.h                 |    7 +
 drivers/vhost/net.c                                |    3 +-
 fs/block_dev.c                                     |    1 +
 fs/btrfs/extent-tree.c                             |   49 ++++-
 fs/btrfs/extent_io.c                               |   33 +++
 fs/btrfs/extent_io.h                               |    2 +
 fs/btrfs/inode.c                                   |   14 ++
 fs/btrfs/scrub.c                                   |    3 +-
 fs/btrfs/tree-log.c                                |    5 +-
 fs/cifs/asn1.c                                     |   53 +----
 fs/dcache.c                                        |   16 +-
 fs/ext4/ext4.h                                     |    6 +-
 fs/ext4/extents.c                                  |    6 +-
 fs/ext4/ialloc.c                                   |    4 +-
 fs/ext4/inode.c                                    |    3 +-
 fs/ext4/mballoc.c                                  |   12 +-
 fs/ext4/super.c                                    |    4 +-
 fs/jbd2/transaction.c                              |   15 +-
 fs/namespace.c                                     |   28 +++
 fs/nfs/blocklayout/blocklayoutdm.c                 |    4 +-
 fs/nfs/idmap.c                                     |   13 +-
 fs/nfs/nfs4proc.c                                  |   14 --
 fs/nfs/pnfs.c                                      |   54 ++++-
 fs/nfsd/nfs4xdr.c                                  |    2 +-
 fs/proc/generic.c                                  |   21 +-
 fs/proc/inode.c                                    |   11 +-
 fs/sysfs/dir.c                                     |   17 +-
 fs/udf/udf_sb.h                                    |    2 +-
 include/drm/drm_pciids.h                           |   13 +-
 include/linux/fs_struct.h                          |    2 +
 include/linux/mount.h                              |    2 +
 include/linux/netdevice.h                          |    2 +
 include/linux/skbuff.h                             |   13 +-
 include/linux/thermal.h                            |    2 +-
 include/linux/usb/serial.h                         |    2 +
 include/net/inet_frag.h                            |    9 +
 include/net/ip_fib.h                               |   12 +-
 include/xen/interface/io/blkif.h                   |   10 +
 ipc/mqueue.c                                       |   15 +-
 kernel/time/tick-broadcast.c                       |    3 +-
 kernel/trace/ftrace.c                              |    4 +-
 kernel/trace/trace.c                               |   61 ++++--
 kernel/trace/trace.h                               |    6 +
 kernel/trace/trace_irqsoff.c                       |   19 +-
 kernel/trace/trace_sched_wakeup.c                  |   18 +-
 kernel/user_namespace.c                            |    9 +
 mm/hugetlb.c                                       |    8 +-
 net/8021q/vlan.c                                   |   14 +-
 net/batman-adv/bat_iv_ogm.c                        |    6 +-
 net/core/dev.c                                     |    7 +-
 net/core/rtnetlink.c                               |    2 +-
 net/ipv4/inet_fragment.c                           |   20 +-
 net/ipv4/ip_fragment.c                             |   11 +-
 net/ipv4/ip_gre.c                                  |    6 +-
 net/ipv4/ip_options.c                              |    5 +-
 net/ipv4/tcp.c                                     |    2 +-
 net/ipv4/tcp_input.c                               |    7 +-
 net/ipv4/tcp_ipv4.c                                |   14 +-
 net/ipv4/tcp_output.c                              |    8 +-
 net/ipv6/addrconf.c                                |   26 +--
 net/ipv6/ip6_input.c                               |   21 ++
 net/ipv6/netfilter/nf_conntrack_reasm.c            |   12 +-
 net/ipv6/reassembly.c                              |    8 +-
 net/ipv6/tcp_ipv6.c                                |    7 +
 net/irda/af_irda.c                                 |    6 +-
 net/l2tp/l2tp_eth.c                                |    3 +-
 net/mac80211/sta_info.c                            |   12 +-
 net/netlink/genetlink.c                            |    1 +
 net/sched/sch_fq_codel.c                           |    2 +-
 net/sched/sch_generic.c                            |    9 +-
 net/sctp/associola.c                               |    2 +-
 net/sctp/sm_statefuns.c                            |    2 +-
 net/sunrpc/sched.c                                 |    9 +-
 net/unix/af_unix.c                                 |    7 +-
 sound/pci/hda/hda_codec.c                          |    2 +-
 sound/pci/hda/patch_conexant.c                     |    8 +-
 sound/usb/mixer.c                                  |   16 +-
 177 files changed, 1453 insertions(+), 960 deletions(-)

^ permalink raw reply	[flat|nested] 189+ messages in thread

* [ 001/171 ] IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum"
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 002/171 ] ppp: Revert backport of "ppp: set qdisc_tx_busylock to avoid LOCKDEP splat" Steven Rostedt
                   ` (169 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0001-IP_GRE-Revert-IP_GRE-Fix-kernel-panic-in-IP_GRE-with.patch --]
[-- Type: text/plain, Size: 1322 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

Commit 1bef9ca32aaed714a204a3eceb856a5000328c5b
"IP_GRE: Fix kernel panic in IP_GRE with GRE csum." which was
upstream commit d0a7cc630a337b0f56dc145e7eb6232852b14dd4 was
added to the 3.6.11.1 by mistake. Ben Hutchings reported to me
that this commit fixes a bug introduced by commit 6b78f16e4bdde3936b
which was added in the 3.7-rc cycle, and not needed to be back ported to
3.6.  I removed it from my queue, but the git repo I used to push still
included it.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv4/ip_gre.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 3ee08ce..b062a98 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -946,12 +946,8 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
 			ptr--;
 		}
 		if (tunnel->parms.o_flags&GRE_CSUM) {
-			int offset = skb_transport_offset(skb);
-
 			*ptr = 0;
-			*(__sum16 *)ptr = csum_fold(skb_checksum(skb, offset,
-								 skb->len - offset,
-								 0));
+			*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
 		}
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 002/171 ] ppp: Revert backport of "ppp: set qdisc_tx_busylock to avoid LOCKDEP splat"
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
  2013-04-11 20:25 ` [ 001/171 ] IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum" Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 003/171 ] net: qdisc busylock needs lockdep annotations Steven Rostedt
                   ` (168 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0002-ppp-Revert-backport-of-ppp-set-qdisc_tx_busylock-to-.patch --]
[-- Type: text/plain, Size: 1159 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

commit 387e6a2cc250f2a6a182a5db1cbf7e40500bc5eb
"ppp: set qdisc_tx_busylock to avoid LOCKDEP splat" which was a backport
of upstream commit 0b652fb68c02c1acd0307d3acac4ae7123536031, should not
have been ported to 3.6.11.1 as it broke the build.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ppp/ppp_generic.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 2603b99..5c05572 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1021,15 +1021,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	return err;
 }
 
-static struct lock_class_key ppp_tx_busylock;
-static int ppp_dev_init(struct net_device *dev)
-{
-	dev->qdisc_tx_busylock = &ppp_tx_busylock;
-	return 0;
-}
-
 static const struct net_device_ops ppp_netdev_ops = {
-	.ndo_init	 = ppp_dev_init,
 	.ndo_start_xmit = ppp_start_xmit,
 	.ndo_do_ioctl   = ppp_net_ioctl,
 };
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 003/171 ] net: qdisc busylock needs lockdep annotations
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
  2013-04-11 20:25 ` [ 001/171 ] IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum" Steven Rostedt
  2013-04-11 20:25 ` [ 002/171 ] ppp: Revert backport of "ppp: set qdisc_tx_busylock to avoid LOCKDEP splat" Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 004/171 ] sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option Steven Rostedt
                   ` (167 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Eric Dumazet, David S. Miller

[-- Attachment #1: 0003-net-qdisc-busylock-needs-lockdep-annotations.patch --]
[-- Type: text/plain, Size: 8483 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 23d3b8bfb8eb20e7d96afa09991e6a5ed1c83164 ]

It seems we need to provide ability for stacked devices
to use specific lock_class_key for sch->busylock

We could instead default l2tpeth tx_queue_len to 0 (no qdisc), but
a user might use a qdisc anyway.

(So same fixes are probably needed on non LLTX stacked drivers)

Noticed while stressing L2TPV3 setup :

======================================================
 [ INFO: possible circular locking dependency detected ]
 3.6.0-rc3+ #788 Not tainted
 -------------------------------------------------------
 netperf/4660 is trying to acquire lock:
  (l2tpsock){+.-...}, at: [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]

 but task is already holding lock:
  (&(&sch->busylock)->rlock){+.-...}, at: [<ffffffff81596595>] dev_queue_xmit+0xd75/0xe00

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> #1 (&(&sch->busylock)->rlock){+.-...}:
        [<ffffffff810a5df0>] lock_acquire+0x90/0x200
        [<ffffffff817499fc>] _raw_spin_lock_irqsave+0x4c/0x60
        [<ffffffff81074872>] __wake_up+0x32/0x70
        [<ffffffff8136d39e>] tty_wakeup+0x3e/0x80
        [<ffffffff81378fb3>] pty_write+0x73/0x80
        [<ffffffff8136cb4c>] tty_put_char+0x3c/0x40
        [<ffffffff813722b2>] process_echoes+0x142/0x330
        [<ffffffff813742ab>] n_tty_receive_buf+0x8fb/0x1230
        [<ffffffff813777b2>] flush_to_ldisc+0x142/0x1c0
        [<ffffffff81062818>] process_one_work+0x198/0x760
        [<ffffffff81063236>] worker_thread+0x186/0x4b0
        [<ffffffff810694d3>] kthread+0x93/0xa0
        [<ffffffff81753e24>] kernel_thread_helper+0x4/0x10

 -> #0 (l2tpsock){+.-...}:
        [<ffffffff810a5288>] __lock_acquire+0x1628/0x1b10
        [<ffffffff810a5df0>] lock_acquire+0x90/0x200
        [<ffffffff817498c1>] _raw_spin_lock+0x41/0x50
        [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
        [<ffffffffa021a802>] l2tp_eth_dev_xmit+0x32/0x60 [l2tp_eth]
        [<ffffffff815952b2>] dev_hard_start_xmit+0x502/0xa70
        [<ffffffff815b63ce>] sch_direct_xmit+0xfe/0x290
        [<ffffffff81595a05>] dev_queue_xmit+0x1e5/0xe00
        [<ffffffff815d9d60>] ip_finish_output+0x3d0/0x890
        [<ffffffff815db019>] ip_output+0x59/0xf0
        [<ffffffff815da36d>] ip_local_out+0x2d/0xa0
        [<ffffffff815da5a3>] ip_queue_xmit+0x1c3/0x680
        [<ffffffff815f4192>] tcp_transmit_skb+0x402/0xa60
        [<ffffffff815f4a94>] tcp_write_xmit+0x1f4/0xa30
        [<ffffffff815f5300>] tcp_push_one+0x30/0x40
        [<ffffffff815e6672>] tcp_sendmsg+0xe82/0x1040
        [<ffffffff81614495>] inet_sendmsg+0x125/0x230
        [<ffffffff81576cdc>] sock_sendmsg+0xdc/0xf0
        [<ffffffff81579ece>] sys_sendto+0xfe/0x130
        [<ffffffff81752c92>] system_call_fastpath+0x16/0x1b
  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&(&sch->busylock)->rlock);
                                lock(l2tpsock);
                                lock(&(&sch->busylock)->rlock);
   lock(l2tpsock);

  *** DEADLOCK ***

 5 locks held by netperf/4660:
  #0:  (sk_lock-AF_INET){+.+.+.}, at: [<ffffffff815e581c>] tcp_sendmsg+0x2c/0x1040
  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff815da3e0>] ip_queue_xmit+0x0/0x680
  #2:  (rcu_read_lock_bh){.+....}, at: [<ffffffff815d9ac5>] ip_finish_output+0x135/0x890
  #3:  (rcu_read_lock_bh){.+....}, at: [<ffffffff81595820>] dev_queue_xmit+0x0/0xe00
  #4:  (&(&sch->busylock)->rlock){+.-...}, at: [<ffffffff81596595>] dev_queue_xmit+0xd75/0xe00

 stack backtrace:
 Pid: 4660, comm: netperf Not tainted 3.6.0-rc3+ #788
 Call Trace:
  [<ffffffff8173dbf8>] print_circular_bug+0x1fb/0x20c
  [<ffffffff810a5288>] __lock_acquire+0x1628/0x1b10
  [<ffffffff810a334b>] ? check_usage+0x9b/0x4d0
  [<ffffffff810a3f44>] ? __lock_acquire+0x2e4/0x1b10
  [<ffffffff810a5df0>] lock_acquire+0x90/0x200
  [<ffffffffa0208db2>] ? l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffff817498c1>] _raw_spin_lock+0x41/0x50
  [<ffffffffa0208db2>] ? l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffffa021a802>] l2tp_eth_dev_xmit+0x32/0x60 [l2tp_eth]
  [<ffffffff815952b2>] dev_hard_start_xmit+0x502/0xa70
  [<ffffffff81594e0e>] ? dev_hard_start_xmit+0x5e/0xa70
  [<ffffffff81595961>] ? dev_queue_xmit+0x141/0xe00
  [<ffffffff815b63ce>] sch_direct_xmit+0xfe/0x290
  [<ffffffff81595a05>] dev_queue_xmit+0x1e5/0xe00
  [<ffffffff81595820>] ? dev_hard_start_xmit+0xa70/0xa70
  [<ffffffff815d9d60>] ip_finish_output+0x3d0/0x890
  [<ffffffff815d9ac5>] ? ip_finish_output+0x135/0x890
  [<ffffffff815db019>] ip_output+0x59/0xf0
  [<ffffffff815da36d>] ip_local_out+0x2d/0xa0
  [<ffffffff815da5a3>] ip_queue_xmit+0x1c3/0x680
  [<ffffffff815da3e0>] ? ip_local_out+0xa0/0xa0
  [<ffffffff815f4192>] tcp_transmit_skb+0x402/0xa60
  [<ffffffff815fa25e>] ? tcp_md5_do_lookup+0x18e/0x1a0
  [<ffffffff815f4a94>] tcp_write_xmit+0x1f4/0xa30
  [<ffffffff815f5300>] tcp_push_one+0x30/0x40
  [<ffffffff815e6672>] tcp_sendmsg+0xe82/0x1040
  [<ffffffff81614495>] inet_sendmsg+0x125/0x230
  [<ffffffff81614370>] ? inet_create+0x6b0/0x6b0
  [<ffffffff8157e6e2>] ? sock_update_classid+0xc2/0x3b0
  [<ffffffff8157e750>] ? sock_update_classid+0x130/0x3b0
  [<ffffffff81576cdc>] sock_sendmsg+0xdc/0xf0
  [<ffffffff81162579>] ? fget_light+0x3f9/0x4f0
  [<ffffffff81579ece>] sys_sendto+0xfe/0x130
  [<ffffffff810a69ad>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff8174a0b0>] ? _raw_spin_unlock_irq+0x30/0x50
  [<ffffffff810757e3>] ? finish_task_switch+0x83/0xf0
  [<ffffffff810757a6>] ? finish_task_switch+0x46/0xf0
  [<ffffffff81752cb7>] ? sysret_check+0x1b/0x56
  [<ffffffff81752c92>] system_call_fastpath+0x16/0x1b

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/netdevice.h |    2 ++
 net/l2tp/l2tp_eth.c       |    3 ++-
 net/sched/sch_generic.c   |    9 ++++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 59dc05f3..b91c93b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1322,6 +1322,8 @@ struct net_device {
 	/* phy device may attach itself for hardware timestamping */
 	struct phy_device *phydev;
 
+	struct lock_class_key *qdisc_tx_busylock;
+
 	/* group the device belongs to */
 	int group;
 
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 69bf48d..76125c5 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -67,6 +67,7 @@ static inline struct l2tp_eth_net *l2tp_eth_pernet(struct net *net)
 	return net_generic(net, l2tp_eth_net_id);
 }
 
+static struct lock_class_key l2tp_eth_tx_busylock;
 static int l2tp_eth_dev_init(struct net_device *dev)
 {
 	struct l2tp_eth *priv = netdev_priv(dev);
@@ -74,7 +75,7 @@ static int l2tp_eth_dev_init(struct net_device *dev)
 	priv->dev = dev;
 	eth_hw_addr_random(dev);
 	memset(&dev->broadcast[0], 0xff, 6);
-
+	dev->qdisc_tx_busylock = &l2tp_eth_tx_busylock;
 	return 0;
 }
 
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 511323e..b62b33d 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -545,6 +545,8 @@ struct Qdisc_ops pfifo_fast_ops __read_mostly = {
 };
 EXPORT_SYMBOL(pfifo_fast_ops);
 
+static struct lock_class_key qdisc_tx_busylock;
+
 struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 			  struct Qdisc_ops *ops)
 {
@@ -552,6 +554,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 	struct Qdisc *sch;
 	unsigned int size = QDISC_ALIGN(sizeof(*sch)) + ops->priv_size;
 	int err = -ENOBUFS;
+	struct net_device *dev = dev_queue->dev;
 
 	p = kzalloc_node(size, GFP_KERNEL,
 			 netdev_queue_numa_node_read(dev_queue));
@@ -571,12 +574,16 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 	}
 	INIT_LIST_HEAD(&sch->list);
 	skb_queue_head_init(&sch->q);
+
 	spin_lock_init(&sch->busylock);
+	lockdep_set_class(&sch->busylock,
+			  dev->qdisc_tx_busylock ?: &qdisc_tx_busylock);
+
 	sch->ops = ops;
 	sch->enqueue = ops->enqueue;
 	sch->dequeue = ops->dequeue;
 	sch->dev_queue = dev_queue;
-	dev_hold(qdisc_dev(sch));
+	dev_hold(dev);
 	atomic_set(&sch->refcnt, 1);
 
 	return sch;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 004/171 ] sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (2 preceding siblings ...)
  2013-04-11 20:25 ` [ 003/171 ] net: qdisc busylock needs lockdep annotations Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 005/171 ] net/ipv4: Ensure that location of timestamp option is stored Steven Rostedt
                   ` (166 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Kirill Tkhai, David Miller

[-- Attachment #1: 0004-sunsu-Fix-panic-in-case-of-nonexistent-port-at-conso.patch --]
[-- Type: text/plain, Size: 3493 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Tkhai Kirill <tkhai@yandex.ru>

[ Upstream commit cb29529ea0030e60ef1bbbf8399a43d397a51526 ]

If a machine has X (X < 4) sunsu ports and cmdline
option "console=ttySY" is passed, where X < Y <= 4,
than the following panic happens:

Unable to handle kernel NULL pointer dereference
TPC: <sunsu_console_setup+0x78/0xe0>
RPC: <sunsu_console_setup+0x74/0xe0>
I7: <register_console+0x378/0x3e0>
Call Trace:
 [0000000000453a38] register_console+0x378/0x3e0
 [0000000000576fa0] uart_add_one_port+0x2e0/0x340
 [000000000057af40] su_probe+0x160/0x2e0
 [00000000005b8a4c] platform_drv_probe+0xc/0x20
 [00000000005b6c2c] driver_probe_device+0x12c/0x220
 [00000000005b6da8] __driver_attach+0x88/0xa0
 [00000000005b4df4] bus_for_each_dev+0x54/0xa0
 [00000000005b5a54] bus_add_driver+0x154/0x260
 [00000000005b7190] driver_register+0x50/0x180
 [00000000006d250c] sunsu_init+0x18c/0x1e0
 [00000000006c2668] do_one_initcall+0xe8/0x160
 [00000000006c282c] kernel_init_freeable+0x12c/0x1e0
 [0000000000603764] kernel_init+0x4/0x100
 [0000000000405f64] ret_from_syscall+0x1c/0x2c
 [0000000000000000]           (null)

1)Fix the panic;
2)Increment registered port number every successful
probe.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/tty/serial/sunsu.c |   21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 675303b..76fa1fa 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -968,6 +968,7 @@ static struct uart_ops sunsu_pops = {
 #define UART_NR	4
 
 static struct uart_sunsu_port sunsu_ports[UART_NR];
+static int nr_inst; /* Number of already registered ports */
 
 #ifdef CONFIG_SERIO
 
@@ -1337,13 +1338,8 @@ static int __init sunsu_console_setup(struct console *co, char *options)
 	printk("Console: ttyS%d (SU)\n",
 	       (sunsu_reg.minor - 64) + co->index);
 
-	/*
-	 * Check whether an invalid uart number has been specified, and
-	 * if so, search for the first available port that does have
-	 * console support.
-	 */
-	if (co->index >= UART_NR)
-		co->index = 0;
+	if (co->index > nr_inst)
+		return -ENODEV;
 	port = &sunsu_ports[co->index].port;
 
 	/*
@@ -1408,7 +1404,6 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
 
 static int __devinit su_probe(struct platform_device *op)
 {
-	static int inst;
 	struct device_node *dp = op->dev.of_node;
 	struct uart_sunsu_port *up;
 	struct resource *rp;
@@ -1418,16 +1413,16 @@ static int __devinit su_probe(struct platform_device *op)
 
 	type = su_get_type(dp);
 	if (type == SU_PORT_PORT) {
-		if (inst >= UART_NR)
+		if (nr_inst >= UART_NR)
 			return -EINVAL;
-		up = &sunsu_ports[inst];
+		up = &sunsu_ports[nr_inst];
 	} else {
 		up = kzalloc(sizeof(*up), GFP_KERNEL);
 		if (!up)
 			return -ENOMEM;
 	}
 
-	up->port.line = inst;
+	up->port.line = nr_inst;
 
 	spin_lock_init(&up->port.lock);
 
@@ -1461,6 +1456,8 @@ static int __devinit su_probe(struct platform_device *op)
 		}
 		dev_set_drvdata(&op->dev, up);
 
+		nr_inst++;
+
 		return 0;
 	}
 
@@ -1488,7 +1485,7 @@ static int __devinit su_probe(struct platform_device *op)
 
 	dev_set_drvdata(&op->dev, up);
 
-	inst++;
+	nr_inst++;
 
 	return 0;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 005/171 ] net/ipv4: Ensure that location of timestamp option is stored
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (3 preceding siblings ...)
  2013-04-11 20:25 ` [ 004/171 ] sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 006/171 ] netconsole: dont call __netpoll_cleanup() while atomic Steven Rostedt
                   ` (165 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: David Ward, David S. Miller

[-- Attachment #1: 0005-net-ipv4-Ensure-that-location-of-timestamp-option-is.patch --]
[-- Type: text/plain, Size: 2075 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: David Ward <david.ward@ll.mit.edu>

[ Upstream commit 4660c7f498c07c43173142ea95145e9dac5a6d14 ]

This is needed in order to detect if the timestamp option appears
more than once in a packet, to remove the option if the packet is
fragmented, etc. My previous change neglected to store the option
location when the router addresses were prespecified and Pointer >
Length. But now the option location is also stored when Flag is an
unrecognized value, to ensure these option handling behaviors are
still performed.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv4/ip_options.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 1dc01f9..98e6916 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -370,7 +370,6 @@ int ip_options_compile(struct net *net,
 				}
 				switch (optptr[3]&0xF) {
 				      case IPOPT_TS_TSONLY:
-					opt->ts = optptr - iph;
 					if (skb)
 						timeptr = &optptr[optptr[2]-1];
 					opt->ts_needtime = 1;
@@ -381,7 +380,6 @@ int ip_options_compile(struct net *net,
 						pp_ptr = optptr + 2;
 						goto error;
 					}
-					opt->ts = optptr - iph;
 					if (rt)  {
 						spec_dst_fill(&spec_dst, skb);
 						memcpy(&optptr[optptr[2]-1], &spec_dst, 4);
@@ -396,7 +394,6 @@ int ip_options_compile(struct net *net,
 						pp_ptr = optptr + 2;
 						goto error;
 					}
-					opt->ts = optptr - iph;
 					{
 						__be32 addr;
 						memcpy(&addr, &optptr[optptr[2]-1], 4);
@@ -429,12 +426,12 @@ int ip_options_compile(struct net *net,
 					pp_ptr = optptr + 3;
 					goto error;
 				}
-				opt->ts = optptr - iph;
 				if (skb) {
 					optptr[3] = (optptr[3]&0xF)|((overflow+1)<<4);
 					opt->is_changed = 1;
 				}
 			}
+			opt->ts = optptr - iph;
 			break;
 		      case IPOPT_RA:
 			if (optlen < 4) {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 006/171 ] netconsole: dont call __netpoll_cleanup() while atomic
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (4 preceding siblings ...)
  2013-04-11 20:25 ` [ 005/171 ] net/ipv4: Ensure that location of timestamp option is stored Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 007/171 ] batman-adv: verify tt len does not exceed packet len Steven Rostedt
                   ` (164 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Veaceslav Falico, Neil Horman, David S. Miller

[-- Attachment #1: 0006-netconsole-don-t-call-__netpoll_cleanup-while-atomic.patch --]
[-- Type: text/plain, Size: 1942 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit 3f315bef23075ea8a98a6fe4221a83b83456d970 ]

__netpoll_cleanup() is called in netconsole_netdev_event() while holding a
spinlock. Release/acquire the spinlock before/after it and restart the
loop. Also, disable the netconsole completely, because we won't have chance
after the restart of the loop, and might end up in a situation where
nt->enabled == 1 and nt->np.dev == NULL.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/netconsole.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index b332112..2524a69 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -626,6 +626,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
 		goto done;
 
 	spin_lock_irqsave(&target_list_lock, flags);
+restart:
 	list_for_each_entry(nt, &target_list, list) {
 		netconsole_target_get(nt);
 		if (nt->np.dev == dev) {
@@ -638,15 +639,17 @@ static int netconsole_netdev_event(struct notifier_block *this,
 			case NETDEV_UNREGISTER:
 				/*
 				 * rtnl_lock already held
+				 * we might sleep in __netpoll_cleanup()
 				 */
-				if (nt->np.dev) {
-					__netpoll_cleanup(&nt->np);
-					dev_put(nt->np.dev);
-					nt->np.dev = NULL;
-				}
+				spin_unlock_irqrestore(&target_list_lock, flags);
+				__netpoll_cleanup(&nt->np);
+				spin_lock_irqsave(&target_list_lock, flags);
+				dev_put(nt->np.dev);
+				nt->np.dev = NULL;
 				nt->enabled = 0;
 				stopped = true;
-				break;
+				netconsole_target_put(nt);
+				goto restart;
 			}
 		}
 		netconsole_target_put(nt);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 007/171 ] batman-adv: verify tt len does not exceed packet len
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (5 preceding siblings ...)
  2013-04-11 20:25 ` [ 006/171 ] netconsole: dont call __netpoll_cleanup() while atomic Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 008/171 ] bonding: dont call update_speed_duplex() under spinlocks Steven Rostedt
                   ` (163 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Marek Lindner, Antonio Quartulli

[-- Attachment #1: 0007-batman-adv-verify-tt-len-does-not-exceed-packet-len.patch --]
[-- Type: text/plain, Size: 1628 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Marek Lindner <lindner_marek@yahoo.de>

[ Upstream commit b47506d91259c29b9c75c404737eb6525556f9b4 ]

batadv_iv_ogm_process() accesses the packet using the tt_num_changes
attribute regardless of the real packet len (assuming the length check
was done before). Therefore a length check is needed to avoid reading
random memory.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/batman-adv/bat_iv_ogm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 1476f26..aca451e 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1273,7 +1273,8 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
 	batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff;
 
 	/* unpack the aggregated packets and process them one by one */
-	do {
+	while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
+					 batadv_ogm_packet->tt_num_changes)) {
 		tt_buff = packet_buff + buff_pos + BATADV_OGM_HLEN;
 
 		batadv_iv_ogm_process(ethhdr, batadv_ogm_packet, tt_buff,
@@ -1284,8 +1285,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
 
 		batadv_ogm_packet = (struct batadv_ogm_packet *)
 						(packet_buff + buff_pos);
-	} while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
-					   batadv_ogm_packet->tt_num_changes));
+	}
 
 	kfree_skb(skb);
 	return NET_RX_SUCCESS;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 008/171 ] bonding: dont call update_speed_duplex() under spinlocks
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (6 preceding siblings ...)
  2013-04-11 20:25 ` [ 007/171 ] batman-adv: verify tt len does not exceed packet len Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 009/171 ] tg3: 5715 does not link up when autoneg off Steven Rostedt
                   ` (162 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Veaceslav Falico, David S. Miller

[-- Attachment #1: 0008-bonding-don-t-call-update_speed_duplex-under-spinloc.patch --]
[-- Type: text/plain, Size: 2209 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit 876254ae2758d50dcb08c7bd00caf6a806571178 ]

bond_update_speed_duplex() might sleep while calling underlying slave's
routines. Move it out of atomic context in bond_enslave() and remove it
from bond_miimon_commit() - it was introduced by commit 546add79, however
when the slave interfaces go up/change state it's their responsibility to
fire NETDEV_UP/NETDEV_CHANGE events so that bonding can properly update
their speed.

I've tested it on all combinations of ifup/ifdown, autoneg/speed/duplex
changes, remote-controlled and local, on (not) MII-based cards. All changes
are visible.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/bonding/bond_main.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index acc0718..704d0ad 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1733,6 +1733,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 
 	bond_compute_features(bond);
 
+	bond_update_speed_duplex(new_slave);
+
 	read_lock(&bond->lock);
 
 	new_slave->last_arp_rx = jiffies -
@@ -1785,8 +1787,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 		new_slave->link == BOND_LINK_DOWN ? "DOWN" :
 			(new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
 
-	bond_update_speed_duplex(new_slave);
-
 	if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
 		/* if there is a primary slave, remember it */
 		if (strcmp(bond->params.primary, new_slave->dev->name) == 0) {
@@ -2467,8 +2467,6 @@ static void bond_miimon_commit(struct bonding *bond)
 				bond_set_backup_slave(slave);
 			}
 
-			bond_update_speed_duplex(slave);
-
 			pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n",
 				bond->dev->name, slave->dev->name,
 				slave->speed, slave->duplex ? "full" : "half");
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 009/171 ] tg3: 5715 does not link up when autoneg off
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (7 preceding siblings ...)
  2013-04-11 20:25 ` [ 008/171 ] bonding: dont call update_speed_duplex() under spinlocks Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 010/171 ] sctp: Use correct sideffect command in duplicate cookie handling Steven Rostedt
                   ` (161 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Marcin Miotk, Benjamin Li, Nithin Nayak Sujir, Michael Chan,
	David S. Miller

[-- Attachment #1: 0009-tg3-5715-does-not-link-up-when-autoneg-off.patch --]
[-- Type: text/plain, Size: 1898 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Nithin Sujir <nsujir@broadcom.com>

[ Upstream commit 7c6cdead7cc9a99650d15497aae47d7472217eb1 ]

Commit d13ba512cbba7de5d55d7a3b2aae7d83c8921457 ("tg3: Remove
SPEED_UNKNOWN checks") cleaned up the autoneg advertisement by
removing some dead code. One effect of this change was that the
advertisement register would not be updated if autoneg is turned off.

This exposed a bug on the 5715 device w.r.t linking. The 5715 defaults
to advertise only 10Mb Full duplex. But with autoneg disabled, it needs
the configured speed enabled in the advertisement register to link up.

This patch adds the work around to advertise all speeds on the 5715 when
autoneg is disabled.

Reported-by: Marcin Miotk <marcinmiotk81@gmail.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/broadcom/tg3.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3756278..fdb4c52 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -4055,6 +4055,14 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
 		tp->link_config.active_speed = tp->link_config.speed;
 		tp->link_config.active_duplex = tp->link_config.duplex;
 
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714) {
+			/* With autoneg disabled, 5715 only links up when the
+			 * advertisement register has the configured speed
+			 * enabled.
+			 */
+			tg3_writephy(tp, MII_ADVERTISE, ADVERTISE_ALL);
+		}
+
 		bmcr = 0;
 		switch (tp->link_config.speed) {
 		default:
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 010/171 ] sctp: Use correct sideffect command in duplicate cookie handling
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (8 preceding siblings ...)
  2013-04-11 20:25 ` [ 009/171 ] tg3: 5715 does not link up when autoneg off Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 011/171 ] sctp: dont break the loop while meeting the active_path so as to find the matched transport Steven Rostedt
                   ` (160 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Karl Heiss, Neil Horman, Vlad Yasevich, David S. Miller

[-- Attachment #1: 0010-sctp-Use-correct-sideffect-command-in-duplicate-cook.patch --]
[-- Type: text/plain, Size: 1955 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Vlad Yasevich <vyasevich@gmail.com>

[ Upstream commit f2815633504b442ca0b0605c16bf3d88a3a0fcea ]

When SCTP is done processing a duplicate cookie chunk, it tries
to delete a newly created association.  For that, it has to set
the right association for the side-effect processing to work.
However, when it uses the SCTP_CMD_NEW_ASOC command, that performs
more work then really needed (like hashing the associationa and
assigning it an id) and there is no point to do that only to
delete the association as a next step.  In fact, it also creates
an impossible condition where an association may be found by
the getsockopt() call, and that association is empty.  This
causes a crash in some sctp getsockopts.

The solution is rather simple.  We simply use SCTP_CMD_SET_ASOC
command that doesn't have all the overhead and does exactly
what we need.

Reported-by: Karl Heiss <kheiss@gmail.com>
Tested-by: Karl Heiss <kheiss@gmail.com>
CC: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/sctp/sm_statefuns.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 9fca103..469ef67 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -2042,7 +2042,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
 	}
 
 	/* Delete the tempory new association. */
-	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));
+	sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
 	/* Restore association pointer to provide SCTP command interpeter
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 011/171 ] sctp: dont break the loop while meeting the active_path so as to find the matched transport
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (9 preceding siblings ...)
  2013-04-11 20:25 ` [ 010/171 ] sctp: Use correct sideffect command in duplicate cookie handling Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 012/171 ] ipv4: fix definition of FIB_TABLE_HASHSZ Steven Rostedt
                   ` (159 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xufeng Zhang, Neil Horman, Vlad Yasevich, David S. Miller

[-- Attachment #1: 0011-sctp-don-t-break-the-loop-while-meeting-the-active_p.patch --]
[-- Type: text/plain, Size: 1314 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Xufeng Zhang <xufeng.zhang@windriver.com>

[ Upstream commit 2317f449af30073cfa6ec8352e4a65a89e357bdd ]

sctp_assoc_lookup_tsn() function searchs which transport a certain TSN
was sent on, if not found in the active_path transport, then go search
all the other transports in the peer's transport_addr_list, however, we
should continue to the next entry rather than break the loop when meet
the active_path transport.

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/sctp/associola.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index ebaef3e..247abb9 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1074,7 +1074,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
 			transports) {
 
 		if (transport == active)
-			break;
+			continue;
 		list_for_each_entry(chunk, &transport->transmitted,
 				transmitted_list) {
 			if (key == chunk->subh.data_hdr->tsn) {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 012/171 ] ipv4: fix definition of FIB_TABLE_HASHSZ
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (10 preceding siblings ...)
  2013-04-11 20:25 ` [ 011/171 ] sctp: dont break the loop while meeting the active_path so as to find the matched transport Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 013/171 ] tcp: fix skb_availroom() Steven Rostedt
                   ` (158 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Denis V. Lunev, Tingwei Liu, Alexey Kuznetsov, David S. Miller

[-- Attachment #1: 0012-ipv4-fix-definition-of-FIB_TABLE_HASHSZ.patch --]
[-- Type: text/plain, Size: 1740 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Denis V. Lunev" <den@openvz.org>

[ Upstream commit 5b9e12dbf92b441b37136ea71dac59f05f2673a9 ]

a long time ago by the commit

  commit 93456b6d7753def8760b423ac6b986eb9d5a4a95
  Author: Denis V. Lunev <den@openvz.org>
  Date:   Thu Jan 10 03:23:38 2008 -0800

    [IPV4]: Unify access to the routing tables.

the defenition of FIB_HASH_TABLE size has obtained wrong dependency:
it should depend upon CONFIG_IP_MULTIPLE_TABLES (as was in the original
code) but it was depended from CONFIG_IP_ROUTE_MULTIPATH

This patch returns the situation to the original state.

The problem was spotted by Tingwei Liu.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Tingwei Liu <tingw.liu@gmail.com>
CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/net/ip_fib.h |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9497be1..e49db91 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -152,18 +152,16 @@ struct fib_result_nl {
 };
 
 #ifdef CONFIG_IP_ROUTE_MULTIPATH
-
 #define FIB_RES_NH(res)		((res).fi->fib_nh[(res).nh_sel])
-
-#define FIB_TABLE_HASHSZ 2
-
 #else /* CONFIG_IP_ROUTE_MULTIPATH */
-
 #define FIB_RES_NH(res)		((res).fi->fib_nh[0])
+#endif /* CONFIG_IP_ROUTE_MULTIPATH */
 
+#ifdef CONFIG_IP_MULTIPLE_TABLES
 #define FIB_TABLE_HASHSZ 256
-
-#endif /* CONFIG_IP_ROUTE_MULTIPATH */
+#else
+#define FIB_TABLE_HASHSZ 2
+#endif
 
 extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 013/171 ] tcp: fix skb_availroom()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (11 preceding siblings ...)
  2013-04-11 20:25 ` [ 012/171 ] ipv4: fix definition of FIB_TABLE_HASHSZ Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 014/171 ] skb: Propagate pfmemalloc on skb from head page only Steven Rostedt
                   ` (157 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Eric Dumazet, Mukesh Agrawal, David S. Miller

[-- Attachment #1: 0013-tcp-fix-skb_availroom.patch --]
[-- Type: text/plain, Size: 2587 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 16fad69cfe4adbbfa813de516757b87bcae36d93 ]

Chrome OS team reported a crash on a Pixel ChromeBook in TCP stack :

https://code.google.com/p/chromium/issues/detail?id=182056

commit a21d45726acac (tcp: avoid order-1 allocations on wifi and tx
path) did a poor choice adding an 'avail_size' field to skb, while
what we really needed was a 'reserved_tailroom' one.

It would have avoided commit 22b4a4f22da (tcp: fix retransmit of
partially acked frames) and this commit.

Crash occurs because skb_split() is not aware of the 'avail_size'
management (and should not be aware)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Mukesh Agrawal <quiche@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/skbuff.h |    7 +++++--
 net/ipv4/tcp.c         |    2 +-
 net/ipv4/tcp_output.c  |    1 -
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f3165d2..9a21379 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -481,7 +481,7 @@ struct sk_buff {
 	union {
 		__u32		mark;
 		__u32		dropcount;
-		__u32		avail_size;
+		__u32		reserved_tailroom;
 	};
 
 	sk_buff_data_t		transport_header;
@@ -1412,7 +1412,10 @@ static inline int skb_tailroom(const struct sk_buff *skb)
  */
 static inline int skb_availroom(const struct sk_buff *skb)
 {
-	return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len;
+	if (skb_is_nonlinear(skb))
+		return 0;
+
+	return skb->end - skb->tail - skb->reserved_tailroom;
 }
 
 /**
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a07e91c..094a01f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -771,7 +771,7 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp)
 			 * Make sure that we have exactly size bytes
 			 * available to the caller, no more, no less.
 			 */
-			skb->avail_size = size;
+			skb->reserved_tailroom = skb->end - skb->tail - size;
 			return skb;
 		}
 		__kfree_skb(skb);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 6a1cdc8..745fc20 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1289,7 +1289,6 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
 	eat = min_t(int, len, skb_headlen(skb));
 	if (eat) {
 		__skb_pull(skb, eat);
-		skb->avail_size -= eat;
 		len -= eat;
 		if (!len)
 			return;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 014/171 ] skb: Propagate pfmemalloc on skb from head page only
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (12 preceding siblings ...)
  2013-04-11 20:25 ` [ 013/171 ] tcp: fix skb_availroom() Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 015/171 ] rtnetlink: Mask the rta_type when range checking Steven Rostedt
                   ` (156 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pavel Emelyanov, Eric Dumazet, Mel Gorman, David S. Miller

[-- Attachment #1: 0014-skb-Propagate-pfmemalloc-on-skb-from-head-page-only.patch --]
[-- Type: text/plain, Size: 2801 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Pavel Emelyanov <xemul@parallels.com>

[ Upstream commit cca7af3889bfa343d33d5e657a38d876abd10e58 ]

Hi.

I'm trying to send big chunks of memory from application address space via
TCP socket using vmsplice + splice like this

   mem = mmap(128Mb);
   vmsplice(pipe[1], mem); /* splice memory into pipe */
   splice(pipe[0], tcp_socket); /* send it into network */

When I'm lucky and a huge page splices into the pipe and then into the socket
_and_ client and server ends of the TCP connection are on the same host,
communicating via lo, the whole connection gets stuck! The sending queue
becomes full and app stops writing/splicing more into it, but the receiving
queue remains empty, and that's why.

The __skb_fill_page_desc observes a tail page of a huge page and erroneously
propagates its page->pfmemalloc value onto socket (the pfmemalloc on tail pages
contain garbage). Then this skb->pfmemalloc leaks through lo and due to the

    tcp_v4_rcv
    sk_filter
        if (skb->pfmemalloc && !sock_flag(sk, SOCK_MEMALLOC)) /* true */
            return -ENOMEM
        goto release_and_discard;

no packets reach the socket. Even TCP re-transmits are dropped by this, as skb
cloning clones the pfmemalloc flag as well.

That said, here's the proper page->pfmemalloc propagation onto socket: we
must check the huge-page's head page only, other pages' pfmemalloc and mapping
values do not contain what is expected in this place. However, I'm not sure
whether this fix is _complete_, since pfmemalloc propagation via lo also
oesn't look great.

Both, bit propagation from page to skb and this check in sk_filter, were
introduced by c48a11c7 (netvm: propagate page->pfmemalloc to skb), in v3.5 so
Mel and stable@ are in Cc.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/skbuff.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9a21379..adab092 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1253,11 +1253,13 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
 	 * do not lose pfmemalloc information as the pages would not be
 	 * allocated using __GFP_MEMALLOC.
 	 */
-	if (page->pfmemalloc && !page->mapping)
-		skb->pfmemalloc	= true;
 	frag->page.p		  = page;
 	frag->page_offset	  = off;
 	skb_frag_size_set(frag, size);
+
+	page = compound_head(page);
+	if (page->pfmemalloc && !page->mapping)
+		skb->pfmemalloc	= true;
 }
 
 /**
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 015/171 ] rtnetlink: Mask the rta_type when range checking
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (13 preceding siblings ...)
  2013-04-11 20:25 ` [ 014/171 ] skb: Propagate pfmemalloc on skb from head page only Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 016/171 ] bnx2x: add missing napi deletion in error path Steven Rostedt
                   ` (155 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Vlad Yasevich, Thomas Graf, David S. Miller

[-- Attachment #1: 0015-rtnetlink-Mask-the-rta_type-when-range-checking.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Vlad Yasevich <vyasevic@redhat.com>

[ Upstream commit a5b8db91442fce9c9713fcd656c3698f1adde1d6 ]

Range/validity checks on rta_type in rtnetlink_rcv_msg() do
not account for flags that may be set.  This causes the function
to return -EINVAL when flags are set on the type (for example
NLA_F_NESTED).

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/core/rtnetlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4908588..1c854d4 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2319,7 +2319,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 		struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len);
 
 		while (RTA_OK(attr, attrlen)) {
-			unsigned int flavor = attr->rta_type;
+			unsigned int flavor = attr->rta_type & NLA_TYPE_MASK;
 			if (flavor) {
 				if (flavor > rta_max[sz_idx])
 					return -EINVAL;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 016/171 ] bnx2x: add missing napi deletion in error path
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (14 preceding siblings ...)
  2013-04-11 20:25 ` [ 015/171 ] rtnetlink: Mask the rta_type when range checking Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 017/171 ] vhost/net: fix heads usage of ubuf_info Steven Rostedt
                   ` (154 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Michal Schmidt, Dmitry Kravkov, David S. Miller

[-- Attachment #1: 0016-bnx2x-add-missing-napi-deletion-in-error-path.patch --]
[-- Type: text/plain, Size: 1233 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Michal Schmidt <mschmidt@redhat.com>

[ Upstream commit 722c6f585088a2c392b4c5d01b87a584bb8fb73f ]

If the hardware initialization fails in bnx2x_nic_load() after adding
napi objects, they would not be deleted. A subsequent attempt to unload
the bnx2x module detects a corruption in the napi list.

Add the missing napi deletion to the error path.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e8e97a7..cb18cf4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2323,6 +2323,7 @@ load_error2:
 	bp->port.pmf = 0;
 load_error1:
 	bnx2x_napi_disable(bp);
+	bnx2x_del_all_napi(bp);
 	/* clear pf_load status, as it was already set */
 	bnx2x_clear_pf_load(bp);
 load_error0:
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 017/171 ] vhost/net: fix heads usage of ubuf_info
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (15 preceding siblings ...)
  2013-04-11 20:25 ` [ 016/171 ] bnx2x: add missing napi deletion in error path Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 018/171 ] bnx2x: fix occasional statistics off-by-4GB error Steven Rostedt
                   ` (153 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rusty Russell, Michael S. Tsirkin, stable, David S. Miller

[-- Attachment #1: 0017-vhost-net-fix-heads-usage-of-ubuf_info.patch --]
[-- Type: text/plain, Size: 1249 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Michael S. Tsirkin" <mst@redhat.com>

[ Upstream commit 46aa92d1ba162b4b3d6b7102440e459d4e4ee255 ]

ubuf info allocator uses guest controlled head as an index,
so a malicious guest could put the same head entry in the ring twice,
and we will get two callbacks on the same value.
To fix use upend_idx which is guaranteed to be unique.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/vhost/net.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 7f93f34..156a360 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -235,7 +235,8 @@ static void handle_tx(struct vhost_net *net)
 				msg.msg_controllen = 0;
 				ubufs = NULL;
 			} else {
-				struct ubuf_info *ubuf = &vq->ubuf_info[head];
+				struct ubuf_info *ubuf;
+				ubuf = vq->ubuf_info + vq->upend_idx;
 
 				vq->heads[vq->upend_idx].len = len;
 				ubuf->callback = vhost_zerocopy_callback;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 018/171 ] bnx2x: fix occasional statistics off-by-4GB error
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (16 preceding siblings ...)
  2013-04-11 20:25 ` [ 017/171 ] vhost/net: fix heads usage of ubuf_info Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 019/171 ] tcp: dont handle MTU reduction on LISTEN socket Steven Rostedt
                   ` (152 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Maciej Żenczykowski, Mintz Yuval, Eilon Greenstein,
	David S. Miller

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0018-bnx2x-fix-occasional-statistics-off-by-4GB-error.patch --]
[-- Type: text/plain, Size: 1603 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= <maze@google.com>

[ Upstream commit b009aac12cd0fe34293c68af8ac48b85be3bd858 ]

The UPDATE_QSTAT function introduced on February 15, 2012
in commit 1355b704b9ba "bnx2x: consistent statistics after
internal driver reload" incorrectly fails to handle overflow
during addition of the lower 32-bit field of a stat.

This bug is present since 3.4-rc1 and should thus be considered
a candidate for stable 3.4+ releases.

Google-Bug-Id: 8374428
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Cc: Mintz Yuval <yuvalmin@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
index 24b8e50..06bd1c0 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
@@ -453,8 +453,9 @@ struct bnx2x_fw_port_stats_old {
 
 #define UPDATE_QSTAT(s, t) \
 	do { \
-		qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi); \
 		qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \
+		qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi) \
+			+ ((qstats->t##_lo < qstats_old->t##_lo) ? 1 : 0); \
 	} while (0)
 
 #define UPDATE_QSTAT_OLD(f) \
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 019/171 ] tcp: dont handle MTU reduction on LISTEN socket
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (17 preceding siblings ...)
  2013-04-11 20:25 ` [ 018/171 ] bnx2x: fix occasional statistics off-by-4GB error Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 020/171 ] inet: limit length of fragment queue hash table bucket lists Steven Rostedt
                   ` (151 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: dormando, Eric Dumazet, David S. Miller

[-- Attachment #1: 0019-tcp-dont-handle-MTU-reduction-on-LISTEN-socket.patch --]
[-- Type: text/plain, Size: 2902 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 0d4f0608619de59fd8169dd8e72aadc28d80e715 ]

When an ICMP ICMP_FRAG_NEEDED (or ICMPV6_PKT_TOOBIG) message finds a
LISTEN socket, and this socket is currently owned by the user, we
set TCP_MTU_REDUCED_DEFERRED flag in listener tsq_flags.

This is bad because if we clone the parent before it had a chance to
clear the flag, the child inherits the tsq_flags value, and next
tcp_release_cb() on the child will decrement sk_refcnt.

Result is that we might free a live TCP socket, as reported by
Dormando.

IPv4: Attempt to release TCP socket in state 1

Fix this issue by testing sk_state against TCP_LISTEN early, so that we
set TCP_MTU_REDUCED_DEFERRED on appropriate sockets (not a LISTEN one)

This bug was introduced in commit 563d34d05786
(tcp: dont drop MTU reduction indications)

Reported-by: dormando <dormando@rydia.net>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv4/tcp_ipv4.c |   14 +++++++-------
 net/ipv6/tcp_ipv6.c |    7 +++++++
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c883f4f..e6ed4ae 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -285,13 +285,6 @@ static void tcp_v4_mtu_reduced(struct sock *sk)
 	struct inet_sock *inet = inet_sk(sk);
 	u32 mtu = tcp_sk(sk)->mtu_info;
 
-	/* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs
-	 * send out by Linux are always <576bytes so they should go through
-	 * unfragmented).
-	 */
-	if (sk->sk_state == TCP_LISTEN)
-		return;
-
 	dst = inet_csk_update_pmtu(sk, mtu);
 	if (!dst)
 		return;
@@ -415,6 +408,13 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
 			goto out;
 
 		if (code == ICMP_FRAG_NEEDED) { /* PMTU discovery (RFC1191) */
+			/* We are not interested in TCP_LISTEN and open_requests
+			 * (SYN-ACKs send out by Linux are always <576bytes so
+			 * they should go through unfragmented).
+			 */
+			if (sk->sk_state == TCP_LISTEN)
+				goto out;
+
 			tp->mtu_info = info;
 			if (!sock_owned_by_user(sk)) {
 				tcp_v4_mtu_reduced(sk);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 8b45fb4..fe48fc9 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -400,6 +400,13 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	}
 
 	if (type == ICMPV6_PKT_TOOBIG) {
+		/* We are not interested in TCP_LISTEN and open_requests
+		 * (SYN-ACKs send out by Linux are always <576bytes so
+		 * they should go through unfragmented).
+		 */
+		if (sk->sk_state == TCP_LISTEN)
+			goto out;
+
 		tp->mtu_info = ntohl(info);
 		if (!sock_owned_by_user(sk))
 			tcp_v6_mtu_reduced(sk);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 020/171 ] inet: limit length of fragment queue hash table bucket lists
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (18 preceding siblings ...)
  2013-04-11 20:25 ` [ 019/171 ] tcp: dont handle MTU reduction on LISTEN socket Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 021/171 ] sfc: Properly sync RX DMA buffer when it is not the last in the page Steven Rostedt
                   ` (150 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Eric Dumazet, Jesper Dangaard Brouer, Hannes Frederic Sowa,
	Eric Dumazet, David S. Miller

[-- Attachment #1: 0020-inet-limit-length-of-fragment-queue-hash-table-bucke.patch --]
[-- Type: text/plain, Size: 6149 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

[ Upstream commit 5a3da1fe9561828d0ca7eca664b16ec2b9bf0055 ]

This patch introduces a constant limit of the fragment queue hash
table bucket list lengths. Currently the limit 128 is choosen somewhat
arbitrary and just ensures that we can fill up the fragment cache with
empty packets up to the default ip_frag_high_thresh limits. It should
just protect from list iteration eating considerable amounts of cpu.

If we reach the maximum length in one hash bucket a warning is printed.
This is implemented on the caller side of inet_frag_find to distinguish
between the different users of inet_fragment.c.

I dropped the out of memory warning in the ipv4 fragment lookup path,
because we already get a warning by the slab allocator.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jesper Dangaard Brouer <jbrouer@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/net/inet_frag.h                 |    9 +++++++++
 net/ipv4/inet_fragment.c                |   20 +++++++++++++++++++-
 net/ipv4/ip_fragment.c                  |   11 ++++-------
 net/ipv6/netfilter/nf_conntrack_reasm.c |   12 ++++++------
 net/ipv6/reassembly.c                   |    8 ++++++--
 5 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 2431cf8..92e211e 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -33,6 +33,13 @@ struct inet_frag_queue {
 
 #define INETFRAGS_HASHSZ		64
 
+/* averaged:
+ * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ /
+ *	       rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or
+ *	       struct frag_queue))
+ */
+#define INETFRAGS_MAXDEPTH		128
+
 struct inet_frags {
 	struct hlist_head	hash[INETFRAGS_HASHSZ];
 	rwlock_t		lock;
@@ -63,6 +70,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f);
 struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
 		struct inet_frags *f, void *key, unsigned int hash)
 	__releases(&f->lock);
+void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
+				   const char *prefix);
 
 static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
 {
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 85190e6..7112e6c 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -21,6 +21,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/slab.h>
 
+#include <net/sock.h>
 #include <net/inet_frag.h>
 
 static void inet_frag_secret_rebuild(unsigned long dummy)
@@ -271,6 +272,7 @@ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
 {
 	struct inet_frag_queue *q;
 	struct hlist_node *n;
+	int depth = 0;
 
 	hlist_for_each_entry(q, n, &f->hash[hash], list) {
 		if (q->net == nf && f->match(q, key)) {
@@ -278,9 +280,25 @@ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
 			read_unlock(&f->lock);
 			return q;
 		}
+		depth++;
 	}
 	read_unlock(&f->lock);
 
-	return inet_frag_create(nf, f, key);
+	if (depth <= INETFRAGS_MAXDEPTH)
+		return inet_frag_create(nf, f, key);
+	else
+		return ERR_PTR(-ENOBUFS);
 }
 EXPORT_SYMBOL(inet_frag_find);
+
+void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
+				   const char *prefix)
+{
+	static const char msg[] = "inet_frag_find: Fragment hash bucket"
+		" list length grew over limit " __stringify(INETFRAGS_MAXDEPTH)
+		". Dropping fragment.\n";
+
+	if (PTR_ERR(q) == -ENOBUFS)
+		LIMIT_NETDEBUG(KERN_WARNING "%s%s", prefix, msg);
+}
+EXPORT_SYMBOL(inet_frag_maybe_warn_overflow);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index cea1859..578e536 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -299,14 +299,11 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
 	hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
 
 	q = inet_frag_find(&net->ipv4.frags, &ip4_frags, &arg, hash);
-	if (q == NULL)
-		goto out_nomem;
-
+	if (IS_ERR_OR_NULL(q)) {
+		inet_frag_maybe_warn_overflow(q, pr_fmt());
+		return NULL;
+	}
 	return container_of(q, struct ipq, q);
-
-out_nomem:
-	LIMIT_NETDEBUG(KERN_ERR pr_fmt("ip_frag_create: no memory left !\n"));
-	return NULL;
 }
 
 /* Is the fragment too far ahead to be part of ipq? */
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index c9c78c2..f5ea02f 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -14,6 +14,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#define pr_fmt(fmt) "IPv6-nf: " fmt
+
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -176,13 +178,11 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst)
 
 	q = inet_frag_find(&nf_init_frags, &nf_frags, &arg, hash);
 	local_bh_enable();
-	if (q == NULL)
-		goto oom;
-
+	if (IS_ERR_OR_NULL(q)) {
+		inet_frag_maybe_warn_overflow(q, pr_fmt());
+		return NULL;
+	}
 	return container_of(q, struct nf_ct_frag6_queue, q);
-
-oom:
-	return NULL;
 }
 
 
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 4ff9af6..66d2096 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -26,6 +26,9 @@
  *	YOSHIFUJI,H. @USAGI	Always remove fragment header to
  *				calculate ICV correctly.
  */
+
+#define pr_fmt(fmt) "IPv6: " fmt
+
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -241,9 +244,10 @@ fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6
 	hash = inet6_hash_frag(id, src, dst, ip6_frags.rnd);
 
 	q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash);
-	if (q == NULL)
+	if (IS_ERR_OR_NULL(q)) {
+		inet_frag_maybe_warn_overflow(q, pr_fmt());
 		return NULL;
-
+	}
 	return container_of(q, struct frag_queue, q);
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 021/171 ] sfc: Properly sync RX DMA buffer when it is not the last in the page
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (19 preceding siblings ...)
  2013-04-11 20:25 ` [ 020/171 ] inet: limit length of fragment queue hash table bucket lists Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 022/171 ] sfc: Fix efx_rx_buf_offset() in the presence of swiotlb Steven Rostedt
                   ` (149 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0021-sfc-Properly-sync-RX-DMA-buffer-when-it-is-not-the-l.patch --]
[-- Type: text/plain, Size: 2655 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <bhutchings@solarflare.com>

[ Upstream commit 3a68f19d7afb80f548d016effbc6ed52643a8085 ]

We may currently allocate two RX DMA buffers to a page, and only unmap
the page when the second is completed.  We do not sync the first RX
buffer to be completed; this can result in packet loss or corruption
if the last RX buffer completed in a NAPI poll is the first in a page
and is not DMA-coherent.  (In the middle of a NAPI poll, we will
handle the following RX completion and unmap the page *before* looking
at the content of the first buffer.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/rx.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 719319b..16ef366 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -240,7 +240,8 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 }
 
 static void efx_unmap_rx_buffer(struct efx_nic *efx,
-				struct efx_rx_buffer *rx_buf)
+				struct efx_rx_buffer *rx_buf,
+				unsigned int used_len)
 {
 	if ((rx_buf->flags & EFX_RX_BUF_PAGE) && rx_buf->u.page) {
 		struct efx_rx_page_state *state;
@@ -251,6 +252,10 @@ static void efx_unmap_rx_buffer(struct efx_nic *efx,
 				       state->dma_addr,
 				       efx_rx_buf_size(efx),
 				       DMA_FROM_DEVICE);
+		} else if (used_len) {
+			dma_sync_single_for_cpu(&efx->pci_dev->dev,
+						rx_buf->dma_addr, used_len,
+						DMA_FROM_DEVICE);
 		}
 	} else if (!(rx_buf->flags & EFX_RX_BUF_PAGE) && rx_buf->u.skb) {
 		dma_unmap_single(&efx->pci_dev->dev, rx_buf->dma_addr,
@@ -273,7 +278,7 @@ static void efx_free_rx_buffer(struct efx_nic *efx,
 static void efx_fini_rx_buffer(struct efx_rx_queue *rx_queue,
 			       struct efx_rx_buffer *rx_buf)
 {
-	efx_unmap_rx_buffer(rx_queue->efx, rx_buf);
+	efx_unmap_rx_buffer(rx_queue->efx, rx_buf, 0);
 	efx_free_rx_buffer(rx_queue->efx, rx_buf);
 }
 
@@ -539,10 +544,10 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
 		goto out;
 	}
 
-	/* Release card resources - assumes all RX buffers consumed in-order
-	 * per RX queue
+	/* Release and/or sync DMA mapping - assumes all RX buffers
+	 * consumed in-order per RX queue
 	 */
-	efx_unmap_rx_buffer(efx, rx_buf);
+	efx_unmap_rx_buffer(efx, rx_buf, len);
 
 	/* Prefetch nice and early so data will (hopefully) be in cache by
 	 * the time we look at it.
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 022/171 ] sfc: Fix efx_rx_buf_offset() in the presence of swiotlb
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (20 preceding siblings ...)
  2013-04-11 20:25 ` [ 021/171 ] sfc: Properly sync RX DMA buffer when it is not the last in the page Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 023/171 ] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Steven Rostedt
                   ` (148 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0022-sfc-Fix-efx_rx_buf_offset-in-the-presence-of-swiotlb.patch --]
[-- Type: text/plain, Size: 3418 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <bhutchings@solarflare.com>

[ Upstream commit b590ace09d51cd39744e0f7662c5e4a0d1b5d952 ]

We assume that the mapping between DMA and virtual addresses is done
on whole pages, so we can find the page offset of an RX buffer using
the lower bits of the DMA address.  However, swiotlb maps in units of
2K, breaking this assumption.

Add an explicit page_offset field to struct efx_rx_buffer.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/net_driver.h |    4 +++-
 drivers/net/ethernet/sfc/rx.c         |   10 +++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index cd9c0a9..4c454bdc 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -205,6 +205,7 @@ struct efx_tx_queue {
  *	Will be %NULL if the buffer slot is currently free.
  * @page: The associated page buffer. Valif iff @flags & %EFX_RX_BUF_PAGE.
  *	Will be %NULL if the buffer slot is currently free.
+ * @page_offset: Offset within page. Valid iff @flags & %EFX_RX_BUF_PAGE.
  * @len: Buffer length, in bytes.
  * @flags: Flags for buffer and packet state.
  */
@@ -214,7 +215,8 @@ struct efx_rx_buffer {
 		struct sk_buff *skb;
 		struct page *page;
 	} u;
-	unsigned int len;
+	u16 page_offset;
+	u16 len;
 	u16 flags;
 };
 #define EFX_RX_BUF_PAGE		0x0001
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 16ef366..b59b6fe 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -90,11 +90,7 @@ static unsigned int rx_refill_threshold;
 static inline unsigned int efx_rx_buf_offset(struct efx_nic *efx,
 					     struct efx_rx_buffer *buf)
 {
-	/* Offset is always within one page, so we don't need to consider
-	 * the page order.
-	 */
-	return ((unsigned int) buf->dma_addr & (PAGE_SIZE - 1)) +
-		efx->type->rx_buffer_hash_size;
+	return buf->page_offset + efx->type->rx_buffer_hash_size;
 }
 static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)
 {
@@ -187,6 +183,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 	struct efx_nic *efx = rx_queue->efx;
 	struct efx_rx_buffer *rx_buf;
 	struct page *page;
+	unsigned int page_offset;
 	void *page_addr;
 	struct efx_rx_page_state *state;
 	dma_addr_t dma_addr;
@@ -214,12 +211,14 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 
 		page_addr += sizeof(struct efx_rx_page_state);
 		dma_addr += sizeof(struct efx_rx_page_state);
+		page_offset = sizeof(struct efx_rx_page_state);
 
 	split:
 		index = rx_queue->added_count & rx_queue->ptr_mask;
 		rx_buf = efx_rx_buffer(rx_queue, index);
 		rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN;
 		rx_buf->u.page = page;
+		rx_buf->page_offset = page_offset;
 		rx_buf->len = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN;
 		rx_buf->flags = EFX_RX_BUF_PAGE;
 		++rx_queue->added_count;
@@ -230,6 +229,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 			/* Use the second half of the page */
 			get_page(page);
 			dma_addr += (PAGE_SIZE >> 1);
+			page_offset += (PAGE_SIZE >> 1);
 			page_addr += (PAGE_SIZE >> 1);
 			++count;
 			goto split;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 023/171 ] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (21 preceding siblings ...)
  2013-04-11 20:25 ` [ 022/171 ] sfc: Fix efx_rx_buf_offset() in the presence of swiotlb Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 024/171 ] sfc: lock TX queues when calling netif_device_detach() Steven Rostedt
                   ` (147 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0023-sfc-Correct-efx_rx_buffer-page_offset-when-EFX_PAGE_.patch --]
[-- Type: text/plain, Size: 1360 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <bhutchings@solarflare.com>

[ Upstream commit c73e787a8db9117d59b5180baf83203a42ecadca ]

RX DMA buffers start at an offset of EFX_PAGE_IP_ALIGN bytes from the
start of a cache line.  This offset obviously needs to be included in
the virtual address, but this was missed in commit b590ace09d51
('sfc: Fix efx_rx_buf_offset() in the presence of swiotlb') since
EFX_PAGE_IP_ALIGN is equal to 0 on both x86 and powerpc.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/rx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index b59b6fe..cd3f12f 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -218,7 +218,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 		rx_buf = efx_rx_buffer(rx_queue, index);
 		rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN;
 		rx_buf->u.page = page;
-		rx_buf->page_offset = page_offset;
+		rx_buf->page_offset = page_offset + EFX_PAGE_IP_ALIGN;
 		rx_buf->len = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN;
 		rx_buf->flags = EFX_RX_BUF_PAGE;
 		++rx_queue->added_count;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 024/171 ] sfc: lock TX queues when calling netif_device_detach()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (22 preceding siblings ...)
  2013-04-11 20:25 ` [ 023/171 ] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:42   ` Ben Hutchings
  2013-04-11 20:25 ` [ 025/171 ] sfc: Detach net device when stopping queues for reconfiguration Steven Rostedt
                   ` (146 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0024-sfc-lock-TX-queues-when-calling-netif_device_detach.patch --]
[-- Type: text/plain, Size: 2694 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Daniel Pieczko <dpieczko@solarflare.com>

[ Upstream commit c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1 ]

The assertion of netif_device_present() at the top of
efx_hard_start_xmit() may fail if we don't do this.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/efx.c      |    4 ++--
 drivers/net/ethernet/sfc/efx.h      |   13 +++++++++++++
 drivers/net/ethernet/sfc/selftest.c |    2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 65a8d49..073fd60 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2224,7 +2224,7 @@ int efx_reset(struct efx_nic *efx, enum reset_type method)
 	netif_info(efx, drv, efx->net_dev, "resetting (%s)\n",
 		   RESET_TYPE(method));
 
-	netif_device_detach(efx->net_dev);
+	efx_device_detach_sync(efx);
 	efx_reset_down(efx, method);
 
 	rc = efx->type->reset(efx, method);
@@ -2719,7 +2719,7 @@ static int efx_pm_freeze(struct device *dev)
 
 	efx->state = STATE_FINI;
 
-	netif_device_detach(efx->net_dev);
+	efx_device_detach_sync(efx);
 
 	efx_stop_all(efx);
 	efx_stop_interrupts(efx, false);
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 70755c9..320cf7b 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -162,4 +162,17 @@ extern void efx_link_status_changed(struct efx_nic *efx);
 extern void efx_link_set_advertising(struct efx_nic *efx, u32);
 extern void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
 
+static inline void efx_device_detach_sync(struct efx_nic *efx)
+{
+	struct net_device *dev = efx->net_dev;
+
+	/* Lock/freeze all TX queues so that we can be sure the
+	 * TX scheduler is stopped when we're done and before
+	 * netif_device_present() becomes false.
+	 */
+	netif_tx_lock(dev);
+	netif_device_detach(dev);
+	netif_tx_unlock(dev);
+}
+
 #endif /* EFX_EFX_H */
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index 96068d1..57dec37 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -721,7 +721,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
 	/* Detach the device so the kernel doesn't transmit during the
 	 * loopback test and the watchdog timeout doesn't fire.
 	 */
-	netif_device_detach(efx->net_dev);
+	efx_device_detach_sync(efx);
 
 	if (efx->type->test_chip) {
 		rc_reset = efx->type->test_chip(efx, tests);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 025/171 ] sfc: Detach net device when stopping queues for reconfiguration
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (23 preceding siblings ...)
  2013-04-11 20:25 ` [ 024/171 ] sfc: lock TX queues when calling netif_device_detach() Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written Steven Rostedt
                   ` (145 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0025-sfc-Detach-net-device-when-stopping-queues-for-recon.patch --]
[-- Type: text/plain, Size: 2972 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <bhutchings@solarflare.com>

[ Upstream commit 29c69a4882641285a854d6d03ca5adbba68c0034 ]

We must only ever stop TX queues when they are full or the net device
is not 'ready' so far as the net core, and specifically the watchdog,
is concerned.  Otherwise, the watchdog may fire *immediately* if no
packets have been added to the queue in the last 5 seconds.

The device is ready if all the following are true:

(a) It has a qdisc
(b) It is marked present
(c) It is running
(d) The link is reported up

(a) and (c) are normally true, and must not be changed by a driver.
(d) is under our control, but fake link changes may disturb userland.
This leaves (b).  We already mark the device absent during reset
and self-test, but we need to do the same during MTU changes and ring
reallocation.  We don't need to do this when the device is brought
down because then (c) is already false.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/efx.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 073fd60..2dd7a3f 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -754,6 +754,7 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries)
 						tx_queue->txd.entries);
 	}
 
+	efx_device_detach_sync(efx);
 	efx_stop_all(efx);
 	efx_stop_interrupts(efx, true);
 
@@ -807,6 +808,7 @@ out:
 
 	efx_start_interrupts(efx, true);
 	efx_start_all(efx);
+	netif_device_attach(efx->net_dev);
 	return rc;
 
 rollback:
@@ -1601,8 +1603,12 @@ static void efx_stop_all(struct efx_nic *efx)
 	/* Flush efx_mac_work(), refill_workqueue, monitor_work */
 	efx_flush_all(efx);
 
-	/* Stop the kernel transmit interface late, so the watchdog
-	 * timer isn't ticking over the flush */
+	/* Stop the kernel transmit interface.  This is only valid if
+	 * the device is stopped or detached; otherwise the watchdog
+	 * may fire immediately.
+	 */
+	WARN_ON(netif_running(efx->net_dev) &&
+		netif_device_present(efx->net_dev));
 	netif_tx_disable(efx->net_dev);
 
 	efx_stop_datapath(efx);
@@ -1921,10 +1927,11 @@ static int efx_change_mtu(struct net_device *net_dev, int new_mtu)
 	if (new_mtu > EFX_MAX_MTU)
 		return -EINVAL;
 
-	efx_stop_all(efx);
-
 	netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu);
 
+	efx_device_detach_sync(efx);
+	efx_stop_all(efx);
+
 	mutex_lock(&efx->mac_lock);
 	/* Reconfigure the MAC before enabling the dma queues so that
 	 * the RX buffers don't overflow */
@@ -1933,6 +1940,7 @@ static int efx_change_mtu(struct net_device *net_dev, int new_mtu)
 	mutex_unlock(&efx->mac_lock);
 
 	efx_start_all(efx);
+	netif_device_attach(efx->net_dev);
 	return 0;
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (24 preceding siblings ...)
  2013-04-11 20:25 ` [ 025/171 ] sfc: Detach net device when stopping queues for reconfiguration Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 21:15   ` Ben Hutchings
  2013-04-11 20:25 ` [ 027/171 ] ALSA: hda/cirrus - Fix the digital beep registration Steven Rostedt
                   ` (144 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ben Hutchings

[-- Attachment #1: 0026-sfc-Only-use-TX-push-if-a-single-descriptor-is-to-be.patch --]
[-- Type: text/plain, Size: 1475 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <bhutchings@solarflare.com>

[ Upstream commit fae8563b25f73dc584a07bcda7a82750ff4f7672 ]

Using TX push when notifying the NIC of multiple new descriptors in
the ring will very occasionally cause the TX DMA engine to re-use an
old descriptor.  This can result in a duplicated or partly duplicated
packet (new headers with old data), or an IOMMU page fault.  This does
not happen when the pushed descriptor is the only one written.

TX push also provides little latency benefit when a packet requires
more than one descriptor.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/sfc/nic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 326d799..a1c3d80 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -377,7 +377,8 @@ efx_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsigned int write_count)
 		return false;
 
 	tx_queue->empty_read_count = 0;
-	return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0;
+	return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0
+		&& tx_queue->write_count - write_count == 1;
 }
 
 /* For each entry inserted into the software descriptor ring, create a
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 027/171 ] ALSA: hda/cirrus - Fix the digital beep registration
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (25 preceding siblings ...)
  2013-04-11 20:25 ` [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 028/171 ] ALSA: hda - Fix typo in checking IEC958 emphasis bit Steven Rostedt
                   ` (143 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Takashi Iwai

[-- Attachment #1: 0027-ALSA-hda-cirrus-Fix-the-digital-beep-registration.patch --]
[-- Type: text/plain, Size: 1897 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

[ Upstream commit a86b1a2cd2f81f74e815e07f756edd7bc5b6f034 ]

The argument passed to snd_hda_attach_beep_device() is a widget NID
while spec->beep_amp holds the composed value for amp controls.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 sound/pci/hda/patch_conexant.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 784017e..ee23081 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1182,7 +1182,7 @@ static int patch_cxt5045(struct hda_codec *codec)
 	}
 
 	if (spec->beep_amp)
-		snd_hda_attach_beep_device(codec, spec->beep_amp);
+		snd_hda_attach_beep_device(codec, get_amp_nid_(spec->beep_amp));
 
 	return 0;
 }
@@ -1961,7 +1961,7 @@ static int patch_cxt5051(struct hda_codec *codec)
 	}
 
 	if (spec->beep_amp)
-		snd_hda_attach_beep_device(codec, spec->beep_amp);
+		snd_hda_attach_beep_device(codec, get_amp_nid_(spec->beep_amp));
 
 	return 0;
 }
@@ -3143,7 +3143,7 @@ static int patch_cxt5066(struct hda_codec *codec)
 	}
 
 	if (spec->beep_amp)
-		snd_hda_attach_beep_device(codec, spec->beep_amp);
+		snd_hda_attach_beep_device(codec, get_amp_nid_(spec->beep_amp));
 
 	return 0;
 }
@@ -4538,7 +4538,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
 	spec->capture_stream = &cx_auto_pcm_analog_capture;
 	codec->patch_ops = cx_auto_patch_ops;
 	if (spec->beep_amp)
-		snd_hda_attach_beep_device(codec, spec->beep_amp);
+		snd_hda_attach_beep_device(codec, get_amp_nid_(spec->beep_amp));
 
 	/* Some laptops with Conexant chips show stalls in S3 resume,
 	 * which falls into the single-cmd mode.
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 028/171 ] ALSA: hda - Fix typo in checking IEC958 emphasis bit
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (26 preceding siblings ...)
  2013-04-11 20:25 ` [ 027/171 ] ALSA: hda/cirrus - Fix the digital beep registration Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 029/171 ] ALSA: snd-usb: mixer: propagate errors up the call chain Steven Rostedt
                   ` (142 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Martin Weishart, Takashi Iwai

[-- Attachment #1: 0028-ALSA-hda-Fix-typo-in-checking-IEC958-emphasis-bit.patch --]
[-- Type: text/plain, Size: 1162 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

[ Upstream commit a686fd141e20244ad75f80ad54706da07d7bb90a ]

There is a typo in convert_to_spdif_status() about checking the
emphasis IEC958 status bit.  It should check the given value instead
of the resultant value.

Reported-by: Martin Weishart <martin.weishart@telosalliance.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 sound/pci/hda/hda_codec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 38fdefc..f60254d 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2970,7 +2970,7 @@ static unsigned int convert_to_spdif_status(unsigned short val)
 	if (val & AC_DIG1_PROFESSIONAL)
 		sbits |= IEC958_AES0_PROFESSIONAL;
 	if (sbits & IEC958_AES0_PROFESSIONAL) {
-		if (sbits & AC_DIG1_EMPHASIS)
+		if (val & AC_DIG1_EMPHASIS)
 			sbits |= IEC958_AES0_PRO_EMPHASIS_5015;
 	} else {
 		if (val & AC_DIG1_EMPHASIS)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 029/171 ] ALSA: snd-usb: mixer: propagate errors up the call chain
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (27 preceding siblings ...)
  2013-04-11 20:25 ` [ 028/171 ] ALSA: hda - Fix typo in checking IEC958 emphasis bit Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 030/171 ] ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() Steven Rostedt
                   ` (141 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Daniel Mack, Takashi Iwai

[-- Attachment #1: 0029-ALSA-snd-usb-mixer-propagate-errors-up-the-call-chai.patch --]
[-- Type: text/plain, Size: 1782 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Daniel Mack <zonque@gmail.com>

[ Upstream commit 4d7b86c98e445b075c2c4c3757eb6d3d6efbe72e ]

In check_input_term() and parse_audio_feature_unit(), propagate the
error value that has been returned by a failing function instead of
-EINVAL. That helps cleaning up the error pathes in the mixer.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 sound/usb/mixer.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 298070e..c20a0c5 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -711,8 +711,9 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
 		case UAC2_CLOCK_SELECTOR: {
 			struct uac_selector_unit_descriptor *d = p1;
 			/* call recursively to retrieve the channel info */
-			if (check_input_term(state, d->baSourceID[0], term) < 0)
-				return -ENODEV;
+			err = check_input_term(state, d->baSourceID[0], term);
+			if (err < 0)
+				return err;
 			term->type = d->bDescriptorSubtype << 16; /* virtual type */
 			term->id = id;
 			term->name = uac_selector_unit_iSelector(d);
@@ -1276,8 +1277,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
 		return err;
 
 	/* determine the input source type and name */
-	if (check_input_term(state, hdr->bSourceID, &iterm) < 0)
-		return -EINVAL;
+	err = check_input_term(state, hdr->bSourceID, &iterm);
+	if (err < 0)
+		return err;
 
 	master_bits = snd_usb_combine_bytes(bmaControls, csize);
 	/* master configuration quirks */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 030/171 ] ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (28 preceding siblings ...)
  2013-04-11 20:25 ` [ 029/171 ] ALSA: snd-usb: mixer: propagate errors up the call chain Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 031/171 ] saner proc_get_inode() calling conventions Steven Rostedt
                   ` (140 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Daniel Mack, Takashi Iwai

[-- Attachment #1: 0030-ALSA-snd-usb-mixer-ignore-EINVAL-in-snd_usb_mixer_co.patch --]
[-- Type: text/plain, Size: 2189 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Daniel Mack <zonque@gmail.com>

[ Upstream commit 83ea5d18d74f032a760fecde78c0210f66f7f70c ]

Creation of individual mixer controls may fail, but that shouldn't cause
the entire mixer creation to fail. Even worse, if the mixer creation
fails, that will error out the entire device probing.

All the functions called by parse_audio_unit() should return -EINVAL if
they find descriptors that are unsupported or believed to be malformed,
so we can safely handle this error code as a non-fatal condition in
snd_usb_mixer_controls().

That fixes a long standing bug which is commonly worked around by
adding quirks which make the driver ignore entire interfaces. Some of
them might now be unnecessary.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Rodolfo Thomazelli <pe.soberbo@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 sound/usb/mixer.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c20a0c5..900bf42 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2040,7 +2040,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
 			state.oterm.type = le16_to_cpu(desc->wTerminalType);
 			state.oterm.name = desc->iTerminal;
 			err = parse_audio_unit(&state, desc->bSourceID);
-			if (err < 0)
+			if (err < 0 && err != -EINVAL)
 				return err;
 		} else { /* UAC_VERSION_2 */
 			struct uac2_output_terminal_descriptor *desc = p;
@@ -2052,12 +2052,12 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
 			state.oterm.type = le16_to_cpu(desc->wTerminalType);
 			state.oterm.name = desc->iTerminal;
 			err = parse_audio_unit(&state, desc->bSourceID);
-			if (err < 0)
+			if (err < 0 && err != -EINVAL)
 				return err;
 
 			/* for UAC2, use the same approach to also add the clock selectors */
 			err = parse_audio_unit(&state, desc->bCSourceID);
-			if (err < 0)
+			if (err < 0 && err != -EINVAL)
 				return err;
 		}
 	}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 031/171 ] saner proc_get_inode() calling conventions
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (29 preceding siblings ...)
  2013-04-11 20:25 ` [ 030/171 ] ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 032/171 ] vfs,proc: guarantee unique inodes in /proc Steven Rostedt
                   ` (139 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Al Viro

[-- Attachment #1: 0031-saner-proc_get_inode-calling-conventions.patch --]
[-- Type: text/plain, Size: 2773 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@zeniv.linux.org.uk>

[ Upstream commit d3d009cb965eae7e002ea5badf603ea8f4c34915 ]

Make it drop the pde in *all* cases when no new reference to it is
put into an inode - both when an inode had already been set up
(as we were already doing) and when inode allocation has failed.
Makes for simpler logics in callers...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/proc/generic.c |   21 +++++++--------------
 fs/proc/inode.c   |    9 +++------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index b3647fe..dcd2b05 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -417,8 +417,7 @@ static const struct dentry_operations proc_dentry_operations =
 struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
 		struct dentry *dentry)
 {
-	struct inode *inode = NULL;
-	int error = -ENOENT;
+	struct inode *inode;
 
 	spin_lock(&proc_subdir_lock);
 	for (de = de->subdir; de ; de = de->next) {
@@ -427,22 +426,16 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
 		if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
 			pde_get(de);
 			spin_unlock(&proc_subdir_lock);
-			error = -EINVAL;
 			inode = proc_get_inode(dir->i_sb, de);
-			goto out_unlock;
+			if (!inode)
+				return ERR_PTR(-ENOMEM);
+			d_set_d_op(dentry, &proc_dentry_operations);
+			d_add(dentry, inode);
+			return NULL;
 		}
 	}
 	spin_unlock(&proc_subdir_lock);
-out_unlock:
-
-	if (inode) {
-		d_set_d_op(dentry, &proc_dentry_operations);
-		d_add(dentry, inode);
-		return NULL;
-	}
-	if (de)
-		pde_put(de);
-	return ERR_PTR(error);
+	return ERR_PTR(-ENOENT);
 }
 
 struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry,
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7ac817b..710e28f 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -443,12 +443,9 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
 
 struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
 {
-	struct inode * inode;
+	struct inode *inode = iget_locked(sb, de->low_ino);
 
-	inode = iget_locked(sb, de->low_ino);
-	if (!inode)
-		return NULL;
-	if (inode->i_state & I_NEW) {
+	if (inode && (inode->i_state & I_NEW)) {
 		inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 		PROC_I(inode)->fd = 0;
 		PROC_I(inode)->pde = de;
@@ -481,7 +478,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
 	} else
 	       pde_put(de);
 	return inode;
-}			
+}
 
 int proc_fill_super(struct super_block *s)
 {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 032/171 ] vfs,proc: guarantee unique inodes in /proc
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (30 preceding siblings ...)
  2013-04-11 20:25 ` [ 031/171 ] saner proc_get_inode() calling conventions Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 033/171 ] Revert "drm/i915: try to train DP even harder" Steven Rostedt
                   ` (138 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0032-vfs-proc-guarantee-unique-inodes-in-proc.patch --]
[-- Type: text/plain, Size: 2637 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Linus Torvalds <torvalds@linux-foundation.org>

[ Upstream commit 51f0885e5415b4cc6535e9cdcc5145bfbc134353 ]

Dave Jones found another /proc issue with his Trinity tool: thanks to
the namespace model, we can have multiple /proc dentries that point to
the same inode, aliasing directories in /proc/<pid>/net/ for example.

This ends up being a total disaster, because it acts like hardlinked
directories, and causes locking problems.  We rely on the topological
sort of the inodes pointed to by dentries, and if we have aliased
directories, that odering becomes unreliable.

In short: don't do this.  Multiple dentries with the same (directory)
inode is just a bad idea, and the namespace code should never have
exposed things this way.  But we're kind of stuck with it.

This solves things by just always allocating a new inode during /proc
dentry lookup, instead of using "iget_locked()" to look up existing
inodes by superblock and number.  That actually simplies the code a bit,
at the cost of potentially doing more inode [de]allocations.

That said, the inode lookup wasn't free either (and did a lot of locking
of inodes), so it is probably not that noticeable.  We could easily keep
the old lookup model for non-directory entries, but rather than try to
be excessively clever this just implements the minimal and simplest
workaround for the problem.

Reported-and-tested-by: Dave Jones <davej@redhat.com>
Analyzed-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/proc/inode.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 710e28f..e5b57da 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -443,9 +443,10 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
 
 struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
 {
-	struct inode *inode = iget_locked(sb, de->low_ino);
+	struct inode *inode = new_inode_pseudo(sb);
 
-	if (inode && (inode->i_state & I_NEW)) {
+	if (inode) {
+		inode->i_ino = de->low_ino;
 		inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 		PROC_I(inode)->fd = 0;
 		PROC_I(inode)->pde = de;
@@ -474,7 +475,6 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
 				inode->i_fop = de->proc_fops;
 			}
 		}
-		unlock_new_inode(inode);
 	} else
 	       pde_put(de);
 	return inode;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 033/171 ] Revert "drm/i915: try to train DP even harder"
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (31 preceding siblings ...)
  2013-04-11 20:25 ` [ 032/171 ] vfs,proc: guarantee unique inodes in /proc Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 034/171 ] drm/i915: restrict kernel address leak in debugfs Steven Rostedt
                   ` (137 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Takashi Iwai, Daniel Vetter

[-- Attachment #1: 0033-Revert-drm-i915-try-to-train-DP-even-harder.patch --]
[-- Type: text/plain, Size: 1443 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

[ Upstream commit 3b4f819d5eac94ba8fe5e8c061f6dabfe8d7b22c ]

This reverts commit 0d71068835e2610576d369d6d4cbf90e0f802a71.

Not only that the commit introduces a bogus check (voltage_tries == 5
will never meet at the inserted code path), it brings the i915 driver
into an endless dp-train loop on HP Z1 desktop machine with IVY+eDP.

At least reverting this commit recovers the framebuffer (but X is
still broken by other reasons...)

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/i915/intel_dp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ace757a..82e5e0d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1771,7 +1771,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
 		for (i = 0; i < intel_dp->lane_count; i++)
 			if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
 				break;
-		if (i == intel_dp->lane_count && voltage_tries == 5) {
+		if (i == intel_dp->lane_count) {
 			++loop_tries;
 			if (loop_tries == 5) {
 				DRM_DEBUG_KMS("too many full retries, give up\n");
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 034/171 ] drm/i915: restrict kernel address leak in debugfs
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (32 preceding siblings ...)
  2013-04-11 20:25 ` [ 033/171 ] Revert "drm/i915: try to train DP even harder" Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 035/171 ] tracing: Fix race in snapshot swapping Steven Rostedt
                   ` (136 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Kees Cook, Daniel Vetter

[-- Attachment #1: 0034-drm-i915-restrict-kernel-address-leak-in-debugfs.patch --]
[-- Type: text/plain, Size: 1208 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Kees Cook <keescook@chromium.org>

[ Upstream commit 2563a4524febe8f4a98e717e02436d1aaf672aa2 ]

Masks kernel address info-leak in object dumps with the %pK suffix,
so they cannot be used to target kernel memory corruption attacks if
the kptr_restrict sysctl is set.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/i915/i915_debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 359f6e8..956e9b7 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -121,7 +121,7 @@ static const char *cache_level_str(int type)
 static void
 describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
 {
-	seq_printf(m, "%p: %s%s %8zdKiB %04x %04x %d %d%s%s%s",
+	seq_printf(m, "%pK: %s%s %8zdKiB %04x %04x %d %d%s%s%s",
 		   &obj->base,
 		   get_pin_flag(obj),
 		   get_tiling_flag(obj),
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 035/171 ] tracing: Fix race in snapshot swapping
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (33 preceding siblings ...)
  2013-04-11 20:25 ` [ 034/171 ] drm/i915: restrict kernel address leak in debugfs Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 036/171 ] tracing: Fix free of probe entry by calling call_rcu_sched() Steven Rostedt
                   ` (135 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0035-tracing-Fix-race-in-snapshot-swapping.patch --]
[-- Type: text/plain, Size: 1723 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

[ Upstream commit 2721e72dd10f71a3ba90f59781becf02638aa0d9 ]

Although the swap is wrapped with a spin_lock, the assignment
of the temp buffer used to swap is not within that lock.
It needs to be moved into that lock, otherwise two swaps
happening on two different CPUs, can end up using the wrong
temp buffer to assign in the swap.

Luckily, all current callers of the swap function appear to have
their own locks. But in case something is added that allows two
different callers to call the swap, then there's a chance that
this race can trigger and corrupt the buffers.

New code is coming soon that will allow for this race to trigger.

I've Cc'd stable, so this bug will not show up if someone backports
one of the changes that can trigger this bug.

Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 5c38c81..0293d9a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -693,7 +693,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
 void
 update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
 {
-	struct ring_buffer *buf = tr->buffer;
+	struct ring_buffer *buf;
 
 	if (trace_stop_count)
 		return;
@@ -705,6 +705,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
 	}
 	arch_spin_lock(&ftrace_max_lock);
 
+	buf = tr->buffer;
 	tr->buffer = max_tr.buffer;
 	max_tr.buffer = buf;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 036/171 ] tracing: Fix free of probe entry by calling call_rcu_sched()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (34 preceding siblings ...)
  2013-04-11 20:25 ` [ 035/171 ] tracing: Fix race in snapshot swapping Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 037/171 ] tracing: Protect tracer flags with trace_types_lock Steven Rostedt
                   ` (134 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Paul McKenney

[-- Attachment #1: 0036-tracing-Fix-free-of-probe-entry-by-calling-call_rcu_.patch --]
[-- Type: text/plain, Size: 1427 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

[ Upstream commit 740466bc89ad8bd5afcc8de220f715f62b21e365 ]

Because function tracing is very invasive, and can even trace
calls to rcu_read_lock(), RCU access in function tracing is done
with preempt_disable_notrace(). This requires a synchronize_sched()
for updates and not a synchronize_rcu().

Function probes (traceon, traceoff, etc) must be freed after
a synchronize_sched() after its entry has been removed from the
hash. But call_rcu() is used. Fix this by using call_rcu_sched().

Also fix the usage to use hlist_del_rcu() instead of hlist_del().

Cc: stable@vger.kernel.org
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 781ecc2..c27095d 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3002,8 +3002,8 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
 					continue;
 			}
 
-			hlist_del(&entry->node);
-			call_rcu(&entry->rcu, ftrace_free_entry_rcu);
+			hlist_del_rcu(&entry->node);
+			call_rcu_sched(&entry->rcu, ftrace_free_entry_rcu);
 		}
 	}
 	__disable_ftrace_function_probe();
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 037/171 ] tracing: Protect tracer flags with trace_types_lock
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (35 preceding siblings ...)
  2013-04-11 20:25 ` [ 036/171 ] tracing: Fix free of probe entry by calling call_rcu_sched() Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 038/171 ] tracing: Keep overwrite in sync between regular and snapshot buffers Steven Rostedt
                   ` (133 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0037-tracing-Protect-tracer-flags-with-trace_types_lock.patch --]
[-- Type: text/plain, Size: 1875 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

[ Upstream commit 69d34da2984c95b33ea21518227e1f9470f11d95 ]

Seems that the tracer flags have never been protected from
synchronous writes. Luckily, admins don't usually modify the
tracing flags via two different tasks. But if scripts were to
be used to modify them, then they could get corrupted.

Move the trace_types_lock that protects against tracers changing
to also protect the flags being set.

Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0293d9a..06b227d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2819,6 +2819,8 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
 		cmp += 2;
 	}
 
+	mutex_lock(&trace_types_lock);
+
 	for (i = 0; trace_options[i]; i++) {
 		if (strcmp(cmp, trace_options[i]) == 0) {
 			set_tracer_flags(1 << i, !neg);
@@ -2827,13 +2829,10 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
 	}
 
 	/* If no option could be set, test the specific tracer options */
-	if (!trace_options[i]) {
-		mutex_lock(&trace_types_lock);
+	if (!trace_options[i])
 		ret = set_tracer_option(current_trace, cmp, neg);
-		mutex_unlock(&trace_types_lock);
-		if (ret)
-			return ret;
-	}
+
+	mutex_unlock(&trace_types_lock);
 
 	*ppos += cnt;
 
@@ -4613,7 +4612,10 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	if (val != 0 && val != 1)
 		return -EINVAL;
+
+	mutex_lock(&trace_types_lock);
 	set_tracer_flags(1 << index, val);
+	mutex_unlock(&trace_types_lock);
 
 	*ppos += cnt;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 038/171 ] tracing: Keep overwrite in sync between regular and snapshot buffers
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (36 preceding siblings ...)
  2013-04-11 20:25 ` [ 037/171 ] tracing: Protect tracer flags with trace_types_lock Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 039/171 ] rtlwifi: rtl8192cu: Fix schedule while atomic bug splat Steven Rostedt
                   ` (132 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0038-tracing-Keep-overwrite-in-sync-between-regular-and-s.patch --]
[-- Type: text/plain, Size: 1307 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

[ Upstream commit 80902822658aab18330569587cdb69ac1dfdcea8 ]

Changing the overwrite mode for the ring buffer via the trace
option only sets the normal buffer. But the snapshot buffer could
swap with it, and then the snapshot would be in non overwrite mode
and the normal buffer would be in overwrite mode, even though the
option flag states otherwise.

Keep the two buffers overwrite modes in sync.

Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 06b227d..1f84103 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2791,8 +2791,12 @@ static void set_tracer_flags(unsigned int mask, int enabled)
 	if (mask == TRACE_ITER_RECORD_CMD)
 		trace_event_enable_cmd_record(enabled);
 
-	if (mask == TRACE_ITER_OVERWRITE)
+	if (mask == TRACE_ITER_OVERWRITE) {
 		ring_buffer_change_overwrite(global_trace.buffer, enabled);
+#ifdef CONFIG_TRACER_MAX_TRACE
+		ring_buffer_change_overwrite(max_tr.buffer, enabled);
+#endif
+	}
 }
 
 static ssize_t
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 039/171 ] rtlwifi: rtl8192cu: Fix schedule while atomic bug splat
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (37 preceding siblings ...)
  2013-04-11 20:25 ` [ 038/171 ] tracing: Keep overwrite in sync between regular and snapshot buffers Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 040/171 ] rtlwifi: rtl8192cu: Fix problem that prevents reassociation Steven Rostedt
                   ` (131 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jussi Kivilinna, Larry Finger, John W. Linville

[-- Attachment #1: 0039-rtlwifi-rtl8192cu-Fix-schedule-while-atomic-bug-spla.patch --]
[-- Type: text/plain, Size: 2981 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

[ Upstream commit 664899786cb49cb52f620e06ac19c0be524a7cfa ]

When run at debug 3 or higher, rtl8192cu reports a BUG as follows:

BUG: scheduling while atomic: kworker/u:0/5281/0x00000002
INFO: lockdep is turned off.
Modules linked in: rtl8192cu rtl8192c_common rtlwifi fuse af_packet bnep bluetooth b43 mac80211 cfg80211 ipv6 snd_hda_codec_conexant kvm_amd k
vm snd_hda_intel snd_hda_codec bcma rng_core snd_pcm ssb mmc_core snd_seq snd_timer snd_seq_device snd i2c_nforce2 sr_mod pcmcia forcedeth i2c_core soundcore
 cdrom sg serio_raw k8temp hwmon joydev ac battery pcmcia_core snd_page_alloc video button wmi autofs4 ext4 mbcache jbd2 crc16 thermal processor scsi_dh_alua
 scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc scsi_dh ata_generic pata_acpi pata_amd [last unloaded: rtlwifi]
Pid: 5281, comm: kworker/u:0 Tainted: G        W    3.8.0-wl+ #119
Call Trace:
 [<ffffffff814531e7>] __schedule_bug+0x62/0x70
 [<ffffffff81459af0>] __schedule+0x730/0xa30
 [<ffffffff81326e49>] ? usb_hcd_link_urb_to_ep+0x19/0xa0
 [<ffffffff8145a0d4>] schedule+0x24/0x70
 [<ffffffff814575ec>] schedule_timeout+0x18c/0x2f0
 [<ffffffff81459ec0>] ? wait_for_common+0x40/0x180
 [<ffffffff8133f461>] ? ehci_urb_enqueue+0xf1/0xee0
 [<ffffffff810a579d>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81459f65>] wait_for_common+0xe5/0x180
 [<ffffffff8107d1c0>] ? try_to_wake_up+0x2d0/0x2d0
 [<ffffffff8145a08e>] wait_for_completion_timeout+0xe/0x10
 [<ffffffff8132ab1c>] usb_start_wait_urb+0x8c/0x100
 [<ffffffff8132adf9>] usb_control_msg+0xd9/0x130
 [<ffffffffa057dd8d>] _usb_read_sync+0xcd/0x140 [rtlwifi]
 [<ffffffffa057de0e>] _usb_read32_sync+0xe/0x10 [rtlwifi]
 [<ffffffffa04b0555>] rtl92cu_update_hal_rate_table+0x1a5/0x1f0 [rtl8192cu]

The cause is a synchronous read from routine rtl92cu_update_hal_rate_table().
The resulting output is not critical, thus the debug statement is
deleted.

Reported-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 4bbb711..b4b2e43 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -2058,8 +2058,6 @@ void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw,
 			       (shortgi_rate << 4) | (shortgi_rate);
 	}
 	rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value);
-	RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
-		 rtl_read_dword(rtlpriv, REG_ARFR0));
 }
 
 void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 040/171 ] rtlwifi: rtl8192cu: Fix problem that prevents reassociation
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (38 preceding siblings ...)
  2013-04-11 20:25 ` [ 039/171 ] rtlwifi: rtl8192cu: Fix schedule while atomic bug splat Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 041/171 ] mwifiex: fix potential out-of-boundary access to ibss rate table Steven Rostedt
                   ` (130 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jussi Kivilinna, Alessandro Lannocca, Larry Finger,
	John W. Linville

[-- Attachment #1: 0040-rtlwifi-rtl8192cu-Fix-problem-that-prevents-reassoci.patch --]
[-- Type: text/plain, Size: 4772 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

[ Upstream commit 9437a248e7cac427c898bdb11bd1ac6844a1ead4 ]

The driver was failing to clear the BSSID when a disconnect happened. That
prevented a reconnection. This problem is reported at
https://bugzilla.redhat.com/show_bug.cgi?id=789605,
https://bugzilla.redhat.com/show_bug.cgi?id=866786,
https://bugzilla.redhat.com/show_bug.cgi?id=906734, and
https://bugzilla.kernel.org/show_bug.cgi?id=46171.

Thanks to Jussi Kivilinna for making the critical observation
that led to the solution.

Reported-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c |   87 +++++++++++----------------
 1 file changed, 35 insertions(+), 52 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index b4b2e43..82167ac 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1377,74 +1377,57 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw)
 
 void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
 {
-	/* dummy routine needed for callback from rtl_op_configure_filter() */
-}
-
-/*========================================================================== */
-
-static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw,
-			      enum nl80211_iftype type)
-{
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
-	u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR);
 	struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
-	struct rtl_phy *rtlphy = &(rtlpriv->phy);
-	u8 filterout_non_associated_bssid = false;
+	u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR);
 
-	switch (type) {
-	case NL80211_IFTYPE_ADHOC:
-	case NL80211_IFTYPE_STATION:
-		filterout_non_associated_bssid = true;
-		break;
-	case NL80211_IFTYPE_UNSPECIFIED:
-	case NL80211_IFTYPE_AP:
-	default:
-		break;
-	}
-	if (filterout_non_associated_bssid) {
+	if (rtlpriv->psc.rfpwr_state != ERFON)
+		return;
+
+	if (check_bssid) {
+		u8 tmp;
 		if (IS_NORMAL_CHIP(rtlhal->version)) {
-			switch (rtlphy->current_io_type) {
-			case IO_CMD_RESUME_DM_BY_SCAN:
-				reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
-				rtlpriv->cfg->ops->set_hw_reg(hw,
-						 HW_VAR_RCR, (u8 *)(&reg_rcr));
-				/* enable update TSF */
-				_rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4));
-				break;
-			case IO_CMD_PAUSE_DM_BY_SCAN:
-				reg_rcr &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);
-				rtlpriv->cfg->ops->set_hw_reg(hw,
-						 HW_VAR_RCR, (u8 *)(&reg_rcr));
-				/* disable update TSF */
-				_rtl92cu_set_bcn_ctrl_reg(hw, BIT(4), 0);
-				break;
-			}
+			reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
+			tmp = BIT(4);
 		} else {
-			reg_rcr |= (RCR_CBSSID);
-			rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
-						      (u8 *)(&reg_rcr));
-			_rtl92cu_set_bcn_ctrl_reg(hw, 0, (BIT(4)|BIT(5)));
+			reg_rcr |= RCR_CBSSID;
+			tmp = BIT(4) | BIT(5);
 		}
-	} else if (filterout_non_associated_bssid == false) {
+		rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
+					      (u8 *) (&reg_rcr));
+		_rtl92cu_set_bcn_ctrl_reg(hw, 0, tmp);
+	} else {
+		u8 tmp;
 		if (IS_NORMAL_CHIP(rtlhal->version)) {
-			reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
-			rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
-						      (u8 *)(&reg_rcr));
-			_rtl92cu_set_bcn_ctrl_reg(hw, BIT(4), 0);
+			reg_rcr &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);
+			tmp = BIT(4);
 		} else {
-			reg_rcr &= (~RCR_CBSSID);
-			rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
-						      (u8 *)(&reg_rcr));
-			_rtl92cu_set_bcn_ctrl_reg(hw, (BIT(4)|BIT(5)), 0);
+			reg_rcr &= ~RCR_CBSSID;
+			tmp = BIT(4) | BIT(5);
 		}
+		reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
+		rtlpriv->cfg->ops->set_hw_reg(hw,
+					      HW_VAR_RCR, (u8 *) (&reg_rcr));
+		_rtl92cu_set_bcn_ctrl_reg(hw, tmp, 0);
 	}
 }
 
+/*========================================================================== */
+
 int rtl92cu_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type)
 {
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
+
 	if (_rtl92cu_set_media_status(hw, type))
 		return -EOPNOTSUPP;
-	_rtl92cu_set_check_bssid(hw, type);
+
+	if (rtlpriv->mac80211.link_state == MAC80211_LINKED) {
+		if (type != NL80211_IFTYPE_AP)
+			rtl92cu_set_check_bssid(hw, true);
+	} else {
+		rtl92cu_set_check_bssid(hw, false);
+	}
+
 	return 0;
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 041/171 ] mwifiex: fix potential out-of-boundary access to ibss rate table
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (39 preceding siblings ...)
  2013-04-11 20:25 ` [ 040/171 ] rtlwifi: rtl8192cu: Fix problem that prevents reassociation Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 042/171 ] drm/i915: bounds check execbuffer relocation count Steven Rostedt
                   ` (129 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Bing Zhao, John W. Linville

[-- Attachment #1: 0041-mwifiex-fix-potential-out-of-boundary-access-to-ibss.patch --]
[-- Type: text/plain, Size: 1337 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Bing Zhao <bzhao@marvell.com>

[ Upstream commit 5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c ]

smatch found this error:

CHECK   drivers/net/wireless/mwifiex/join.c
  drivers/net/wireless/mwifiex/join.c:1121
  mwifiex_cmd_802_11_ad_hoc_join()
  error: testing array offset 'i' after use.

Cc: <stable@vger.kernel.org> # 3.0+
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/mwifiex/join.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 82e63ce..fa42578 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1093,10 +1093,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
 		adhoc_join->bss_descriptor.bssid,
 		adhoc_join->bss_descriptor.ssid);
 
-	for (i = 0; bss_desc->supported_rates[i] &&
-			i < MWIFIEX_SUPPORTED_RATES;
-			i++)
-			;
+	for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
+		    bss_desc->supported_rates[i]; i++)
+		;
 	rates_size = i;
 
 	/* Copy Data Rates from the Rates recorded in scan response */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 042/171 ] drm/i915: bounds check execbuffer relocation count
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (40 preceding siblings ...)
  2013-04-11 20:25 ` [ 041/171 ] mwifiex: fix potential out-of-boundary access to ibss rate table Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 043/171 ] KMS: fix EDID detailed timing vsync parsing Steven Rostedt
                   ` (128 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Kees Cook, Chris Wilson, Daniel Vetter

[-- Attachment #1: 0042-drm-i915-bounds-check-execbuffer-relocation-count.patch --]
[-- Type: text/plain, Size: 1951 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Kees Cook <keescook@chromium.org>

[ Upstream commit 3118a4f652c7b12c752f3222af0447008f9b2368 ]

It is possible to wrap the counter used to allocate the buffer for
relocation copies. This could lead to heap writing overflows.

CVE-2013-0913

v3: collapse test, improve comment
v2: move check into validate_exec_list

Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Pinkie Pie
Cc: stable@vger.kernel.org
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index cdf46b5..c26a8f8 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -910,15 +910,20 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
 		   int count)
 {
 	int i;
+	int relocs_total = 0;
+	int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry);
 
 	for (i = 0; i < count; i++) {
 		char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr;
 		int length; /* limited by fault_in_pages_readable() */
 
-		/* First check for malicious input causing overflow */
-		if (exec[i].relocation_count >
-		    INT_MAX / sizeof(struct drm_i915_gem_relocation_entry))
+		/* First check for malicious input causing overflow in
+		 * the worst case where we need to allocate the entire
+		 * relocation tree as a single array.
+		 */
+		if (exec[i].relocation_count > relocs_max - relocs_total)
 			return -EINVAL;
+		relocs_total += exec[i].relocation_count;
 
 		length = exec[i].relocation_count *
 			sizeof(struct drm_i915_gem_relocation_entry);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 043/171 ] KMS: fix EDID detailed timing vsync parsing
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (41 preceding siblings ...)
  2013-04-11 20:25 ` [ 042/171 ] drm/i915: bounds check execbuffer relocation count Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 044/171 ] KMS: fix EDID detailed timing frame rate Steven Rostedt
                   ` (127 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Torsten Duwe

[-- Attachment #1: 0043-KMS-fix-EDID-detailed-timing-vsync-parsing.patch --]
[-- Type: text/plain, Size: 1788 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Torsten Duwe <torsten@lst.de>

[ Upstream commit 16dad1d743d31a104a849c8944e6b9eb479f6cd7 ]

EDID spreads some values across multiple bytes; bit-fiddling is needed
to retrieve these.  The current code to parse "detailed timings" has a
cut&paste error that results in a vsync offset of at most 15 lines
instead of 63.

See

   http://en.wikipedia.org/wiki/EDID

and in the "EDID Detailed Timing Descriptor" see bytes 10+11 show why
that needs to be a left shift.

Cc: stable@vger.kernel.org
Signed-off-by: Torsten Duwe <duwe@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/drm_edid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b7ee230..fafd5a1 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -879,7 +879,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
 	unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo;
 	unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo;
 	unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse_width_lo;
-	unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) >> 2 | pt->vsync_offset_pulse_width_lo >> 4;
+	unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 2 | pt->vsync_offset_pulse_width_lo >> 4;
 	unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offset_pulse_width_lo & 0xf);
 
 	/* ignore tiny modes */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 044/171 ] KMS: fix EDID detailed timing frame rate
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (42 preceding siblings ...)
  2013-04-11 20:25 ` [ 043/171 ] KMS: fix EDID detailed timing vsync parsing Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 045/171 ] mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting Steven Rostedt
                   ` (126 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Torsten Duwe

[-- Attachment #1: 0044-KMS-fix-EDID-detailed-timing-frame-rate.patch --]
[-- Type: text/plain, Size: 1213 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Torsten Duwe <torsten@lst.de>

[ Upstream commit c19b3b0f6eed552952845e4ad908dba2113d67b4 ]

When KMS has parsed an EDID "detailed timing", it leaves the frame rate
zeroed.  Consecutive (debug-) output of that mode thus yields 0 for
vsync.  This simple fix also speeds up future invocations of
drm_mode_vrefresh().

While it is debatable whether this qualifies as a -stable fix I'd apply
it for consistency's sake; drm_helper_probe_single_connector_modes()
does the same thing already for all probed modes.

Cc: stable@vger.kernel.org
Signed-off-by: Torsten Duwe <duwe@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/drm_edid.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index fafd5a1..24763fa 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -960,6 +960,7 @@ set_size:
 	}
 
 	mode->type = DRM_MODE_TYPE_DRIVER;
+	mode->vrefresh = drm_mode_vrefresh(mode);
 	drm_mode_set_name(mode);
 
 	return mode;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 045/171 ] mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (43 preceding siblings ...)
  2013-04-11 20:25 ` [ 044/171 ] KMS: fix EDID detailed timing frame rate Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 046/171 ] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only Steven Rostedt
                   ` (125 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Wanpeng Li, Michal Hocko, Aneesh Kumar K.V, Hillf Danton,
	KAMEZAWA Hiroyuki, Andrew Morton

[-- Attachment #1: 0045-mm-hugetlb-fix-total-hugetlbfs-pages-count-when-usin.patch --]
[-- Type: text/plain, Size: 2351 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Wanpeng Li <liwanp@linux.vnet.ibm.com>

[ Upstream commit d00285884c0892bb1310df96bce6056e9ce9b9d9 ]

hugetlb_total_pages is used for overcommit calculations but the current
implementation considers only the default hugetlb page size (which is
either the first defined hugepage size or the one specified by
default_hugepagesz kernel boot parameter).

If the system is configured for more than one hugepage size, which is
possible since commit a137e1cc6d6e ("hugetlbfs: per mount huge page
sizes") then the overcommit estimation done by __vm_enough_memory()
(resp.  shown by meminfo_proc_show) is not precise - there is an
impression of more available/allowed memory.  This can lead to an
unexpected ENOMEM/EFAULT resp.  SIGSEGV when memory is accounted.

Testcase:
  boot: hugepagesz=1G hugepages=1
  the default overcommit ratio is 50
  before patch:

    egrep 'CommitLimit' /proc/meminfo
    CommitLimit:     55434168 kB

  after patch:

    egrep 'CommitLimit' /proc/meminfo
    CommitLimit:     54909880 kB

[akpm@linux-foundation.org: coding-style tweak]
Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: <stable@vger.kernel.org>		[3.0+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/hugetlb.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 3adceaf..651d1ab 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2131,8 +2131,12 @@ int hugetlb_report_node_meminfo(int nid, char *buf)
 /* Return the number pages of memory we physically have, in PAGE_SIZE units. */
 unsigned long hugetlb_total_pages(void)
 {
-	struct hstate *h = &default_hstate;
-	return h->nr_huge_pages * pages_per_huge_page(h);
+	struct hstate *h;
+	unsigned long nr_total_pages = 0;
+
+	for_each_hstate(h)
+		nr_total_pages += h->nr_huge_pages * pages_per_huge_page(h);
+	return nr_total_pages;
 }
 
 static int hugetlb_acct_memory(struct hstate *h, long delta)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 046/171 ] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (44 preceding siblings ...)
  2013-04-11 20:25 ` [ 045/171 ] mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 047/171 ] target/iscsi: Fix mutual CHAP auth on big-endian arches Steven Rostedt
                   ` (124 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Vladimir Davydov, Doug Ledford, KOSAKI Motohiro,
	Eric W. Biederman, Al Viro, Andrew Morton

[-- Attachment #1: 0046-mqueue-sys_mq_open-do-not-call-mnt_drop_write-if-rea.patch --]
[-- Type: text/plain, Size: 1671 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Vladimir Davydov <vdavydov@parallels.com>

[ Upstream commit 38d78e587d4960d0db94add518d27ee74bad2301 ]

mnt_drop_write() must be called only if mnt_want_write() succeeded,
otherwise the mnt_writers counter will diverge.

mnt_writers counters are used to check if remounting FS as read-only is
OK, so after an extra mnt_drop_write() call, it would be impossible to
remount mqueue FS as read-only.  Besides, on umount a warning would be
printed like this one:

  =====================================
  [ BUG: bad unlock balance detected! ]
  3.9.0-rc3 #5 Not tainted
  -------------------------------------
  a.out/12486 is trying to release lock (sb_writers) at:
  mnt_drop_write+0x1f/0x30
  but there are no more locks to release!

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 ipc/mqueue.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9a08acc..9e4cf7f 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -841,7 +841,8 @@ out_putfd:
 		fd = error;
 	}
 	mutex_unlock(&root->d_inode->i_mutex);
-	mnt_drop_write(mnt);
+	if (!ro)
+		mnt_drop_write(mnt);
 out_putname:
 	putname(name);
 	return fd;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 047/171 ] target/iscsi: Fix mutual CHAP auth on big-endian arches
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (45 preceding siblings ...)
  2013-04-11 20:25 ` [ 046/171 ] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 048/171 ] target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os Steven Rostedt
                   ` (123 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Andy Grover, Nicholas Bellinger

[-- Attachment #1: 0047-target-iscsi-Fix-mutual-CHAP-auth-on-big-endian-arch.patch --]
[-- Type: text/plain, Size: 1433 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Andy Grover <agrover@redhat.com>

[ Upstream commit 7ac9ad11b2a5cf77a92b58ee6b672ad2fa155eb1 ]

See https://bugzilla.redhat.com/show_bug.cgi?id=916290

Used a temp var since we take its address in sg_init_one.

Signed-off-by: Andy Grover <agrover@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/target/iscsi/iscsi_target_auth.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c
index db0cf7c..a0fc7b9 100644
--- a/drivers/target/iscsi/iscsi_target_auth.c
+++ b/drivers/target/iscsi/iscsi_target_auth.c
@@ -166,6 +166,7 @@ static int chap_server_compute_md5(
 {
 	char *endptr;
 	unsigned long id;
+	unsigned char id_as_uchar;
 	unsigned char digest[MD5_SIGNATURE_SIZE];
 	unsigned char type, response[MD5_SIGNATURE_SIZE * 2 + 2];
 	unsigned char identifier[10], *challenge = NULL;
@@ -355,7 +356,9 @@ static int chap_server_compute_md5(
 		goto out;
 	}
 
-	sg_init_one(&sg, &id, 1);
+	/* To handle both endiannesses */
+	id_as_uchar = id;
+	sg_init_one(&sg, &id_as_uchar, 1);
 	ret = crypto_hash_update(&desc, &sg, 1);
 	if (ret < 0) {
 		pr_err("crypto_hash_update() failed for id\n");
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 048/171 ] target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (46 preceding siblings ...)
  2013-04-11 20:25 ` [ 047/171 ] target/iscsi: Fix mutual CHAP auth on big-endian arches Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 049/171 ] dm verity: avoid deadlock Steven Rostedt
                   ` (122 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Viljami Ilola, Nicholas Bellinger

[-- Attachment #1: 0048-target-file-Bump-FD_MAX_SECTORS-to-2048-to-handle-1M.patch --]
[-- Type: text/plain, Size: 1426 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Nicholas Bellinger <nab@linux-iscsi.org>

[ Upstream commit f002a24388cc460c8a9be7d446a9871f7c9d52b6 ]

This patch bumps the default FILEIO backend FD_MAX_SECTORS value from
1024 -> 2048 in order to allow block_size=512 to handle 1M sized I/Os.

The current default rejects I/Os larger than 512K in sbc_parse_cdb():

[12015.915146] SCSI OP 2ah with too big sectors 1347 exceeds backend
hw_max_sectors: 1024
[12015.977744] SCSI OP 2ah with too big sectors 2048 exceeds backend
hw_max_sectors: 1024

This issue is present in >= v3.5 based kernels, introduced after the
removal of se_task logic.

Reported-by: Viljami Ilola <azmulx@netikka.fi>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/target/target_core_file.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_file.h b/drivers/target/target_core_file.h
index 876ae53..291f66e 100644
--- a/drivers/target/target_core_file.h
+++ b/drivers/target/target_core_file.h
@@ -7,7 +7,7 @@
 #define FD_DEVICE_QUEUE_DEPTH	32
 #define FD_MAX_DEVICE_QUEUE_DEPTH 128
 #define FD_BLOCKSIZE		512
-#define FD_MAX_SECTORS		1024
+#define FD_MAX_SECTORS		2048
 
 #define RRF_EMULATE_CDB		0x01
 #define RRF_GOT_LBA		0x02
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 049/171 ] dm verity: avoid deadlock
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (47 preceding siblings ...)
  2013-04-11 20:25 ` [ 048/171 ] target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 050/171 ] drm/mgag200: Bug fix: Modified pll algorithm for EH project Steven Rostedt
                   ` (121 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Paul Taysom, Mikulas Patocka, Alasdair G Kergon, stable

[-- Attachment #1: 0049-dm-verity-avoid-deadlock.patch --]
[-- Type: text/plain, Size: 4206 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mikulas Patocka <mpatocka@redhat.com>

[ Upstream commit 3b6b7813b198b578aa7e04e4047ddb8225c37b7f ]

A deadlock was found in the prefetch code in the dm verity map
function.  This patch fixes this by transferring the prefetch
to a worker thread and skipping it completely if kmalloc fails.

If generic_make_request is called recursively, it queues the I/O
request on the current->bio_list without making the I/O request
and returns. The routine making the recursive call cannot wait
for the I/O to complete.

The deadlock occurs when one thread grabs the bufio_client
mutex and waits for an I/O to complete but the I/O is queued
on another thread's current->bio_list and is waiting to get
the mutex held by the first thread.

The fix recognises that prefetching is not essential.  If memory
can be allocated, it queues the prefetch request to the worker thread,
but if not, it does nothing.

Signed-off-by: Paul Taysom <taysom@chromium.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/md/dm-bufio.c  |    2 ++
 drivers/md/dm-verity.c |   39 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index cc06a1e..c0fc827 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1029,6 +1029,8 @@ void dm_bufio_prefetch(struct dm_bufio_client *c,
 {
 	struct blk_plug plug;
 
+	BUG_ON(dm_bufio_in_request());
+
 	blk_start_plug(&plug);
 	dm_bufio_lock(c);
 
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c
index 892ae27..dd5ba3b 100644
--- a/drivers/md/dm-verity.c
+++ b/drivers/md/dm-verity.c
@@ -95,6 +95,13 @@ struct dm_verity_io {
 	 */
 };
 
+struct dm_verity_prefetch_work {
+	struct work_struct work;
+	struct dm_verity *v;
+	sector_t block;
+	unsigned n_blocks;
+};
+
 static struct shash_desc *io_hash_desc(struct dm_verity *v, struct dm_verity_io *io)
 {
 	return (struct shash_desc *)(io + 1);
@@ -428,15 +435,18 @@ static void verity_end_io(struct bio *bio, int error)
  * The root buffer is not prefetched, it is assumed that it will be cached
  * all the time.
  */
-static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
+static void verity_prefetch_io(struct work_struct *work)
 {
+	struct dm_verity_prefetch_work *pw =
+		container_of(work, struct dm_verity_prefetch_work, work);
+	struct dm_verity *v = pw->v;
 	int i;
 
 	for (i = v->levels - 2; i >= 0; i--) {
 		sector_t hash_block_start;
 		sector_t hash_block_end;
-		verity_hash_at_level(v, io->block, i, &hash_block_start, NULL);
-		verity_hash_at_level(v, io->block + io->n_blocks - 1, i, &hash_block_end, NULL);
+		verity_hash_at_level(v, pw->block, i, &hash_block_start, NULL);
+		verity_hash_at_level(v, pw->block + pw->n_blocks - 1, i, &hash_block_end, NULL);
 		if (!i) {
 			unsigned cluster = *(volatile unsigned *)&dm_verity_prefetch_cluster;
 
@@ -456,6 +466,25 @@ no_prefetch_cluster:
 		dm_bufio_prefetch(v->bufio, hash_block_start,
 				  hash_block_end - hash_block_start + 1);
 	}
+
+	kfree(pw);
+}
+
+static void verity_submit_prefetch(struct dm_verity *v, struct dm_verity_io *io)
+{
+	struct dm_verity_prefetch_work *pw;
+
+	pw = kmalloc(sizeof(struct dm_verity_prefetch_work),
+		GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
+
+	if (!pw)
+		return;
+
+	INIT_WORK(&pw->work, verity_prefetch_io);
+	pw->v = v;
+	pw->block = io->block;
+	pw->n_blocks = io->n_blocks;
+	queue_work(v->verify_wq, &pw->work);
 }
 
 /*
@@ -504,7 +533,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio,
 	memcpy(io->io_vec, bio_iovec(bio),
 	       io->io_vec_size * sizeof(struct bio_vec));
 
-	verity_prefetch_io(v, io);
+	verity_submit_prefetch(v, io);
 
 	generic_make_request(bio);
 
@@ -875,7 +904,7 @@ bad:
 
 static struct target_type verity_target = {
 	.name		= "verity",
-	.version	= {1, 0, 0},
+	.version	= {1, 2, 0},
 	.module		= THIS_MODULE,
 	.ctr		= verity_ctr,
 	.dtr		= verity_dtr,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 050/171 ] drm/mgag200: Bug fix: Modified pll algorithm for EH project
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (48 preceding siblings ...)
  2013-04-11 20:25 ` [ 049/171 ] dm verity: avoid deadlock Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 051/171 ] drm/radeon: add Richland pci ids Steven Rostedt
                   ` (120 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Julia Lemire, Dave Airlie

[-- Attachment #1: 0050-drm-mgag200-Bug-fix-Modified-pll-algorithm-for-EH-pr.patch --]
[-- Type: text/plain, Size: 2394 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Julia Lemire <jlemire@matrox.com>

[ Upstream commit 260b3f1291a75a580d22ce8bfb1499c617272716 ]

While testing the mgag200 kms driver on the HP ProLiant Gen8, a
bug was seen.  Once the bootloader would load the selected kernel,
the screen would go black.  At first it was assumed that the
mgag200 kms driver was hanging.  But after setting up the grub
serial output, it was seen that the driver was being loaded
properly.  After trying serval monitors, one finaly displayed
the message "Frequency Out of Range".  By comparing the kms pll
algorithm with the previous mgag200 xorg driver pll algorithm,
discrepencies were found.  Once the kms pll algorithm was
modified, the expected pll values were produced.  This fix was
tested on several monitors of varying native resolutions.

Signed-off-by: Julia Lemire <jlemire@matrox.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index b69642d..0a5daaa 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -383,19 +383,19 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)
 	m = n = p = 0;
 	vcomax = 800000;
 	vcomin = 400000;
-	pllreffreq = 3333;
+	pllreffreq = 33333;
 
 	delta = 0xffffffff;
 	permitteddelta = clock * 5 / 1000;
 
-	for (testp = 16; testp > 0; testp--) {
+	for (testp = 16; testp > 0; testp >>= 1) {
 		if (clock * testp > vcomax)
 			continue;
 		if (clock * testp < vcomin)
 			continue;
 
 		for (testm = 1; testm < 33; testm++) {
-			for (testn = 1; testn < 257; testn++) {
+			for (testn = 17; testn < 257; testn++) {
 				computed = (pllreffreq * testn) /
 					(testm * testp);
 				if (computed > clock)
@@ -405,11 +405,11 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)
 				if (tmpdelta < delta) {
 					delta = tmpdelta;
 					n = testn - 1;
-					m = (testm - 1) | ((n >> 1) & 0x80);
+					m = (testm - 1);
 					p = testp - 1;
 				}
 				if ((clock * testp) >= 600000)
-					p |= 80;
+					p |= 0x80;
 			}
 		}
 	}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 051/171 ] drm/radeon: add Richland pci ids
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (49 preceding siblings ...)
  2013-04-11 20:25 ` [ 050/171 ] drm/mgag200: Bug fix: Modified pll algorithm for EH project Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 052/171 ] drm/radeon: add support for Richland APUs Steven Rostedt
                   ` (119 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jerome Glisse, Alex Deucher

[-- Attachment #1: 0051-drm-radeon-add-Richland-pci-ids.patch --]
[-- Type: text/plain, Size: 3432 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit b75bbaa038ffc426e88ea3df6c4ae11834fc3e4f ]

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/drm/drm_pciids.h |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index c5c35e6..1cdbfe9 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -568,7 +568,11 @@
 	{0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-	{0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x990B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x990C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x990D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x990E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
@@ -579,6 +583,13 @@
 	{0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9996, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9998, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x9999, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x999A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x999B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 052/171 ] drm/radeon: add support for Richland APUs
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (50 preceding siblings ...)
  2013-04-11 20:25 ` [ 051/171 ] drm/radeon: add Richland pci ids Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 053/171 ] drm/radeon/benchmark: make sure bo blit copy exists before using it Steven Rostedt
                   ` (118 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jerome Glisse, Alex Deucher

[-- Attachment #1: 0052-drm-radeon-add-support-for-Richland-APUs.patch --]
[-- Type: text/plain, Size: 2166 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit e4d170633fde379f39a90f8a5e7eb619b5d1144d ]

Richland APUs are a new version of the Trinity APUs
with performance and power management improvements.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/radeon/ni.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 853800e..eecf30f 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -466,13 +466,19 @@ static void cayman_gpu_init(struct radeon_device *rdev)
 		    (rdev->pdev->device == 0x9907) ||
 		    (rdev->pdev->device == 0x9908) ||
 		    (rdev->pdev->device == 0x9909) ||
+		    (rdev->pdev->device == 0x990B) ||
+		    (rdev->pdev->device == 0x990C) ||
+		    (rdev->pdev->device == 0x990F) ||
 		    (rdev->pdev->device == 0x9910) ||
-		    (rdev->pdev->device == 0x9917)) {
+		    (rdev->pdev->device == 0x9917) ||
+		    (rdev->pdev->device == 0x9999)) {
 			rdev->config.cayman.max_simds_per_se = 6;
 			rdev->config.cayman.max_backends_per_se = 2;
 		} else if ((rdev->pdev->device == 0x9903) ||
 			   (rdev->pdev->device == 0x9904) ||
 			   (rdev->pdev->device == 0x990A) ||
+			   (rdev->pdev->device == 0x990D) ||
+			   (rdev->pdev->device == 0x990E) ||
 			   (rdev->pdev->device == 0x9913) ||
 			   (rdev->pdev->device == 0x9918)) {
 			rdev->config.cayman.max_simds_per_se = 4;
@@ -481,6 +487,9 @@ static void cayman_gpu_init(struct radeon_device *rdev)
 			   (rdev->pdev->device == 0x9990) ||
 			   (rdev->pdev->device == 0x9991) ||
 			   (rdev->pdev->device == 0x9994) ||
+			   (rdev->pdev->device == 0x9995) ||
+			   (rdev->pdev->device == 0x9996) ||
+			   (rdev->pdev->device == 0x999A) ||
 			   (rdev->pdev->device == 0x99A0)) {
 			rdev->config.cayman.max_simds_per_se = 3;
 			rdev->config.cayman.max_backends_per_se = 1;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 053/171 ] drm/radeon/benchmark: make sure bo blit copy exists before using it
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (51 preceding siblings ...)
  2013-04-11 20:25 ` [ 052/171 ] drm/radeon: add support for Richland APUs Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 054/171 ] cifs: ignore everything in SPNEGO blob after mechTypes Steven Rostedt
                   ` (117 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Michel Dänzer, Alex Deucher

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0053-drm-radeon-benchmark-make-sure-bo-blit-copy-exists-b.patch --]
[-- Type: text/plain, Size: 1558 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit fa8d387dc3f62062a6b4afbbb2a3438094fd8584 ]

Fixes a segfault on asics without a blit callback.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=62239

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/radeon/radeon_benchmark.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c
index bedda9c..a2f0c24 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -135,13 +135,15 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
 						     sdomain, ddomain, "dma");
 	}
 
-	time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
-					RADEON_BENCHMARK_COPY_BLIT, n);
-	if (time < 0)
-		goto out_cleanup;
-	if (time > 0)
-		radeon_benchmark_log_results(n, size, time,
-					     sdomain, ddomain, "blit");
+	if (rdev->asic->copy.blit) {
+		time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
+						RADEON_BENCHMARK_COPY_BLIT, n);
+		if (time < 0)
+			goto out_cleanup;
+		if (time > 0)
+			radeon_benchmark_log_results(n, size, time,
+						     sdomain, ddomain, "blit");
+	}
 
 out_cleanup:
 	if (sobj) {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 054/171 ] cifs: ignore everything in SPNEGO blob after mechTypes
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (52 preceding siblings ...)
  2013-04-11 20:25 ` [ 053/171 ] drm/radeon/benchmark: make sure bo blit copy exists before using it Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 055/171 ] jbd2: fix use after free in jbd2_journal_dirty_metadata() Steven Rostedt
                   ` (116 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jason Burgess, Yan Li, Jeff Layton, Steve French

[-- Attachment #1: 0054-cifs-ignore-everything-in-SPNEGO-blob-after-mechType.patch --]
[-- Type: text/plain, Size: 3587 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jeff Layton <jlayton@redhat.com>

[ Upstream commit f853c616883a8de966873a1dab283f1369e275a1 ]

We've had several reports of people attempting to mount Windows 8 shares
and getting failures with a return code of -EINVAL. The default sec=
mode changed recently to sec=ntlmssp. With that, we expect and parse a
SPNEGO blob from the server in the NEGOTIATE reply.

The current decode_negTokenInit function first parses all of the
mechTypes and then tries to parse the rest of the negTokenInit reply.
The parser however currently expects a mechListMIC or nothing to follow the
mechTypes, but Windows 8 puts a mechToken field there instead to carry
some info for the new NegoEx stuff.

In practice, we don't do anything with the fields after the mechTypes
anyway so I don't see any real benefit in continuing to parse them.
This patch just has the kernel ignore the fields after the mechTypes.
We'll probably need to reinstate some of this if we ever want to support
NegoEx.

Reported-by: Jason Burgess <jason@jacknife2.dns2go.com>
Reported-by: Yan Li <elliot.li.tech@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/cifs/asn1.c |   53 +++++------------------------------------------------
 1 file changed, 5 insertions(+), 48 deletions(-)

diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index cfd1ce3..1d36db1 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -614,53 +614,10 @@ decode_negTokenInit(unsigned char *security_blob, int length,
 		}
 	}
 
-	/* mechlistMIC */
-	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
-		/* Check if we have reached the end of the blob, but with
-		   no mechListMic (e.g. NTLMSSP instead of KRB5) */
-		if (ctx.error == ASN1_ERR_DEC_EMPTY)
-			goto decode_negtoken_exit;
-		cFYI(1, "Error decoding last part negTokenInit exit3");
-		return 0;
-	} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
-		/* tag = 3 indicating mechListMIC */
-		cFYI(1, "Exit 4 cls = %d con = %d tag = %d end = %p (%d)",
-			cls, con, tag, end, *end);
-		return 0;
-	}
-
-	/* sequence */
-	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
-		cFYI(1, "Error decoding last part negTokenInit exit5");
-		return 0;
-	} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
-		   || (tag != ASN1_SEQ)) {
-		cFYI(1, "cls = %d con = %d tag = %d end = %p (%d)",
-			cls, con, tag, end, *end);
-	}
-
-	/* sequence of */
-	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
-		cFYI(1, "Error decoding last part negTokenInit exit 7");
-		return 0;
-	} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
-		cFYI(1, "Exit 8 cls = %d con = %d tag = %d end = %p (%d)",
-			cls, con, tag, end, *end);
-		return 0;
-	}
-
-	/* general string */
-	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
-		cFYI(1, "Error decoding last part negTokenInit exit9");
-		return 0;
-	} else if ((cls != ASN1_UNI) || (con != ASN1_PRI)
-		   || (tag != ASN1_GENSTR)) {
-		cFYI(1, "Exit10 cls = %d con = %d tag = %d end = %p (%d)",
-			cls, con, tag, end, *end);
-		return 0;
-	}
-	cFYI(1, "Need to call asn1_octets_decode() function for %s",
-		ctx.pointer);	/* is this UTF-8 or ASCII? */
-decode_negtoken_exit:
+	/*
+	 * We currently ignore anything at the end of the SPNEGO blob after
+	 * the mechTypes have been parsed, since none of that info is
+	 * used at the moment.
+	 */
 	return 1;
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 055/171 ] jbd2: fix use after free in jbd2_journal_dirty_metadata()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (53 preceding siblings ...)
  2013-04-11 20:25 ` [ 054/171 ] cifs: ignore everything in SPNEGO blob after mechTypes Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:25 ` [ 056/171 ] ext4: fix the wrong number of the allocated blocks in ext4_split_extent() Steven Rostedt
                   ` (115 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Zheng Liu, Jan Kara, Theodore Tso

[-- Attachment #1: 0055-jbd2-fix-use-after-free-in-jbd2_journal_dirty_metada.patch --]
[-- Type: text/plain, Size: 2604 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jan Kara <jack@suse.cz>

[ Upstream commit ad56edad089b56300fd13bb9eeb7d0424d978239 ]

jbd2_journal_dirty_metadata() didn't get a reference to journal_head it
was working with. This is OK in most of the cases since the journal head
should be attached to a transaction but in rare occasions when we are
journalling data, __ext4_journalled_writepage() can race with
jbd2_journal_invalidatepage() stripping buffers from a page and thus
journal head can be freed under hands of jbd2_journal_dirty_metadata().

Fix the problem by getting own journal head reference in
jbd2_journal_dirty_metadata() (and also in jbd2_journal_set_triggers()
which can possibly have the same issue).

Reported-by: Zheng Liu <gnehzuil.liu@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/jbd2/transaction.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index fb1ab953..9427cf1 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1046,9 +1046,12 @@ out:
 void jbd2_journal_set_triggers(struct buffer_head *bh,
 			       struct jbd2_buffer_trigger_type *type)
 {
-	struct journal_head *jh = bh2jh(bh);
+	struct journal_head *jh = jbd2_journal_grab_journal_head(bh);
 
+	if (WARN_ON(!jh))
+		return;
 	jh->b_triggers = type;
+	jbd2_journal_put_journal_head(jh);
 }
 
 void jbd2_buffer_frozen_trigger(struct journal_head *jh, void *mapped_data,
@@ -1100,17 +1103,18 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 {
 	transaction_t *transaction = handle->h_transaction;
 	journal_t *journal = transaction->t_journal;
-	struct journal_head *jh = bh2jh(bh);
+	struct journal_head *jh;
 	int ret = 0;
 
-	jbd_debug(5, "journal_head %p\n", jh);
-	JBUFFER_TRACE(jh, "entry");
 	if (is_handle_aborted(handle))
 		goto out;
-	if (!buffer_jbd(bh)) {
+	jh = jbd2_journal_grab_journal_head(bh);
+	if (!jh) {
 		ret = -EUCLEAN;
 		goto out;
 	}
+	jbd_debug(5, "journal_head %p\n", jh);
+	JBUFFER_TRACE(jh, "entry");
 
 	jbd_lock_bh_state(bh);
 
@@ -1201,6 +1205,7 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	spin_unlock(&journal->j_list_lock);
 out_unlock_bh:
 	jbd_unlock_bh_state(bh);
+	jbd2_journal_put_journal_head(jh);
 out:
 	JBUFFER_TRACE(jh, "exit");
 	WARN_ON(ret);	/* All errors are bugs, so dump the stack */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 056/171 ] ext4: fix the wrong number of the allocated blocks in ext4_split_extent()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (54 preceding siblings ...)
  2013-04-11 20:25 ` [ 055/171 ] jbd2: fix use after free in jbd2_journal_dirty_metadata() Steven Rostedt
@ 2013-04-11 20:25 ` Steven Rostedt
  2013-04-11 20:26 ` [ 057/171 ] usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player Steven Rostedt
                   ` (114 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Zheng Liu, Theodore Tso, Dmitry Monakhov

[-- Attachment #1: 0056-ext4-fix-the-wrong-number-of-the-allocated-blocks-in.patch --]
[-- Type: text/plain, Size: 2195 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Zheng Liu <wenqing.lz@taobao.com>

[ Upstream commit 3a2256702e47f68f921dfad41b1764d05c572329 ]

This commit fixes a wrong return value of the number of the allocated
blocks in ext4_split_extent.  When the length of blocks we want to
allocate is greater than the length of the current extent, we return a
wrong number.  Let's see what happens in the following case when we
call ext4_split_extent().

  map: [48, 72]
  ex:  [32, 64, u]

'ex' will be split into two parts:
  ex1: [32, 47, u]
  ex2: [48, 64, w]

'map->m_len' is returned from this function, and the value is 24.  But
the real length is 16.  So it should be fixed.

Meanwhile in this commit we use right length of the allocated blocks
when get_reserved_cluster_alloc in ext4_ext_handle_uninitialized_extents
is called.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/ext4/extents.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 741bb94..4f7d479 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3011,6 +3011,7 @@ static int ext4_split_extent(handle_t *handle,
 	int err = 0;
 	int uninitialized;
 	int split_flag1, flags1;
+	int allocated = map->m_len;
 
 	depth = ext_depth(inode);
 	ex = path[depth].p_ext;
@@ -3030,6 +3031,8 @@ static int ext4_split_extent(handle_t *handle,
 				map->m_lblk + map->m_len, split_flag1, flags1);
 		if (err)
 			goto out;
+	} else {
+		allocated = ee_len - (map->m_lblk - ee_block);
 	}
 
 	ext4_ext_drop_refs(path);
@@ -3052,7 +3055,7 @@ static int ext4_split_extent(handle_t *handle,
 
 	ext4_ext_show_leaf(inode, path);
 out:
-	return err ? err : map->m_len;
+	return err ? err : allocated;
 }
 
 #define EXT4_EXT_ZERO_LEN 7
@@ -3720,6 +3723,7 @@ out:
 					allocated - map->m_len);
 		allocated = map->m_len;
 	}
+	map->m_len = allocated;
 
 	/*
 	 * If we have done fallocate with the offset that is already
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 057/171 ] usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (55 preceding siblings ...)
  2013-04-11 20:25 ` [ 056/171 ] ext4: fix the wrong number of the allocated blocks in ext4_split_extent() Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 058/171 ] ext4: use atomic64_t for the per-flexbg free_clusters count Steven Rostedt
                   ` (113 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Dmitry Artamonow, Greg Kroah-Hartman

[-- Attachment #1: 0057-usb-storage-add-unusual_devs-entry-for-Samsung-YP-Z3.patch --]
[-- Type: text/plain, Size: 1467 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Dmitry Artamonow <mad_soft@inbox.ru>

[ Upstream commit 29f86e66428ee083aec106cca1748dc63d98ce23 ]

Device stucks on filesystem writes, unless following quirk is passed:
  echo 04e8:5136:m > /sys/module/usb_storage/parameters/quirks

Add corresponding entry to unusual_devs.h

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/storage/unusual_devs.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 8f98c9a..3561322 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -488,6 +488,13 @@ UNUSUAL_DEV(  0x04e8, 0x5122, 0x0000, 0x9999,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_MAX_SECTORS_64 | US_FL_BULK_IGNORE_TAG),
 
+/* Added by Dmitry Artamonow <mad_soft@inbox.ru> */
+UNUSUAL_DEV(  0x04e8, 0x5136, 0x0000, 0x9999,
+		"Samsung",
+		"YP-Z3",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_MAX_SECTORS_64),
+
 /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>.
  * Device uses standards-violating 32-byte Bulk Command Block Wrappers and
  * reports itself as "Proprietary SCSI Bulk." Cf. device entry 0x084d:0x0011.
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 058/171 ] ext4: use atomic64_t for the per-flexbg free_clusters count
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (56 preceding siblings ...)
  2013-04-11 20:26 ` [ 057/171 ] usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 059/171 ] ext4: fix data=journal fast mount/umount hang Steven Rostedt
                   ` (112 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Theodore Tso, Lukas Czerner

[-- Attachment #1: 0058-ext4-use-atomic64_t-for-the-per-flexbg-free_clusters.patch --]
[-- Type: text/plain, Size: 4102 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Theodore Ts'o <tytso@mit.edu>

[ Upstream commit 90ba983f6889e65a3b506b30dc606aa9d1d46cd2 ]

A user who was using a 8TB+ file system and with a very large flexbg
size (> 65536) could cause the atomic_t used in the struct flex_groups
to overflow.  This was detected by PaX security patchset:

http://forums.grsecurity.net/viewtopic.php?f=3&t=3289&p=12551#p12551

This bug was introduced in commit 9f24e4208f7e, so it's been around
since 2.6.30.  :-(

Fix this by using an atomic64_t for struct orlav_stats's
free_clusters.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/ext4/ext4.h    |    6 +++---
 fs/ext4/ialloc.c  |    4 ++--
 fs/ext4/mballoc.c |   12 ++++++------
 fs/ext4/super.c   |    4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b686b43..1b3df8f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -329,9 +329,9 @@ struct ext4_group_desc
  */
 
 struct flex_groups {
-	atomic_t free_inodes;
-	atomic_t free_clusters;
-	atomic_t used_dirs;
+	atomic64_t	free_clusters;
+	atomic_t	free_inodes;
+	atomic_t	used_dirs;
 };
 
 #define EXT4_BG_INODE_UNINIT	0x0001 /* Inode table/bitmap not in use */
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index cc2d77c..c690ff9 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -324,8 +324,8 @@ error_return:
 }
 
 struct orlov_stats {
+	__u64 free_clusters;
 	__u32 free_inodes;
-	__u32 free_clusters;
 	__u32 used_dirs;
 };
 
@@ -342,7 +342,7 @@ static void get_orlov_stats(struct super_block *sb, ext4_group_t g,
 
 	if (flex_size > 1) {
 		stats->free_inodes = atomic_read(&flex_group[g].free_inodes);
-		stats->free_clusters = atomic_read(&flex_group[g].free_clusters);
+		stats->free_clusters = atomic64_read(&flex_group[g].free_clusters);
 		stats->used_dirs = atomic_read(&flex_group[g].used_dirs);
 		return;
 	}
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b26410c..87b5519 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2820,8 +2820,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
 	if (sbi->s_log_groups_per_flex) {
 		ext4_group_t flex_group = ext4_flex_group(sbi,
 							  ac->ac_b_ex.fe_group);
-		atomic_sub(ac->ac_b_ex.fe_len,
-			   &sbi->s_flex_groups[flex_group].free_clusters);
+		atomic64_sub(ac->ac_b_ex.fe_len,
+			     &sbi->s_flex_groups[flex_group].free_clusters);
 	}
 
 	err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
@@ -4670,8 +4670,8 @@ do_more:
 
 	if (sbi->s_log_groups_per_flex) {
 		ext4_group_t flex_group = ext4_flex_group(sbi, block_group);
-		atomic_add(count_clusters,
-			   &sbi->s_flex_groups[flex_group].free_clusters);
+		atomic64_add(count_clusters,
+			     &sbi->s_flex_groups[flex_group].free_clusters);
 	}
 
 	ext4_mb_unload_buddy(&e4b);
@@ -4815,8 +4815,8 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,
 
 	if (sbi->s_log_groups_per_flex) {
 		ext4_group_t flex_group = ext4_flex_group(sbi, block_group);
-		atomic_add(EXT4_B2C(sbi, blocks_freed),
-			   &sbi->s_flex_groups[flex_group].free_clusters);
+		atomic64_add(EXT4_B2C(sbi, blocks_freed),
+			     &sbi->s_flex_groups[flex_group].free_clusters);
 	}
 
 	ext4_mb_unload_buddy(&e4b);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2b5fb60..f581886 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1945,8 +1945,8 @@ static int ext4_fill_flex_info(struct super_block *sb)
 		flex_group = ext4_flex_group(sbi, i);
 		atomic_add(ext4_free_inodes_count(sb, gdp),
 			   &sbi->s_flex_groups[flex_group].free_inodes);
-		atomic_add(ext4_free_group_clusters(sb, gdp),
-			   &sbi->s_flex_groups[flex_group].free_clusters);
+		atomic64_add(ext4_free_group_clusters(sb, gdp),
+			     &sbi->s_flex_groups[flex_group].free_clusters);
 		atomic_add(ext4_used_dirs_count(sb, gdp),
 			   &sbi->s_flex_groups[flex_group].used_dirs);
 	}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 059/171 ] ext4: fix data=journal fast mount/umount hang
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (57 preceding siblings ...)
  2013-04-11 20:26 ` [ 058/171 ] ext4: use atomic64_t for the per-flexbg free_clusters count Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 060/171 ] IPoIB: Fix send lockup due to missed TX completion Steven Rostedt
                   ` (111 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Theodore Tso, Jan Kara

[-- Attachment #1: 0059-ext4-fix-data-journal-fast-mount-umount-hang.patch --]
[-- Type: text/plain, Size: 2965 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Theodore Ts'o <tytso@mit.edu>

[ Upstream commit 2b405bfa84063bfa35621d2d6879f52693c614b0 ]

In data=journal mode, if we unmount the file system before a
transaction has a chance to complete, when the journal inode is being
evicted, we can end up calling into jbd2_log_wait_commit() for the
last transaction, after the journalling machinery has been shut down.

Arguably we should adjust ext4_should_journal_data() to return FALSE
for the journal inode, but the only place it matters is
ext4_evict_inode(), and so to save a bit of CPU time, and to make the
patch much more obviously correct by inspection(tm), we'll fix it by
explicitly not trying to waiting for a journal commit when we are
evicting the journal inode, since it's guaranteed to never succeed in
this case.

This can be easily replicated via:

     mount -t ext4 -o data=journal /dev/vdb /vdb ; umount /vdb

------------[ cut here ]------------
WARNING: at /usr/projects/linux/ext4/fs/jbd2/journal.c:542 __jbd2_log_start_commit+0xba/0xcd()
Hardware name: Bochs
JBD2: bad log_start_commit: 3005630206 3005630206 0 0
Modules linked in:
Pid: 2909, comm: umount Not tainted 3.8.0-rc3 #1020
Call Trace:
 [<c015c0ef>] warn_slowpath_common+0x68/0x7d
 [<c02b7e7d>] ? __jbd2_log_start_commit+0xba/0xcd
 [<c015c177>] warn_slowpath_fmt+0x2b/0x2f
 [<c02b7e7d>] __jbd2_log_start_commit+0xba/0xcd
 [<c02b8075>] jbd2_log_start_commit+0x24/0x34
 [<c0279ed5>] ext4_evict_inode+0x71/0x2e3
 [<c021f0ec>] evict+0x94/0x135
 [<c021f9aa>] iput+0x10a/0x110
 [<c02b7836>] jbd2_journal_destroy+0x190/0x1ce
 [<c0175284>] ? bit_waitqueue+0x50/0x50
 [<c028d23f>] ext4_put_super+0x52/0x294
 [<c020efe3>] generic_shutdown_super+0x48/0xb4
 [<c020f071>] kill_block_super+0x22/0x60
 [<c020f3e0>] deactivate_locked_super+0x22/0x49
 [<c020f5d6>] deactivate_super+0x30/0x33
 [<c0222795>] mntput_no_expire+0x107/0x10c
 [<c02233a7>] sys_umount+0x2cf/0x2e0
 [<c02233ca>] sys_oldumount+0x12/0x14
 [<c08096b8>] syscall_call+0x7/0xb
---[ end trace 6a954cc790501c1f ]---
jbd2_log_wait_commit: error: j_commit_request=-1289337090, tid=0

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/ext4/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2ce16af..5cf441c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -211,7 +211,8 @@ void ext4_evict_inode(struct inode *inode)
 		 * don't use page cache.
 		 */
 		if (ext4_should_journal_data(inode) &&
-		    (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode))) {
+		    (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode)) &&
+		    inode->i_ino != EXT4_JOURNAL_INO) {
 			journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
 			tid_t commit_tid = EXT4_I(inode)->i_datasync_tid;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 060/171 ] IPoIB: Fix send lockup due to missed TX completion
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (58 preceding siblings ...)
  2013-04-11 20:26 ` [ 059/171 ] ext4: fix data=journal fast mount/umount hang Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 061/171 ] clockevents: Dont allow dummy broadcast timers Steven Rostedt
                   ` (110 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Dean Luick, Mike Marciniszyn, Roland Dreier

[-- Attachment #1: 0060-IPoIB-Fix-send-lockup-due-to-missed-TX-completion.patch --]
[-- Type: text/plain, Size: 2102 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mike Marciniszyn <mike.marciniszyn@intel.com>

[ Upstream commit 1ee9e2aa7b31427303466776f455d43e5e3c9275 ]

Commit f0dc117abdfa ("IPoIB: Fix TX queue lockup with mixed UD/CM
traffic") attempts to solve an issue where unprocessed UD send
completions can deadlock the netdev.

The patch doesn't fully resolve the issue because if more than half
the tx_outstanding's were UD and all of the destinations are RC
reachable, arming the CQ doesn't solve the issue.

This patch uses the IB_CQ_REPORT_MISSED_EVENTS on the
ib_req_notify_cq().  If the rc is above 0, the UD send cq completion
callback is called directly to re-arm the send completion timer.

This issue is seen in very large parallel filesystem deployments
and the patch has been shown to correct the issue.

Cc: <stable@vger.kernel.org>
Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 24683fd..2ad27ce 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -755,9 +755,13 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
 		if (++priv->tx_outstanding == ipoib_sendq_size) {
 			ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
 				  tx->qp->qp_num);
-			if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
-				ipoib_warn(priv, "request notify on send CQ failed\n");
 			netif_stop_queue(dev);
+			rc = ib_req_notify_cq(priv->send_cq,
+				IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
+			if (rc < 0)
+				ipoib_warn(priv, "request notify on send CQ failed\n");
+			else if (rc)
+				ipoib_send_comp_handler(priv->send_cq, dev);
 		}
 	}
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 061/171 ] clockevents: Dont allow dummy broadcast timers
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (59 preceding siblings ...)
  2013-04-11 20:26 ` [ 060/171 ] IPoIB: Fix send lockup due to missed TX completion Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 062/171 ] x86-64: Fix the failure case in copy_user_handle_tail() Steven Rostedt
                   ` (109 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mark Rutland, linux-arm-kernel, Jon Medhurst (Tixy),
	Thomas Gleixner

[-- Attachment #1: 0061-clockevents-Don-t-allow-dummy-broadcast-timers.patch --]
[-- Type: text/plain, Size: 1663 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mark Rutland <mark.rutland@arm.com>

[ Upstream commit a7dc19b8652c862d5b7c4d2339bd3c428bd29c4a ]

Currently tick_check_broadcast_device doesn't reject clock_event_devices
with CLOCK_EVT_FEAT_DUMMY, and may select them in preference to real
hardware if they have a higher rating value. In this situation, the
dummy timer is responsible for broadcasting to itself, and the core
clockevents code may attempt to call non-existent callbacks for
programming the dummy, eventually leading to a panic.

This patch makes tick_check_broadcast_device always reject dummy timers,
preventing this problem.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jon Medhurst (Tixy) <tixy@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/time/tick-broadcast.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index f113755..a13987a 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -66,7 +66,8 @@ static void tick_broadcast_start_periodic(struct clock_event_device *bc)
  */
 int tick_check_broadcast_device(struct clock_event_device *dev)
 {
-	if ((tick_broadcast_device.evtdev &&
+	if ((dev->features & CLOCK_EVT_FEAT_DUMMY) ||
+	    (tick_broadcast_device.evtdev &&
 	     tick_broadcast_device.evtdev->rating >= dev->rating) ||
 	     (dev->features & CLOCK_EVT_FEAT_C3STOP))
 		return 0;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 062/171 ] x86-64: Fix the failure case in copy_user_handle_tail()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (60 preceding siblings ...)
  2013-04-11 20:26 ` [ 061/171 ] clockevents: Dont allow dummy broadcast timers Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 063/171 ] USB: xhci - fix bit definitions for IMAN register Steven Rostedt
                   ` (108 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: CQ Tang, Mike Marciniszyn, H. Peter Anvin

[-- Attachment #1: 0062-x86-64-Fix-the-failure-case-in-copy_user_handle_tail.patch --]
[-- Type: text/plain, Size: 1369 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: CQ Tang <cq.tang@intel.com>

[ Upstream commit 66db3feb486c01349f767b98ebb10b0c3d2d021b ]

The increment of "to" in copy_user_handle_tail() will have incremented
before a failure has been noted.  This causes us to skip a byte in the
failure case.

Only do the increment when assured there is no failure.

Signed-off-by: CQ Tang <cq.tang@intel.com>
Link: http://lkml.kernel.org/r/20130318150221.8439.993.stgit@phlsvslse11.ph.intel.com
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/x86/lib/usercopy_64.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
index e5b130b..cc9de31 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -72,10 +72,10 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
 	char c;
 	unsigned zero_len;
 
-	for (; len; --len) {
+	for (; len; --len, to++) {
 		if (__get_user_nocheck(c, from++, sizeof(char)))
 			break;
-		if (__put_user_nocheck(c, to++, sizeof(char)))
+		if (__put_user_nocheck(c, to, sizeof(char)))
 			break;
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 063/171 ] USB: xhci - fix bit definitions for IMAN register
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (61 preceding siblings ...)
  2013-04-11 20:26 ` [ 062/171 ] x86-64: Fix the failure case in copy_user_handle_tail() Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 064/171 ] USB: xhci: correctly enable interrupts Steven Rostedt
                   ` (107 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sarah Sharp

[-- Attachment #1: 0063-USB-xhci-fix-bit-definitions-for-IMAN-register.patch --]
[-- Type: text/plain, Size: 1612 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Dmitry Torokhov <dtor@vmware.com>

[ Upstream commit f8264340e694604863255cc0276491d17c402390 ]

According to XHCI specification (5.5.2.1) the IP is bit 0 and IE is bit 1
of IMAN register. Previously their definitions were reversed.

Even though there are no ill effects being observed from the swapped
definitions (because IMAN_IP is RW1C and in legacy PCI case we come in
with it already set to 1 so it was clearing itself even though we were
setting IMAN_IE instead of IMAN_IP), we should still correct the values.

This patch should be backported to kernels as old as 2.6.36, that
contain the commit 4e833c0b87a30798e67f06120cecebef6ee9644c "xhci: don't
re-enable IE constantly".

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/host/xhci.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 53df4e7..7c75bfe 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -206,8 +206,8 @@ struct xhci_op_regs {
 /* bits 12:31 are reserved (and should be preserved on writes). */
 
 /* IMAN - Interrupt Management Register */
-#define IMAN_IP		(1 << 1)
-#define IMAN_IE		(1 << 0)
+#define IMAN_IE		(1 << 1)
+#define IMAN_IP		(1 << 0)
 
 /* USBSTS - USB status - status bitmasks */
 /* HC not running - set to 1 when run/stop bit is cleared. */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 064/171 ] USB: xhci: correctly enable interrupts
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (62 preceding siblings ...)
  2013-04-11 20:26 ` [ 063/171 ] USB: xhci - fix bit definitions for IMAN register Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 065/171 ] USB: cdc-acm: fix device unregistration Steven Rostedt
                   ` (106 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bjorn Helgaas, Oliver Neukum, Thomas Renninger, Yinghai Lu,
	Frederik Himpe, David Haerdeman, Alan Stern, Sarah Sharp,
	Hannes Reinecke, Greg Kroah-Hartman

[-- Attachment #1: 0064-USB-xhci-correctly-enable-interrupts.patch --]
[-- Type: text/plain, Size: 3440 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hannes Reinecke <hare@suse.de>

[ Upstream commit 00eed9c814cb8f281be6f0f5d8f45025dc0a97eb ]

xhci has its own interrupt enabling routine, which will try to
use MSI-X/MSI if present. So the usb core shouldn't try to enable
legacy interrupts; on some machines the xhci legacy IRQ setting
is invalid.

v3: Be careful to not break XHCI_BROKEN_MSI workaround (by trenn)

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Frederik Himpe <fhimpe@vub.ac.be>
Cc: David Haerdeman <david@hardeman.nu>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/core/hcd-pci.c |   23 ++++++++++++++---------
 drivers/usb/host/xhci.c    |    3 ++-
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 622b4a4..2b487d4 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -173,6 +173,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	struct hc_driver	*driver;
 	struct usb_hcd		*hcd;
 	int			retval;
+	int			hcd_irq = 0;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -187,15 +188,19 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		return -ENODEV;
 	dev->current_state = PCI_D0;
 
-	/* The xHCI driver supports MSI and MSI-X,
-	 * so don't fail if the BIOS doesn't provide a legacy IRQ.
+	/*
+	 * The xHCI driver has its own irq management
+	 * make sure irq setup is not touched for xhci in generic hcd code
 	 */
-	if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {
-		dev_err(&dev->dev,
-			"Found HC with no IRQ.  Check BIOS/PCI %s setup!\n",
-			pci_name(dev));
-		retval = -ENODEV;
-		goto disable_pci;
+	if ((driver->flags & HCD_MASK) != HCD_USB3) {
+		if (!dev->irq) {
+			dev_err(&dev->dev,
+			"Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
+				pci_name(dev));
+			retval = -ENODEV;
+			goto disable_pci;
+		}
+		hcd_irq = dev->irq;
 	}
 
 	hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev));
@@ -245,7 +250,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	pci_set_master(dev);
 
-	retval = usb_add_hcd(hcd, dev->irq, IRQF_SHARED);
+	retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
 	if (retval != 0)
 		goto unmap_registers;
 	set_hs_companion(dev, hcd);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index a6e910b..fd36acd 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -350,7 +350,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
 	 * generate interrupts.  Don't even try to enable MSI.
 	 */
 	if (xhci->quirks & XHCI_BROKEN_MSI)
-		return 0;
+		goto legacy_irq;
 
 	/* unregister the legacy interrupt */
 	if (hcd->irq)
@@ -371,6 +371,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
 		return -EINVAL;
 	}
 
+ legacy_irq:
 	/* fall back to legacy interrupt*/
 	ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
 			hcd->irq_descr, hcd);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 065/171 ] USB: cdc-acm: fix device unregistration
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (63 preceding siblings ...)
  2013-04-11 20:26 ` [ 064/171 ] USB: xhci: correctly enable interrupts Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 066/171 ] USB: EHCI: fix regression in QH unlinking Steven Rostedt
                   ` (105 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Oliver Neukum, Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0065-USB-cdc-acm-fix-device-unregistration.patch --]
[-- Type: text/plain, Size: 1959 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit cb25505fc604292c70fc02143fc102f54c8595f0 ]

Unregister tty device in disconnect as is required by the USB stack.

By deferring unregistration to when the last tty reference is dropped,
the parent interface device can get unregistered before the child
resulting in broken hotplug events being generated when the tty is
finally closed:

KERNEL[2290.798128] remove   /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:3.1 (usb)
KERNEL[2290.804589] remove   /devices/pci0000:00/0000:00:1d.7/usb2/2-1 (usb)
KERNEL[2294.554799] remove   /2-1:3.1/tty/ttyACM0 (tty)

The driver must deal with tty callbacks after disconnect by checking the
disconnected flag. Specifically, further opens must be prevented and
this is already implemented.

Cc: stable <stable@vger.kernel.org>
Cc: Oliver Neukum <oneukum@suse.de>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/class/cdc-acm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 89c752a..d0d8f1c 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -601,7 +601,6 @@ static void acm_port_destruct(struct tty_port *port)
 
 	dev_dbg(&acm->control->dev, "%s\n", __func__);
 
-	tty_unregister_device(acm_tty_driver, acm->minor);
 	acm_release_minor(acm);
 	usb_put_intf(acm->control);
 	kfree(acm->country_codes);
@@ -1418,6 +1417,8 @@ static void acm_disconnect(struct usb_interface *intf)
 
 	stop_data_traffic(acm);
 
+	tty_unregister_device(acm_tty_driver, acm->minor);
+
 	usb_free_urb(acm->ctrlurb);
 	for (i = 0; i < ACM_NW; i++)
 		usb_free_urb(acm->wb[i].urb);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 066/171 ] USB: EHCI: fix regression in QH unlinking
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (64 preceding siblings ...)
  2013-04-11 20:26 ` [ 065/171 ] USB: cdc-acm: fix device unregistration Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 067/171 ] usb: gadget: ffs: fix enable multiple instances Steven Rostedt
                   ` (104 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Alan Stern, Andreas Bombe, Greg Kroah-Hartman

[-- Attachment #1: 0066-USB-EHCI-fix-regression-in-QH-unlinking.patch --]
[-- Type: text/plain, Size: 2183 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

[ Upstream commit d714aaf649460cbfd5e82e75520baa856b4fa0a0 ]

This patch (as1670) fixes a regression caused by commit
6402c796d3b4205d3d7296157956c5100a05d7d6 (USB: EHCI: work around
silicon bug in Intel's EHCI controllers).  The workaround goes through
two IAA cycles for each QH being unlinked.  During the first cycle,
the QH is not added to the async_iaa list (because it isn't fully gone
from the hardware yet), which means that list will be empty.

Unfortunately, I forgot to update the IAA watchdog timer routine.  It
thinks that an empty async_iaa list means the timer expiration was an
error, which isn't true any more.  This problem didn't show up during
initial testing because the controllers being tested all had working
IAA interrupts.  But not all controllers do, and when the watchdog
timer expires, the empty-list check prevents the second IAA cycle from
starting.  As a result, URB unlinks never complete.  The check needs
to be removed.

Among the symptoms of the regression are processes stuck in D wait
states and hangs during system shutdown.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-and-tested-by: Sven Joachim <svenjoac@gmx.de>
Reported-by: Andreas Bombe <aeb@debian.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/host/ehci-timer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-timer.c b/drivers/usb/host/ehci-timer.c
index 20dbdcb..c3fa130 100644
--- a/drivers/usb/host/ehci-timer.c
+++ b/drivers/usb/host/ehci-timer.c
@@ -304,7 +304,7 @@ static void ehci_iaa_watchdog(struct ehci_hcd *ehci)
 	 * (a) SMP races against real IAA firing and retriggering, and
 	 * (b) clean HC shutdown, when IAA watchdog was pending.
 	 */
-	if (ehci->async_iaa) {
+	if (1) {
 		u32 cmd, status;
 
 		/* If we get here, IAA is *REALLY* late.  It's barely
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 067/171 ] usb: gadget: ffs: fix enable multiple instances
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (65 preceding siblings ...)
  2013-04-11 20:26 ` [ 066/171 ] USB: EHCI: fix regression in QH unlinking Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 068/171 ] USB: serial: fix interface refcounting Steven Rostedt
                   ` (103 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Michal Nazarewicz, Andrzej Pietrasiewicz, Kyungmin Park,
	Felipe Balbi

[-- Attachment #1: 0067-usb-gadget-ffs-fix-enable-multiple-instances.patch --]
[-- Type: text/plain, Size: 1655 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>

[ Upstream commit 3416905ba058e43112ad7b1b4859797f027f5a07 ]

This patch fixes an "off-by-one" bug found in
581791f (FunctionFS: enable multiple functions).

During gfs_bind/gfs_unbind the functionfs_bind/functionfs_unbind should be
called for every functionfs instance. With the "i" pre-decremented they
were not called for the zeroth instance.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

[ balbi@ti.com : added offending commit's subject ]

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/gadget/g_ffs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index d3ace90..919177b 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -358,7 +358,7 @@ static int gfs_bind(struct usb_composite_dev *cdev)
 	if (unlikely(ret < 0))
 		goto error;
 
-	for (i = func_num; --i; ) {
+	for (i = func_num; i--; ) {
 		ret = functionfs_bind(ffs_tab[i].ffs_data, cdev);
 		if (unlikely(ret < 0)) {
 			while (++i < func_num)
@@ -413,7 +413,7 @@ static int gfs_unbind(struct usb_composite_dev *cdev)
 		gether_cleanup();
 	gfs_ether_setup = false;
 
-	for (i = func_num; --i; )
+	for (i = func_num; i--; )
 		if (ffs_tab[i].ffs_data)
 			functionfs_unbind(ffs_tab[i].ffs_data);
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 068/171 ] USB: serial: fix interface refcounting
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (66 preceding siblings ...)
  2013-04-11 20:26 ` [ 067/171 ] usb: gadget: ffs: fix enable multiple instances Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 069/171 ] ACPI: Rework acpi_get_child() to be more efficient Steven Rostedt
                   ` (102 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0068-USB-serial-fix-interface-refcounting.patch --]
[-- Type: text/plain, Size: 1445 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit d7971051e4df825e0bc11b995e87bfe86355b8e5 ]

Make sure the interface is not released before our serial device.

Note that drivers are still not allowed to access the interface in
any way that may interfere with another driver that may have gotten
bound to the same interface after disconnect returns.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/usb-serial.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 667c39c..da1e728 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -157,6 +157,7 @@ static void destroy_serial(struct kref *kref)
 		}
 	}
 
+	usb_put_intf(serial->interface);
 	usb_put_dev(serial->dev);
 	kfree(serial);
 }
@@ -614,7 +615,7 @@ static struct usb_serial *create_serial(struct usb_device *dev,
 	}
 	serial->dev = usb_get_dev(dev);
 	serial->type = driver;
-	serial->interface = interface;
+	serial->interface = usb_get_intf(interface);
 	kref_init(&serial->kref);
 	mutex_init(&serial->disc_mutex);
 	serial->minor = SERIAL_TTY_NO_MINOR;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 069/171 ] ACPI: Rework acpi_get_child() to be more efficient
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (67 preceding siblings ...)
  2013-04-11 20:26 ` [ 068/171 ] USB: serial: fix interface refcounting Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 070/171 ] udf: Fix bitmap overflow on large filesystems with small block size Steven Rostedt
                   ` (101 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Rafael J. Wysocki

[-- Attachment #1: 0069-ACPI-Rework-acpi_get_child-to-be-more-efficient.patch --]
[-- Type: text/plain, Size: 2672 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

[ Upstream commit 33f767d767e9a684e9cd60704d4c049a2014c8d5 ]

Observe that acpi_get_child() doesn't need to use the helper
struct acpi_find_child structure and change it to work without it.
Also, using acpi_get_object_info() to get the output of _ADR for the
given device is overkill, because that function does much more than
just evaluating _ADR (let alone the additional memory allocation
done by it).

Moreover, acpi_get_child() doesn't need to loop any more once it has
found a matching handle, so make it stop in that case.  To prevent
the results from changing, make it use do_acpi_find_child() as
a post-order callback.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/acpi/glue.c |   35 +++++++++++++----------------------
 1 file changed, 13 insertions(+), 22 deletions(-)

diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 243ee85..6eff12f 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -88,40 +88,31 @@ static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle)
 	return ret;
 }
 
-/* Get device's handler per its address under its parent */
-struct acpi_find_child {
-	acpi_handle handle;
-	u64 address;
-};
-
-static acpi_status
-do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
+static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used,
+				      void *addr_p, void **ret_p)
 {
+	unsigned long long addr;
 	acpi_status status;
-	struct acpi_device_info *info;
-	struct acpi_find_child *find = context;
-
-	status = acpi_get_object_info(handle, &info);
-	if (ACPI_SUCCESS(status)) {
-		if ((info->address == find->address)
-			&& (info->valid & ACPI_VALID_ADR))
-			find->handle = handle;
-		kfree(info);
+
+	status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &addr);
+	if (ACPI_SUCCESS(status) && addr == *((u64 *)addr_p)) {
+		*ret_p = handle;
+		return AE_CTRL_TERMINATE;
 	}
 	return AE_OK;
 }
 
 acpi_handle acpi_get_child(acpi_handle parent, u64 address)
 {
-	struct acpi_find_child find = { NULL, address };
+	void *ret = NULL;
 
 	if (!parent)
 		return NULL;
-	acpi_walk_namespace(ACPI_TYPE_DEVICE, parent,
-			    1, do_acpi_find_child, NULL, &find, NULL);
-	return find.handle;
-}
 
+	acpi_walk_namespace(ACPI_TYPE_DEVICE, parent, 1, NULL,
+			    do_acpi_find_child, &address, &ret);
+	return (acpi_handle)ret;
+}
 EXPORT_SYMBOL(acpi_get_child);
 
 /* Link ACPI devices with physical devices */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 070/171 ] udf: Fix bitmap overflow on large filesystems with small block size
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (68 preceding siblings ...)
  2013-04-11 20:26 ` [ 069/171 ] ACPI: Rework acpi_get_child() to be more efficient Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 071/171 ] USB: garmin_gps: fix memory leak on disconnect Steven Rostedt
                   ` (100 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jan Kara

[-- Attachment #1: 0070-udf-Fix-bitmap-overflow-on-large-filesystems-with-sm.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jan Kara <jack@suse.cz>

[ Upstream commit 89b1f39eb4189de745fae554b0d614d87c8d5c63 ]

For large UDF filesystems with 512-byte blocks the number of necessary
bitmap blocks is larger than 2^16 so s_nr_groups in udf_bitmap overflows
(the number will overflow for filesystems larger than 128 GB with
512-byte blocks). That results in ENOSPC errors despite the filesystem
has plenty of free space.

Fix the problem by changing s_nr_groups' type to 'int'. That is enough
even for filesystems 2^32 blocks (UDF maximum) and 512-byte blocksize.

Reported-and-tested-by: v10lator@myway.de
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/udf/udf_sb.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 42ad69a..9e8e08e 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -82,7 +82,7 @@ struct udf_virtual_data {
 struct udf_bitmap {
 	__u32			s_extLength;
 	__u32			s_extPosition;
-	__u16			s_nr_groups;
+	int			s_nr_groups;
 	struct buffer_head 	**s_block_bitmap;
 };
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 071/171 ] USB: garmin_gps: fix memory leak on disconnect
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (69 preceding siblings ...)
  2013-04-11 20:26 ` [ 070/171 ] udf: Fix bitmap overflow on large filesystems with small block size Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 072/171 ] USB: io_ti: fix get_icount for two port adapters Steven Rostedt
                   ` (99 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0071-USB-garmin_gps-fix-memory-leak-on-disconnect.patch --]
[-- Type: text/plain, Size: 1519 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 618aa1068df29c37a58045fe940f9106664153fd ]

Remove bogus disconnect test introduced by 95bef012e ("USB: more serial
drivers writing after disconnect") which prevented queued data from
being freed on disconnect.

The possible IO it was supposed to prevent is long gone.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/garmin_gps.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index de9cfd4..6e6e305 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -959,10 +959,7 @@ static void garmin_close(struct usb_serial_port *port)
 	if (!serial)
 		return;
 
-	mutex_lock(&port->serial->disc_mutex);
-
-	if (!port->serial->disconnected)
-		garmin_clear(garmin_data_p);
+	garmin_clear(garmin_data_p);
 
 	/* shutdown our urbs */
 	usb_kill_urb(port->read_urb);
@@ -971,8 +968,6 @@ static void garmin_close(struct usb_serial_port *port)
 	/* keep reset state so we know that we must start a new session */
 	if (garmin_data_p->state != STATE_RESET)
 		garmin_data_p->state = STATE_DISCONNECTED;
-
-	mutex_unlock(&port->serial->disc_mutex);
 }
 
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 072/171 ] USB: io_ti: fix get_icount for two port adapters
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (70 preceding siblings ...)
  2013-04-11 20:26 ` [ 071/171 ] USB: garmin_gps: fix memory leak on disconnect Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 073/171 ] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation Steven Rostedt
                   ` (98 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0072-USB-io_ti-fix-get_icount-for-two-port-adapters.patch --]
[-- Type: text/plain, Size: 1183 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 5492bf3d5655b4954164f69c02955a7fca267611 ]

Add missing get_icount field to two-port driver.

The two-port driver was not updated when switching to the new icount
interface in commit 0bca1b913aff ("tty: Convert the USB drivers to the
new icount interface").

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/io_ti.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index ccf297d..a943c06 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2766,6 +2766,7 @@ static struct usb_serial_driver edgeport_2port_device = {
 	.set_termios		= edge_set_termios,
 	.tiocmget		= edge_tiocmget,
 	.tiocmset		= edge_tiocmset,
+	.get_icount		= edge_get_icount,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 073/171 ] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (71 preceding siblings ...)
  2013-04-11 20:26 ` [ 072/171 ] USB: io_ti: fix get_icount for two port adapters Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 074/171 ] SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked Steven Rostedt
                   ` (97 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Krzysztof Halasa, Marek Szyprowski

[-- Attachment #1: 0073-ARM-DMA-mapping-add-missing-GFP_DMA-flag-for-atomic-.patch --]
[-- Type: text/plain, Size: 1533 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Marek Szyprowski <m.szyprowski@samsung.com>

[ Upstream commit 9d1400cf79afb49584b4873eb22cd5130cb341db ]

Atomic pool should always be allocated from DMA zone if such zone is
available in the system to avoid issues caused by limited dma mask of
any of the devices used for making an atomic allocation.

Reported-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Stable <stable@vger.kernel.org>	[v3.6+]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mm/dma-mapping.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 13f555d..a3658d6 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -311,6 +311,7 @@ static int __init atomic_pool_init(void)
 {
 	struct dma_pool *pool = &atomic_pool;
 	pgprot_t prot = pgprot_dmacoherent(pgprot_kernel);
+	gfp_t gfp = GFP_KERNEL | GFP_DMA;
 	unsigned long nr_pages = pool->size >> PAGE_SHIFT;
 	unsigned long *bitmap;
 	struct page *page;
@@ -329,8 +330,8 @@ static int __init atomic_pool_init(void)
 	if (IS_ENABLED(CONFIG_CMA))
 		ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page);
 	else
-		ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot,
-					   &page, NULL);
+		ptr = __alloc_remap_buffer(NULL, pool->size, gfp, prot, &page,
+					   NULL);
 	if (ptr) {
 		int i;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 074/171 ] SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (72 preceding siblings ...)
  2013-04-11 20:26 ` [ 073/171 ] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 075/171 ] tile: expect new initramfs name from hypervisor file system Steven Rostedt
                   ` (96 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Trond Myklebust

[-- Attachment #1: 0074-SUNRPC-Add-barriers-to-ensure-read-ordering-in-rpc_w.patch --]
[-- Type: text/plain, Size: 1669 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

[ Upstream commit 1166fde6a923c30f4351515b6a9a1efc513e7d00 ]

We need to be careful when testing task->tk_waitqueue in
rpc_wake_up_task_queue_locked, because it can be changed while we
are holding the queue->lock.
By adding appropriate memory barriers, we can ensure that it is safe to
test task->tk_waitqueue for equality if the RPC_TASK_QUEUED bit is set.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/sunrpc/sched.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 128494e..cd09810 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -143,6 +143,8 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue,
 		list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]);
 	task->tk_waitqueue = queue;
 	queue->qlen++;
+	/* barrier matches the read in rpc_wake_up_task_queue_locked() */
+	smp_wmb();
 	rpc_set_queued(task);
 
 	dprintk("RPC: %5u added to queue %p \"%s\"\n",
@@ -400,8 +402,11 @@ static void __rpc_do_wake_up_task(struct rpc_wait_queue *queue, struct rpc_task
  */
 static void rpc_wake_up_task_queue_locked(struct rpc_wait_queue *queue, struct rpc_task *task)
 {
-	if (RPC_IS_QUEUED(task) && task->tk_waitqueue == queue)
-		__rpc_do_wake_up_task(queue, task);
+	if (RPC_IS_QUEUED(task)) {
+		smp_rmb();
+		if (task->tk_waitqueue == queue)
+			__rpc_do_wake_up_task(queue, task);
+	}
 }
 
 /*
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 075/171 ] tile: expect new initramfs name from hypervisor file system
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (73 preceding siblings ...)
  2013-04-11 20:26 ` [ 074/171 ] SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 076/171 ] Bluetooth: Add support for Dell[QCA 0cf3:0036] Steven Rostedt
                   ` (95 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Chris Metcalf

[-- Attachment #1: 0075-tile-expect-new-initramfs-name-from-hypervisor-file-.patch --]
[-- Type: text/plain, Size: 2824 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Chris Metcalf <cmetcalf@tilera.com>

[ Upstream commit ff7f3efb9abf986f4ecd8793a9593f7ca4d6431a ]

The current Tilera boot infrastructure now provides the initramfs
to Linux as a Tilera-hypervisor file named "initramfs", rather than
"initramfs.cpio.gz", as before.  (This makes it reasonable to use
other compression techniques than gzip on the file without having to
worry about the name causing confusion.)  Adapt to use the new name,
but also fall back to checking for the old name.

Cc'ing to stable so that older kernels will remain compatible with
newer Tilera boot infrastructure.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/tile/kernel/setup.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 6a649a4..86b1ae4 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -999,15 +999,8 @@ void __cpuinit setup_cpu(int boot)
 
 #ifdef CONFIG_BLK_DEV_INITRD
 
-/*
- * Note that the kernel can potentially support other compression
- * techniques than gz, though we don't do so by default.  If we ever
- * decide to do so we can either look for other filename extensions,
- * or just allow a file with this name to be compressed with an
- * arbitrary compressor (somewhat counterintuitively).
- */
 static int __initdata set_initramfs_file;
-static char __initdata initramfs_file[128] = "initramfs.cpio.gz";
+static char __initdata initramfs_file[128] = "initramfs";
 
 static int __init setup_initramfs_file(char *str)
 {
@@ -1021,9 +1014,9 @@ static int __init setup_initramfs_file(char *str)
 early_param("initramfs_file", setup_initramfs_file);
 
 /*
- * We look for an "initramfs.cpio.gz" file in the hvfs.
- * If there is one, we allocate some memory for it and it will be
- * unpacked to the initramfs.
+ * We look for a file called "initramfs" in the hvfs.  If there is one, we
+ * allocate some memory for it and it will be unpacked to the initramfs.
+ * If it's compressed, the initd code will uncompress it first.
  */
 static void __init load_hv_initrd(void)
 {
@@ -1033,10 +1026,16 @@ static void __init load_hv_initrd(void)
 
 	fd = hv_fs_findfile((HV_VirtAddr) initramfs_file);
 	if (fd == HV_ENOENT) {
-		if (set_initramfs_file)
+		if (set_initramfs_file) {
 			pr_warning("No such hvfs initramfs file '%s'\n",
 				   initramfs_file);
-		return;
+			return;
+		} else {
+			/* Try old backwards-compatible name. */
+			fd = hv_fs_findfile((HV_VirtAddr)"initramfs.cpio.gz");
+			if (fd == HV_ENOENT)
+				return;
+		}
 	}
 	BUG_ON(fd < 0);
 	stat = hv_fs_fstat(fd);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 076/171 ] Bluetooth: Add support for Dell[QCA 0cf3:0036]
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (74 preceding siblings ...)
  2013-04-11 20:26 ` [ 075/171 ] tile: expect new initramfs name from hypervisor file system Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 077/171 ] Bluetooth: Add support for Dell[QCA 0cf3:817a] Steven Rostedt
                   ` (94 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Gustavo Padovan, Ming Lei

[-- Attachment #1: 0076-Bluetooth-Add-support-for-Dell-QCA-0cf3-0036.patch --]
[-- Type: text/plain, Size: 3455 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ming Lei <ming.lei@canonical.com>

[ Upstream commit d66629c1325399cf080ba8b2fb086c10e5439cdd ]

Add support for the AR9462 chip

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0cf3 ProdID=0036 Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Cc: <stable@vger.kernel.org>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/bluetooth/ath3k.c |    2 ++
 drivers/bluetooth/btusb.c |    1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index fc2de55..3859b23 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -72,6 +72,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x03F0, 0x311D) },
 
 	/* Atheros AR3012 with sflash firmware*/
+	{ USB_DEVICE(0x0CF3, 0x0036) },
 	{ USB_DEVICE(0x0CF3, 0x3004) },
 	{ USB_DEVICE(0x0CF3, 0x311D) },
 	{ USB_DEVICE(0x13d3, 0x3375) },
@@ -99,6 +100,7 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
 static struct usb_device_id ath3k_blist_tbl[] = {
 
 	/* Atheros AR3012 with sflash firmware*/
+	{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 654e248..57474b1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -128,6 +128,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
 
 	/* Atheros 3012 with sflash firmware */
+	{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 077/171 ] Bluetooth: Add support for Dell[QCA 0cf3:817a]
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (75 preceding siblings ...)
  2013-04-11 20:26 ` [ 076/171 ] Bluetooth: Add support for Dell[QCA 0cf3:0036] Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 078/171 ] staging: comedi: s626: fix continuous acquisition Steven Rostedt
                   ` (93 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Gustavo Padovan, Ming Lei

[-- Attachment #1: 0077-Bluetooth-Add-support-for-Dell-QCA-0cf3-817a.patch --]
[-- Type: text/plain, Size: 3615 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ming Lei <ming.lei@canonical.com>

[ Upstream commit ebaf5795ef57a70a042ea259448a465024e2821d ]

Add support for the AR9462 chip

T:  Bus=03 Lev=01 Prnt=01 Port=08 Cnt=01 Dev#=  5 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0cf3 ProdID=817a Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Cc: <stable@vger.kernel.org>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/bluetooth/ath3k.c |    2 ++
 drivers/bluetooth/btusb.c |    1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 3859b23..b0395b0 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -75,6 +75,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x0CF3, 0x0036) },
 	{ USB_DEVICE(0x0CF3, 0x3004) },
 	{ USB_DEVICE(0x0CF3, 0x311D) },
+	{ USB_DEVICE(0x0CF3, 0x817a) },
 	{ USB_DEVICE(0x13d3, 0x3375) },
 	{ USB_DEVICE(0x04CA, 0x3005) },
 	{ USB_DEVICE(0x13d3, 0x3362) },
@@ -103,6 +104,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 57474b1..30ac56b 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -131,6 +131,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 078/171 ] staging: comedi: s626: fix continuous acquisition
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (76 preceding siblings ...)
  2013-04-11 20:26 ` [ 077/171 ] Bluetooth: Add support for Dell[QCA 0cf3:817a] Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 079/171 ] sysfs: fix race between readdir and lseek Steven Rostedt
                   ` (92 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ian Abbott, Greg Kroah-Hartman

[-- Attachment #1: 0078-staging-comedi-s626-fix-continuous-acquisition.patch --]
[-- Type: text/plain, Size: 2200 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

[ Upstream commit e4317ce877a31dbb9d96375391c1c4ad2210d637 ]

For the s626 driver, there is a bug in the handling of asynchronous
commands on the AI subdevice when the stop source is `TRIG_NONE`.  The
command should run continuously until cancelled, but the interrupt
handler stops the command running after the first scan.

The command set-up function `s626_ai_cmd()` contains this code:

	switch (cmd->stop_src) {
	case TRIG_COUNT:
		/*  data arrives as one packet */
		devpriv->ai_sample_count = cmd->stop_arg;
		devpriv->ai_continous = 0;
		break;
	case TRIG_NONE:
		/*  continous acquisition */
		devpriv->ai_continous = 1;
		devpriv->ai_sample_count = 0;
		break;
	}

The interrupt handler `s626_irq_handler()` contains this code:

		if (!(devpriv->ai_continous))
			devpriv->ai_sample_count--;
		if (devpriv->ai_sample_count <= 0) {
			devpriv->ai_cmd_running = 0;
			/* ... */
		}

So `devpriv->ai_sample_count` is only decremented for the `TRIG_COUNT`
case, but `devpriv->ai_cmd_running` is set to 0 (and the command
stopped) regardless.

Fix this in `s626_ai_cmd()` by setting `devpriv->ai_sample_count = 1`
for the `TRIG_NONE` case.  The interrupt handler will not decrement it
so it will remain greater than 0 and the check for stopping the
acquisition will fail.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/staging/comedi/drivers/s626.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 2b03b68..f809ef3 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -1509,7 +1509,7 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	case TRIG_NONE:
 		/*  continous acquisition */
 		devpriv->ai_continous = 1;
-		devpriv->ai_sample_count = 0;
+		devpriv->ai_sample_count = 1;
 		break;
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 079/171 ] sysfs: fix race between readdir and lseek
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (77 preceding siblings ...)
  2013-04-11 20:26 ` [ 078/171 ] staging: comedi: s626: fix continuous acquisition Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 080/171 ] sysfs: handle failure path correctly for readdir() Steven Rostedt
                   ` (91 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dave Jones, Sasha Levin, Ming Lei, Greg Kroah-Hartman

[-- Attachment #1: 0079-sysfs-fix-race-between-readdir-and-lseek.patch --]
[-- Type: text/plain, Size: 1676 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ming Lei <ming.lei@canonical.com>

[ Upstream commit 991f76f837bf22c5bb07261cfd86525a0a96650c ]

While readdir() is running, lseek() may set filp->f_pos as zero,
then may leave filp->private_data pointing to one sysfs_dirent
object without holding its reference counter, so the sysfs_dirent
object may be used after free in next readdir().

This patch holds inode->i_mutex to avoid the problem since
the lock is always held in readdir path.

Reported-by: Dave Jones <davej@redhat.com>
Tested-by: Sasha Levin <levinsasha928@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/sysfs/dir.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 2fbdff6..b65a354 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -1058,10 +1058,21 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 	return 0;
 }
 
+static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence)
+{
+	struct inode *inode =  file->f_path.dentry->d_inode;
+	loff_t ret;
+
+	mutex_lock(&inode->i_mutex);
+	ret = generic_file_llseek(file, offset, whence);
+	mutex_unlock(&inode->i_mutex);
+
+	return ret;
+}
 
 const struct file_operations sysfs_dir_operations = {
 	.read		= generic_read_dir,
 	.readdir	= sysfs_readdir,
 	.release	= sysfs_dir_release,
-	.llseek		= generic_file_llseek,
+	.llseek		= sysfs_dir_llseek,
 };
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 080/171 ] sysfs: handle failure path correctly for readdir()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (78 preceding siblings ...)
  2013-04-11 20:26 ` [ 079/171 ] sysfs: fix race between readdir and lseek Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 081/171 ] can: sja1000: fix define conflict on SH Steven Rostedt
                   ` (90 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dave Jones, Sasha Levin, Ming Lei, Greg Kroah-Hartman

[-- Attachment #1: 0080-sysfs-handle-failure-path-correctly-for-readdir.patch --]
[-- Type: text/plain, Size: 1731 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ming Lei <ming.lei@canonical.com>

[ Upstream commit e5110f411d2ee35bf8d202ccca2e89c633060dca ]

In case of 'if (filp->f_pos ==  0 or 1)' of sysfs_readdir(),
the failure from filldir() isn't handled, and the reference counter
of the sysfs_dirent object pointed by filp->private_data will be
released without clearing filp->private_data, so use after free
bug will be triggered later.

This patch returns immeadiately under the situation for fixing the bug,
and it is reasonable to return from readdir() when filldir() fails.

Reported-by: Dave Jones <davej@redhat.com>
Tested-by: Sasha Levin <levinsasha928@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/sysfs/dir.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index b65a354..4b93159 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -1020,6 +1020,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 		ino = parent_sd->s_ino;
 		if (filldir(dirent, ".", 1, filp->f_pos, ino, DT_DIR) == 0)
 			filp->f_pos++;
+		else
+			return 0;
 	}
 	if (filp->f_pos == 1) {
 		if (parent_sd->s_parent)
@@ -1028,6 +1030,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 			ino = parent_sd->s_ino;
 		if (filldir(dirent, "..", 2, filp->f_pos, ino, DT_DIR) == 0)
 			filp->f_pos++;
+		else
+			return 0;
 	}
 	mutex_lock(&sysfs_mutex);
 	for (pos = sysfs_dir_pos(ns, parent_sd, filp->f_pos, pos);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 081/171 ] can: sja1000: fix define conflict on SH
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (79 preceding siblings ...)
  2013-04-11 20:26 ` [ 080/171 ] sysfs: handle failure path correctly for readdir() Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 082/171 ] ath9k: limit tx path hang check to normal data queues Steven Rostedt
                   ` (89 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Fengguang Wu, Marc Kleine-Budde

[-- Attachment #1: 0081-can-sja1000-fix-define-conflict-on-SH.patch --]
[-- Type: text/plain, Size: 3814 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Marc Kleine-Budde <mkl@pengutronix.de>

[ Upstream commit f901b6bc404b67d96eca739857c097e022727b71 ]

Thias patch fixes a define conflict between the SH architecture and the sja1000
driver:

    drivers/net/can/sja1000/sja1000.h:59:0: warning:
        "REG_SR" redefined [enabled by default]
    arch/sh/include/asm/ptrace_32.h:25:0: note:
         this is the location of the previous definition

A SJA1000_ prefix is added to the offending sja1000 define only, to make a
minimal patch suited for stable. A later patch will add a SJA1000_ prefix to
all defines in sja1000.h.

Cc: linux-stable <stable@vger.kernel.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/can/sja1000/plx_pci.c |    4 ++--
 drivers/net/can/sja1000/sja1000.c |    6 +++---
 drivers/net/can/sja1000/sja1000.h |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
index 8bc9598..8099275 100644
--- a/drivers/net/can/sja1000/plx_pci.c
+++ b/drivers/net/can/sja1000/plx_pci.c
@@ -329,7 +329,7 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv)
 	 */
 	if ((priv->read_reg(priv, REG_CR) & REG_CR_BASICCAN_INITIAL_MASK) ==
 	    REG_CR_BASICCAN_INITIAL &&
-	    (priv->read_reg(priv, REG_SR) == REG_SR_BASICCAN_INITIAL) &&
+	    (priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_BASICCAN_INITIAL) &&
 	    (priv->read_reg(priv, REG_IR) == REG_IR_BASICCAN_INITIAL))
 		flag = 1;
 
@@ -341,7 +341,7 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv)
 	 * See states on p. 23 of the Datasheet.
 	 */
 	if (priv->read_reg(priv, REG_MOD) == REG_MOD_PELICAN_INITIAL &&
-	    priv->read_reg(priv, REG_SR) == REG_SR_PELICAN_INITIAL &&
+	    priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_PELICAN_INITIAL &&
 	    priv->read_reg(priv, REG_IR) == REG_IR_PELICAN_INITIAL)
 		return flag;
 
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 4c4f33d..f0e1789 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -91,7 +91,7 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
 	 */
 	spin_lock_irqsave(&priv->cmdreg_lock, flags);
 	priv->write_reg(priv, REG_CMR, val);
-	priv->read_reg(priv, REG_SR);
+	priv->read_reg(priv, SJA1000_REG_SR);
 	spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
 }
 
@@ -496,7 +496,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
 
 	while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
 		n++;
-		status = priv->read_reg(priv, REG_SR);
+		status = priv->read_reg(priv, SJA1000_REG_SR);
 		/* check for absent controller due to hw unplug */
 		if (status == 0xFF && sja1000_is_absent(priv))
 			return IRQ_NONE;
@@ -515,7 +515,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
 			/* receive interrupt */
 			while (status & SR_RBS) {
 				sja1000_rx(dev);
-				status = priv->read_reg(priv, REG_SR);
+				status = priv->read_reg(priv, SJA1000_REG_SR);
 				/* check for absent controller */
 				if (status == 0xFF && sja1000_is_absent(priv))
 					return IRQ_NONE;
diff --git a/drivers/net/can/sja1000/sja1000.h b/drivers/net/can/sja1000/sja1000.h
index 23fff06..2a79543 100644
--- a/drivers/net/can/sja1000/sja1000.h
+++ b/drivers/net/can/sja1000/sja1000.h
@@ -56,7 +56,7 @@
 /* SJA1000 registers - manual section 6.4 (Pelican Mode) */
 #define REG_MOD		0x00
 #define REG_CMR		0x01
-#define REG_SR		0x02
+#define SJA1000_REG_SR		0x02
 #define REG_IR		0x03
 #define REG_IER		0x04
 #define REG_ALC		0x0B
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 082/171 ] ath9k: limit tx path hang check to normal data queues
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (80 preceding siblings ...)
  2013-04-11 20:26 ` [ 081/171 ] can: sja1000: fix define conflict on SH Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 083/171 ] ath9k: avoid queueing hw check work when suspended Steven Rostedt
                   ` (88 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Felix Fietkau, John W. Linville

[-- Attachment #1: 0082-ath9k-limit-tx-path-hang-check-to-normal-data-queues.patch --]
[-- Type: text/plain, Size: 1852 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Felix Fietkau <nbd@openwrt.org>

[ Upstream commit 01d4ab96d2e7fceaad204e5a8710ce34e229b8c5 ]

The beacon and multicast-buffer queues are managed by the beacon
tasklet, and the generic tx path hang check does not help in any way
here. Running it on those queues anyway can introduce some race
conditions leading to unnecessary chip resets.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/ath/ath9k/link.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index 7b88b9c..62b58ba 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -31,21 +31,21 @@ void ath_tx_complete_poll_work(struct work_struct *work)
 	sc->tx_complete_poll_work_seen++;
 #endif
 
-	for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
-		if (ATH_TXQ_SETUP(sc, i)) {
-			txq = &sc->tx.txq[i];
-			ath_txq_lock(sc, txq);
-			if (txq->axq_depth) {
-				if (txq->axq_tx_inprogress) {
-					needreset = true;
-					ath_txq_unlock(sc, txq);
-					break;
-				} else {
-					txq->axq_tx_inprogress = true;
-				}
+	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+		txq = sc->tx.txq_map[i];
+
+		ath_txq_lock(sc, txq);
+		if (txq->axq_depth) {
+			if (txq->axq_tx_inprogress) {
+				needreset = true;
+				ath_txq_unlock(sc, txq);
+				break;
+			} else {
+				txq->axq_tx_inprogress = true;
 			}
-			ath_txq_unlock_complete(sc, txq);
 		}
+		ath_txq_unlock_complete(sc, txq);
+	}
 
 	if (needreset) {
 		ath_dbg(ath9k_hw_common(sc->sc_ah), RESET,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 083/171 ] ath9k: avoid queueing hw check work when suspended
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (81 preceding siblings ...)
  2013-04-11 20:26 ` [ 082/171 ] ath9k: limit tx path hang check to normal data queues Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 084/171 ] HID: usbhid: quirk for Realtek Multi-card reader Steven Rostedt
                   ` (87 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Parag Warudkar, Luis R. Rodriguez, John W. Linville

[-- Attachment #1: 0083-ath9k-avoid-queueing-hw-check-work-when-suspended.patch --]
[-- Type: text/plain, Size: 1777 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

[ Upstream commit 7fc0357479eeff4ca808c4d8c09bc7631f576b8d ]

The following issue was reported.

WARNING: at net/mac80211/util.c:599 ieee80211_can_queue_work.isra.7+0x32/0x40 [mac80211]()
Hardware name: iMac12,1
queueing ieee80211 work while going to suspend
Pid: 0, comm: swapper/0 Tainted: PF          O 3.8.2-206.fc18.x86_64 #1
Call Trace: Mar 16 09:39:17 Parags-iMac kernel: [ 3993.642992]  <IRQ>
[<ffffffff8105e61f>] warn_slowpath_common+0x7f/0xc0
[<ffffffffa0581420>] ? ath_start_rx_poll+0x70/0x70 [ath9k]
<ffffffff8105e716>] warn_slowpath_fmt+0x46/0x50
[<ffffffffa045b542>] ieee80211_can_queue_work.isra.7+0x32/0x40

Fix this by avoiding to queue the work if our device has
already been marked as suspended or stopped.

Reported-by: Parag Warudkar <parag.lkml@gmail.com>
Tested-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/ath/ath9k/link.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index 62b58ba..b99514f 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -173,7 +173,8 @@ void ath_rx_poll(unsigned long data)
 {
 	struct ath_softc *sc = (struct ath_softc *)data;
 
-	ieee80211_queue_work(sc->hw, &sc->hw_check_work);
+	if (!test_bit(SC_OP_INVALID, &sc->sc_flags))
+		ieee80211_queue_work(sc->hw, &sc->hw_check_work);
 }
 
 /*
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 084/171 ] HID: usbhid: quirk for Realtek Multi-card reader
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (82 preceding siblings ...)
  2013-04-11 20:26 ` [ 083/171 ] ath9k: avoid queueing hw check work when suspended Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 085/171 ] HID: usbhid: quirk for MSI GX680R led panel Steven Rostedt
                   ` (86 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Josh Boyer, Jiri Kosina

[-- Attachment #1: 0084-HID-usbhid-quirk-for-Realtek-Multi-card-reader.patch --]
[-- Type: text/plain, Size: 2073 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josh Boyer <jwboyer@redhat.com>

[ Upstream commit 3d464d9b71ef2f2b40a4bc9dcf06794fd1be9d12 ]

This device needs to be added to the quirks list with HID_QUIRK_NO_INIT_REPORTS,
otherwise it causes 10 seconds timeout during report initialization.

This fixes Red Hat bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=806587

Cc: stable@vger.kernel.org
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/hid/hid-ids.h           |    3 +++
 drivers/hid/usbhid/hid-quirks.c |    1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ab8ce9f..9966388 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -657,6 +657,9 @@
 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008		0x3008
 #define USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN	0x3001
 
+#define USB_VENDOR_ID_REALTEK		0x0bda
+#define USB_DEVICE_ID_REALTEK_READER	0x0152
+
 #define USB_VENDOR_ID_ROCCAT		0x1e7d
 #define USB_DEVICE_ID_ROCCAT_ARVO	0x30d4
 #define USB_DEVICE_ID_ROCCAT_ISKU	0x319c
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 8865fa3..984f2e5 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -78,6 +78,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET },
+	{ USB_VENDOR_ID_REALTEK, USB_DEVICE_ID_REALTEK_READER, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 085/171 ] HID: usbhid: quirk for MSI GX680R led panel
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (83 preceding siblings ...)
  2013-04-11 20:26 ` [ 084/171 ] HID: usbhid: quirk for Realtek Multi-card reader Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 086/171 ] HID: usbhid: fix build problem Steven Rostedt
                   ` (85 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Josh Boyer, Jiri Kosina

[-- Attachment #1: 0085-HID-usbhid-quirk-for-MSI-GX680R-led-panel.patch --]
[-- Type: text/plain, Size: 1986 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josh Boyer <jwboyer@redhat.com>

[ Upstream commit 620ae90ed8ca8b6e40cb9e10279b4f5ef9f0ab81 ]

This keyboard backlight device causes a 10 second delay to boot.  Add it
to the quirk list with HID_QUIRK_NO_INIT_REPORTS.

This fixes Red Hat bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=907221

Cc: stable@vger.kernel.org
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/hid/hid-ids.h           |    3 +++
 drivers/hid/usbhid/hid-quirks.c |    1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 9966388..b4fc436 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -566,6 +566,9 @@
 #define USB_VENDOR_ID_MONTEREY		0x0566
 #define USB_DEVICE_ID_GENIUS_KB29E	0x3004
 
+#define USB_VENDOR_ID_MSI		0x1770
+#define USB_DEVICE_ID_MSI_GX680R_LED_PANEL	0xff00
+
 #define USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR 0x0400
 #define USB_DEVICE_ID_N_S_HARMONY	0xc359
 
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 984f2e5..cd125e1 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -72,6 +72,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
+	{ USB_VENDIR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 086/171 ] HID: usbhid: fix build problem
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (84 preceding siblings ...)
  2013-04-11 20:26 ` [ 085/171 ] HID: usbhid: quirk for MSI GX680R led panel Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 087/171 ] rtlwifi: usb: add missing freeing of skbuff Steven Rostedt
                   ` (84 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jiri Kosina

[-- Attachment #1: 0086-HID-usbhid-fix-build-problem.patch --]
[-- Type: text/plain, Size: 1473 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jiri Kosina <jkosina@suse.cz>

[ Upstream commit 570637dc8eeb2faba06228d497ff40bb019bcc93 ]

Fix build problem caused by typo introduced by 620ae90ed8
("HID: usbhid: quirk for MSI GX680R led panel").

Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/hid/usbhid/hid-quirks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index cd125e1..833d417 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -72,7 +72,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
-	{ USB_VENDIR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
+	{ USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 087/171 ] rtlwifi: usb: add missing freeing of skbuff
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (85 preceding siblings ...)
  2013-04-11 20:26 ` [ 086/171 ] HID: usbhid: fix build problem Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 088/171 ] b43: N-PHY: increase initial value of "mind" in RSSI calibration Steven Rostedt
                   ` (83 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jussi Kivilinna, Larry Finger, John W. Linville

[-- Attachment #1: 0087-rtlwifi-usb-add-missing-freeing-of-skbuff.patch --]
[-- Type: text/plain, Size: 1028 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jussi Kivilinna <jussi.kivilinna@iki.fi>

[ Upstream commit 36ef0b473fbf43d5db23eea4616cc1d18cec245f ]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/rtlwifi/usb.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index aa970fc..98b0d6d 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -842,6 +842,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 	if (unlikely(!_urb)) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
 			 "Can't allocate urb. Drop skb!\n");
+		kfree_skb(skb);
 		return;
 	}
 	urb_list = &rtlusb->tx_pending[ep_num];
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 088/171 ] b43: N-PHY: increase initial value of "mind" in RSSI calibration
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (86 preceding siblings ...)
  2013-04-11 20:26 ` [ 087/171 ] rtlwifi: usb: add missing freeing of skbuff Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 089/171 ] b43: A fix for DMA transmission sequence errors Steven Rostedt
                   ` (82 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Rafał Miłecki, John W. Linville

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0088-b43-N-PHY-increase-initial-value-of-mind-in-RSSI-cal.patch --]
[-- Type: text/plain, Size: 1608 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>

[ Upstream commit e67dd874e60529dbd2e8232babb1e23479ba2ffa ]

We're using "mind" variable to find the VCM that got the best polling
results. For each VCM we calculte "currd" which is compared to the
"mind". For PHY rev3+ "currd" gets values around 14k-40k. Looking for a
value smaller than 40 makes no sense, so increase the initial value.

This fixes a regression introduced in 3.4 by commit:
e0c9a0219a8f542e3946fe972a68aacf8c3f906c
(my BCM4322 performance dropped from 18,4Mb/s to 9,26Mb/s)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/b43/phy_n.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index b92bb9c..e167a88 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1371,7 +1371,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
 		}
 		for (i = 0; i < 4; i += 2) {
 			s32 curr;
-			s32 mind = 40;
+			s32 mind = 0x100000;
 			s32 minpoll = 249;
 			u8 minvcm = 0;
 			if (2 * core != i)
@@ -1555,7 +1555,7 @@ static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
 	}
 
 	for (i = 0; i < 4; i++) {
-		s32 mind = 40;
+		s32 mind = 0x100000;
 		u8 minvcm = 0;
 		s32 minpoll = 249;
 		s32 curr;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 089/171 ] b43: A fix for DMA transmission sequence errors
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (87 preceding siblings ...)
  2013-04-11 20:26 ` [ 088/171 ] b43: N-PHY: increase initial value of "mind" in RSSI calibration Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 090/171 ] b43: N-PHY: use more bits for offset in RSSI calibration Steven Rostedt
                   ` (81 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Chris Vine, Larry Finger, John W. Linville

[-- Attachment #1: 0089-b43-A-fix-for-DMA-transmission-sequence-errors.patch --]
[-- Type: text/plain, Size: 5568 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Iestyn C. Elfick" <isedev@gmail.com>

[ Upstream commit b251412db99ccd4495ce372fec7daee27bf06923 ]

Intermittently, b43 will report "Out of order TX status report on DMA ring".
When this happens, the driver must be reset before communication can resume.
The cause of the problem is believed to be an error in the closed-source
firmware; however, all versions of the firmware are affected.

This change uses the observation that the expected status is always 2 less
than the observed value, and supplies a fake status report to skip one
header/data pair.

Not all devices suffer from this problem, but it can occur several times
per second under heavy load. As each occurence kills the unmodified driver,
this patch makes if possible for the affected devices to function. The patch
logs only the first instance of the reset operation to prevent spamming
the logs.

Tested-by: Chris Vine <chris@cvine.freeserve.co.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/b43/dma.c |   65 ++++++++++++++++++++++++++++++++--------
 1 file changed, 53 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 777cd74..92768d304 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1484,8 +1484,12 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 	const struct b43_dma_ops *ops;
 	struct b43_dmaring *ring;
 	struct b43_dmadesc_meta *meta;
+	static const struct b43_txstatus fake; /* filled with 0 */
+	const struct b43_txstatus *txstat;
 	int slot, firstused;
 	bool frame_succeed;
+	int skip;
+	static u8 err_out1, err_out2;
 
 	ring = parse_cookie(dev, status->cookie, &slot);
 	if (unlikely(!ring))
@@ -1498,13 +1502,36 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 	firstused = ring->current_slot - ring->used_slots + 1;
 	if (firstused < 0)
 		firstused = ring->nr_slots + firstused;
+
+	skip = 0;
 	if (unlikely(slot != firstused)) {
 		/* This possibly is a firmware bug and will result in
-		 * malfunction, memory leaks and/or stall of DMA functionality. */
-		b43dbg(dev->wl, "Out of order TX status report on DMA ring %d. "
-		       "Expected %d, but got %d\n",
-		       ring->index, firstused, slot);
-		return;
+		 * malfunction, memory leaks and/or stall of DMA functionality.
+		 */
+		if (slot == next_slot(ring, next_slot(ring, firstused))) {
+			/* If a single header/data pair was missed, skip over
+			 * the first two slots in an attempt to recover.
+			 */
+			slot = firstused;
+			skip = 2;
+			if (!err_out1) {
+				/* Report the error once. */
+				b43dbg(dev->wl,
+				       "Skip on DMA ring %d slot %d.\n",
+				       ring->index, slot);
+				err_out1 = 1;
+			}
+		} else {
+			/* More than a single header/data pair were missed.
+			 * Report this error once.
+			 */
+			if (!err_out2)
+				b43dbg(dev->wl,
+				       "Out of order TX status report on DMA ring %d. Expected %d, but got %d\n",
+				       ring->index, firstused, slot);
+			err_out2 = 1;
+			return;
+		}
 	}
 
 	ops = ring->ops;
@@ -1519,11 +1546,13 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 			       slot, firstused, ring->index);
 			break;
 		}
+
 		if (meta->skb) {
 			struct b43_private_tx_info *priv_info =
-				b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb));
+			     b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb));
 
-			unmap_descbuffer(ring, meta->dmaaddr, meta->skb->len, 1);
+			unmap_descbuffer(ring, meta->dmaaddr,
+					 meta->skb->len, 1);
 			kfree(priv_info->bouncebuffer);
 			priv_info->bouncebuffer = NULL;
 		} else {
@@ -1535,8 +1564,9 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 			struct ieee80211_tx_info *info;
 
 			if (unlikely(!meta->skb)) {
-				/* This is a scatter-gather fragment of a frame, so
-				 * the skb pointer must not be NULL. */
+				/* This is a scatter-gather fragment of a frame,
+				 * so the skb pointer must not be NULL.
+				 */
 				b43dbg(dev->wl, "TX status unexpected NULL skb "
 				       "at slot %d (first=%d) on ring %d\n",
 				       slot, firstused, ring->index);
@@ -1547,9 +1577,18 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 
 			/*
 			 * Call back to inform the ieee80211 subsystem about
-			 * the status of the transmission.
+			 * the status of the transmission. When skipping over
+			 * a missed TX status report, use a status structure
+			 * filled with zeros to indicate that the frame was not
+			 * sent (frame_count 0) and not acknowledged
 			 */
-			frame_succeed = b43_fill_txstatus_report(dev, info, status);
+			if (unlikely(skip))
+				txstat = &fake;
+			else
+				txstat = status;
+
+			frame_succeed = b43_fill_txstatus_report(dev, info,
+								 txstat);
 #ifdef CONFIG_B43_DEBUG
 			if (frame_succeed)
 				ring->nr_succeed_tx_packets++;
@@ -1577,12 +1616,14 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
 		/* Everything unmapped and free'd. So it's not used anymore. */
 		ring->used_slots--;
 
-		if (meta->is_last_fragment) {
+		if (meta->is_last_fragment && !skip) {
 			/* This is the last scatter-gather
 			 * fragment of the frame. We are done. */
 			break;
 		}
 		slot = next_slot(ring, slot);
+		if (skip > 0)
+			--skip;
 	}
 	if (ring->stopped) {
 		B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 090/171 ] b43: N-PHY: use more bits for offset in RSSI calibration
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (88 preceding siblings ...)
  2013-04-11 20:26 ` [ 089/171 ] b43: A fix for DMA transmission sequence errors Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 091/171 ] tg3: fix length overflow in VPD firmware parsing Steven Rostedt
                   ` (80 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Rafał Miłecki, John W. Linville

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0090-b43-N-PHY-use-more-bits-for-offset-in-RSSI-calibrati.patch --]
[-- Type: text/plain, Size: 1633 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>

[ Upstream commit 2e1253d640eb7f8707d2591c93097c1e9f9c71d5 ]

When calculating "offset" for final RSSI calibration we're using numbers
bigger than s8 can hold. We have for example:
offset[j] = 232 - poll_results[j];
formula. If poll_results[j] is small enough (it usually is) we treat
number's bit as a sign bit. For example 232 - 1 becomes:
0xE8 - 0x1 = 0xE7, which is not 231 but -25.

This code was introduced in e0c9a0219a8f542e3946fe972a68aacf8c3f906c
and caused stability regression on some cards, for ex. BCM4322.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/b43/phy_n.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index e167a88..914718a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1320,7 +1320,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
 	u16 clip_off[2] = { 0xFFFF, 0xFFFF };
 
 	u8 vcm_final = 0;
-	s8 offset[4];
+	s32 offset[4];
 	s32 results[8][4] = { };
 	s32 results_min[4] = { };
 	s32 poll_results[4] = { };
@@ -1488,7 +1488,7 @@ static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
 	u8 regs_save_radio[2];
 	u16 regs_save_phy[2];
 
-	s8 offset[4];
+	s32 offset[4];
 	u8 core;
 	u8 rail;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 091/171 ] tg3: fix length overflow in VPD firmware parsing
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (89 preceding siblings ...)
  2013-04-11 20:26 ` [ 090/171 ] b43: N-PHY: use more bits for offset in RSSI calibration Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 092/171 ] mac80211: always synchronize_net() during station removal Steven Rostedt
                   ` (79 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Kees Cook, Oded Horovitz, Brad Spengler, Matt Carlson,
	David S. Miller

[-- Attachment #1: 0091-tg3-fix-length-overflow-in-VPD-firmware-parsing.patch --]
[-- Type: text/plain, Size: 1744 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Kees Cook <keescook@chromium.org>

[ Upstream commit 715230a44310a8cf66fbfb5a46f9a62a9b2de424 ]

Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.

Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string length (32 bytes). On overflow,
truncate the formatted firmware string instead of potentially overwriting
portions of the tg3 struct.

http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf

Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Oded Horovitz <oded@privatecore.com>
Reported-by: Brad Spengler <spender@grsecurity.net>
Cc: stable@vger.kernel.org
Cc: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/broadcom/tg3.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index fdb4c52..440e963 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -13867,8 +13867,11 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
 		if (j + len > block_end)
 			goto partno;
 
-		memcpy(tp->fw_ver, &vpd_data[j], len);
-		strncat(tp->fw_ver, " bc ", vpdlen - len - 1);
+		if (len >= sizeof(tp->fw_ver))
+			len = sizeof(tp->fw_ver) - 1;
+		memset(tp->fw_ver, 0, sizeof(tp->fw_ver));
+		snprintf(tp->fw_ver, sizeof(tp->fw_ver), "%.*s bc ", len,
+			 &vpd_data[j]);
 	}
 
 partno:
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 092/171 ] mac80211: always synchronize_net() during station removal
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (90 preceding siblings ...)
  2013-04-11 20:26 ` [ 091/171 ] tg3: fix length overflow in VPD firmware parsing Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 093/171 ] iommu/amd: Make sure dma_ops are set for hotplug devices Steven Rostedt
                   ` (78 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johannes Berg

[-- Attachment #1: 0092-mac80211-always-synchronize_net-during-station-remov.patch --]
[-- Type: text/plain, Size: 1767 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johannes Berg <johannes.berg@intel.com>

[ Upstream commit 27a737ff7cb062fb9cbceba9b44d60aa74862bfa ]

If there are keys left during station removal, then a
synchronize_net() will be done (for each key, I have a
patch to address this for 3.10), otherwise it won't be
done at all which causes issues because the station
could be used for TX while it's being removed from the
driver -- that might confuse the driver.

Fix this by always doing synchronize_net() if no key
was present any more.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/mac80211/sta_info.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 31aa8b8..d82dec3 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -656,6 +656,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
 	struct ieee80211_sub_if_data *sdata;
 	int ret, i, ac;
 	struct tid_ampdu_tx *tid_tx;
+	bool have_key = false;
 
 	might_sleep();
 
@@ -683,12 +684,19 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
 	list_del_rcu(&sta->list);
 
 	mutex_lock(&local->key_mtx);
-	for (i = 0; i < NUM_DEFAULT_KEYS; i++)
+	for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
 		__ieee80211_key_free(key_mtx_dereference(local, sta->gtk[i]));
-	if (sta->ptk)
+		have_key = true;
+	}
+	if (sta->ptk) {
 		__ieee80211_key_free(key_mtx_dereference(local, sta->ptk));
+		have_key = true;
+	}
 	mutex_unlock(&local->key_mtx);
 
+	if (!have_key)
+		synchronize_net();
+
 	sta->dead = true;
 
 	local->num_sta--;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 093/171 ] iommu/amd: Make sure dma_ops are set for hotplug devices
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (91 preceding siblings ...)
  2013-04-11 20:26 ` [ 092/171 ] mac80211: always synchronize_net() during station removal Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 094/171 ] xen/blkback: correctly respond to unknown, non-native requests Steven Rostedt
                   ` (77 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Andreas Degert, Joerg Roedel

[-- Attachment #1: 0093-iommu-amd-Make-sure-dma_ops-are-set-for-hotplug-devi.patch --]
[-- Type: text/plain, Size: 1785 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Joerg Roedel <joro@8bytes.org>

[ Upstream commit c2a2876e863356b092967ea62bebdb4dd663af80 ]

There is a bug introduced with commit 27c2127 that causes
devices which are hot unplugged and then hot-replugged to
not have per-device dma_ops set. This causes these devices
to not function correctly. Fixed with this patch.

Cc: stable@vger.kernel.org
Reported-by: Andreas Degert <andreas.degert@googlemail.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/iommu/amd_iommu.c |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index e89daf1..c698cf6 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2337,18 +2337,16 @@ static int device_change_notifier(struct notifier_block *nb,
 
 		/* allocate a protection domain if a device is added */
 		dma_domain = find_protection_domain(devid);
-		if (dma_domain)
-			goto out;
-		dma_domain = dma_ops_domain_alloc();
-		if (!dma_domain)
-			goto out;
-		dma_domain->target_dev = devid;
-
-		spin_lock_irqsave(&iommu_pd_list_lock, flags);
-		list_add_tail(&dma_domain->list, &iommu_pd_list);
-		spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
-
-		dev_data = get_dev_data(dev);
+		if (!dma_domain) {
+			dma_domain = dma_ops_domain_alloc();
+			if (!dma_domain)
+				goto out;
+			dma_domain->target_dev = devid;
+
+			spin_lock_irqsave(&iommu_pd_list_lock, flags);
+			list_add_tail(&dma_domain->list, &iommu_pd_list);
+			spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
+		}
 
 		dev->archdata.dma_ops = &amd_iommu_dma_ops;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 094/171 ] xen/blkback: correctly respond to unknown, non-native requests
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (92 preceding siblings ...)
  2013-04-11 20:26 ` [ 093/171 ] iommu/amd: Make sure dma_ops are set for hotplug devices Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 095/171 ] xen-blkback: fix dispatch_rw_block_io() error path Steven Rostedt
                   ` (76 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: David Vrabel, Konrad Rzeszutek Wilk

[-- Attachment #1: 0094-xen-blkback-correctly-respond-to-unknown-non-native-.patch --]
[-- Type: text/plain, Size: 5890 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: David Vrabel <david.vrabel@citrix.com>

[ Upstream commit 0e367ae46503cfe7791460c8ba8434a5d60b2bd5 ]

If the frontend is using a non-native protocol (e.g., a 64-bit
frontend with a 32-bit backend) and it sent an unrecognized request,
the request was not translated and the response would have the
incorrect ID.  This may cause the frontend driver to behave
incorrectly or crash.

Since the ID field in the request is always in the same place,
regardless of the request type we can get the correct ID and make a
valid response (which will report BLKIF_RSP_EOPNOTSUPP).

This bug affected 64-bit SLES 11 guests when using a 32-bit backend.
This guest does a BLKIF_OP_RESERVED_1 (BLKIF_OP_PACKET in the SLES
source) and would crash in blkif_int() as the ID in the response would
be invalid.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/xen-blkback/blkback.c |   31 +++++++++++++++++++++++++++----
 drivers/block/xen-blkback/common.h  |   25 +++++++++++++++++++++++++
 include/xen/interface/io/blkif.h    |   10 ++++++++++
 3 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c6decb9..c85d91a 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -422,6 +422,16 @@ static int dispatch_discard_io(struct xen_blkif *blkif,
 	return err;
 }
 
+static int dispatch_other_io(struct xen_blkif *blkif,
+			     struct blkif_request *req,
+			     struct pending_req *pending_req)
+{
+	free_req(pending_req);
+	make_response(blkif, req->u.other.id, req->operation,
+		      BLKIF_RSP_EOPNOTSUPP);
+	return -EIO;
+}
+
 static void xen_blk_drain_io(struct xen_blkif *blkif)
 {
 	atomic_set(&blkif->drain, 1);
@@ -543,17 +553,30 @@ __do_block_io_op(struct xen_blkif *blkif)
 
 		/* Apply all sanity checks to /private copy/ of request. */
 		barrier();
-		if (unlikely(req.operation == BLKIF_OP_DISCARD)) {
+
+		switch (req.operation) {
+		case BLKIF_OP_READ:
+		case BLKIF_OP_WRITE:
+		case BLKIF_OP_WRITE_BARRIER:
+		case BLKIF_OP_FLUSH_DISKCACHE:
+			if (dispatch_rw_block_io(blkif, &req, pending_req))
+				goto done;
+			break;
+		case BLKIF_OP_DISCARD:
 			free_req(pending_req);
 			if (dispatch_discard_io(blkif, &req))
-				break;
-		} else if (dispatch_rw_block_io(blkif, &req, pending_req))
+				goto done;
+			break;
+		default:
+			if (dispatch_other_io(blkif, &req, pending_req))
+				goto done;
 			break;
+		}
 
 		/* Yield point for this unbounded loop. */
 		cond_resched();
 	}
-
+done:
 	return more_to_do;
 }
 
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 9ad3b5e..fc2a486 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -76,11 +76,18 @@ struct blkif_x86_32_request_discard {
 	uint64_t       nr_sectors;
 } __attribute__((__packed__));
 
+struct blkif_x86_32_request_other {
+	uint8_t        _pad1;
+	blkif_vdev_t   _pad2;
+	uint64_t       id;           /* private guest value, echoed in resp  */
+} __attribute__((__packed__));
+
 struct blkif_x86_32_request {
 	uint8_t        operation;    /* BLKIF_OP_???                         */
 	union {
 		struct blkif_x86_32_request_rw rw;
 		struct blkif_x86_32_request_discard discard;
+		struct blkif_x86_32_request_other other;
 	} u;
 } __attribute__((__packed__));
 
@@ -112,11 +119,19 @@ struct blkif_x86_64_request_discard {
 	uint64_t       nr_sectors;
 } __attribute__((__packed__));
 
+struct blkif_x86_64_request_other {
+	uint8_t        _pad1;
+	blkif_vdev_t   _pad2;
+	uint32_t       _pad3;        /* offsetof(blkif_..,u.discard.id)==8   */
+	uint64_t       id;           /* private guest value, echoed in resp  */
+} __attribute__((__packed__));
+
 struct blkif_x86_64_request {
 	uint8_t        operation;    /* BLKIF_OP_???                         */
 	union {
 		struct blkif_x86_64_request_rw rw;
 		struct blkif_x86_64_request_discard discard;
+		struct blkif_x86_64_request_other other;
 	} u;
 } __attribute__((__packed__));
 
@@ -262,6 +277,11 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst,
 		dst->u.discard.nr_sectors = src->u.discard.nr_sectors;
 		break;
 	default:
+		/*
+		 * Don't know how to translate this op. Only get the
+		 * ID so failure can be reported to the frontend.
+		 */
+		dst->u.other.id = src->u.other.id;
 		break;
 	}
 }
@@ -293,6 +313,11 @@ static inline void blkif_get_x86_64_req(struct blkif_request *dst,
 		dst->u.discard.nr_sectors = src->u.discard.nr_sectors;
 		break;
 	default:
+		/*
+		 * Don't know how to translate this op. Only get the
+		 * ID so failure can be reported to the frontend.
+		 */
+		dst->u.other.id = src->u.other.id;
 		break;
 	}
 }
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index ee338bf..2af8fdb 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -138,11 +138,21 @@ struct blkif_request_discard {
 	uint8_t        _pad3;
 } __attribute__((__packed__));
 
+struct blkif_request_other {
+	uint8_t      _pad1;
+	blkif_vdev_t _pad2;        /* only for read/write requests         */
+#ifdef CONFIG_X86_64
+	uint32_t     _pad3;        /* offsetof(blkif_req..,u.other.id)==8*/
+#endif
+	uint64_t     id;           /* private guest value, echoed in resp  */
+} __attribute__((__packed__));
+
 struct blkif_request {
 	uint8_t        operation;    /* BLKIF_OP_???                         */
 	union {
 		struct blkif_request_rw rw;
 		struct blkif_request_discard discard;
+		struct blkif_request_other other;
 	} u;
 } __attribute__((__packed__));
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 095/171 ] xen-blkback: fix dispatch_rw_block_io() error path
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (93 preceding siblings ...)
  2013-04-11 20:26 ` [ 094/171 ] xen/blkback: correctly respond to unknown, non-native requests Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 096/171 ] tty: atmel_serial_probe(): index of atmel_ports[] fix Steven Rostedt
                   ` (75 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jan Beulich, Konrad Rzeszutek Wilk

[-- Attachment #1: 0095-xen-blkback-fix-dispatch_rw_block_io-error-path.patch --]
[-- Type: text/plain, Size: 1797 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Jan Beulich <JBeulich@suse.com>

[ Upstream commit 0e5e098ac22dae38f957e951b70d3cf73beff0f7 ]

Commit 7708992 ("xen/blkback: Seperate the bio allocation and the bio
submission") consolidated the pendcnt updates to just a single write,
neglecting the fact that the error path relied on it getting set to 1
up front (such that the decrement in __end_block_io_op() would actually
drop the count to zero, triggering the necessary cleanup actions).

Also remove a misleading and a stale (after said commit) comment.

CC: stable@vger.kernel.org
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/xen-blkback/blkback.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c85d91a..4fd1dea 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -743,13 +743,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		bio->bi_end_io  = end_block_io_op;
 	}
 
-	/*
-	 * We set it one so that the last submit_bio does not have to call
-	 * atomic_inc.
-	 */
 	atomic_set(&pending_req->pendcnt, nbio);
-
-	/* Get a reference count for the disk queue and start sending I/O */
 	blk_start_plug(&plug);
 
 	for (i = 0; i < nbio; i++)
@@ -777,6 +771,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
  fail_put_bio:
 	for (i = 0; i < nbio; i++)
 		bio_put(biolist[i]);
+	atomic_set(&pending_req->pendcnt, 1);
 	__end_block_io_op(pending_req, -EINVAL);
 	msleep(1); /* back off a bit */
 	return -EIO;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 096/171 ] tty: atmel_serial_probe(): index of atmel_ports[] fix
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (94 preceding siblings ...)
  2013-04-11 20:26 ` [ 095/171 ] xen-blkback: fix dispatch_rw_block_io() error path Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 097/171 ] usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD Steven Rostedt
                   ` (74 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pawel Wieczorkiewicz, Nicolas Ferre, Greg Kroah-Hartman

[-- Attachment #1: 0096-tty-atmel_serial_probe-index-of-atmel_ports-fix.patch --]
[-- Type: text/plain, Size: 2032 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Pawel Wieczorkiewicz <wpawel@gmail.com>

[ Upstream commit 503bded92da283b2f31d87e054c4c6d30c3c2340 ]

Index of atmel_ports[ATMEL_MAX_UART] should be smaller
than ATMEL_MAX_UART.

Signed-off-by: Pawel Wieczorkiewicz <wpawel@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/tty/serial/atmel_serial.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 3d7e1ee..ed7cd37 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -159,7 +159,7 @@ struct atmel_uart_port {
 };
 
 static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
-static unsigned long atmel_ports_in_use;
+static DECLARE_BITMAP(atmel_ports_in_use, ATMEL_MAX_UART);
 
 #ifdef SUPPORT_SYSRQ
 static struct console atmel_console;
@@ -1785,15 +1785,14 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
 	if (ret < 0)
 		/* port id not found in platform data nor device-tree aliases:
 		 * auto-enumerate it */
-		ret = find_first_zero_bit(&atmel_ports_in_use,
-				sizeof(atmel_ports_in_use));
+		ret = find_first_zero_bit(atmel_ports_in_use, ATMEL_MAX_UART);
 
-	if (ret > ATMEL_MAX_UART) {
+	if (ret >= ATMEL_MAX_UART) {
 		ret = -ENODEV;
 		goto err;
 	}
 
-	if (test_and_set_bit(ret, &atmel_ports_in_use)) {
+	if (test_and_set_bit(ret, atmel_ports_in_use)) {
 		/* port already in use */
 		ret = -EBUSY;
 		goto err;
@@ -1867,7 +1866,7 @@ static int __devexit atmel_serial_remove(struct platform_device *pdev)
 
 	/* "port" is allocated statically, so we shouldn't free it */
 
-	clear_bit(port->line, &atmel_ports_in_use);
+	clear_bit(port->line, atmel_ports_in_use);
 
 	clk_put(atmel_port->clk);
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 097/171 ] usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (95 preceding siblings ...)
  2013-04-11 20:26 ` [ 096/171 ] tty: atmel_serial_probe(): index of atmel_ports[] fix Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 098/171 ] vt: synchronize_rcu() under spinlock is not nice Steven Rostedt
                   ` (73 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Konstantin Holoborodko, Greg Kroah-Hartman

[-- Attachment #1: 0097-usb-ftdi_sio-Add-support-for-Mitsubishi-FX-USB-AW-BD.patch --]
[-- Type: text/plain, Size: 2020 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Konstantin Holoborodko <klh.kernel@gmail.com>

[ Upstream commit 482b0b5d82bd916cc0c55a2abf65bdc69023b843 ]

It enhances the driver for FTDI-based USB serial adapters
to recognize Mitsubishi Electric Corp. USB/RS422 Converters
as FT232BM chips and support them.
https://search.meau.com/?q=FX-USB-AW

Signed-off-by: Konstantin Holoborodko <klh.kernel@gmail.com>
Tested-by: Konstantin Holoborodko <klh.kernel@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ftdi_sio.c     |    1 +
 drivers/usb/serial/ftdi_sio_ids.h |    7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 360bdeb..edf6bb4 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -647,6 +647,7 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
 	{ USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) },
 	{ USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) },
+	{ USB_DEVICE(MITSUBISHI_VID, MITSUBISHI_FXUSB_PID) },
 	{ USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
 	{ USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
 	{ USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 049b6e7..4801983 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -577,6 +577,13 @@
 #define CONTEC_COM1USBH_PID	0x8311	/* COM-1(USB)H */
 
 /*
+ * Mitsubishi Electric Corp. (http://www.meau.com)
+ * Submitted by Konstantin Holoborodko
+ */
+#define MITSUBISHI_VID		0x06D3
+#define MITSUBISHI_FXUSB_PID	0x0284 /* USB/RS422 converters: FX-USB-AW/-BD */
+
+/*
  * Definitions for B&B Electronics products.
  */
 #define BANDB_VID		0x0856	/* B&B Electronics Vendor ID */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 098/171 ] vt: synchronize_rcu() under spinlock is not nice...
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (96 preceding siblings ...)
  2013-04-11 20:26 ` [ 097/171 ] usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 099/171 ] mwifiex: fix race when queuing commands Steven Rostedt
                   ` (72 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Al Viro

[-- Attachment #1: 0098-vt-synchronize_rcu-under-spinlock-is-not-nice.patch --]
[-- Type: text/plain, Size: 1398 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@zeniv.linux.org.uk>

[ Upstream commit e8cd81693bbbb15db57d3c9aa7dd90eda4842874 ]

vcs_poll_data_free() calls unregister_vt_notifier(), which calls
atomic_notifier_chain_unregister(), which calls synchronize_rcu().
Do it *after* we'd dropped ->f_lock.

Cc: stable@vger.kernel.org (all kernels since 2.6.37)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/tty/vt/vc_screen.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index fa7268a..6abb92c 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -93,7 +93,7 @@ vcs_poll_data_free(struct vcs_poll_data *poll)
 static struct vcs_poll_data *
 vcs_poll_data_get(struct file *file)
 {
-	struct vcs_poll_data *poll = file->private_data;
+	struct vcs_poll_data *poll = file->private_data, *kill = NULL;
 
 	if (poll)
 		return poll;
@@ -122,10 +122,12 @@ vcs_poll_data_get(struct file *file)
 		file->private_data = poll;
 	} else {
 		/* someone else raced ahead of us */
-		vcs_poll_data_free(poll);
+		kill = poll;
 		poll = file->private_data;
 	}
 	spin_unlock(&file->f_lock);
+	if (kill)
+		vcs_poll_data_free(kill);
 
 	return poll;
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 099/171 ] mwifiex: fix race when queuing commands
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (97 preceding siblings ...)
  2013-04-11 20:26 ` [ 098/171 ] vt: synchronize_rcu() under spinlock is not nice Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 21:29   ` Bing Zhao
  2013-04-11 20:26 ` [ 100/171 ] mwifiex: skip pending commands after function shutdown Steven Rostedt
                   ` (71 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Daniel Drake, Marco Cesarano, Amitkumar Karwar, Bing Zhao,
	John W. Linville

[-- Attachment #1: 0099-mwifiex-fix-race-when-queuing-commands.patch --]
[-- Type: text/plain, Size: 5603 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Amitkumar Karwar <akarwar@marvell.com>

[ Upstream commit 00d7ea11ff0783e24fe70778f3141270b561aaa1 ]

Running the following script repeatedly on XO-4 with SD8787
produces command timeout and system lockup.

insmod mwifiex_sdio.ko
sleep 1
ifconfig eth0 up
iwlist eth0 scan &
sleep 0.5
rmmod mwifiex_sdio

mwifiex_send_cmd_async() is called for sync as well as async
commands. (mwifiex_send_cmd_sync() internally calls it for
sync command.)

"adapter->cmd_queued" gets filled inside mwifiex_send_cmd_async()
routine for both types of commands. But it is used only for sync
commands in mwifiex_wait_queue_complete(). This could lead to a
race when two threads try to queue a sync command with another
sync/async command simultaneously.

Get rid of global variable and pass command node as a parameter
to mwifiex_wait_queue_complete() to fix the problem.

Cc: <stable@vger.kernel.org> # 3.8
Reported-by: Daniel Drake <dsd@laptop.org>
Tested-by: Daniel Drake <dsd@laptop.org>
Tested-by: Marco Cesarano <marco@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/mwifiex/cmdevt.c    |    5 ++---
 drivers/net/wireless/mwifiex/main.h      |    4 ++--
 drivers/net/wireless/mwifiex/scan.c      |    8 ++++----
 drivers/net/wireless/mwifiex/sta_ioctl.c |   10 ++--------
 4 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 95382f1..da50426 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -485,8 +485,6 @@ int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no,
 
 	ret = mwifiex_send_cmd_async(priv, cmd_no, cmd_action, cmd_oid,
 				     data_buf);
-	if (!ret)
-		ret = mwifiex_wait_queue_complete(adapter);
 
 	return ret;
 }
@@ -589,9 +587,10 @@ int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
 	if (cmd_no == HostCmd_CMD_802_11_SCAN) {
 		mwifiex_queue_scan_cmd(priv, cmd_node);
 	} else {
-		adapter->cmd_queued = cmd_node;
 		mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, true);
 		queue_work(adapter->workqueue, &adapter->main_work);
+		if (cmd_node->wait_q_enabled)
+			ret = mwifiex_wait_queue_complete(adapter, cmd_node);
 	}
 
 	return ret;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index e7c2a82..eab0daa 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -684,7 +684,6 @@ struct mwifiex_adapter {
 	u16 cmd_wait_q_required;
 	struct mwifiex_wait_queue cmd_wait_q;
 	u8 scan_wait_q_woken;
-	struct cmd_ctrl_node *cmd_queued;
 	spinlock_t queue_lock;		/* lock for tx queues */
 	struct completion fw_load;
 	u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
@@ -936,7 +935,8 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
 			struct mwifiex_multicast_list *mcast_list);
 int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
 			    struct net_device *dev);
-int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter);
+int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
+				struct cmd_ctrl_node *cmd_queued);
 int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
 		      struct cfg80211_ssid *req_ssid);
 int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 04dc7ca..0d3f98d 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1357,10 +1357,13 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
 			list_del(&cmd_node->list);
 			spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
 					       flags);
-			adapter->cmd_queued = cmd_node;
 			mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
 							true);
 			queue_work(adapter->workqueue, &adapter->main_work);
+
+			/* Perform internal scan synchronously */
+			if (!priv->scan_request)
+				mwifiex_wait_queue_complete(adapter, cmd_node);
 		} else {
 			spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
 					       flags);
@@ -1902,9 +1905,6 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
 		/* Normal scan */
 		ret = mwifiex_scan_networks(priv, NULL);
 
-	if (!ret)
-		ret = mwifiex_wait_queue_complete(priv->adapter);
-
 	if (ret == -1) {
 		priv->scan_pending_on_block = false;
 		up(&priv->async_sem);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index fb21360..b9d9952 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -51,17 +51,11 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  * This function waits on a cmd wait queue. It also cancels the pending
  * request after waking up, in case of errors.
  */
-int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
+int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
+				struct cmd_ctrl_node *cmd_queued)
 {
 	bool cancel_flag = false;
 	int status;
-	struct cmd_ctrl_node *cmd_queued;
-
-	if (!adapter->cmd_queued)
-		return 0;
-
-	cmd_queued = adapter->cmd_queued;
-	adapter->cmd_queued = NULL;
 
 	dev_dbg(adapter->dev, "cmd pending\n");
 	atomic_inc(&adapter->cmd_pending);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 100/171 ] mwifiex: skip pending commands after function shutdown
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (98 preceding siblings ...)
  2013-04-11 20:26 ` [ 099/171 ] mwifiex: fix race when queuing commands Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 101/171 ] pnfs-block: removing DM device maybe cause oops when call dev_remove Steven Rostedt
                   ` (70 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Daniel Drake, Marco Cesarano, Bing Zhao, Amitkumar Karwar,
	John W. Linville

[-- Attachment #1: 0100-mwifiex-skip-pending-commands-after-function-shutdow.patch --]
[-- Type: text/plain, Size: 2099 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Bing Zhao <bzhao@marvell.com>

[ Upstream commit a3e240cacc93a06bff3313e28938e980d01a2160 ]

During rmmod mwifiex_sdio processing FUNC_SHUTDOWN command is
sent to firmware. Firmware expcets only FUNC_INIT once WLAN
function is shut down.

Any command pending in the command queue should be ignored and
freed.

Cc: <stable@vger.kernel.org> # 3.8
Tested-by: Daniel Drake <dsd@laptop.org>
Tested-by: Marco Cesarano <marco@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/mwifiex/cmdevt.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index da50426..c65efd0 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -156,6 +156,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
 		return -1;
 	}
 
+	cmd_code = le16_to_cpu(host_cmd->command);
+	cmd_size = le16_to_cpu(host_cmd->size);
+
+	if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET &&
+	    cmd_code != HostCmd_CMD_FUNC_SHUTDOWN &&
+	    cmd_code != HostCmd_CMD_FUNC_INIT) {
+		dev_err(adapter->dev,
+			"DNLD_CMD: FW in reset state, ignore cmd %#x\n",
+			cmd_code);
+		mwifiex_complete_cmd(adapter, cmd_node);
+		mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
+		return -1;
+	}
+
 	/* Set command sequence number */
 	adapter->seq_num++;
 	host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
@@ -167,9 +181,6 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
 	adapter->curr_cmd = cmd_node;
 	spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
 
-	cmd_code = le16_to_cpu(host_cmd->command);
-	cmd_size = le16_to_cpu(host_cmd->size);
-
 	/* Adjust skb length */
 	if (cmd_node->cmd_skb->len > cmd_size)
 		/*
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 101/171 ] pnfs-block: removing DM device maybe cause oops when call dev_remove
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (99 preceding siblings ...)
  2013-04-11 20:26 ` [ 100/171 ] mwifiex: skip pending commands after function shutdown Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 102/171 ] NFSv4: Fix the string length returned by the idmapper Steven Rostedt
                   ` (69 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: fanchaoting, Trond Myklebust

[-- Attachment #1: 0101-pnfs-block-removing-DM-device-maybe-cause-oops-when-.patch --]
[-- Type: text/plain, Size: 1724 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: fanchaoting <fanchaoting@cn.fujitsu.com>

[ Upstream commit 4376c94618c26225e69e17b7c91169c45a90b292 ]

when pnfs block using device mapper,if umounting later,it maybe
cause oops. we apply "1 + sizeof(bl_umount_request)" memory for
msg->data, the memory maybe overflow when we do "memcpy(&dataptr
[sizeof(bl_msg)], &bl_umount_request, sizeof(bl_umount_request))",
because the size of bl_msg is more than 1 byte.

Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/nfs/blocklayout/blocklayoutdm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayoutdm.c b/fs/nfs/blocklayout/blocklayoutdm.c
index 737d839..6fc7b5c 100644
--- a/fs/nfs/blocklayout/blocklayoutdm.c
+++ b/fs/nfs/blocklayout/blocklayoutdm.c
@@ -55,7 +55,8 @@ static void dev_remove(struct net *net, dev_t dev)
 
 	bl_pipe_msg.bl_wq = &nn->bl_wq;
 	memset(msg, 0, sizeof(*msg));
-	msg->data = kzalloc(1 + sizeof(bl_umount_request), GFP_NOFS);
+	msg->len = sizeof(bl_msg) + bl_msg.totallen;
+	msg->data = kzalloc(msg->len, GFP_NOFS);
 	if (!msg->data)
 		goto out;
 
@@ -66,7 +67,6 @@ static void dev_remove(struct net *net, dev_t dev)
 	memcpy(msg->data, &bl_msg, sizeof(bl_msg));
 	dataptr = (uint8_t *) msg->data;
 	memcpy(&dataptr[sizeof(bl_msg)], &bl_umount_request, sizeof(bl_umount_request));
-	msg->len = sizeof(bl_msg) + bl_msg.totallen;
 
 	add_wait_queue(&nn->bl_wq, &wq);
 	if (rpc_queue_upcall(nn->bl_device_pipe, msg) < 0) {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 102/171 ] NFSv4: Fix the string length returned by the idmapper
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (100 preceding siblings ...)
  2013-04-11 20:26 ` [ 101/171 ] pnfs-block: removing DM device maybe cause oops when call dev_remove Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 103/171 ] NFSv4.1: Fix a race in pNFS layoutcommit Steven Rostedt
                   ` (68 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Dave Chiluk, Trond Myklebust, Bryan Schumaker

[-- Attachment #1: 0102-NFSv4-Fix-the-string-length-returned-by-the-idmapper.patch --]
[-- Type: text/plain, Size: 2133 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

[ Upstream commit cf4ab538f1516606d3ae730dce15d6f33d96b7e1 ]

Functions like nfs_map_uid_to_name() and nfs_map_gid_to_group() are
expected to return a string without any terminating NUL character.
Regression introduced by commit 57e62324e469e092ecc6c94a7a86fe4bd6ac5172
(NFS: Store the legacy idmapper result in the keyring).

Reported-by: Dave Chiluk <dave.chiluk@canonical.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Bryan Schumaker <bjschuma@netapp.com>
Cc: stable@vger.kernel.org [>=3.4]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/nfs/idmap.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index a850079..e720df5 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -707,9 +707,9 @@ out1:
 	return ret;
 }
 
-static int nfs_idmap_instantiate(struct key *key, struct key *authkey, char *data)
+static int nfs_idmap_instantiate(struct key *key, struct key *authkey, char *data, size_t datalen)
 {
-	return key_instantiate_and_link(key, data, strlen(data) + 1,
+	return key_instantiate_and_link(key, data, datalen,
 					id_resolver_cache->thread_keyring,
 					authkey);
 }
@@ -717,15 +717,18 @@ static int nfs_idmap_instantiate(struct key *key, struct key *authkey, char *dat
 static int nfs_idmap_read_message(struct idmap_msg *im, struct key *key, struct key *authkey)
 {
 	char id_str[NFS_UINT_MAXLEN];
+	size_t len;
 	int ret = -EINVAL;
 
 	switch (im->im_conv) {
 	case IDMAP_CONV_NAMETOID:
-		sprintf(id_str, "%d", im->im_id);
-		ret = nfs_idmap_instantiate(key, authkey, id_str);
+		/* Note: here we store the NUL terminator too */
+		len = sprintf(id_str, "%d", im->im_id) + 1;
+		ret = nfs_idmap_instantiate(key, authkey, id_str, len);
 		break;
 	case IDMAP_CONV_IDTONAME:
-		ret = nfs_idmap_instantiate(key, authkey, im->im_name);
+		len = strlen(im->im_name);
+		ret = nfs_idmap_instantiate(key, authkey, im->im_name, len);
 		break;
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 103/171 ] NFSv4.1: Fix a race in pNFS layoutcommit
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (101 preceding siblings ...)
  2013-04-11 20:26 ` [ 102/171 ] NFSv4: Fix the string length returned by the idmapper Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 104/171 ] NFSv4.1: Always clear the NFS_INO_LAYOUTCOMMIT in layoutreturn Steven Rostedt
                   ` (67 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Trond Myklebust, Benny Halevy

[-- Attachment #1: 0103-NFSv4.1-Fix-a-race-in-pNFS-layoutcommit.patch --]
[-- Type: text/plain, Size: 3393 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

[ Upstream commit a073dbff359f4741013ae4b8395f5364c5e00b48 ]

We need to clear the NFS_LSEG_LAYOUTCOMMIT bits atomically with the
NFS_INO_LAYOUTCOMMIT bit, otherwise we may end up with situations
where the two are out of sync.
The first half of the problem is to ensure that pnfs_layoutcommit_inode
clears the NFS_LSEG_LAYOUTCOMMIT bit through pnfs_list_write_lseg.
We still need to keep the reference to those segments until the RPC call
is finished, so in order to make it clear _where_ those references come
from, we add a helper pnfs_list_write_lseg_done() that cleans up after
pnfs_list_write_lseg.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Benny Halevy <bhalevy@tonian.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/nfs/nfs4proc.c |   14 --------------
 fs/nfs/pnfs.c     |   19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7bff871..2c6c214 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6549,22 +6549,8 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
 static void nfs4_layoutcommit_release(void *calldata)
 {
 	struct nfs4_layoutcommit_data *data = calldata;
-	struct pnfs_layout_segment *lseg, *tmp;
-	unsigned long *bitlock = &NFS_I(data->args.inode)->flags;
 
 	pnfs_cleanup_layoutcommit(data);
-	/* Matched by references in pnfs_set_layoutcommit */
-	list_for_each_entry_safe(lseg, tmp, &data->lseg_list, pls_lc_list) {
-		list_del_init(&lseg->pls_lc_list);
-		if (test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT,
-				       &lseg->pls_flags))
-			put_lseg(lseg);
-	}
-
-	clear_bit_unlock(NFS_INO_LAYOUTCOMMITTING, bitlock);
-	smp_mb__after_clear_bit();
-	wake_up_bit(bitlock, NFS_INO_LAYOUTCOMMITTING);
-
 	put_rpccred(data->cred);
 	kfree(data);
 }
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 2e00fea..c5fe1a5 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1567,11 +1567,27 @@ static void pnfs_list_write_lseg(struct inode *inode, struct list_head *listp)
 
 	list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list) {
 		if (lseg->pls_range.iomode == IOMODE_RW &&
-		    test_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags))
+		    test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags))
 			list_add(&lseg->pls_lc_list, listp);
 	}
 }
 
+static void pnfs_list_write_lseg_done(struct inode *inode, struct list_head *listp)
+{
+	struct pnfs_layout_segment *lseg, *tmp;
+	unsigned long *bitlock = &NFS_I(inode)->flags;
+
+	/* Matched by references in pnfs_set_layoutcommit */
+	list_for_each_entry_safe(lseg, tmp, listp, pls_lc_list) {
+		list_del_init(&lseg->pls_lc_list);
+		put_lseg(lseg);
+	}
+
+	clear_bit_unlock(NFS_INO_LAYOUTCOMMITTING, bitlock);
+	smp_mb__after_clear_bit();
+	wake_up_bit(bitlock, NFS_INO_LAYOUTCOMMITTING);
+}
+
 void pnfs_set_lo_fail(struct pnfs_layout_segment *lseg)
 {
 	if (lseg->pls_range.iomode == IOMODE_RW) {
@@ -1622,6 +1638,7 @@ void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data)
 
 	if (nfss->pnfs_curr_ld->cleanup_layoutcommit)
 		nfss->pnfs_curr_ld->cleanup_layoutcommit(data);
+	pnfs_list_write_lseg_done(data->args.inode, &data->lseg_list);
 }
 
 /*
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 104/171 ] NFSv4.1: Always clear the NFS_INO_LAYOUTCOMMIT in layoutreturn
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (102 preceding siblings ...)
  2013-04-11 20:26 ` [ 103/171 ] NFSv4.1: Fix a race in pNFS layoutcommit Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 105/171 ] net/irda: add missing error path release_sock call Steven Rostedt
                   ` (66 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Trond Myklebust, Benny Halevy

[-- Attachment #1: 0104-NFSv4.1-Always-clear-the-NFS_INO_LAYOUTCOMMIT-in-lay.patch --]
[-- Type: text/plain, Size: 3906 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

[ Upstream commit 24956804349ca0eadcdde032d65e8c00b4214096 ]

Note that clearing NFS_INO_LAYOUTCOMMIT is tricky, since it requires
you to also clear the NFS_LSEG_LAYOUTCOMMIT bits from the layout
segments.
The only two sites that need to do this are the ones that call
pnfs_return_layout() without first doing a layout commit.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Benny Halevy <bhalevy@tonian.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/nfs/pnfs.c |   35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c5fe1a5..49dffeb5 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -364,6 +364,16 @@ should_free_lseg(struct pnfs_layout_range *lseg_range,
 	       lo_seg_intersecting(lseg_range, recall_range);
 }
 
+static bool pnfs_lseg_dec_and_remove_zero(struct pnfs_layout_segment *lseg,
+		struct list_head *tmp_list)
+{
+	if (!atomic_dec_and_test(&lseg->pls_refcount))
+		return false;
+	put_lseg_common(lseg);
+	list_add(&lseg->pls_list, tmp_list);
+	return true;
+}
+
 /* Returns 1 if lseg is removed from list, 0 otherwise */
 static int mark_lseg_invalid(struct pnfs_layout_segment *lseg,
 			     struct list_head *tmp_list)
@@ -377,11 +387,8 @@ static int mark_lseg_invalid(struct pnfs_layout_segment *lseg,
 		 */
 		dprintk("%s: lseg %p ref %d\n", __func__, lseg,
 			atomic_read(&lseg->pls_refcount));
-		if (atomic_dec_and_test(&lseg->pls_refcount)) {
-			put_lseg_common(lseg);
-			list_add(&lseg->pls_list, tmp_list);
+		if (pnfs_lseg_dec_and_remove_zero(lseg, tmp_list))
 			rv = 1;
-		}
 	}
 	return rv;
 }
@@ -614,6 +621,21 @@ send_layoutget(struct pnfs_layout_hdr *lo,
 	return lseg;
 }
 
+static void pnfs_clear_layoutcommit(struct inode *inode,
+		struct list_head *head)
+{
+	struct nfs_inode *nfsi = NFS_I(inode);
+	struct pnfs_layout_segment *lseg, *tmp;
+
+	if (!test_and_clear_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags))
+		return;
+	list_for_each_entry_safe(lseg, tmp, &nfsi->layout->plh_segs, pls_list) {
+		if (!test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags))
+			continue;
+		pnfs_lseg_dec_and_remove_zero(lseg, head);
+	}
+}
+
 /*
  * Initiates a LAYOUTRETURN(FILE), and removes the pnfs_layout_hdr
  * when the layout segment list is empty.
@@ -645,6 +667,7 @@ _pnfs_return_layout(struct inode *ino)
 	/* Reference matched in nfs4_layoutreturn_release */
 	get_layout_hdr(lo);
 	empty = list_empty(&lo->plh_segs);
+	pnfs_clear_layoutcommit(ino, &tmp_list);
 	mark_matching_lsegs_invalid(lo, &tmp_list, NULL);
 	/* Don't send a LAYOUTRETURN if list was initially empty */
 	if (empty) {
@@ -658,8 +681,6 @@ _pnfs_return_layout(struct inode *ino)
 	spin_unlock(&ino->i_lock);
 	pnfs_free_lseg_list(&tmp_list);
 
-	WARN_ON(test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags));
-
 	lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
 	if (unlikely(lrp == NULL)) {
 		status = -ENOMEM;
@@ -1283,7 +1304,6 @@ static void pnfs_ld_handle_write_error(struct nfs_write_data *data)
 	dprintk("pnfs write error = %d\n", hdr->pnfs_error);
 	if (NFS_SERVER(hdr->inode)->pnfs_curr_ld->flags &
 	    PNFS_LAYOUTRET_ON_ERROR) {
-		clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(hdr->inode)->flags);
 		pnfs_return_layout(hdr->inode);
 	}
 	if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags))
@@ -1435,7 +1455,6 @@ static void pnfs_ld_handle_read_error(struct nfs_read_data *data)
 	dprintk("pnfs read error = %d\n", hdr->pnfs_error);
 	if (NFS_SERVER(hdr->inode)->pnfs_curr_ld->flags &
 	    PNFS_LAYOUTRET_ON_ERROR) {
-		clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(hdr->inode)->flags);
 		pnfs_return_layout(hdr->inode);
 	}
 	if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags))
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 105/171 ] net/irda: add missing error path release_sock call
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (103 preceding siblings ...)
  2013-04-11 20:26 ` [ 104/171 ] NFSv4.1: Always clear the NFS_INO_LAYOUTCOMMIT in layoutreturn Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 106/171 ] Nest rename_lock inside vfsmount_lock Steven Rostedt
                   ` (65 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Kees Cook, Brad Spengler, David S. Miller

[-- Attachment #1: 0105-net-irda-add-missing-error-path-release_sock-call.patch --]
[-- Type: text/plain, Size: 1108 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Kees Cook <keescook@chromium.org>

[ Upstream commit 896ee0eee6261e30c3623be931c3f621428947df ]

This makes sure that release_sock is called for all error conditions in
irda_getsockopt.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Brad Spengler <spender@grsecurity.net>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/irda/af_irda.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index bb738c9..73dfe2c 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2584,8 +2584,10 @@ bed:
 				    NULL, NULL, NULL);
 
 		/* Check if the we got some results */
-		if (!self->cachedaddr)
-			return -EAGAIN;		/* Didn't find any devices */
+		if (!self->cachedaddr) {
+			err = -EAGAIN;		/* Didn't find any devices */
+			goto out;
+		}
 		daddr = self->cachedaddr;
 		/* Cleanup */
 		self->cachedaddr = 0;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 106/171 ] Nest rename_lock inside vfsmount_lock
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (104 preceding siblings ...)
  2013-04-11 20:26 ` [ 105/171 ] net/irda: add missing error path release_sock call Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 107/171 ] USB: EHCI: fix bug in iTD/siTD DMA pool allocation Steven Rostedt
                   ` (64 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Al Viro

[-- Attachment #1: 0106-Nest-rename_lock-inside-vfsmount_lock.patch --]
[-- Type: text/plain, Size: 3682 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@zeniv.linux.org.uk>

[ Upstream commit 7ea600b5314529f9d1b9d6d3c41cb26fce6a7a4a ]

... lest we get livelocks between path_is_under() and d_path() and friends.

The thing is, wrt fairness lglocks are more similar to rwsems than to rwlocks;
it is possible to have thread B spin on attempt to take lock shared while thread
A is already holding it shared, if B is on lower-numbered CPU than A and there's
a thread C spinning on attempt to take the same lock exclusive.

As the result, we need consistent ordering between vfsmount_lock (lglock) and
rename_lock (seq_lock), even though everything that takes both is going to take
vfsmount_lock only shared.

Spotted-by: Brad Spengler <spender@grsecurity.net>
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/dcache.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 693f95b..2488c47 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2583,7 +2583,6 @@ static int prepend_path(const struct path *path,
 	bool slash = false;
 	int error = 0;
 
-	br_read_lock(&vfsmount_lock);
 	while (dentry != root->dentry || vfsmnt != root->mnt) {
 		struct dentry * parent;
 
@@ -2613,8 +2612,6 @@ static int prepend_path(const struct path *path,
 	if (!error && !slash)
 		error = prepend(buffer, buflen, "/", 1);
 
-out:
-	br_read_unlock(&vfsmount_lock);
 	return error;
 
 global_root:
@@ -2631,7 +2628,7 @@ global_root:
 		error = prepend(buffer, buflen, "/", 1);
 	if (!error)
 		error = is_mounted(vfsmnt) ? 1 : 2;
-	goto out;
+	return error;
 }
 
 /**
@@ -2658,9 +2655,11 @@ char *__d_path(const struct path *path,
 	int error;
 
 	prepend(&res, &buflen, "\0", 1);
+	br_read_lock(&vfsmount_lock);
 	write_seqlock(&rename_lock);
 	error = prepend_path(path, root, &res, &buflen);
 	write_sequnlock(&rename_lock);
+	br_read_unlock(&vfsmount_lock);
 
 	if (error < 0)
 		return ERR_PTR(error);
@@ -2677,9 +2676,11 @@ char *d_absolute_path(const struct path *path,
 	int error;
 
 	prepend(&res, &buflen, "\0", 1);
+	br_read_lock(&vfsmount_lock);
 	write_seqlock(&rename_lock);
 	error = prepend_path(path, &root, &res, &buflen);
 	write_sequnlock(&rename_lock);
+	br_read_unlock(&vfsmount_lock);
 
 	if (error > 1)
 		error = -EINVAL;
@@ -2743,11 +2744,13 @@ char *d_path(const struct path *path, char *buf, int buflen)
 		return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
 
 	get_fs_root(current->fs, &root);
+	br_read_lock(&vfsmount_lock);
 	write_seqlock(&rename_lock);
 	error = path_with_deleted(path, &root, &res, &buflen);
+	write_sequnlock(&rename_lock);
+	br_read_unlock(&vfsmount_lock);
 	if (error < 0)
 		res = ERR_PTR(error);
-	write_sequnlock(&rename_lock);
 	path_put(&root);
 	return res;
 }
@@ -2902,6 +2905,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
 	get_fs_root_and_pwd(current->fs, &root, &pwd);
 
 	error = -ENOENT;
+	br_read_lock(&vfsmount_lock);
 	write_seqlock(&rename_lock);
 	if (!d_unlinked(pwd.dentry)) {
 		unsigned long len;
@@ -2911,6 +2915,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
 		prepend(&cwd, &buflen, "\0", 1);
 		error = prepend_path(&pwd, &root, &cwd, &buflen);
 		write_sequnlock(&rename_lock);
+		br_read_unlock(&vfsmount_lock);
 
 		if (error < 0)
 			goto out;
@@ -2931,6 +2936,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
 		}
 	} else {
 		write_sequnlock(&rename_lock);
+		br_read_unlock(&vfsmount_lock);
 	}
 
 out:
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 107/171 ] USB: EHCI: fix bug in iTD/siTD DMA pool allocation
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (105 preceding siblings ...)
  2013-04-11 20:26 ` [ 106/171 ] Nest rename_lock inside vfsmount_lock Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 108/171 ] usb: xhci: Fix TRB transfer length macro used for Event TRB Steven Rostedt
                   ` (63 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Soeren Moch, Alan Stern, Greg Kroah-Hartman

[-- Attachment #1: 0107-USB-EHCI-fix-bug-in-iTD-siTD-DMA-pool-allocation.patch --]
[-- Type: text/plain, Size: 3861 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Soeren Moch <smoch@web.de>

[ Upstream commit 85ecd0322b9a1a9f451d9150e9460ab42fd17219 ]

[Description written by Alan Stern]

Soeren tracked down a very difficult bug in ehci-hcd's DMA pool
management of iTD and siTD structures.  Some background: ehci-hcd
gives each isochronous endpoint its own set of active and free itd's
(or sitd's for full-speed devices).  When a new itd is needed, it is
taken from the head of the free list, if possible.  However, itd's
must not be used twice in a single frame because the hardware
continues to access the data structure for the entire duration of a
frame.  Therefore if the itd at the head of the free list has its
"frame" member equal to the current value of ehci->now_frame, it
cannot be reused and instead a new itd is allocated from the DMA pool.
The entries on the free list are not released back to the pool until
the endpoint is no longer in use.

The bug arises from the fact that sometimes an itd can be moved back
onto the free list before itd->frame has been set properly.  In
Soeren's case, this happened because ehci-hcd can allocate one more
itd than it actually needs for an URB; the extra itd may or may not be
required depending on how the transfer aligns with a frame boundary.
For example, an URB with 8 isochronous packets will cause two itd's to
be allocated.  If the URB is scheduled to start in microframe 3 of
frame N then it will require both itds: one for microframes 3 - 7 of
frame N and one for microframes 0 - 2 of frame N+1.  But if the URB
had been scheduled to start in microframe 0 then it would require only
the first itd, which could cover microframes 0 - 7 of frame N.  The
second itd would be returned to the end of the free list.

The itd allocation routine initializes the entire structure to 0, so
the extra itd ends up on the free list with itd->frame set to 0
instead of a meaningful value.  After a while the itd reaches the head
of the list, and occasionally this happens when ehci->now_frame is
equal to 0.  Then, even though it would be okay to reuse this itd, the
driver thinks it must get another itd from the DMA pool.

For as long as the isochronous endpoint remains in use, this flaw in
the mechanism causes more and more itd's to be taken slowly from the
DMA pool.  Since none are released back, the pool eventually becomes
exhausted.

This reuslts in memory allocation failures, which typically show up
during a long-running audio stream.  Video might suffer the same
effect.

The fix is very simple.  To prevent allocations from the pool when
they aren't needed, make sure that itd's sent back to the free list
prematurely have itd->frame set to an invalid value which can never be
equal to ehci->now_frame.

This should be applied to -stable kernels going back to 3.6.

Signed-off-by: Soeren Moch <smoch@web.de>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/host/ehci-sched.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 528a540..56a1907 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1237,6 +1237,7 @@ itd_urb_transaction (
 
 		memset (itd, 0, sizeof *itd);
 		itd->itd_dma = itd_dma;
+		itd->frame = 9999;		/* an invalid value */
 		list_add (&itd->itd_list, &sched->td_list);
 	}
 	spin_unlock_irqrestore (&ehci->lock, flags);
@@ -1931,6 +1932,7 @@ sitd_urb_transaction (
 
 		memset (sitd, 0, sizeof *sitd);
 		sitd->sitd_dma = sitd_dma;
+		sitd->frame = 9999;		/* an invalid value */
 		list_add (&sitd->sitd_list, &iso_sched->td_list);
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 108/171 ] usb: xhci: Fix TRB transfer length macro used for Event TRB.
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (106 preceding siblings ...)
  2013-04-11 20:26 ` [ 107/171 ] USB: EHCI: fix bug in iTD/siTD DMA pool allocation Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 109/171 ] userns: Dont allow creation if the user is chrooted Steven Rostedt
                   ` (62 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Vivek gautam, Sarah Sharp

[-- Attachment #1: 0108-usb-xhci-Fix-TRB-transfer-length-macro-used-for-Even.patch --]
[-- Type: text/plain, Size: 5369 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Vivek Gautam <gautam.vivek@samsung.com>

[ Upstream commit 1c11a172cb30492f5f6a82c6e118fdcd9946c34f ]

Use proper macro while extracting TRB transfer length from
Transfer event TRBs. Adding a macro EVENT_TRB_LEN (bits 0:23)
for the same, and use it instead of TRB_LEN (bits 0:16) in
case of event TRBs.

This patch should be backported to kernels as old as 2.6.31, that
contain the commit b10de142119a676552df3f0d2e3a9d647036c26a "USB: xhci:
Bulk transfer support".  This patch will have issues applying to older
kernels.

Signed-off-by: Vivek gautam <gautam.vivek@samsung.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/host/xhci-ring.c |   24 ++++++++++++------------
 drivers/usb/host/xhci.h      |    4 ++++
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 4f1e265..b9ade46 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2018,8 +2018,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		if (event_trb != ep_ring->dequeue &&
 				event_trb != td->last_trb)
 			td->urb->actual_length =
-				td->urb->transfer_buffer_length
-				- TRB_LEN(le32_to_cpu(event->transfer_len));
+				td->urb->transfer_buffer_length -
+				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 		else
 			td->urb->actual_length = 0;
 
@@ -2051,7 +2051,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		/* Maybe the event was for the data stage? */
 			td->urb->actual_length =
 				td->urb->transfer_buffer_length -
-				TRB_LEN(le32_to_cpu(event->transfer_len));
+				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 			xhci_dbg(xhci, "Waiting for status "
 					"stage event\n");
 			return 0;
@@ -2087,7 +2087,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
 	/* handle completion code */
 	switch (trb_comp_code) {
 	case COMP_SUCCESS:
-		if (TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) {
+		if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) {
 			frame->status = 0;
 			break;
 		}
@@ -2132,7 +2132,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
 				len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2]));
 		}
 		len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -
-			TRB_LEN(le32_to_cpu(event->transfer_len));
+			EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 
 		if (trb_comp_code != COMP_STOP_INVAL) {
 			frame->actual_length = len;
@@ -2190,7 +2190,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
 	case COMP_SUCCESS:
 		/* Double check that the HW transferred everything. */
 		if (event_trb != td->last_trb ||
-				TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
+		    EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
 			xhci_warn(xhci, "WARN Successful completion "
 					"on short TX\n");
 			if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
@@ -2218,18 +2218,18 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
 				"%d bytes untransferred\n",
 				td->urb->ep->desc.bEndpointAddress,
 				td->urb->transfer_buffer_length,
-				TRB_LEN(le32_to_cpu(event->transfer_len)));
+				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)));
 	/* Fast path - was this the last TRB in the TD for this URB? */
 	if (event_trb == td->last_trb) {
-		if (TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
+		if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
 			td->urb->actual_length =
 				td->urb->transfer_buffer_length -
-				TRB_LEN(le32_to_cpu(event->transfer_len));
+				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 			if (td->urb->transfer_buffer_length <
 					td->urb->actual_length) {
 				xhci_warn(xhci, "HC gave bad length "
 						"of %d bytes left\n",
-					  TRB_LEN(le32_to_cpu(event->transfer_len)));
+					  EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)));
 				td->urb->actual_length = 0;
 				if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
 					*status = -EREMOTEIO;
@@ -2271,7 +2271,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		if (trb_comp_code != COMP_STOP_INVAL)
 			td->urb->actual_length +=
 				TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -
-				TRB_LEN(le32_to_cpu(event->transfer_len));
+				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 	}
 
 	return finish_td(xhci, td, event_trb, event, ep, status, false);
@@ -2357,7 +2357,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 	 * transfer type
 	 */
 	case COMP_SUCCESS:
-		if (TRB_LEN(le32_to_cpu(event->transfer_len)) == 0)
+		if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0)
 			break;
 		if (xhci->quirks & XHCI_TRUST_TX_LENGTH)
 			trb_comp_code = COMP_SHORT_TX;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 7c75bfe..212d408 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -972,6 +972,10 @@ struct xhci_transfer_event {
 	__le32	flags;
 };
 
+/* Transfer event TRB length bit mask */
+/* bits 0:23 */
+#define	EVENT_TRB_LEN(p)		((p) & 0xffffff)
+
 /** Transfer Event bit fields **/
 #define	TRB_TO_EP_ID(p)	(((p) >> 16) & 0x1f)
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 109/171 ] userns: Dont allow creation if the user is chrooted
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (107 preceding siblings ...)
  2013-04-11 20:26 ` [ 108/171 ] usb: xhci: Fix TRB transfer length macro used for Event TRB Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-10-22 11:15   ` Luis Henriques
  2013-04-11 20:26 ` [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts Steven Rostedt
                   ` (61 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Serge Hallyn, Andy Lutomirski, Eric W. Biederman

[-- Attachment #1: 0109-userns-Don-t-allow-creation-if-the-user-is-chrooted.patch --]
[-- Type: text/plain, Size: 3472 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Eric W. Biederman" <ebiederm@xmission.com>

[ Upstream commit 3151527ee007b73a0ebd296010f1c0454a919c7d ]

Guarantee that the policy of which files may be access that is
established by setting the root directory will not be violated
by user namespaces by verifying that the root directory points
to the root of the mount namespace at the time of user namespace
creation.

Changing the root is a privileged operation, and as a matter of policy
it serves to limit unprivileged processes to files below the current
root directory.

For reasons of simplicity and comprehensibility the privilege to
change the root directory is gated solely on the CAP_SYS_CHROOT
capability in the user namespace.  Therefore when creating a user
namespace we must ensure that the policy of which files may be access
can not be violated by changing the root directory.

Anyone who runs a processes in a chroot and would like to use user
namespace can setup the same view of filesystems with a mount
namespace instead.  With this result that this is not a practical
limitation for using user namespaces.

Cc: stable@vger.kernel.org
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/namespace.c            |   25 +++++++++++++++++++++++++
 include/linux/fs_struct.h |    2 ++
 kernel/user_namespace.c   |    9 +++++++++
 3 files changed, 36 insertions(+)

diff --git a/fs/namespace.c b/fs/namespace.c
index 7bdf790..c48b0d3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2681,3 +2681,28 @@ bool our_mnt(struct vfsmount *mnt)
 {
 	return check_mnt(real_mount(mnt));
 }
+
+bool current_chrooted(void)
+{
+	/* Does the current process have a non-standard root */
+	struct path ns_root;
+	struct path fs_root;
+	bool chrooted;
+
+	/* Find the namespace root */
+	ns_root.mnt = &current->nsproxy->mnt_ns->root->mnt;
+	ns_root.dentry = ns_root.mnt->mnt_root;
+	path_get(&ns_root);
+	while (d_mountpoint(ns_root.dentry) && follow_down_one(&ns_root))
+		;
+
+	get_fs_root(current->fs, &fs_root);
+
+	chrooted = !path_equal(&fs_root, &ns_root);
+
+	path_put(&fs_root);
+	path_put(&ns_root);
+
+	return chrooted;
+}
+
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 003dc0f..961cdaa 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -51,4 +51,6 @@ static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
 	spin_unlock(&fs->lock);
 }
 
+extern bool current_chrooted(void);
+
 #endif /* _LINUX_FS_STRUCT_H */
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 8660231..a74dc5b 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -39,6 +39,15 @@ int create_user_ns(struct cred *new)
 	kuid_t owner = new->euid;
 	kgid_t group = new->egid;
 
+	/*
+	 * Verify that we can not violate the policy of which files
+	 * may be accessed that is specified by the root directory,
+	 * by verifing that the root directory is at the root of the
+	 * mount namespace which allows all files to be accessed.
+	 */
+	if (current_chrooted())
+		return -EPERM;
+
 	/* The creator needs a mapping in the parent user namespace
 	 * or else we won't be able to reasonably tell userspace who
 	 * created a user_namespace.
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (108 preceding siblings ...)
  2013-04-11 20:26 ` [ 109/171 ] userns: Dont allow creation if the user is chrooted Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:57   ` Eric W. Biederman
  2013-04-11 20:26 ` [ 111/171 ] ipc: Restrict mounting the mqueue filesystem Steven Rostedt
                   ` (60 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Serge Hallyn, Eric W. Biederman

[-- Attachment #1: 0110-vfs-Add-a-mount-flag-to-lock-read-only-bind-mounts.patch --]
[-- Type: text/plain, Size: 1635 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Eric W. Biederman" <ebiederm@xmission.com>

[ Upstream commit 90563b198e4c6674c63672fae1923da467215f45 ]

When a read-only bind mount is copied from mount namespace in a higher
privileged user namespace to a mount namespace in a lesser privileged
user namespace, it should not be possible to remove the the read-only
restriction.

Add a MNT_LOCK_READONLY mount flag to indicate that a mount must
remain read-only.

CC: stable@vger.kernel.org
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/namespace.c        |    3 +++
 include/linux/mount.h |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/fs/namespace.c b/fs/namespace.c
index c48b0d3..48c7edb 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1702,6 +1702,9 @@ static int change_mount_flags(struct vfsmount *mnt, int ms_flags)
 	if (readonly_request == __mnt_is_readonly(mnt))
 		return 0;
 
+	if (mnt->mnt_flags & MNT_LOCK_READONLY)
+		return -EPERM;
+
 	if (readonly_request)
 		error = mnt_make_readonly(real_mount(mnt));
 	else
diff --git a/include/linux/mount.h b/include/linux/mount.h
index d7029f4..73005f9 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -47,6 +47,8 @@ struct mnt_namespace;
 
 #define MNT_INTERNAL	0x4000
 
+#define MNT_LOCK_READONLY	0x400000
+
 struct vfsmount {
 	struct dentry *mnt_root;	/* root of the mounted tree */
 	struct super_block *mnt_sb;	/* pointer to superblock */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 111/171 ] ipc: Restrict mounting the mqueue filesystem
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (109 preceding siblings ...)
  2013-04-11 20:26 ` [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:55   ` Eric W. Biederman
  2013-04-11 20:26 ` [ 112/171 ] Btrfs: use set_nlink if our i_nlink is 0 Steven Rostedt
                   ` (59 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Serge Hallyn, Eric W. Biederman

[-- Attachment #1: 0111-ipc-Restrict-mounting-the-mqueue-filesystem.patch --]
[-- Type: text/plain, Size: 1901 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Eric W. Biederman" <ebiederm@xmission.com>

[ Upstream commit a636b702ed1805e988ad3d8ff8b52c060f8b341c ]

Only allow mounting the mqueue filesystem if the caller has CAP_SYS_ADMIN
rights over the ipc namespace.   The principle here is if you create
or have capabilities over it you can mount it, otherwise you get to live
with what other people have mounted.

This information is not particularly sensitive and mqueue essentially
only reports which posix messages queues exist.  Still when creating a
restricted environment for an application to live any extra
information may be of use to someone with sufficient creativity.  The
historical if imperfect way this information has been restricted has
been not to allow mounts and restricting this to ipc namespace
creators maintains the spirit of the historical restriction.

Cc: stable@vger.kernel.org
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 ipc/mqueue.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9e4cf7f..f1df4bc 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -331,8 +331,16 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type,
 			 int flags, const char *dev_name,
 			 void *data)
 {
-	if (!(flags & MS_KERNMOUNT))
-		data = current->nsproxy->ipc_ns;
+	if (!(flags & MS_KERNMOUNT)) {
+		struct ipc_namespace *ns = current->nsproxy->ipc_ns;
+		/* Don't allow mounting unless the caller has CAP_SYS_ADMIN
+		 * over the ipc namespace.
+		 */
+		if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN))
+			return ERR_PTR(-EPERM);
+
+		data = ns;
+	}
 	return mount_ns(fs_type, flags, data, mqueue_fill_super);
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 112/171 ] Btrfs: use set_nlink if our i_nlink is 0
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (110 preceding siblings ...)
  2013-04-11 20:26 ` [ 111/171 ] ipc: Restrict mounting the mqueue filesystem Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 113/171 ] Btrfs: fix race between mmap writes and compression Steven Rostedt
                   ` (58 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Josef Bacik

[-- Attachment #1: 0112-Btrfs-use-set_nlink-if-our-i_nlink-is-0.patch --]
[-- Type: text/plain, Size: 1277 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josef Bacik <jbacik@fusionio.com>

[ Upstream commit 9bf7a4890518186238d2579be16ecc5190a707c0 ]

We need to inc the nlink of deleted entries when running replay so we can do the
unlink on the fs_root and get everything cleaned up and then have the orphan
cleanup do the right thing.  The problem is inc_nlink complains about this, even
thought it still does the right thing.  So use set_nlink() if our i_nlink is 0
to keep users from seeing the warnings during log replay.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/btrfs/tree-log.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c86670f..d814a5d 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1132,7 +1132,10 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
 
 	btrfs_release_path(path);
 	if (ret == 0) {
-		btrfs_inc_nlink(inode);
+		if (!inode->i_nlink)
+			set_nlink(inode, 1);
+		else
+			btrfs_inc_nlink(inode);
 		ret = btrfs_update_inode(trans, root, inode);
 	} else if (ret == -EEXIST) {
 		ret = 0;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 113/171 ] Btrfs: fix race between mmap writes and compression
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (111 preceding siblings ...)
  2013-04-11 20:26 ` [ 112/171 ] Btrfs: use set_nlink if our i_nlink is 0 Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 114/171 ] Btrfs: limit the global reserve to 512mb Steven Rostedt
                   ` (57 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Chris Mason, Alexandre Oliva

[-- Attachment #1: 0113-Btrfs-fix-race-between-mmap-writes-and-compression.patch --]
[-- Type: text/plain, Size: 4535 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Chris Mason <chris.mason@fusionio.com>

[ Upstream commit 4adaa611020fa6ac65b0ac8db78276af4ec04e63 ]

Btrfs uses page_mkwrite to ensure stable pages during
crc calculations and mmap workloads.  We call clear_page_dirty_for_io
before we do any crcs, and this forces any application with the file
mapped to wait for the crc to finish before it is allowed to change
the file.

With compression on, the clear_page_dirty_for_io step is happening after
we've compressed the pages.  This means the applications might be
changing the pages while we are compressing them, and some of those
modifications might not hit the disk.

This commit adds the clear_page_dirty_for_io before compression starts
and makes sure to redirty the page if we have to fallback to
uncompressed IO as well.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Reported-by: Alexandre Oliva <oliva@gnu.org>
cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/btrfs/extent_io.c |   33 +++++++++++++++++++++++++++++++++
 fs/btrfs/extent_io.h |    2 ++
 fs/btrfs/inode.c     |   14 ++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4c87847..d1e1b7c 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1230,6 +1230,39 @@ int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end)
 				GFP_NOFS);
 }
 
+int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
+{
+	unsigned long index = start >> PAGE_CACHE_SHIFT;
+	unsigned long end_index = end >> PAGE_CACHE_SHIFT;
+	struct page *page;
+
+	while (index <= end_index) {
+		page = find_get_page(inode->i_mapping, index);
+		BUG_ON(!page); /* Pages should be in the extent_io_tree */
+		clear_page_dirty_for_io(page);
+		page_cache_release(page);
+		index++;
+	}
+	return 0;
+}
+
+int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
+{
+	unsigned long index = start >> PAGE_CACHE_SHIFT;
+	unsigned long end_index = end >> PAGE_CACHE_SHIFT;
+	struct page *page;
+
+	while (index <= end_index) {
+		page = find_get_page(inode->i_mapping, index);
+		BUG_ON(!page); /* Pages should be in the extent_io_tree */
+		account_page_redirty(page);
+		__set_page_dirty_nobuffers(page);
+		page_cache_release(page);
+		index++;
+	}
+	return 0;
+}
+
 /*
  * helper function to set both pages and extents in the tree writeback
  */
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 25900af..c5003db 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -314,6 +314,8 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long offset,
 		      unsigned long *map_len);
 int extent_range_uptodate(struct extent_io_tree *tree,
 			  u64 start, u64 end);
+int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
+int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
 int extent_clear_unlock_delalloc(struct inode *inode,
 				struct extent_io_tree *tree,
 				u64 start, u64 end, struct page *locked_page,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ec154f9..cb6f206 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -350,6 +350,7 @@ static noinline int compress_file_range(struct inode *inode,
 	int i;
 	int will_compress;
 	int compress_type = root->fs_info->compress_type;
+	int redirty = 0;
 
 	/* if this is a small write inside eof, kick off a defrag */
 	if ((end - start + 1) < 16 * 1024 &&
@@ -412,6 +413,17 @@ again:
 		if (BTRFS_I(inode)->force_compress)
 			compress_type = BTRFS_I(inode)->force_compress;
 
+		/*
+		 * we need to call clear_page_dirty_for_io on each
+		 * page in the range.  Otherwise applications with the file
+		 * mmap'd can wander in and change the page contents while
+		 * we are compressing them.
+		 *
+		 * If the compression fails for any reason, we set the pages
+		 * dirty again later on.
+		 */
+		extent_range_clear_dirty_for_io(inode, start, end);
+		redirty = 1;
 		ret = btrfs_compress_pages(compress_type,
 					   inode->i_mapping, start,
 					   total_compressed, pages,
@@ -553,6 +565,8 @@ cleanup_and_bail_uncompressed:
 			__set_page_dirty_nobuffers(locked_page);
 			/* unlocked later on in the async handlers */
 		}
+		if (redirty)
+			extent_range_redirty_for_io(inode, start, end);
 		add_async_extent(async_cow, start, end - start + 1,
 				 0, NULL, 0, BTRFS_COMPRESS_NONE);
 		*num_added += 1;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 114/171 ] Btrfs: limit the global reserve to 512mb
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (112 preceding siblings ...)
  2013-04-11 20:26 ` [ 113/171 ] Btrfs: fix race between mmap writes and compression Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 115/171 ] Btrfs: dont drop path when printing out tree errors in scrub Steven Rostedt
                   ` (56 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Josef Bacik

[-- Attachment #1: 0114-Btrfs-limit-the-global-reserve-to-512mb.patch --]
[-- Type: text/plain, Size: 1509 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josef Bacik <jbacik@fusionio.com>

[ Upstream commit fdf30d1c1b386e1b73116cc7e0fb14e962b763b0 ]

A user reported a problem where he was getting early ENOSPC with hundreds of
gigs of free data space and 6 gigs of free metadata space.  This is because the
global block reserve was taking up the entire free metadata space.  This is
ridiculous, we have infrastructure in place to throttle if we start using too
much of the global reserve, so instead of letting it get this huge just limit it
to 512mb so that users can still get work done.  This allowed the user to
complete his rsync without issues.  Thanks

Cc: stable@vger.kernel.org
Reported-and-tested-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/btrfs/extent-tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ba58024..f1bdfb5 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4301,7 +4301,7 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
 	spin_lock(&sinfo->lock);
 	spin_lock(&block_rsv->lock);
 
-	block_rsv->size = num_bytes;
+	block_rsv->size = min_t(u64, num_bytes, 512 * 1024 * 1024);
 
 	num_bytes = sinfo->bytes_used + sinfo->bytes_pinned +
 		    sinfo->bytes_reserved + sinfo->bytes_readonly +
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 115/171 ] Btrfs: dont drop path when printing out tree errors in scrub
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (113 preceding siblings ...)
  2013-04-11 20:26 ` [ 114/171 ] Btrfs: limit the global reserve to 512mb Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:26 ` [ 116/171 ] USB: serial: add modem-status-change wait queue Steven Rostedt
                   ` (55 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Josef Bacik, Chris Mason

[-- Attachment #1: 0115-Btrfs-don-t-drop-path-when-printing-out-tree-errors-.patch --]
[-- Type: text/plain, Size: 1655 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josef Bacik <jbacik@fusionio.com>

[ Upstream commit d8fe29e9dea8d7d61fd140d8779326856478fc62 ]

A user reported a panic where we were panicing somewhere in
tree_backref_for_extent from scrub_print_warning.  He only captured the trace
but looking at scrub_print_warning we drop the path right before we mess with
the extent buffer to print out a bunch of stuff, which isn't right.  So fix this
by dropping the path after we use the eb if we need to.  Thanks,

Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/btrfs/scrub.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index b223620..5aeffbe 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -385,7 +385,6 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
 	eb = path->nodes[0];
 	ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
 	item_size = btrfs_item_size_nr(eb, path->slots[0]);
-	btrfs_release_path(path);
 
 	if (ret & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
 		do {
@@ -401,7 +400,9 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
 				ret < 0 ? -1 : ref_level,
 				ret < 0 ? -1 : ref_root);
 		} while (ret != 1);
+		btrfs_release_path(path);
 	} else {
+		btrfs_release_path(path);
 		swarn.path = path;
 		iterate_extent_inodes(fs_info, found_key.objectid,
 					extent_item_pos, 1,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 116/171 ] USB: serial: add modem-status-change wait queue
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (114 preceding siblings ...)
  2013-04-11 20:26 ` [ 115/171 ] Btrfs: dont drop path when printing out tree errors in scrub Steven Rostedt
@ 2013-04-11 20:26 ` Steven Rostedt
  2013-04-11 20:27 ` [ 117/171 ] USB: serial: fix hang when opening port Steven Rostedt
                   ` (54 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0116-USB-serial-add-modem-status-change-wait-queue.patch --]
[-- Type: text/plain, Size: 1591 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit e5b33dc9d16053c2ae4c2c669cf008829530364b ]

Add modem-status-change wait queue to struct usb_serial_port that
subdrivers can use to implement TIOCMIWAIT.

Currently subdrivers use a private wait queue which may have been
released when waking up after device disconnected.

Note that we're adding a new wait queue rather than reusing the tty-port
one as we do not want to get woken up at hangup (yet).

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/usb/serial.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 86c0b45..0b61f01 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -66,6 +66,7 @@
  *	port.
  * @flags: usb serial port flags
  * @write_wait: a wait_queue_head_t used by the port.
+ * @delta_msr_wait: modem-status-change wait queue
  * @work: work queue entry for the line discipline waking up.
  * @throttled: nonzero if the read urb is inactive to throttle the device
  * @throttle_req: nonzero if the tty wants to throttle us
@@ -112,6 +113,7 @@ struct usb_serial_port {
 
 	unsigned long		flags;
 	wait_queue_head_t	write_wait;
+	wait_queue_head_t	delta_msr_wait;
 	struct work_struct	work;
 	char			throttled;
 	char			throttle_req;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 117/171 ] USB: serial: fix hang when opening port
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (115 preceding siblings ...)
  2013-04-11 20:26 ` [ 116/171 ] USB: serial: add modem-status-change wait queue Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 118/171 ] USB: quatech2: fix use-after-free in TIOCMIWAIT Steven Rostedt
                   ` (53 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ming Lei, Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0117-USB-serial-fix-hang-when-opening-port.patch --]
[-- Type: text/plain, Size: 1381 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Ming Lei <tom.leiming@gmail.com>

[ Upstream commit eba0e3c3a0ba7b96f01cbe997680f6a4401a0bfc ]

Johan's 'fix use-after-free in TIOCMIWAIT' patchset[1] introduces
one bug which can cause kernel hang when opening port.

This patch initialized the 'port->delta_msr_wait' waitqueue head
to fix the bug which is introduced in 3.9-rc4.

[1], http://marc.info/?l=linux-usb&m=136368139627876&w=2

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/usb-serial.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index da1e728..5f38894 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -889,6 +889,7 @@ static int usb_serial_probe(struct usb_interface *interface,
 		port->port.ops = &serial_port_ops;
 		port->serial = serial;
 		spin_lock_init(&port->lock);
+		init_waitqueue_head(&port->delta_msr_wait);
 		/* Keep this for private driver use for the moment but
 		   should probably go away */
 		INIT_WORK(&port->work, usb_serial_port_work);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 118/171 ] USB: quatech2: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (116 preceding siblings ...)
  2013-04-11 20:27 ` [ 117/171 ] USB: serial: fix hang when opening port Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 119/171 ] USB: mos7840: fix broken TIOCMIWAIT Steven Rostedt
                   ` (52 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0118-USB-quatech2-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2562 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 69f87f40d2b98e8b4ab82a121fd2bd584690b887 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/quatech2.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index ea69301..e801c54 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -132,7 +132,6 @@ struct qt2_port_private {
 	u8          shadowLSR;
 	u8          shadowMSR;
 
-	wait_queue_head_t   delta_msr_wait; /* Used for TIOCMIWAIT */
 	struct async_icount icount;
 
 	struct usb_serial_port *port;
@@ -510,8 +509,9 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	while (1) {
-		wait_event_interruptible(priv->delta_msr_wait,
-					 ((priv->icount.rng != prev.rng) ||
+		wait_event_interruptible(port->delta_msr_wait,
+					 (port->serial->disconnected ||
+					  (priv->icount.rng != prev.rng) ||
 					  (priv->icount.dsr != prev.dsr) ||
 					  (priv->icount.dcd != prev.dcd) ||
 					  (priv->icount.cts != prev.cts)));
@@ -519,6 +519,9 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		cur = priv->icount;
 		spin_unlock_irqrestore(&priv->lock, flags);
@@ -845,7 +848,6 @@ static int qt2_port_probe(struct usb_serial_port *port)
 
 	spin_lock_init(&port_priv->lock);
 	spin_lock_init(&port_priv->urb_lock);
-	init_waitqueue_head(&port_priv->delta_msr_wait);
 	port_priv->port = port;
 
 	port_priv->write_urb = usb_alloc_urb(0, GFP_KERNEL);
@@ -990,7 +992,7 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch)
 		if (newMSR & UART_MSR_TERI)
 			port_priv->icount.rng++;
 
-		wake_up_interruptible(&port_priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 	}
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 119/171 ] USB: mos7840: fix broken TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (117 preceding siblings ...)
  2013-04-11 20:27 ` [ 118/171 ] USB: quatech2: fix use-after-free in TIOCMIWAIT Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 120/171 ] USB: io_ti: fix use-after-free in TIOCMIWAIT Steven Rostedt
                   ` (51 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0119-USB-mos7840-fix-broken-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 1420 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit e670c6af12517d08a403487b1122eecf506021cf ]

Make sure waiting processes are woken on modem-status changes.

Currently processes are only woken on termios changes regardless of
whether the modem status has changed.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/mos7840.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 5311819..fbef4f7 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -441,6 +441,9 @@ static void mos7840_handle_new_msr(struct moschip_port *port, __u8 new_msr)
 			icount->rng++;
 			smp_wmb();
 		}
+
+		mos7840_port->delta_msr_cond = 1;
+		wake_up_interruptible(&mos7840_port->delta_msr_wait);
 	}
 }
 
@@ -2095,8 +2098,6 @@ static void mos7840_change_port_settings(struct tty_struct *tty,
 			mos7840_port->read_urb_busy = false;
 		}
 	}
-	wake_up(&mos7840_port->delta_msr_wait);
-	mos7840_port->delta_msr_cond = 1;
 	dbg("mos7840_change_port_settings mos7840_port->shadowLCR is End %x",
 	    mos7840_port->shadowLCR);
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 120/171 ] USB: io_ti: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (118 preceding siblings ...)
  2013-04-11 20:27 ` [ 119/171 ] USB: mos7840: fix broken TIOCMIWAIT Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 121/171 ] USB: oti6858: " Steven Rostedt
                   ` (50 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0120-USB-io_ti-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2516 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 7b2459690584f239650a365f3411ba2ec1c6d1e0 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/io_ti.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index a943c06..d2b6008 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -91,9 +91,6 @@ struct edgeport_port {
 	int close_pending;
 	int lsr_event;
 	struct async_icount	icount;
-	wait_queue_head_t	delta_msr_wait;	/* for handling sleeping while
-						   waiting for msr change to
-						   happen */
 	struct edgeport_serial	*edge_serial;
 	struct usb_serial_port	*port;
 	__u8 bUartMode;		/* Port type, 0: RS232, etc. */
@@ -1539,7 +1536,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 msr)
 			icount->dcd++;
 		if (msr & EDGEPORT_MSR_DELTA_RI)
 			icount->rng++;
-		wake_up_interruptible(&edge_port->delta_msr_wait);
+		wake_up_interruptible(&edge_port->port->delta_msr_wait);
 	}
 
 	/* Save the new modem status */
@@ -1857,7 +1854,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
 	dev = port->serial->dev;
 
 	memset(&(edge_port->icount), 0x00, sizeof(edge_port->icount));
-	init_waitqueue_head(&edge_port->delta_msr_wait);
 
 	/* turn off loopback */
 	status = ti_do_config(edge_port, UMPC_SET_CLR_LOOPBACK, 0);
@@ -2549,10 +2545,14 @@ static int edge_ioctl(struct tty_struct *tty,
 		dbg("%s - (%d) TIOCMIWAIT", __func__, port->number);
 		cprev = edge_port->icount;
 		while (1) {
-			interruptible_sleep_on(&edge_port->delta_msr_wait);
+			interruptible_sleep_on(&port->delta_msr_wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			cnow = edge_port->icount;
 			if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
 			    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 121/171 ] USB: oti6858: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (119 preceding siblings ...)
  2013-04-11 20:27 ` [ 120/171 ] USB: io_ti: fix use-after-free in TIOCMIWAIT Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 122/171 ] USB: ftdi_sio: " Steven Rostedt
                   ` (49 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0121-USB-oti6858-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2362 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 8edfdab37157d2683e51b8be5d3d5697f66a9f7b ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/oti6858.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 3aa582e..88e31f8 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -191,7 +191,6 @@ struct oti6858_private {
 	u8 setup_done;
 	struct delayed_work delayed_setup_work;
 
-	wait_queue_head_t intr_wait;
 	struct usb_serial_port *port;   /* USB port with which associated */
 };
 
@@ -342,7 +341,6 @@ static int oti6858_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->intr_wait);
 	priv->port = port;
 	INIT_DELAYED_WORK(&priv->delayed_setup_work, setup_line);
 	INIT_DELAYED_WORK(&priv->delayed_write_work, send_data);
@@ -669,11 +667,15 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	while (1) {
-		wait_event_interruptible(priv->intr_wait,
+		wait_event_interruptible(port->delta_msr_wait,
+					port->serial->disconnected ||
 					priv->status.pin_state != prev);
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		status = priv->status.pin_state & PIN_MASK;
 		spin_unlock_irqrestore(&priv->lock, flags);
@@ -771,7 +773,7 @@ static void oti6858_read_int_callback(struct urb *urb)
 
 		if (!priv->transient) {
 			if (xs->pin_state != priv->status.pin_state)
-				wake_up_interruptible(&priv->intr_wait);
+				wake_up_interruptible(&port->delta_msr_wait);
 			memcpy(&priv->status, xs, OTI6858_CTRL_PKT_SIZE);
 		}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 122/171 ] USB: ftdi_sio: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (120 preceding siblings ...)
  2013-04-11 20:27 ` [ 121/171 ] USB: oti6858: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 123/171 ] USB: pl2303: " Steven Rostedt
                   ` (48 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0122-USB-ftdi_sio-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 3611 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 71ccb9b01981fabae27d3c98260ea4613207618e ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

When switching to tty ports, some lifetime assumptions were changed.
Specifically, close can now be called before the final tty reference is
dropped as part of hangup at device disconnect. Even with the ftdi
private-data refcounting this means that the port private data can be
freed while a process is sleeping on modem-status changes and thus
cannot be relied on to detect disconnects when woken up.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ftdi_sio.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index edf6bb4..caa52dd 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -74,9 +74,7 @@ struct ftdi_private {
 	int flags;		/* some ASYNC_xxxx flags are supported */
 	unsigned long last_dtr_rts;	/* saved modem control outputs */
 	struct async_icount	icount;
-	wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
 	char prev_status;        /* Used for TIOCMIWAIT */
-	bool dev_gone;        /* Used to abort TIOCMIWAIT */
 	char transmit_empty;	/* If transmitter is empty or not */
 	struct usb_serial_port *port;
 	__u16 interface;	/* FT2232C, FT2232H or FT4232H port interface
@@ -1691,10 +1689,8 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
 	kref_init(&priv->kref);
 	mutex_init(&priv->cfg_lock);
 	memset(&priv->icount, 0x00, sizeof(priv->icount));
-	init_waitqueue_head(&priv->delta_msr_wait);
 
 	priv->flags = ASYNC_LOW_LATENCY;
-	priv->dev_gone = false;
 
 	if (quirk && quirk->port_probe)
 		quirk->port_probe(priv);
@@ -1841,8 +1837,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
 {
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 
-	priv->dev_gone = true;
-	wake_up_interruptible_all(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 
 	remove_sysfs_attrs(port);
 
@@ -1993,7 +1988,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
 		if (diff_status & FTDI_RS0_RLSD)
 			priv->icount.dcd++;
 
-		wake_up_interruptible_all(&priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 		priv->prev_status = status;
 	}
 
@@ -2392,11 +2387,15 @@ static int ftdi_ioctl(struct tty_struct *tty,
 	 */
 	case TIOCMIWAIT:
 		cprev = priv->icount;
-		while (!priv->dev_gone) {
-			interruptible_sleep_on(&priv->delta_msr_wait);
+		for (;;) {
+			interruptible_sleep_on(&port->delta_msr_wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			cnow = priv->icount;
 			if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
 			    ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
@@ -2406,8 +2405,6 @@ static int ftdi_ioctl(struct tty_struct *tty,
 			}
 			cprev = cnow;
 		}
-		return -EIO;
-		break;
 	case TIOCSERGETLSR:
 		return get_lsr_info(port, (struct serial_struct __user *)arg);
 		break;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 123/171 ] USB: pl2303: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (121 preceding siblings ...)
  2013-04-11 20:27 ` [ 122/171 ] USB: ftdi_sio: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 124/171 ] USB: mos7840: " Steven Rostedt
                   ` (47 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0123-USB-pl2303-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2563 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 40509ca982c00c4b70fc00be887509feca0bff15 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/pl2303.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 4d8d210..bf39f1b 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -141,7 +141,6 @@ struct pl2303_serial_private {
 
 struct pl2303_private {
 	spinlock_t lock;
-	wait_queue_head_t delta_msr_wait;
 	u8 line_control;
 	u8 line_status;
 };
@@ -235,7 +234,6 @@ static int pl2303_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->delta_msr_wait);
 
 	usb_set_serial_port_data(port, priv);
 
@@ -609,11 +607,14 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	while (1) {
-		interruptible_sleep_on(&priv->delta_msr_wait);
+		interruptible_sleep_on(&port->delta_msr_wait);
 		/* see if a signal did it */
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		status = priv->line_status;
 		spin_unlock_irqrestore(&priv->lock, flags);
@@ -721,7 +722,7 @@ static void pl2303_update_line_status(struct usb_serial_port *port,
 	spin_unlock_irqrestore(&priv->lock, flags);
 	if (priv->line_status & UART_BREAK_ERROR)
 		usb_serial_handle_break(port);
-	wake_up_interruptible(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 
 	tty = tty_port_tty_get(&port->port);
 	if (!tty)
@@ -786,7 +787,7 @@ static void pl2303_process_read_urb(struct urb *urb)
 	line_status = priv->line_status;
 	priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
 	spin_unlock_irqrestore(&priv->lock, flags);
-	wake_up_interruptible(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 
 	if (!urb->actual_length)
 		return;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 124/171 ] USB: mos7840: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (122 preceding siblings ...)
  2013-04-11 20:27 ` [ 123/171 ] USB: pl2303: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 125/171 ] USB: spcp8x5: " Steven Rostedt
                   ` (46 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0124-USB-mos7840-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2641 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit a14430db686b8e459e1cf070a6ecf391515c9ab9 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/mos7840.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index fbef4f7..8654df0 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -223,7 +223,6 @@ struct moschip_port {
 	char open;
 	char open_ports;
 	wait_queue_head_t wait_chase;	/* for handling sleeping while waiting for chase to finish */
-	wait_queue_head_t delta_msr_wait;	/* for handling sleeping while waiting for msr change to happen */
 	int delta_msr_cond;
 	struct async_icount icount;
 	struct usb_serial_port *port;	/* loop back to the owner of this object */
@@ -443,7 +442,7 @@ static void mos7840_handle_new_msr(struct moschip_port *port, __u8 new_msr)
 		}
 
 		mos7840_port->delta_msr_cond = 1;
-		wake_up_interruptible(&mos7840_port->delta_msr_wait);
+		wake_up_interruptible(&port->port->delta_msr_wait);
 	}
 }
 
@@ -1165,7 +1164,6 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port)
 
 	/* initialize our wait queues */
 	init_waitqueue_head(&mos7840_port->wait_chase);
-	init_waitqueue_head(&mos7840_port->delta_msr_wait);
 
 	/* initialize our icount structure */
 	memset(&(mos7840_port->icount), 0x00, sizeof(mos7840_port->icount));
@@ -2306,13 +2304,18 @@ static int mos7840_ioctl(struct tty_struct *tty,
 		while (1) {
 			/* interruptible_sleep_on(&mos7840_port->delta_msr_wait); */
 			mos7840_port->delta_msr_cond = 0;
-			wait_event_interruptible(mos7840_port->delta_msr_wait,
-						 (mos7840_port->
+			wait_event_interruptible(port->delta_msr_wait,
+						 (port->serial->disconnected ||
+						  mos7840_port->
 						  delta_msr_cond == 1));
 
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			cnow = mos7840_port->icount;
 			smp_rmb();
 			if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 125/171 ] USB: spcp8x5: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (123 preceding siblings ...)
  2013-04-11 20:27 ` [ 124/171 ] USB: mos7840: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 126/171 ] USB: ssu100: " Steven Rostedt
                   ` (45 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0125-USB-spcp8x5-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2226 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit dbcea7615d8d7d58f6ff49d2c5568113f70effe9 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/spcp8x5.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 2451c08..0822a10 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -154,7 +154,6 @@ enum spcp8x5_type {
 struct spcp8x5_private {
 	spinlock_t 	lock;
 	enum spcp8x5_type	type;
-	wait_queue_head_t	delta_msr_wait;
 	u8 			line_control;
 	u8 			line_status;
 };
@@ -184,7 +183,6 @@ static int spcp8x5_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->delta_msr_wait);
 	priv->type = type;
 
 	usb_set_serial_port_data(port , priv);
@@ -481,7 +479,7 @@ static void spcp8x5_process_read_urb(struct urb *urb)
 	priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
 	spin_unlock_irqrestore(&priv->lock, flags);
 	/* wake up the wait for termios */
-	wake_up_interruptible(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 
 	if (!urb->actual_length)
 		return;
@@ -531,12 +529,15 @@ static int spcp8x5_wait_modem_info(struct usb_serial_port *port,
 
 	while (1) {
 		/* wake up in bulk read */
-		interruptible_sleep_on(&priv->delta_msr_wait);
+		interruptible_sleep_on(&port->delta_msr_wait);
 
 		/* see if a signal did it */
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		status = priv->line_status;
 		spin_unlock_irqrestore(&priv->lock, flags);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 126/171 ] USB: ssu100: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (124 preceding siblings ...)
  2013-04-11 20:27 ` [ 125/171 ] USB: spcp8x5: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 127/171 ] USB: ch341: " Steven Rostedt
                   ` (44 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0126-USB-ssu100-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2491 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 43a66b4c417ad15f6d2f632ce67ad195bdf999e8 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ssu100.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index fe3a8a0..fd260de 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -65,7 +65,6 @@ struct ssu100_port_private {
 	spinlock_t status_lock;
 	u8 shadowLSR;
 	u8 shadowMSR;
-	wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
 	struct async_icount icount;
 };
 
@@ -359,8 +358,9 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->status_lock, flags);
 
 	while (1) {
-		wait_event_interruptible(priv->delta_msr_wait,
-					 ((priv->icount.rng != prev.rng) ||
+		wait_event_interruptible(port->delta_msr_wait,
+					 (port->serial->disconnected ||
+					  (priv->icount.rng != prev.rng) ||
 					  (priv->icount.dsr != prev.dsr) ||
 					  (priv->icount.dcd != prev.dcd) ||
 					  (priv->icount.cts != prev.cts)));
@@ -368,6 +368,9 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->status_lock, flags);
 		cur = priv->icount;
 		spin_unlock_irqrestore(&priv->status_lock, flags);
@@ -449,7 +452,6 @@ static int ssu100_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->status_lock);
-	init_waitqueue_head(&priv->delta_msr_wait);
 
 	usb_set_serial_port_data(port, priv);
 
@@ -544,7 +546,7 @@ static void ssu100_update_msr(struct usb_serial_port *port, u8 msr)
 			priv->icount.dcd++;
 		if (msr & UART_MSR_TERI)
 			priv->icount.rng++;
-		wake_up_interruptible(&priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 	}
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 127/171 ] USB: ch341: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (125 preceding siblings ...)
  2013-04-11 20:27 ` [ 126/171 ] USB: ssu100: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 128/171 ] USB: io_edgeport: " Steven Rostedt
                   ` (43 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0127-USB-ch341-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2710 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit fa1e11d5231c001c80a479160b5832933c5d35fb ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ch341.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 8391d30..65fb3e0 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -82,7 +82,6 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 struct ch341_private {
 	spinlock_t lock; /* access lock */
-	wait_queue_head_t delta_msr_wait; /* wait queue for modem status */
 	unsigned baud_rate; /* set baud rate */
 	u8 line_control; /* set line control value RTS/DTR */
 	u8 line_status; /* active status of modem control inputs */
@@ -251,7 +250,6 @@ static int ch341_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->delta_msr_wait);
 	priv->baud_rate = DEFAULT_BAUD_RATE;
 	priv->line_control = CH341_BIT_RTS | CH341_BIT_DTR;
 
@@ -297,7 +295,7 @@ static void ch341_dtr_rts(struct usb_serial_port *port, int on)
 		priv->line_control &= ~(CH341_BIT_RTS | CH341_BIT_DTR);
 	spin_unlock_irqrestore(&priv->lock, flags);
 	ch341_set_handshake(port->serial->dev, priv->line_control);
-	wake_up_interruptible(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 }
 
 static void ch341_close(struct usb_serial_port *port)
@@ -490,7 +488,7 @@ static void ch341_read_int_callback(struct urb *urb)
 			tty_kref_put(tty);
 		}
 
-		wake_up_interruptible(&priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 	}
 
 exit:
@@ -516,11 +514,14 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	while (!multi_change) {
-		interruptible_sleep_on(&priv->delta_msr_wait);
+		interruptible_sleep_on(&port->delta_msr_wait);
 		/* see if a signal did it */
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		status = priv->line_status;
 		multi_change = priv->multi_status_change;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 128/171 ] USB: io_edgeport: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (126 preceding siblings ...)
  2013-04-11 20:27 ` [ 127/171 ] USB: ch341: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 129/171 ] USB: f81232: " Steven Rostedt
                   ` (42 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0128-USB-io_edgeport-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2908 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 333576255d4cfc53efd056aad438568184b36af6 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/io_edgeport.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 6c22679..3067157 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -114,7 +114,6 @@ struct edgeport_port {
 	wait_queue_head_t	wait_chase;		/* for handling sleeping while waiting for chase to finish */
 	wait_queue_head_t	wait_open;		/* for handling sleeping while waiting for open to finish */
 	wait_queue_head_t	wait_command;		/* for handling sleeping while waiting for command to finish */
-	wait_queue_head_t	delta_msr_wait;		/* for handling sleeping while waiting for msr change to happen */
 
 	struct async_icount	icount;
 	struct usb_serial_port	*port;			/* loop back to the owner of this object */
@@ -886,7 +885,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
 	/* initialize our wait queues */
 	init_waitqueue_head(&edge_port->wait_open);
 	init_waitqueue_head(&edge_port->wait_chase);
-	init_waitqueue_head(&edge_port->delta_msr_wait);
 	init_waitqueue_head(&edge_port->wait_command);
 
 	/* initialize our icount structure */
@@ -1703,13 +1701,17 @@ static int edge_ioctl(struct tty_struct *tty,
 		dbg("%s (%d) TIOCMIWAIT", __func__,  port->number);
 		cprev = edge_port->icount;
 		while (1) {
-			prepare_to_wait(&edge_port->delta_msr_wait,
+			prepare_to_wait(&port->delta_msr_wait,
 						&wait, TASK_INTERRUPTIBLE);
 			schedule();
-			finish_wait(&edge_port->delta_msr_wait, &wait);
+			finish_wait(&port->delta_msr_wait, &wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			cnow = edge_port->icount;
 			if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
 			    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
@@ -2090,7 +2092,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr)
 			icount->dcd++;
 		if (newMsr & EDGEPORT_MSR_DELTA_RI)
 			icount->rng++;
-		wake_up_interruptible(&edge_port->delta_msr_wait);
+		wake_up_interruptible(&edge_port->port->delta_msr_wait);
 	}
 
 	/* Save the new modem status */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 129/171 ] USB: f81232: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (127 preceding siblings ...)
  2013-04-11 20:27 ` [ 128/171 ] USB: io_edgeport: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 130/171 ] USB: ark3116: " Steven Rostedt
                   ` (41 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0129-USB-f81232-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2203 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 508f940f1407656076a2e7d8f7fa059b567ecac2 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/f81232.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index be94436..441f09a 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -49,7 +49,6 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 struct f81232_private {
 	spinlock_t lock;
-	wait_queue_head_t delta_msr_wait;
 	u8 line_control;
 	u8 line_status;
 };
@@ -114,7 +113,7 @@ static void f81232_process_read_urb(struct urb *urb)
 	line_status = priv->line_status;
 	priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
 	spin_unlock_irqrestore(&priv->lock, flags);
-	wake_up_interruptible(&priv->delta_msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 
 	if (!urb->actual_length)
 		return;
@@ -262,11 +261,14 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	while (1) {
-		interruptible_sleep_on(&priv->delta_msr_wait);
+		interruptible_sleep_on(&port->delta_msr_wait);
 		/* see if a signal did it */
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 
+		if (port->serial->disconnected)
+			return -EIO;
+
 		spin_lock_irqsave(&priv->lock, flags);
 		status = priv->line_status;
 		spin_unlock_irqrestore(&priv->lock, flags);
@@ -328,7 +330,6 @@ static int f81232_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->delta_msr_wait);
 
 	usb_set_serial_port_data(port, priv);
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 130/171 ] USB: ark3116: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (128 preceding siblings ...)
  2013-04-11 20:27 ` [ 129/171 ] USB: f81232: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 131/171 ] USB: mct_u232: " Steven Rostedt
                   ` (40 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0130-USB-ark3116-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2184 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 5018860321dc7a9e50a75d5f319bc981298fb5b7 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ark3116.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index a6758ff..5f9eaaf 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -68,7 +68,6 @@ static int is_irda(struct usb_serial *serial)
 }
 
 struct ark3116_private {
-	wait_queue_head_t       delta_msr_wait;
 	struct async_icount	icount;
 	int			irda;	/* 1 for irda device */
 
@@ -152,7 +151,6 @@ static int ark3116_port_probe(struct usb_serial_port *port)
 	if (!priv)
 		return -ENOMEM;
 
-	init_waitqueue_head(&priv->delta_msr_wait);
 	mutex_init(&priv->hw_lock);
 	spin_lock_init(&priv->status_lock);
 
@@ -462,10 +460,14 @@ static int ark3116_ioctl(struct tty_struct *tty,
 	case TIOCMIWAIT:
 		for (;;) {
 			struct async_icount prev = priv->icount;
-			interruptible_sleep_on(&priv->delta_msr_wait);
+			interruptible_sleep_on(&port->delta_msr_wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			if ((prev.rng == priv->icount.rng) &&
 			    (prev.dsr == priv->icount.dsr) &&
 			    (prev.dcd == priv->icount.dcd) &&
@@ -586,7 +588,7 @@ static void ark3116_update_msr(struct usb_serial_port *port, __u8 msr)
 			priv->icount.dcd++;
 		if (msr & UART_MSR_TERI)
 			priv->icount.rng++;
-		wake_up_interruptible(&priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 	}
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 131/171 ] USB: mct_u232: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (129 preceding siblings ...)
  2013-04-11 20:27 ` [ 130/171 ] USB: ark3116: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 132/171 ] USB: cypress_m8: " Steven Rostedt
                   ` (39 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0131-USB-mct_u232-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2514 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit cf1d24443677a0758cfa88ca40f24858b89261c0 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/mct_u232.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index c088250..505c954 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -120,8 +120,6 @@ struct mct_u232_private {
 	unsigned char	     last_msr;      /* Modem Status Register */
 	unsigned int	     rx_flags;      /* Throttling flags */
 	struct async_icount  icount;
-	wait_queue_head_t    msr_wait;	/* for handling sleeping while waiting
-						for msr change to happen */
 };
 
 #define THROTTLED		0x01
@@ -417,7 +415,6 @@ static int mct_u232_port_probe(struct usb_serial_port *port)
 		return -ENOMEM;
 
 	spin_lock_init(&priv->lock);
-	init_waitqueue_head(&priv->msr_wait);
 
 	usb_set_serial_port_data(port, priv);
 
@@ -625,7 +622,7 @@ static void mct_u232_read_int_callback(struct urb *urb)
 		tty_kref_put(tty);
 	}
 #endif
-	wake_up_interruptible(&priv->msr_wait);
+	wake_up_interruptible(&port->delta_msr_wait);
 	spin_unlock_irqrestore(&priv->lock, flags);
 exit:
 	retval = usb_submit_urb(urb, GFP_ATOMIC);
@@ -836,13 +833,17 @@ static int  mct_u232_ioctl(struct tty_struct *tty,
 		cprev = mct_u232_port->icount;
 		spin_unlock_irqrestore(&mct_u232_port->lock, flags);
 		for ( ; ; ) {
-			prepare_to_wait(&mct_u232_port->msr_wait,
+			prepare_to_wait(&port->delta_msr_wait,
 					&wait, TASK_INTERRUPTIBLE);
 			schedule();
-			finish_wait(&mct_u232_port->msr_wait, &wait);
+			finish_wait(&port->delta_msr_wait, &wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			spin_lock_irqsave(&mct_u232_port->lock, flags);
 			cnow = mct_u232_port->icount;
 			spin_unlock_irqrestore(&mct_u232_port->lock, flags);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 132/171 ] USB: cypress_m8: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (130 preceding siblings ...)
  2013-04-11 20:27 ` [ 131/171 ] USB: mct_u232: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 133/171 ] USB: ti_usb_3410_5052: " Steven Rostedt
                   ` (38 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0132-USB-cypress_m8-fix-use-after-free-in-TIOCMIWAIT.patch --]
[-- Type: text/plain, Size: 2655 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit 356050d8b1e526db093e9d2c78daf49d6bf418e3 ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Also remove bogus test for private data pointer being NULL as it is
never assigned in the loop.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/cypress_m8.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 5ad6e7d..61de7e1 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -116,7 +116,6 @@ struct cypress_private {
 	int baud_rate;			   /* stores current baud rate in
 					      integer form */
 	int isthrottled;		   /* if throttled, discard reads */
-	wait_queue_head_t delta_msr_wait;  /* used for TIOCMIWAIT */
 	char prev_status, diff_status;	   /* used for TIOCMIWAIT */
 	/* we pass a pointer to this as the argument sent to
 	   cypress_set_termios old_termios */
@@ -452,7 +451,6 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)
 		kfree(priv);
 		return -ENOMEM;
 	}
-	init_waitqueue_head(&priv->delta_msr_wait);
 
 	usb_reset_configuration(serial->dev);
 
@@ -872,12 +870,16 @@ static int cypress_ioctl(struct tty_struct *tty,
 	switch (cmd) {
 	/* This code comes from drivers/char/serial.c and ftdi_sio.c */
 	case TIOCMIWAIT:
-		while (priv != NULL) {
-			interruptible_sleep_on(&priv->delta_msr_wait);
+		for (;;) {
+			interruptible_sleep_on(&port->delta_msr_wait);
 			/* see if a signal did it */
 			if (signal_pending(current))
 				return -ERESTARTSYS;
-			else {
+
+			if (port->serial->disconnected)
+				return -EIO;
+
+			{
 				char diff = priv->diff_status;
 				if (diff == 0)
 					return -EIO; /* no change => error */
@@ -1193,7 +1195,7 @@ static void cypress_read_int_callback(struct urb *urb)
 	if (priv->current_status != priv->prev_status) {
 		priv->diff_status |= priv->current_status ^
 			priv->prev_status;
-		wake_up_interruptible(&priv->delta_msr_wait);
+		wake_up_interruptible(&port->delta_msr_wait);
 		priv->prev_status = priv->current_status;
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 133/171 ] USB: ti_usb_3410_5052: fix use-after-free in TIOCMIWAIT
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (131 preceding siblings ...)
  2013-04-11 20:27 ` [ 132/171 ] USB: cypress_m8: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 134/171 ] usb: gadget: udc-core: fix a regression during gadget driver unbinding Steven Rostedt
                   ` (37 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Johan Hovold, Greg Kroah-Hartman

[-- Attachment #1: 0133-USB-ti_usb_3410_5052-fix-use-after-free-in-TIOCMIWAI.patch --]
[-- Type: text/plain, Size: 2470 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Johan Hovold <jhovold@gmail.com>

[ Upstream commit fc98ab873aa3dbe783ce56a2ffdbbe7c7609521a ]

Use the port wait queue and make sure to check the serial disconnected
flag before accessing private port data after waking up.

This is is needed as the private port data (including the wait queue
itself) can be gone when waking up after a disconnect.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/serial/ti_usb_3410_5052.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 33537bb..722069c 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -75,7 +75,6 @@ struct ti_port {
 	int			tp_flags;
 	int			tp_closing_wait;/* in .01 secs */
 	struct async_icount	tp_icount;
-	wait_queue_head_t	tp_msr_wait;	/* wait for msr change */
 	wait_queue_head_t	tp_write_wait;
 	struct ti_device	*tp_tdev;
 	struct usb_serial_port	*tp_port;
@@ -442,7 +441,6 @@ static int ti_port_probe(struct usb_serial_port *port)
 	else
 		tport->tp_uart_base_addr = TI_UART2_BASE_ADDR;
 	tport->tp_closing_wait = closing_wait;
-	init_waitqueue_head(&tport->tp_msr_wait);
 	init_waitqueue_head(&tport->tp_write_wait);
 	if (kfifo_alloc(&tport->write_fifo, TI_WRITE_BUF_SIZE, GFP_KERNEL)) {
 		kfree(tport);
@@ -798,9 +796,13 @@ static int ti_ioctl(struct tty_struct *tty,
 		dbg("%s - (%d) TIOCMIWAIT", __func__, port->number);
 		cprev = tport->tp_icount;
 		while (1) {
-			interruptible_sleep_on(&tport->tp_msr_wait);
+			interruptible_sleep_on(&port->delta_msr_wait);
 			if (signal_pending(current))
 				return -ERESTARTSYS;
+
+			if (port->serial->disconnected)
+				return -EIO;
+
 			cnow = tport->tp_icount;
 			if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
 			    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
@@ -1412,7 +1414,7 @@ static void ti_handle_new_msr(struct ti_port *tport, __u8 msr)
 			icount->dcd++;
 		if (msr & TI_MSR_DELTA_RI)
 			icount->rng++;
-		wake_up_interruptible(&tport->tp_msr_wait);
+		wake_up_interruptible(&tport->tp_port->delta_msr_wait);
 		spin_unlock_irqrestore(&tport->tp_lock, flags);
 	}
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 134/171 ] usb: gadget: udc-core: fix a regression during gadget driver unbinding
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (132 preceding siblings ...)
  2013-04-11 20:27 ` [ 133/171 ] USB: ti_usb_3410_5052: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 135/171 ] loop: prevent bdev freeing while device in use Steven Rostedt
                   ` (36 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Alan Stern, Felipe Balbi

[-- Attachment #1: 0134-usb-gadget-udc-core-fix-a-regression-during-gadget-d.patch --]
[-- Type: text/plain, Size: 1566 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

[ Upstream commit 511f3c5326eabe1ece35202a404c24c0aeacc246 ]

This patch (as1666) fixes a regression in the UDC core.  The core
takes care of unbinding gadget drivers, and it does the unbinding
before telling the UDC driver to turn off the controller hardware.
When the call to the udc_stop callback is made, the gadget no longer
has a driver.  The callback routine should not be invoked with a
pointer to the old driver; doing so can cause problems (such as
use-after-free accesses in net2280).

This patch should be applied, with appropriate context changes, to all
the stable kernels going back to 3.1.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/gadget/udc-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index e5e44f8..b0af333 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -265,7 +265,7 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
 		udc->driver->disconnect(udc->gadget);
 		usb_gadget_disconnect(udc->gadget);
 		udc->driver->unbind(udc->gadget);
-		usb_gadget_udc_stop(udc->gadget, udc->driver);
+		usb_gadget_udc_stop(udc->gadget, NULL);
 	} else {
 		usb_gadget_stop(udc->gadget, udc->driver);
 	}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 135/171 ] loop: prevent bdev freeing while device in use
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (133 preceding siblings ...)
  2013-04-11 20:27 ` [ 134/171 ] usb: gadget: udc-core: fix a regression during gadget driver unbinding Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 136/171 ] ARM: cns3xxx: fix mapping of private memory region Steven Rostedt
                   ` (35 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Anatol Pomozov, Al Viro

[-- Attachment #1: 0135-loop-prevent-bdev-freeing-while-device-in-use.patch --]
[-- Type: text/plain, Size: 3446 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Anatol Pomozov <anatol.pomozov@gmail.com>

[ Upstream commit c1681bf8a7b1b98edee8b862a42c19c4e53205fd ]

struct block_device lifecycle is defined by its inode (see fs/block_dev.c) -
block_device allocated first time we access /dev/loopXX and deallocated on
bdev_destroy_inode. When we create the device "losetup /dev/loopXX afile"
we want that block_device stay alive until we destroy the loop device
with "losetup -d".

But because we do not hold /dev/loopXX inode its counter goes 0, and
inode/bdev can be destroyed at any moment. Usually it happens at memory
pressure or when user drops inode cache (like in the test below). When later in
loop_clr_fd() we want to use bdev we have use-after-free error with following
stack:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000280
  bd_set_size+0x10/0xa0
  loop_clr_fd+0x1f8/0x420 [loop]
  lo_ioctl+0x200/0x7e0 [loop]
  lo_compat_ioctl+0x47/0xe0 [loop]
  compat_blkdev_ioctl+0x341/0x1290
  do_filp_open+0x42/0xa0
  compat_sys_ioctl+0xc1/0xf20
  do_sys_open+0x16e/0x1d0
  sysenter_dispatch+0x7/0x1a

To prevent use-after-free we need to grab the device in loop_set_fd()
and put it later in loop_clr_fd().

The issue is reprodusible on current Linus head and v3.3. Here is the test:

  dd if=/dev/zero of=loop.file bs=1M count=1
  while [ true ]; do
    losetup /dev/loop0 loop.file
    echo 2 > /proc/sys/vm/drop_caches
    losetup -d /dev/loop0
  done

[ Doing bdgrab/bput in loop_set_fd/loop_clr_fd is safe, because every
  time we call loop_set_fd() we check that loop_device->lo_state is
  Lo_unbound and set it to Lo_bound If somebody will try to set_fd again
  it will get EBUSY.  And if we try to loop_clr_fd() on unbound loop
  device we'll get ENXIO.

  loop_set_fd/loop_clr_fd (and any other loop ioctl) is called under
  loop_device->lo_ctl_mutex. ]

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/loop.c |    9 ++++++++-
 fs/block_dev.c       |    1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3bba655..1d6b89d 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -908,6 +908,11 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
 		lo->lo_flags |= LO_FLAGS_PARTSCAN;
 	if (lo->lo_flags & LO_FLAGS_PARTSCAN)
 		ioctl_by_bdev(bdev, BLKRRPART, 0);
+
+	/* Grab the block_device to prevent its destruction after we
+	 * put /dev/loopXX inode. Later in loop_clr_fd() we bdput(bdev).
+	 */
+	bdgrab(bdev);
 	return 0;
 
 out_clr:
@@ -1004,8 +1009,10 @@ static int loop_clr_fd(struct loop_device *lo)
 	memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);
 	memset(lo->lo_crypt_name, 0, LO_NAME_SIZE);
 	memset(lo->lo_file_name, 0, LO_NAME_SIZE);
-	if (bdev)
+	if (bdev) {
+		bdput(bdev);
 		invalidate_bdev(bdev);
+	}
 	set_capacity(lo->lo_disk, 0);
 	loop_sysfs_exit(lo);
 	if (bdev) {
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 38e721b..daaca3d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -604,6 +604,7 @@ struct block_device *bdgrab(struct block_device *bdev)
 	ihold(bdev->bd_inode);
 	return bdev;
 }
+EXPORT_SYMBOL(bdgrab);
 
 long nr_blockdev_pages(void)
 {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 136/171 ] ARM: cns3xxx: fix mapping of private memory region
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (134 preceding siblings ...)
  2013-04-11 20:27 ` [ 135/171 ] loop: prevent bdev freeing while device in use Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 137/171 ] ARM: kirkwood: Fix chip-delay for GoFlex Net Steven Rostedt
                   ` (34 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Mac Lin, Anton Vorontsov

[-- Attachment #1: 0136-ARM-cns3xxx-fix-mapping-of-private-memory-region.patch --]
[-- Type: text/plain, Size: 4165 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mac Lin <mkl0301@gmail.com>

[ Upstream commit a3d9052c6296ad3398d3ad649c3c682c3e7ecfa6 ]

Since commit 0536bdf33faf (ARM: move iotable mappings within the vmalloc
region), the Cavium CNS3xxx cannot boot anymore.

This is caused by the pre-defined iotable mappings is not in the vmalloc
region. This patch move the iotable mappings into the vmalloc region, and
merge the MPCore private memory region (containing the SCU, the GIC and
the TWD) as a single region.

Signed-off-by: Mac Lin <mkl0301@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Cc: stable@vger.kernel.org [v3.3+]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-cns3xxx/core.c                 |   16 +++-------------
 arch/arm/mach-cns3xxx/include/mach/cns3xxx.h |   16 ++++++++--------
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
index 031805b..7f26faf 100644
--- a/arch/arm/mach-cns3xxx/core.c
+++ b/arch/arm/mach-cns3xxx/core.c
@@ -22,19 +22,9 @@
 
 static struct map_desc cns3xxx_io_desc[] __initdata = {
 	{
-		.virtual	= CNS3XXX_TC11MP_TWD_BASE_VIRT,
-		.pfn		= __phys_to_pfn(CNS3XXX_TC11MP_TWD_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE,
-	}, {
-		.virtual	= CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT,
-		.pfn		= __phys_to_pfn(CNS3XXX_TC11MP_GIC_CPU_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE,
-	}, {
-		.virtual	= CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT,
-		.pfn		= __phys_to_pfn(CNS3XXX_TC11MP_GIC_DIST_BASE),
-		.length		= SZ_4K,
+		.virtual	= CNS3XXX_TC11MP_SCU_BASE_VIRT,
+		.pfn		= __phys_to_pfn(CNS3XXX_TC11MP_SCU_BASE),
+		.length		= SZ_8K,
 		.type		= MT_DEVICE,
 	}, {
 		.virtual	= CNS3XXX_TIMER1_2_3_BASE_VIRT,
diff --git a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
index 191c8e5..b1021aa 100644
--- a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
+++ b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
@@ -94,10 +94,10 @@
 #define RTC_INTR_STS_OFFSET			0x34
 
 #define CNS3XXX_MISC_BASE			0x76000000	/* Misc Control */
-#define CNS3XXX_MISC_BASE_VIRT			0xFFF07000	/* Misc Control */
+#define CNS3XXX_MISC_BASE_VIRT			0xFB000000	/* Misc Control */
 
 #define CNS3XXX_PM_BASE				0x77000000	/* Power Management Control */
-#define CNS3XXX_PM_BASE_VIRT			0xFFF08000
+#define CNS3XXX_PM_BASE_VIRT			0xFB001000
 
 #define PM_CLK_GATE_OFFSET			0x00
 #define PM_SOFT_RST_OFFSET			0x04
@@ -109,7 +109,7 @@
 #define PM_PLL_HM_PD_OFFSET			0x1C
 
 #define CNS3XXX_UART0_BASE			0x78000000	/* UART 0 */
-#define CNS3XXX_UART0_BASE_VIRT			0xFFF09000
+#define CNS3XXX_UART0_BASE_VIRT			0xFB002000
 
 #define CNS3XXX_UART1_BASE			0x78400000	/* UART 1 */
 #define CNS3XXX_UART1_BASE_VIRT			0xFFF0A000
@@ -130,7 +130,7 @@
 #define CNS3XXX_I2S_BASE_VIRT			0xFFF10000
 
 #define CNS3XXX_TIMER1_2_3_BASE			0x7C800000	/* Timer */
-#define CNS3XXX_TIMER1_2_3_BASE_VIRT		0xFFF10800
+#define CNS3XXX_TIMER1_2_3_BASE_VIRT		0xFB003000
 
 #define TIMER1_COUNTER_OFFSET			0x00
 #define TIMER1_AUTO_RELOAD_OFFSET		0x04
@@ -227,16 +227,16 @@
  * Testchip peripheral and fpga gic regions
  */
 #define CNS3XXX_TC11MP_SCU_BASE			0x90000000	/* IRQ, Test chip */
-#define CNS3XXX_TC11MP_SCU_BASE_VIRT		0xFF000000
+#define CNS3XXX_TC11MP_SCU_BASE_VIRT		0xFB004000
 
 #define CNS3XXX_TC11MP_GIC_CPU_BASE		0x90000100	/* Test chip interrupt controller CPU interface */
-#define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT	0xFF000100
+#define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT	(CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x100)
 
 #define CNS3XXX_TC11MP_TWD_BASE			0x90000600
-#define CNS3XXX_TC11MP_TWD_BASE_VIRT		0xFF000600
+#define CNS3XXX_TC11MP_TWD_BASE_VIRT		(CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x600)
 
 #define CNS3XXX_TC11MP_GIC_DIST_BASE		0x90001000	/* Test chip interrupt controller distributor */
-#define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT	0xFF001000
+#define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT	(CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x1000)
 
 #define CNS3XXX_TC11MP_L220_BASE		0x92002000	/* L220 registers */
 #define CNS3XXX_TC11MP_L220_BASE_VIRT		0xFF002000
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 137/171 ] ARM: kirkwood: Fix chip-delay for GoFlex Net
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (135 preceding siblings ...)
  2013-04-11 20:27 ` [ 136/171 ] ARM: cns3xxx: fix mapping of private memory region Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 138/171 ] virtio: console: rename cvq_lock to c_ivq_lock Steven Rostedt
                   ` (33 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Eric Hutter, Andrew Lunn, Jason Cooper

[-- Attachment #1: 0137-ARM-kirkwood-Fix-chip-delay-for-GoFlex-Net.patch --]
[-- Type: text/plain, Size: 1042 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Hutter <hutter.eric@gmail.com>

[ Upstream commit 2992714d431976c4b154875bd18ba61bf4df3b93 ]

This fixes "Too few good blocks within range" issues on GoFlex Net by setting
chip-delay to 40.

The basic problem was discussed at http://forum.doozan.com/read.php?2,7451

Signed-off-by: Eric Hutter <hutter.eric@gmail.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Cc: <stable@vger.kernel.org> # v3.6.x
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/boot/dts/kirkwood-goflexnet.dts |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index 7c8238f..a66a8eb 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -22,6 +22,7 @@
 		};
 
 		nand@3000000 {
+			chip-delay = <40>;
 			status = "okay";
 
 			partition@0 {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 138/171 ] virtio: console: rename cvq_lock to c_ivq_lock
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (136 preceding siblings ...)
  2013-04-11 20:27 ` [ 137/171 ] ARM: kirkwood: Fix chip-delay for GoFlex Net Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 139/171 ] virtio: console: add locking around c_ovq operations Steven Rostedt
                   ` (32 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Amit Shah, Asias He, Wanlong Gao, Rusty Russell, stable

[-- Attachment #1: 0138-virtio-console-rename-cvq_lock-to-c_ivq_lock.patch --]
[-- Type: text/plain, Size: 2853 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Amit Shah <amit.shah@redhat.com>

[ Upstream commit 165b1b8bbc17c9469b053bab78b11b7cbce6d161 ]

The cvq_lock was taken for the c_ivq.  Rename the lock to make that
obvious.

We'll also add a lock around the c_ovq in the next commit, so there's no
ambiguity.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Asias He <asias@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/char/virtio_console.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index cdf2f54..86cfffe 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -131,7 +131,7 @@ struct ports_device {
 	spinlock_t ports_lock;
 
 	/* To protect the vq operations for the control channel */
-	spinlock_t cvq_lock;
+	spinlock_t c_ivq_lock;
 
 	/* The current config space is stored here */
 	struct virtio_console_config config;
@@ -1465,23 +1465,23 @@ static void control_work_handler(struct work_struct *work)
 	portdev = container_of(work, struct ports_device, control_work);
 	vq = portdev->c_ivq;
 
-	spin_lock(&portdev->cvq_lock);
+	spin_lock(&portdev->c_ivq_lock);
 	while ((buf = virtqueue_get_buf(vq, &len))) {
-		spin_unlock(&portdev->cvq_lock);
+		spin_unlock(&portdev->c_ivq_lock);
 
 		buf->len = len;
 		buf->offset = 0;
 
 		handle_control_message(portdev, buf);
 
-		spin_lock(&portdev->cvq_lock);
+		spin_lock(&portdev->c_ivq_lock);
 		if (add_inbuf(portdev->c_ivq, buf) < 0) {
 			dev_warn(&portdev->vdev->dev,
 				 "Error adding buffer to queue\n");
 			free_buf(buf);
 		}
 	}
-	spin_unlock(&portdev->cvq_lock);
+	spin_unlock(&portdev->c_ivq_lock);
 }
 
 static void out_intr(struct virtqueue *vq)
@@ -1742,10 +1742,11 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
 	if (multiport) {
 		unsigned int nr_added_bufs;
 
-		spin_lock_init(&portdev->cvq_lock);
+		spin_lock_init(&portdev->c_ivq_lock);
 		INIT_WORK(&portdev->control_work, &control_work_handler);
 
-		nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock);
+		nr_added_bufs = fill_queue(portdev->c_ivq,
+					   &portdev->c_ivq_lock);
 		if (!nr_added_bufs) {
 			dev_err(&vdev->dev,
 				"Error allocating buffers for control queue\n");
@@ -1885,7 +1886,7 @@ static int virtcons_restore(struct virtio_device *vdev)
 		return ret;
 
 	if (use_multiport(portdev))
-		fill_queue(portdev->c_ivq, &portdev->cvq_lock);
+		fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
 
 	list_for_each_entry(port, &portdev->ports, list) {
 		port->in_vq = portdev->in_vqs[port->id];
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 139/171 ] virtio: console: add locking around c_ovq operations
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (137 preceding siblings ...)
  2013-04-11 20:27 ` [ 138/171 ] virtio: console: rename cvq_lock to c_ivq_lock Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 140/171 ] nfsd4: reject "negative" acl lengths Steven Rostedt
                   ` (31 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: FuXiangChun, Amit Shah, Wanlong Gao, Asias He, Rusty Russell,
	stable

[-- Attachment #1: 0139-virtio-console-add-locking-around-c_ovq-operations.patch --]
[-- Type: text/plain, Size: 2499 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Amit Shah <amit.shah@redhat.com>

[ Upstream commit 9ba5c80b1aea8648a3efe5f22dc1f7cacdfbeeb8 ]

When multiple ovq operations are being performed (lots of open/close
operations on virtio_console fds), the __send_control_msg() function can
get confused without locking.

A simple recipe to cause badness is:
* create a QEMU VM with two virtio-serial ports
* in the guest, do
  while true;do echo abc >/dev/vport0p1;done
  while true;do echo edf >/dev/vport0p2;done

In one run, this caused a panic in __send_control_msg().  In another, I
got

   virtio_console virtio0: control-o:id 0 is not a head!

This also results repeated messages similar to these on the host:

  qemu-kvm: virtio-serial-bus: Unexpected port id 478762112 for device virtio-serial-bus.0
  qemu-kvm: virtio-serial-bus: Unexpected port id 478762368 for device virtio-serial-bus.0

Reported-by: FuXiangChun <xfu@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Asias He <asias@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/char/virtio_console.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 86cfffe..d2f7eb0 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -132,6 +132,7 @@ struct ports_device {
 
 	/* To protect the vq operations for the control channel */
 	spinlock_t c_ivq_lock;
+	spinlock_t c_ovq_lock;
 
 	/* The current config space is stored here */
 	struct virtio_console_config config;
@@ -457,11 +458,14 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
 	vq = portdev->c_ovq;
 
 	sg_init_one(sg, &cpkt, sizeof(cpkt));
+
+	spin_lock(&portdev->c_ovq_lock);
 	if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) >= 0) {
 		virtqueue_kick(vq);
 		while (!virtqueue_get_buf(vq, &len))
 			cpu_relax();
 	}
+	spin_unlock(&portdev->c_ovq_lock);
 	return 0;
 }
 
@@ -1743,6 +1747,7 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
 		unsigned int nr_added_bufs;
 
 		spin_lock_init(&portdev->c_ivq_lock);
+		spin_lock_init(&portdev->c_ovq_lock);
 		INIT_WORK(&portdev->control_work, &control_work_handler);
 
 		nr_added_bufs = fill_queue(portdev->c_ivq,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 140/171 ] nfsd4: reject "negative" acl lengths
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (138 preceding siblings ...)
  2013-04-11 20:27 ` [ 139/171 ] virtio: console: add locking around c_ovq operations Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 141/171 ] drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n() Steven Rostedt
                   ` (30 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Toralf Förster, stable, J. Bruce Fields

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0140-nfsd4-reject-negative-acl-lengths.patch --]
[-- Type: text/plain, Size: 1036 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "J. Bruce Fields" <bfields@redhat.com>

[ Upstream commit 64a817cfbded8674f345d1117b117f942a351a69 ]

Since we only enforce an upper bound, not a lower bound, a "negative"
length can get through here.

The symptom seen was a warning when we attempt to a kmalloc with an
excessive size.

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/nfsd/nfs4xdr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 6322df3..551b061 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -263,7 +263,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 		iattr->ia_valid |= ATTR_SIZE;
 	}
 	if (bmval[0] & FATTR4_WORD0_ACL) {
-		int nace;
+		u32 nace;
 		struct nfs4_ace *ace;
 
 		READ_BUF(4); len += 4;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 141/171 ] drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (139 preceding siblings ...)
  2013-04-11 20:27 ` [ 140/171 ] nfsd4: reject "negative" acl lengths Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 142/171 ] drm/i915: Dont clobber crtc->fb when queue_flip fails Steven Rostedt
                   ` (29 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Takashi Iwai, Daniel Vetter

[-- Attachment #1: 0141-drm-i915-Use-the-fixed-pixel-clock-for-eDP-in-intel_.patch --]
[-- Type: text/plain, Size: 2429 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

[ Upstream commit 9d1a455b0ca1c2c956b4d9ab212864a8695270f1 ]

The eDP output on HP Z1 is still broken when X is started even after
fixing the infinite link-train loop.  The regression was introduced in
3.6 kernel for cleaning up the mode clock handling code in intel_dp.c
by the commit [71244653: drm/i915: adjusted_mode->clock in the dp
mode_fix].

In the past, the clock of the reference mode was modified in
intel_dp_mode_fixup() in the case of eDP fixed clock, and this clock was
used for calculating in intel_dp_set_m_n().  This override was removed,
thus the wrong mode clock is used for the calculation, resulting in a
psychedelic smoking output in the end.

This patch corrects the clock to be used in the place.

v1->v2: Use intel_edp_target_clock() for checking eDP fixed clock
instead of open code as in ironlake_set_m_n().

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/i915/intel_dp.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 82e5e0d..2e2bf3d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -800,6 +800,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
 	int lane_count = 4;
 	struct intel_dp_m_n m_n;
 	int pipe = intel_crtc->pipe;
+	int target_clock;
 
 	/*
 	 * Find the lane count in the intel_encoder private
@@ -815,13 +816,22 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
 		}
 	}
 
+	target_clock = mode->clock;
+	for_each_encoder_on_crtc(dev, crtc, encoder) {
+		if (encoder->type == INTEL_OUTPUT_EDP) {
+			target_clock = intel_edp_target_clock(encoder,
+							      mode);
+			break;
+		}
+	}
+
 	/*
 	 * Compute the GMCH and Link ratios. The '3' here is
 	 * the number of bytes_per_pixel post-LUT, which we always
 	 * set up for 8-bits of R/G/B, or 3 bytes total.
 	 */
 	intel_dp_compute_m_n(intel_crtc->bpp, lane_count,
-			     mode->clock, adjusted_mode->clock, &m_n);
+			     target_clock, adjusted_mode->clock, &m_n);
 
 	if (HAS_PCH_SPLIT(dev)) {
 		I915_WRITE(TRANSDATA_M1(pipe),
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 142/171 ] drm/i915: Dont clobber crtc->fb when queue_flip fails
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (140 preceding siblings ...)
  2013-04-11 20:27 ` [ 141/171 ] drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n() Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 143/171 ] iwlwifi: dvm: dont send HCMD in restart flow Steven Rostedt
                   ` (28 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Ville Syrjälä, Chris Wilson, Daniel Vetter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0142-drm-i915-Don-t-clobber-crtc-fb-when-queue_flip-fails.patch --]
[-- Type: text/plain, Size: 2534 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>

[ Upstream commit 4a35f83b2b7c6aae3fc0d1c4554fdc99dc33ad07 ]

Restore crtc->fb to the old framebuffer if queue_flip fails.

While at it, kill the pointless intel_fb temp variable.

v2: Update crtc->fb before queue_flip and restore it back
    after a failure.

Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/gpu/drm/i915/intel_display.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0777c79..379abcb 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6459,8 +6459,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct intel_framebuffer *intel_fb;
-	struct drm_i915_gem_object *obj;
+	struct drm_framebuffer *old_fb = crtc->fb;
+	struct drm_i915_gem_object *obj = to_intel_framebuffer(fb)->obj;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_unpin_work *work;
 	unsigned long flags;
@@ -6485,8 +6485,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
 	work->event = event;
 	work->dev = crtc->dev;
-	intel_fb = to_intel_framebuffer(crtc->fb);
-	work->old_fb_obj = intel_fb->obj;
+	work->old_fb_obj = to_intel_framebuffer(old_fb)->obj;
 	INIT_WORK(&work->work, intel_unpin_work_fn);
 
 	ret = drm_vblank_get(dev, intel_crtc->pipe);
@@ -6506,9 +6505,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	intel_crtc->unpin_work = work;
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 
-	intel_fb = to_intel_framebuffer(fb);
-	obj = intel_fb->obj;
-
 	ret = i915_mutex_lock_interruptible(dev);
 	if (ret)
 		goto cleanup;
@@ -6542,6 +6538,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
 cleanup_pending:
 	atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
+	crtc->fb = old_fb;
 	drm_gem_object_unreference(&work->old_fb_obj->base);
 	drm_gem_object_unreference(&obj->base);
 	mutex_unlock(&dev->struct_mutex);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 143/171 ] iwlwifi: dvm: dont send HCMD in restart flow
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (141 preceding siblings ...)
  2013-04-11 20:27 ` [ 142/171 ] drm/i915: Dont clobber crtc->fb when queue_flip fails Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 144/171 ] Btrfs: fix space leak when we fail to reserve metadata space Steven Rostedt
                   ` (27 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Emmanuel Grumbach, Johannes Berg

[-- Attachment #1: 0143-iwlwifi-dvm-don-t-send-HCMD-in-restart-flow.patch --]
[-- Type: text/plain, Size: 2170 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

[ Upstream commit 2d5d50ee596361566f7f84300117cba7d7672bc5 ]

There is a race between the restart flow and the workers.
The workers are cancelled after the fw is already killed
and might send HCMD when there is fw to handle them.
Simply check that there is a fw to which the HCMD can be
sent before actually sending it.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/wireless/iwlwifi/dvm/lib.c   |    9 +++++++++
 drivers/net/wireless/iwlwifi/dvm/ucode.c |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c
index bef88c1..f18ecd3 100644
--- a/drivers/net/wireless/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/lib.c
@@ -1263,6 +1263,15 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 	}
 
 	/*
+	 * This can happen upon FW ASSERT: we clear the STATUS_FW_ERROR flag
+	 * in iwl_down but cancel the workers only later.
+	 */
+	if (!priv->ucode_loaded) {
+		IWL_ERR(priv, "Fw not loaded - dropping CMD: %x\n", cmd->id);
+		return -EIO;
+	}
+
+	/*
 	 * Synchronous commands from this op-mode must hold
 	 * the mutex, this ensures we don't try to send two
 	 * (or more) synchronous commands at a time.
diff --git a/drivers/net/wireless/iwlwifi/dvm/ucode.c b/drivers/net/wireless/iwlwifi/dvm/ucode.c
index 6d8d6dd..6215b16 100644
--- a/drivers/net/wireless/iwlwifi/dvm/ucode.c
+++ b/drivers/net/wireless/iwlwifi/dvm/ucode.c
@@ -450,6 +450,8 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
 		return -EIO;
 	}
 
+	priv->ucode_loaded = true;
+
 	/*
 	 * This step takes a long time (60-80ms!!) and
 	 * WoWLAN image should be loaded quickly, so
@@ -474,8 +476,6 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
 		return ret;
 	}
 
-	priv->ucode_loaded = true;
-
 	return 0;
 }
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 144/171 ] Btrfs: fix space leak when we fail to reserve metadata space
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (142 preceding siblings ...)
  2013-04-11 20:27 ` [ 143/171 ] iwlwifi: dvm: dont send HCMD in restart flow Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 145/171 ] tracing: Prevent buffer overwrite disabled for latency tracers Steven Rostedt
                   ` (26 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: David Sterba, Josef Bacik

[-- Attachment #1: 0144-Btrfs-fix-space-leak-when-we-fail-to-reserve-metadat.patch --]
[-- Type: text/plain, Size: 3590 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josef Bacik <jbacik@fusionio.com>

[ Upstream commit f4881bc7a83eff263789dd524b7c269d138d4af5 ]

Dave reported a warning when running xfstest 275.  We have been leaking delalloc
metadata space when our reservations fail.  This is because we were improperly
calculating how much space to free for our checksum reservations.  The problem
is we would sometimes free up space that had already been freed in another
thread and we would end up with negative usage for the delalloc space.  This
patch fixes the problem by calculating how much space the other threads would
have already freed, and then calculate how much space we need to free had we not
done the reservation at all, and then freeing any excess space.  This makes
xfstests 275 no longer have leaked space.  Thanks

Cc: stable@vger.kernel.org
Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/btrfs/extent-tree.c |   47 +++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 41 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index f1bdfb5..6d7b589 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4582,14 +4582,49 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
 		 * If the inodes csum_bytes is the same as the original
 		 * csum_bytes then we know we haven't raced with any free()ers
 		 * so we can just reduce our inodes csum bytes and carry on.
-		 * Otherwise we have to do the normal free thing to account for
-		 * the case that the free side didn't free up its reserve
-		 * because of this outstanding reservation.
 		 */
-		if (BTRFS_I(inode)->csum_bytes == csum_bytes)
+		if (BTRFS_I(inode)->csum_bytes == csum_bytes) {
 			calc_csum_metadata_size(inode, num_bytes, 0);
-		else
-			to_free = calc_csum_metadata_size(inode, num_bytes, 0);
+		} else {
+			u64 orig_csum_bytes = BTRFS_I(inode)->csum_bytes;
+			u64 bytes;
+
+			/*
+			 * This is tricky, but first we need to figure out how much we
+			 * free'd from any free-ers that occured during this
+			 * reservation, so we reset ->csum_bytes to the csum_bytes
+			 * before we dropped our lock, and then call the free for the
+			 * number of bytes that were freed while we were trying our
+			 * reservation.
+			 */
+			bytes = csum_bytes - BTRFS_I(inode)->csum_bytes;
+			BTRFS_I(inode)->csum_bytes = csum_bytes;
+			to_free = calc_csum_metadata_size(inode, bytes, 0);
+
+
+			/*
+			 * Now we need to see how much we would have freed had we not
+			 * been making this reservation and our ->csum_bytes were not
+			 * artificially inflated.
+			 */
+			BTRFS_I(inode)->csum_bytes = csum_bytes - num_bytes;
+			bytes = csum_bytes - orig_csum_bytes;
+			bytes = calc_csum_metadata_size(inode, bytes, 0);
+
+			/*
+			 * Now reset ->csum_bytes to what it should be.  If bytes is
+			 * more than to_free then we would have free'd more space had we
+			 * not had an artificially high ->csum_bytes, so we need to free
+			 * the remainder.  If bytes is the same or less then we don't
+			 * need to do anything, the other free-ers did the correct
+			 * thing.
+			 */
+			BTRFS_I(inode)->csum_bytes = orig_csum_bytes - num_bytes;
+			if (bytes > to_free)
+				to_free = bytes - to_free;
+			else
+				to_free = 0;
+		}
 		spin_unlock(&BTRFS_I(inode)->lock);
 		if (dropped)
 			to_free += btrfs_calc_trans_metadata_size(root, dropped);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 145/171 ] tracing: Prevent buffer overwrite disabled for latency tracers
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (143 preceding siblings ...)
  2013-04-11 20:27 ` [ 144/171 ] Btrfs: fix space leak when we fail to reserve metadata space Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 146/171 ] net: remove a WARN_ON() in net_enable_timestamp() Steven Rostedt
                   ` (25 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable

[-- Attachment #1: 0145-tracing-Prevent-buffer-overwrite-disabled-for-latenc.patch --]
[-- Type: text/plain, Size: 8970 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

[ Upstream commit 613f04a0f51e6e68ac6fe571ab79da3c0a5eb4da ]

The latency tracers require the buffers to be in overwrite mode,
otherwise they get screwed up. Force the buffers to stay in overwrite
mode when latency tracers are enabled.

Added a flag_changed() method to the tracer structure to allow
the tracers to see what flags are being changed, and also be able
to prevent the change from happing.

Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c              |   38 +++++++++++++++++++++++++++++++------
 kernel/trace/trace.h              |    6 ++++++
 kernel/trace/trace_irqsoff.c      |   19 ++++++++++++++-----
 kernel/trace/trace_sched_wakeup.c |   18 +++++++++++++-----
 4 files changed, 65 insertions(+), 16 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 1f84103..bf2c50b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2777,11 +2777,25 @@ static int set_tracer_option(struct tracer *trace, char *cmp, int neg)
 	return -EINVAL;
 }
 
-static void set_tracer_flags(unsigned int mask, int enabled)
+/* Some tracers require overwrite to stay enabled */
+int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set)
+{
+	if (tracer->enabled && (mask & TRACE_ITER_OVERWRITE) && !set)
+		return -1;
+
+	return 0;
+}
+
+int set_tracer_flag(unsigned int mask, int enabled)
 {
 	/* do nothing if flag is already set */
 	if (!!(trace_flags & mask) == !!enabled)
-		return;
+		return 0;
+
+	/* Give the tracer a chance to approve the change */
+	if (current_trace->flag_changed)
+		if (current_trace->flag_changed(current_trace, mask, !!enabled))
+			return -EINVAL;
 
 	if (enabled)
 		trace_flags |= mask;
@@ -2797,6 +2811,8 @@ static void set_tracer_flags(unsigned int mask, int enabled)
 		ring_buffer_change_overwrite(max_tr.buffer, enabled);
 #endif
 	}
+
+	return 0;
 }
 
 static ssize_t
@@ -2827,7 +2843,7 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
 
 	for (i = 0; trace_options[i]; i++) {
 		if (strcmp(cmp, trace_options[i]) == 0) {
-			set_tracer_flags(1 << i, !neg);
+			ret = set_tracer_flag(1 << i, !neg);
 			break;
 		}
 	}
@@ -2838,6 +2854,9 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
 
 	mutex_unlock(&trace_types_lock);
 
+	if (ret < 0)
+		return ret;
+
 	*ppos += cnt;
 
 	return cnt;
@@ -3178,8 +3197,11 @@ static int tracing_set_tracer(const char *buf)
 		goto out;
 
 	trace_branch_disable();
-	if (current_trace && current_trace->reset)
-		current_trace->reset(tr);
+	if (current_trace) {
+		current_trace->enabled = false;
+		if (current_trace->reset)
+			current_trace->reset(tr);
+	}
 	if (current_trace && current_trace->use_max_tr) {
 		/*
 		 * We don't free the ring buffer. instead, resize it because
@@ -3215,6 +3237,7 @@ static int tracing_set_tracer(const char *buf)
 	}
 
 	current_trace = t;
+	current_trace->enabled = true;
 	trace_branch_enable(tr);
  out:
 	mutex_unlock(&trace_types_lock);
@@ -4618,9 +4641,12 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 		return -EINVAL;
 
 	mutex_lock(&trace_types_lock);
-	set_tracer_flags(1 << index, val);
+	ret = set_tracer_flag(1 << index, val);
 	mutex_unlock(&trace_types_lock);
 
+	if (ret < 0)
+		return ret;
+
 	*ppos += cnt;
 
 	return cnt;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 55e1f7f..1dd9fe7 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -283,10 +283,14 @@ struct tracer {
 	enum print_line_t	(*print_line)(struct trace_iterator *iter);
 	/* If you handled the flag setting, return 0 */
 	int			(*set_flag)(u32 old_flags, u32 bit, int set);
+	/* Return 0 if OK with change, else return non-zero */
+	int			(*flag_changed)(struct tracer *tracer,
+						u32 mask, int set);
 	struct tracer		*next;
 	struct tracer_flags	*flags;
 	int			print_max;
 	int			use_max_tr;
+	bool			enabled;
 };
 
 
@@ -840,6 +844,8 @@ extern const char *__start___trace_bprintk_fmt[];
 extern const char *__stop___trace_bprintk_fmt[];
 
 void trace_printk_init_buffers(void);
+int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set);
+int set_tracer_flag(unsigned int mask, int enabled);
 
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter)	\
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 99d20e9..8dd139a 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -32,7 +32,7 @@ enum {
 
 static int trace_type __read_mostly;
 
-static int save_lat_flag;
+static int save_flags;
 
 static void stop_irqsoff_tracer(struct trace_array *tr, int graph);
 static int start_irqsoff_tracer(struct trace_array *tr, int graph);
@@ -557,8 +557,11 @@ static void stop_irqsoff_tracer(struct trace_array *tr, int graph)
 
 static void __irqsoff_tracer_init(struct trace_array *tr)
 {
-	save_lat_flag = trace_flags & TRACE_ITER_LATENCY_FMT;
-	trace_flags |= TRACE_ITER_LATENCY_FMT;
+	save_flags = trace_flags;
+
+	/* non overwrite screws up the latency tracers */
+	set_tracer_flag(TRACE_ITER_OVERWRITE, 1);
+	set_tracer_flag(TRACE_ITER_LATENCY_FMT, 1);
 
 	tracing_max_latency = 0;
 	irqsoff_trace = tr;
@@ -572,10 +575,13 @@ static void __irqsoff_tracer_init(struct trace_array *tr)
 
 static void irqsoff_tracer_reset(struct trace_array *tr)
 {
+	int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT;
+	int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE;
+
 	stop_irqsoff_tracer(tr, is_graph());
 
-	if (!save_lat_flag)
-		trace_flags &= ~TRACE_ITER_LATENCY_FMT;
+	set_tracer_flag(TRACE_ITER_LATENCY_FMT, lat_flag);
+	set_tracer_flag(TRACE_ITER_OVERWRITE, overwrite_flag);
 }
 
 static void irqsoff_tracer_start(struct trace_array *tr)
@@ -608,6 +614,7 @@ static struct tracer irqsoff_tracer __read_mostly =
 	.print_line     = irqsoff_print_line,
 	.flags		= &tracer_flags,
 	.set_flag	= irqsoff_set_flag,
+	.flag_changed	= trace_keep_overwrite,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_irqsoff,
 #endif
@@ -641,6 +648,7 @@ static struct tracer preemptoff_tracer __read_mostly =
 	.print_line     = irqsoff_print_line,
 	.flags		= &tracer_flags,
 	.set_flag	= irqsoff_set_flag,
+	.flag_changed	= trace_keep_overwrite,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_preemptoff,
 #endif
@@ -676,6 +684,7 @@ static struct tracer preemptirqsoff_tracer __read_mostly =
 	.print_line     = irqsoff_print_line,
 	.flags		= &tracer_flags,
 	.set_flag	= irqsoff_set_flag,
+	.flag_changed	= trace_keep_overwrite,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_preemptirqsoff,
 #endif
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index ff791ea..9eadedc 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -36,7 +36,7 @@ static void __wakeup_reset(struct trace_array *tr);
 static int wakeup_graph_entry(struct ftrace_graph_ent *trace);
 static void wakeup_graph_return(struct ftrace_graph_ret *trace);
 
-static int save_lat_flag;
+static int save_flags;
 
 #define TRACE_DISPLAY_GRAPH     1
 
@@ -539,8 +539,11 @@ static void stop_wakeup_tracer(struct trace_array *tr)
 
 static int __wakeup_tracer_init(struct trace_array *tr)
 {
-	save_lat_flag = trace_flags & TRACE_ITER_LATENCY_FMT;
-	trace_flags |= TRACE_ITER_LATENCY_FMT;
+	save_flags = trace_flags;
+
+	/* non overwrite screws up the latency tracers */
+	set_tracer_flag(TRACE_ITER_OVERWRITE, 1);
+	set_tracer_flag(TRACE_ITER_LATENCY_FMT, 1);
 
 	tracing_max_latency = 0;
 	wakeup_trace = tr;
@@ -562,12 +565,15 @@ static int wakeup_rt_tracer_init(struct trace_array *tr)
 
 static void wakeup_tracer_reset(struct trace_array *tr)
 {
+	int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT;
+	int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE;
+
 	stop_wakeup_tracer(tr);
 	/* make sure we put back any tasks we are tracing */
 	wakeup_reset(tr);
 
-	if (!save_lat_flag)
-		trace_flags &= ~TRACE_ITER_LATENCY_FMT;
+	set_tracer_flag(TRACE_ITER_LATENCY_FMT, lat_flag);
+	set_tracer_flag(TRACE_ITER_OVERWRITE, overwrite_flag);
 }
 
 static void wakeup_tracer_start(struct trace_array *tr)
@@ -593,6 +599,7 @@ static struct tracer wakeup_tracer __read_mostly =
 	.print_line	= wakeup_print_line,
 	.flags		= &tracer_flags,
 	.set_flag	= wakeup_set_flag,
+	.flag_changed	= trace_keep_overwrite,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_wakeup,
 #endif
@@ -614,6 +621,7 @@ static struct tracer wakeup_rt_tracer __read_mostly =
 	.print_line	= wakeup_print_line,
 	.flags		= &tracer_flags,
 	.set_flag	= wakeup_set_flag,
+	.flag_changed	= trace_keep_overwrite,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_wakeup,
 #endif
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 146/171 ] net: remove a WARN_ON() in net_enable_timestamp()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (144 preceding siblings ...)
  2013-04-11 20:27 ` [ 145/171 ] tracing: Prevent buffer overwrite disabled for latency tracers Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 147/171 ] sky2: Receive Overflows not counted Steven Rostedt
                   ` (24 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Laurent Chavey, Eric Dumazet, David S. Miller

[-- Attachment #1: 0146-net-remove-a-WARN_ON-in-net_enable_timestamp.patch --]
[-- Type: text/plain, Size: 2202 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 9979a55a833883242e3a29f3596676edd7199c46 ]

The WARN_ON(in_interrupt()) in net_enable_timestamp() can get false
positive, in socket clone path, run from softirq context :

[ 3641.624425] WARNING: at net/core/dev.c:1532 net_enable_timestamp+0x7b/0x80()
[ 3641.668811] Call Trace:
[ 3641.671254]  <IRQ>  [<ffffffff80286817>] warn_slowpath_common+0x87/0xc0
[ 3641.677871]  [<ffffffff8028686a>] warn_slowpath_null+0x1a/0x20
[ 3641.683683]  [<ffffffff80742f8b>] net_enable_timestamp+0x7b/0x80
[ 3641.689668]  [<ffffffff80732ce5>] sk_clone_lock+0x425/0x450
[ 3641.695222]  [<ffffffff8078db36>] inet_csk_clone_lock+0x16/0x170
[ 3641.701213]  [<ffffffff807ae449>] tcp_create_openreq_child+0x29/0x820
[ 3641.707663]  [<ffffffff807d62e2>] ? ipt_do_table+0x222/0x670
[ 3641.713354]  [<ffffffff807aaf5b>] tcp_v4_syn_recv_sock+0xab/0x3d0
[ 3641.719425]  [<ffffffff807af63a>] tcp_check_req+0x3da/0x530
[ 3641.724979]  [<ffffffff8078b400>] ? inet_hashinfo_init+0x60/0x80
[ 3641.730964]  [<ffffffff807ade6f>] ? tcp_v4_rcv+0x79f/0xbe0
[ 3641.736430]  [<ffffffff807ab9bd>] tcp_v4_do_rcv+0x38d/0x4f0
[ 3641.741985]  [<ffffffff807ae14a>] tcp_v4_rcv+0xa7a/0xbe0

Its safe at this point because the parent socket owns a reference
on the netstamp_needed, so we cant have a 0 -> 1 transition, which
requires to lock a mutex.

Instead of refining the check, lets remove it, as all known callers
are safe. If it ever changes in the future, static_key_slow_inc()
will complain anyway.

Reported-by: Laurent Chavey <chavey@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/core/dev.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index c41efb7..d283020 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1481,7 +1481,6 @@ void net_enable_timestamp(void)
 		return;
 	}
 #endif
-	WARN_ON(in_interrupt());
 	static_key_slow_inc(&netstamp_needed);
 }
 EXPORT_SYMBOL(net_enable_timestamp);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 147/171 ] sky2: Receive Overflows not counted
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (145 preceding siblings ...)
  2013-04-11 20:27 ` [ 146/171 ] net: remove a WARN_ON() in net_enable_timestamp() Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 148/171 ] sky2: Threshold for Pause Packet is set wrong Steven Rostedt
                   ` (23 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Mirko Lindner, Stephen Hemminger, David S. Miller

[-- Attachment #1: 0147-sky2-Receive-Overflows-not-counted.patch --]
[-- Type: text/plain, Size: 1439 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mirko Lindner <mlindner@marvell.com>

[ Upstream commit 9cfe8b156c21cf340b3a10ecb3022fbbc1c39185 ]

The sky2 driver doesn't count the Receive Overflows because the MAC
interrupt for this event is not set in the MAC's interrupt mask.
The MAC's interrupt mask is set only for Transmit FIFO Underruns.

Fix: The correct setting should be (GM_IS_TX_FF_UR | GM_IS_RX_FF_OR)
Otherwise the Receive Overflow event will not generate any interrupt.
The  Receive Overflow interrupt is handled correctly

Signed-off-by: Mirko Lindner <mlindner@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/marvell/sky2.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.h b/drivers/net/ethernet/marvell/sky2.h
index 615ac63..ec6dcd8 100644
--- a/drivers/net/ethernet/marvell/sky2.h
+++ b/drivers/net/ethernet/marvell/sky2.h
@@ -2074,7 +2074,7 @@ enum {
 	GM_IS_RX_FF_OR	= 1<<1,	/* Receive FIFO Overrun */
 	GM_IS_RX_COMPL	= 1<<0,	/* Frame Reception Complete */
 
-#define GMAC_DEF_MSK     GM_IS_TX_FF_UR
+#define GMAC_DEF_MSK     (GM_IS_TX_FF_UR | GM_IS_RX_FF_OR)
 };
 
 /*	GMAC_LINK_CTRL	16 bit	GMAC Link Control Reg (YUKON only) */
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 148/171 ] sky2: Threshold for Pause Packet is set wrong
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (146 preceding siblings ...)
  2013-04-11 20:27 ` [ 147/171 ] sky2: Receive Overflows not counted Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 149/171 ] tcp: preserve ACK clocking in TSO Steven Rostedt
                   ` (22 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Mirko Lindner, Stephen Hemminger, David S. Miller

[-- Attachment #1: 0148-sky2-Threshold-for-Pause-Packet-is-set-wrong.patch --]
[-- Type: text/plain, Size: 1351 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mirko Lindner <mlindner@marvell.com>

[ Upstream commit 74f9f42c1c1650e74fb464f76644c9041f996851 ]

The sky2 driver sets the Rx Upper Threshold for Pause Packet generation to a
wrong value which leads to only 2kB of RAM remaining space. This can lead to
Rx overflow errors even with activated flow-control.

Fix: We should increase the value to 8192/8

Signed-off-by: Mirko Lindner <mlindner@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/marvell/sky2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 2b0748d..c8d7e5f 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1067,7 +1067,7 @@ static void sky2_ramset(struct sky2_hw *hw, u16 q, u32 start, u32 space)
 		sky2_write32(hw, RB_ADDR(q, RB_RX_UTHP), tp);
 		sky2_write32(hw, RB_ADDR(q, RB_RX_LTHP), space/2);
 
-		tp = space - 2048/8;
+		tp = space - 8192/8;
 		sky2_write32(hw, RB_ADDR(q, RB_RX_UTPP), tp);
 		sky2_write32(hw, RB_ADDR(q, RB_RX_LTPP), space/4);
 	} else {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 149/171 ] tcp: preserve ACK clocking in TSO
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (147 preceding siblings ...)
  2013-04-11 20:27 ` [ 148/171 ] sky2: Threshold for Pause Packet is set wrong Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 150/171 ] tcp: undo spurious timeout after SACK reneging Steven Rostedt
                   ` (21 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Eric Dumazet, Yuchung Cheng, Van Jacobson, Neal Cardwell,
	Nandita Dukkipati, David S. Miller

[-- Attachment #1: 0149-tcp-preserve-ACK-clocking-in-TSO.patch --]
[-- Type: text/plain, Size: 3552 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit f4541d60a449afd40448b06496dcd510f505928e ]

A long standing problem with TSO is the fact that tcp_tso_should_defer()
rearms the deferred timer, while it should not.

Current code leads to following bad bursty behavior :

20:11:24.484333 IP A > B: . 297161:316921(19760) ack 1 win 119
20:11:24.484337 IP B > A: . ack 263721 win 1117
20:11:24.485086 IP B > A: . ack 265241 win 1117
20:11:24.485925 IP B > A: . ack 266761 win 1117
20:11:24.486759 IP B > A: . ack 268281 win 1117
20:11:24.487594 IP B > A: . ack 269801 win 1117
20:11:24.488430 IP B > A: . ack 271321 win 1117
20:11:24.489267 IP B > A: . ack 272841 win 1117
20:11:24.490104 IP B > A: . ack 274361 win 1117
20:11:24.490939 IP B > A: . ack 275881 win 1117
20:11:24.491775 IP B > A: . ack 277401 win 1117
20:11:24.491784 IP A > B: . 316921:332881(15960) ack 1 win 119
20:11:24.492620 IP B > A: . ack 278921 win 1117
20:11:24.493448 IP B > A: . ack 280441 win 1117
20:11:24.494286 IP B > A: . ack 281961 win 1117
20:11:24.495122 IP B > A: . ack 283481 win 1117
20:11:24.495958 IP B > A: . ack 285001 win 1117
20:11:24.496791 IP B > A: . ack 286521 win 1117
20:11:24.497628 IP B > A: . ack 288041 win 1117
20:11:24.498459 IP B > A: . ack 289561 win 1117
20:11:24.499296 IP B > A: . ack 291081 win 1117
20:11:24.500133 IP B > A: . ack 292601 win 1117
20:11:24.500970 IP B > A: . ack 294121 win 1117
20:11:24.501388 IP B > A: . ack 295641 win 1117
20:11:24.501398 IP A > B: . 332881:351881(19000) ack 1 win 119

While the expected behavior is more like :

20:19:49.259620 IP A > B: . 197601:202161(4560) ack 1 win 119
20:19:49.260446 IP B > A: . ack 154281 win 1212
20:19:49.261282 IP B > A: . ack 155801 win 1212
20:19:49.262125 IP B > A: . ack 157321 win 1212
20:19:49.262136 IP A > B: . 202161:206721(4560) ack 1 win 119
20:19:49.262958 IP B > A: . ack 158841 win 1212
20:19:49.263795 IP B > A: . ack 160361 win 1212
20:19:49.264628 IP B > A: . ack 161881 win 1212
20:19:49.264637 IP A > B: . 206721:211281(4560) ack 1 win 119
20:19:49.265465 IP B > A: . ack 163401 win 1212
20:19:49.265886 IP B > A: . ack 164921 win 1212
20:19:49.266722 IP B > A: . ack 166441 win 1212
20:19:49.266732 IP A > B: . 211281:215841(4560) ack 1 win 119
20:19:49.267559 IP B > A: . ack 167961 win 1212
20:19:49.268394 IP B > A: . ack 169481 win 1212
20:19:49.269232 IP B > A: . ack 171001 win 1212
20:19:49.269241 IP A > B: . 215841:221161(5320) ack 1 win 119

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Van Jacobson <vanj@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv4/tcp_output.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 745fc20..fb79daa 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1800,8 +1800,11 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)
 			goto send_now;
 	}
 
-	/* Ok, it looks like it is advisable to defer.  */
-	tp->tso_deferred = 1 | (jiffies << 1);
+	/* Ok, it looks like it is advisable to defer.
+	 * Do not rearm the timer if already set to not break TCP ACK clocking.
+	 */
+	if (!tp->tso_deferred)
+		tp->tso_deferred = 1 | (jiffies << 1);
 
 	return true;
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 150/171 ] tcp: undo spurious timeout after SACK reneging
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (148 preceding siblings ...)
  2013-04-11 20:27 ` [ 149/171 ] tcp: preserve ACK clocking in TSO Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 151/171 ] 8021q: fix a potential use-after-free Steven Rostedt
                   ` (20 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Yuchung Cheng, Neal Cardwell, David S. Miller

[-- Attachment #1: 0150-tcp-undo-spurious-timeout-after-SACK-reneging.patch --]
[-- Type: text/plain, Size: 1312 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Yuchung Cheng <ycheng@google.com>

[ Upstream commit 7ebe183c6d444ef5587d803b64a1f4734b18c564 ]

On SACK reneging the sender immediately retransmits and forces a
timeout but disables Eifel (undo). If the (buggy) receiver does not
drop any packet this can trigger a false slow-start retransmit storm
driven by the ACKs of the original packets. This can be detected with
undo and TCP timestamps.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv4/tcp_input.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 396c6ae..db1b172 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2083,11 +2083,8 @@ void tcp_enter_loss(struct sock *sk, int how)
 	if (tcp_is_reno(tp))
 		tcp_reset_reno_sack(tp);
 
-	if (!how) {
-		/* Push undo marker, if it was plain RTO and nothing
-		 * was retransmitted. */
-		tp->undo_marker = tp->snd_una;
-	} else {
+	tp->undo_marker = tp->snd_una;
+	if (how) {
 		tp->sacked_out = 0;
 		tp->fackets_out = 0;
 	}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 151/171 ] 8021q: fix a potential use-after-free
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (149 preceding siblings ...)
  2013-04-11 20:27 ` [ 150/171 ] tcp: undo spurious timeout after SACK reneging Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 152/171 ] thermal: shorten too long mcast group name Steven Rostedt
                   ` (19 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Patrick McHardy, David S. Miller, Cong Wang, Eric Dumazet

[-- Attachment #1: 0151-8021q-fix-a-potential-use-after-free.patch --]
[-- Type: text/plain, Size: 1851 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Cong Wang <amwang@redhat.com>

[ Upstream commit 4a7df340ed1bac190c124c1601bfc10cde9fb4fb ]

vlan_vid_del() could possibly free ->vlan_info after a RCU grace
period, however, we may still refer to the freed memory area
by 'grp' pointer. Found by code inspection.

This patch moves vlan_vid_del() as behind as possible.

Cc: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/8021q/vlan.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 9096bcb..8bdc56d 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -86,13 +86,6 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
 
 	grp = &vlan_info->grp;
 
-	/* Take it out of our own structures, but be sure to interlock with
-	 * HW accelerating devices or SW vlan input packet processing if
-	 * VLAN is not 0 (leave it there for 802.1p).
-	 */
-	if (vlan_id)
-		vlan_vid_del(real_dev, vlan_id);
-
 	grp->nr_vlan_devs--;
 
 	if (vlan->flags & VLAN_FLAG_GVRP)
@@ -108,6 +101,13 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
 	if (grp->nr_vlan_devs == 0)
 		vlan_gvrp_uninit_applicant(real_dev);
 
+	/* Take it out of our own structures, but be sure to interlock with
+	 * HW accelerating devices or SW vlan input packet processing if
+	 * VLAN is not 0 (leave it there for 802.1p).
+	 */
+	if (vlan_id)
+		vlan_vid_del(real_dev, vlan_id);
+
 	/* Get rid of the vlan's reference to real_dev */
 	dev_put(real_dev);
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 152/171 ] thermal: shorten too long mcast group name
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (150 preceding siblings ...)
  2013-04-11 20:27 ` [ 151/171 ] 8021q: fix a potential use-after-free Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 153/171 ] genetlink: trigger BUG_ON if a group name is too long Steven Rostedt
                   ` (18 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Masatake YAMATO, David S. Miller

[-- Attachment #1: 0152-thermal-shorten-too-long-mcast-group-name.patch --]
[-- Type: text/plain, Size: 1034 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Masatake YAMATO <yamato@redhat.com>

[ Upstream commit 73214f5d9f33b79918b1f7babddd5c8af28dd23d ]

The original name is too long.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/thermal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 4b94a61..30c223b 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -122,7 +122,7 @@ struct thermal_zone_device {
 /* Adding event notification support elements */
 #define THERMAL_GENL_FAMILY_NAME                "thermal_event"
 #define THERMAL_GENL_VERSION                    0x01
-#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_group"
+#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_grp"
 
 enum events {
 	THERMAL_AUX0,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 153/171 ] genetlink: trigger BUG_ON if a group name is too long
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (151 preceding siblings ...)
  2013-04-11 20:27 ` [ 152/171 ] thermal: shorten too long mcast group name Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 154/171 ] unix: fix a race condition in unix_release() Steven Rostedt
                   ` (17 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Masatake YAMATO, David S. Miller

[-- Attachment #1: 0153-genetlink-trigger-BUG_ON-if-a-group-name-is-too-long.patch --]
[-- Type: text/plain, Size: 860 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Masatake YAMATO <yamato@redhat.com>

[ Upstream commit f1e79e208076ffe7bad97158275f1c572c04f5c7 ]

Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/netlink/genetlink.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index fda4974..42556ce 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -142,6 +142,7 @@ int genl_register_mc_group(struct genl_family *family,
 	int err = 0;
 
 	BUG_ON(grp->name[0] == '\0');
+	BUG_ON(memchr(grp->name, '\0', GENL_NAMSIZ) == NULL);
 
 	genl_lock();
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 154/171 ] unix: fix a race condition in unix_release()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (152 preceding siblings ...)
  2013-04-11 20:27 ` [ 153/171 ] genetlink: trigger BUG_ON if a group name is too long Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 155/171 ] bonding: remove already created master sysfs link on failure Steven Rostedt
                   ` (16 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Jan Stancek, Paul Moore, David S. Miller

[-- Attachment #1: 0154-unix-fix-a-race-condition-in-unix_release.patch --]
[-- Type: text/plain, Size: 2107 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Paul Moore <pmoore@redhat.com>

[ Upstream commit ded34e0fe8fe8c2d595bfa30626654e4b87621e0 ]

As reported by Jan, and others over the past few years, there is a
race condition caused by unix_release setting the sock->sk pointer
to NULL before properly marking the socket as dead/orphaned.  This
can cause a problem with the LSM hook security_unix_may_send() if
there is another socket attempting to write to this partially
released socket in between when sock->sk is set to NULL and it is
marked as dead/orphaned.  This patch fixes this by only setting
sock->sk to NULL after the socket has been marked as dead; I also
take the opportunity to make unix_release_sock() a void function
as it only ever returned 0/success.

Dave, I think this one should go on the -stable pile.

Special thanks to Jan for coming up with a reproducer for this
problem.

Reported-by: Jan Stancek <jan.stancek@gmail.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/unix/af_unix.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c5ee4ff..1b3abc8 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -384,7 +384,7 @@ static void unix_sock_destructor(struct sock *sk)
 #endif
 }
 
-static int unix_release_sock(struct sock *sk, int embrion)
+static void unix_release_sock(struct sock *sk, int embrion)
 {
 	struct unix_sock *u = unix_sk(sk);
 	struct path path;
@@ -453,8 +453,6 @@ static int unix_release_sock(struct sock *sk, int embrion)
 
 	if (unix_tot_inflight)
 		unix_gc();		/* Garbage collect fds */
-
-	return 0;
 }
 
 static void init_peercred(struct sock *sk)
@@ -704,9 +702,10 @@ static int unix_release(struct socket *sock)
 	if (!sk)
 		return 0;
 
+	unix_release_sock(sk, 0);
 	sock->sk = NULL;
 
-	return unix_release_sock(sk, 0);
+	return 0;
 }
 
 static int unix_autobind(struct socket *sock)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 155/171 ] bonding: remove already created master sysfs link on failure
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (153 preceding siblings ...)
  2013-04-11 20:27 ` [ 154/171 ] unix: fix a race condition in unix_release() Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 156/171 ] bonding: fix miimon and arp_interval delayed work race conditions Steven Rostedt
                   ` (15 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Veaceslav Falico, David S. Miller

[-- Attachment #1: 0155-bonding-remove-already-created-master-sysfs-link-on-.patch --]
[-- Type: text/plain, Size: 1141 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit 9fe16b78ee17579cb4f333534cf7043e94c67024 ]

If slave sysfs symlink failes to be created - we end up without removing
the master sysfs symlink. Remove it in case of failure.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/bonding/bond_sysfs.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 21609f9..ecd47a3 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -183,6 +183,11 @@ int bond_create_slave_symlinks(struct net_device *master,
 	sprintf(linkname, "slave_%s", slave->name);
 	ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
 				linkname);
+
+	/* free the master link created earlier in case of error */
+	if (ret)
+		sysfs_remove_link(&(slave->dev.kobj), "master");
+
 	return ret;
 
 }
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 156/171 ] bonding: fix miimon and arp_interval delayed work race conditions
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (154 preceding siblings ...)
  2013-04-11 20:27 ` [ 155/171 ] bonding: remove already created master sysfs link on failure Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 157/171 ] bonding: fix disabling of arp_interval and miimon Steven Rostedt
                   ` (14 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Nikolay Aleksandrov, Jay Vosburgh, David S. Miller

[-- Attachment #1: 0156-bonding-fix-miimon-and-arp_interval-delayed-work-rac.patch --]
[-- Type: text/plain, Size: 10364 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "nikolay@redhat.com" <nikolay@redhat.com>

[ Upstream commit fbb0c41b814d497c656fc7be9e35456f139cb2fb ]

First I would give three observations which will be used later.
Observation 1: if (delayed_work_pending(wq)) cancel_delayed_work(wq)
 This usage is wrong because the pending bit is cleared just before the
 work's fn is executed and if the function re-arms itself we might end up
 with the work still running. It's safe to call cancel_delayed_work_sync()
 even if the work is not queued at all.
Observation 2: Use of INIT_DELAYED_WORK()
 Work needs to be initialized only once prior to (de/en)queueing.
Observation 3: IFF_UP is set only after ndo_open is called

Related race conditions:
1. Race between bonding_store_miimon() and bonding_store_arp_interval()
 Because of Obs.1 we can end up having both works enqueued.
2. Multiple races with INIT_DELAYED_WORK()
 Since the works are not protected by anything between INIT_DELAYED_WORK()
 and calls to (en/de)queue it is possible for races between the following
 functions:
 (races are also possible between the calls to INIT_DELAYED_WORK()
  and workqueue code)
 bonding_store_miimon() - bonding_store_arp_interval(), bond_close(),
			  bond_open(), enqueued functions
 bonding_store_arp_interval() - bonding_store_miimon(), bond_close(),
				bond_open(), enqueued functions
3. By Obs.1 we need to change bond_cancel_all()

Bugs 1 and 2 are fixed by moving all work initializations in bond_open
which by Obs. 2 and Obs. 3 and the fact that we make sure that all works
are cancelled in bond_close(), is guaranteed not to have any work
enqueued.
Also RTNL lock is now acquired in bonding_store_miimon/arp_interval so
they can't race with bond_close and bond_open. The opposing work is
cancelled only if the IFF_UP flag is set and it is cancelled
unconditionally. The opposing work is already cancelled if the interface
is down so no need to cancel it again. This way we don't need new
synchronizations for the bonding workqueue. These bugs (and fixes) are
tied together and belong in the same patch.
Note: I have left 1 line intentionally over 80 characters (84) because I
      didn't like how it looks broken down. If you'd prefer it otherwise,
      then simply break it.

 v2: Make description text < 75 columns

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/bonding/bond_main.c  |   88 +++++++++++---------------------------
 drivers/net/bonding/bond_sysfs.c |   34 +++++----------
 2 files changed, 36 insertions(+), 86 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 704d0ad..a9a07ce 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3411,6 +3411,28 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb, int count)
 
 /*-------------------------- Device entry points ----------------------------*/
 
+static void bond_work_init_all(struct bonding *bond)
+{
+	INIT_DELAYED_WORK(&bond->mcast_work,
+			  bond_resend_igmp_join_requests_delayed);
+	INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
+	INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
+	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
+		INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);
+	else
+		INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon);
+	INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
+}
+
+static void bond_work_cancel_all(struct bonding *bond)
+{
+	cancel_delayed_work_sync(&bond->mii_work);
+	cancel_delayed_work_sync(&bond->arp_work);
+	cancel_delayed_work_sync(&bond->alb_work);
+	cancel_delayed_work_sync(&bond->ad_work);
+	cancel_delayed_work_sync(&bond->mcast_work);
+}
+
 static int bond_open(struct net_device *bond_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
@@ -3433,41 +3455,27 @@ static int bond_open(struct net_device *bond_dev)
 	}
 	read_unlock(&bond->lock);
 
-	INIT_DELAYED_WORK(&bond->mcast_work, bond_resend_igmp_join_requests_delayed);
+	bond_work_init_all(bond);
 
 	if (bond_is_lb(bond)) {
 		/* bond_alb_initialize must be called before the timer
 		 * is started.
 		 */
-		if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
-			/* something went wrong - fail the open operation */
+		if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB)))
 			return -ENOMEM;
-		}
-
-		INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
 		queue_delayed_work(bond->wq, &bond->alb_work, 0);
 	}
 
-	if (bond->params.miimon) {  /* link check interval, in milliseconds. */
-		INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
+	if (bond->params.miimon)  /* link check interval, in milliseconds. */
 		queue_delayed_work(bond->wq, &bond->mii_work, 0);
-	}
 
 	if (bond->params.arp_interval) {  /* arp interval, in milliseconds. */
-		if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
-			INIT_DELAYED_WORK(&bond->arp_work,
-					  bond_activebackup_arp_mon);
-		else
-			INIT_DELAYED_WORK(&bond->arp_work,
-					  bond_loadbalance_arp_mon);
-
 		queue_delayed_work(bond->wq, &bond->arp_work, 0);
 		if (bond->params.arp_validate)
 			bond->recv_probe = bond_arp_rcv;
 	}
 
 	if (bond->params.mode == BOND_MODE_8023AD) {
-		INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
 		queue_delayed_work(bond->wq, &bond->ad_work, 0);
 		/* register to receive LACPDUs */
 		bond->recv_probe = bond_3ad_lacpdu_recv;
@@ -3482,34 +3490,10 @@ static int bond_close(struct net_device *bond_dev)
 	struct bonding *bond = netdev_priv(bond_dev);
 
 	write_lock_bh(&bond->lock);
-
 	bond->send_peer_notif = 0;
-
 	write_unlock_bh(&bond->lock);
 
-	if (bond->params.miimon) {  /* link check interval, in milliseconds. */
-		cancel_delayed_work_sync(&bond->mii_work);
-	}
-
-	if (bond->params.arp_interval) {  /* arp interval, in milliseconds. */
-		cancel_delayed_work_sync(&bond->arp_work);
-	}
-
-	switch (bond->params.mode) {
-	case BOND_MODE_8023AD:
-		cancel_delayed_work_sync(&bond->ad_work);
-		break;
-	case BOND_MODE_TLB:
-	case BOND_MODE_ALB:
-		cancel_delayed_work_sync(&bond->alb_work);
-		break;
-	default:
-		break;
-	}
-
-	if (delayed_work_pending(&bond->mcast_work))
-		cancel_delayed_work_sync(&bond->mcast_work);
-
+	bond_work_cancel_all(bond);
 	if (bond_is_lb(bond)) {
 		/* Must be called only after all
 		 * slaves have been released
@@ -4388,26 +4372,6 @@ static void bond_setup(struct net_device *bond_dev)
 	bond_dev->features |= bond_dev->hw_features;
 }
 
-static void bond_work_cancel_all(struct bonding *bond)
-{
-	if (bond->params.miimon && delayed_work_pending(&bond->mii_work))
-		cancel_delayed_work_sync(&bond->mii_work);
-
-	if (bond->params.arp_interval && delayed_work_pending(&bond->arp_work))
-		cancel_delayed_work_sync(&bond->arp_work);
-
-	if (bond->params.mode == BOND_MODE_ALB &&
-	    delayed_work_pending(&bond->alb_work))
-		cancel_delayed_work_sync(&bond->alb_work);
-
-	if (bond->params.mode == BOND_MODE_8023AD &&
-	    delayed_work_pending(&bond->ad_work))
-		cancel_delayed_work_sync(&bond->ad_work);
-
-	if (delayed_work_pending(&bond->mcast_work))
-		cancel_delayed_work_sync(&bond->mcast_work);
-}
-
 /*
 * Destroy a bonding device.
 * Must be under rtnl_lock when this function is called.
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ecd47a3..13e37cc 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -518,6 +518,8 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 	int new_value, ret = count;
 	struct bonding *bond = to_bond(d);
 
+	if (!rtnl_trylock())
+		return restart_syscall();
 	if (sscanf(buf, "%d", &new_value) != 1) {
 		pr_err("%s: no arp_interval value specified.\n",
 		       bond->dev->name);
@@ -544,10 +546,6 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 		pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
 			bond->dev->name, bond->dev->name);
 		bond->params.miimon = 0;
-		if (delayed_work_pending(&bond->mii_work)) {
-			cancel_delayed_work(&bond->mii_work);
-			flush_workqueue(bond->wq);
-		}
 	}
 	if (!bond->params.arp_targets[0]) {
 		pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
@@ -559,19 +557,12 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 		 * timer will get fired off when the open function
 		 * is called.
 		 */
-		if (!delayed_work_pending(&bond->arp_work)) {
-			if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
-				INIT_DELAYED_WORK(&bond->arp_work,
-						  bond_activebackup_arp_mon);
-			else
-				INIT_DELAYED_WORK(&bond->arp_work,
-						  bond_loadbalance_arp_mon);
-
-			queue_delayed_work(bond->wq, &bond->arp_work, 0);
-		}
+		cancel_delayed_work_sync(&bond->mii_work);
+		queue_delayed_work(bond->wq, &bond->arp_work, 0);
 	}
 
 out:
+	rtnl_unlock();
 	return ret;
 }
 static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,
@@ -967,6 +958,8 @@ static ssize_t bonding_store_miimon(struct device *d,
 	int new_value, ret = count;
 	struct bonding *bond = to_bond(d);
 
+	if (!rtnl_trylock())
+		return restart_syscall();
 	if (sscanf(buf, "%d", &new_value) != 1) {
 		pr_err("%s: no miimon value specified.\n",
 		       bond->dev->name);
@@ -998,10 +991,6 @@ static ssize_t bonding_store_miimon(struct device *d,
 				bond->params.arp_validate =
 					BOND_ARP_VALIDATE_NONE;
 			}
-			if (delayed_work_pending(&bond->arp_work)) {
-				cancel_delayed_work(&bond->arp_work);
-				flush_workqueue(bond->wq);
-			}
 		}
 
 		if (bond->dev->flags & IFF_UP) {
@@ -1010,15 +999,12 @@ static ssize_t bonding_store_miimon(struct device *d,
 			 * timer will get fired off when the open function
 			 * is called.
 			 */
-			if (!delayed_work_pending(&bond->mii_work)) {
-				INIT_DELAYED_WORK(&bond->mii_work,
-						  bond_mii_monitor);
-				queue_delayed_work(bond->wq,
-						   &bond->mii_work, 0);
-			}
+			cancel_delayed_work_sync(&bond->arp_work);
+			queue_delayed_work(bond->wq, &bond->mii_work, 0);
 		}
 	}
 out:
+	rtnl_unlock();
 	return ret;
 }
 static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 157/171 ] bonding: fix disabling of arp_interval and miimon
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (155 preceding siblings ...)
  2013-04-11 20:27 ` [ 156/171 ] bonding: fix miimon and arp_interval delayed work race conditions Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 158/171 ] drivers: net: ethernet: davinci_emac: use netif_wake_queue() while restarting tx queue Steven Rostedt
                   ` (13 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Nikolay Aleksandrov, David S. Miller

[-- Attachment #1: 0157-bonding-fix-disabling-of-arp_interval-and-miimon.patch --]
[-- Type: text/plain, Size: 6344 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "nikolay@redhat.com" <nikolay@redhat.com>

[ Upstream commit 1bc7db16782c2a581fb4d53ca853631050f31611 ]

Currently if either arp_interval or miimon is disabled, they both get
disabled, and upon disabling they get executed once more which is not
the proper behaviour. Also when doing a no-op and disabling an already
disabled one, the other again gets disabled.
Also fix the error messages with the proper valid ranges, and a small
typo fix in the up delay error message (outputting "down delay", instead
of "up delay").

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/bonding/bond_sysfs.c |   92 ++++++++++++++++++++------------------
 1 file changed, 48 insertions(+), 44 deletions(-)

diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 13e37cc..53eeac2 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -527,7 +527,7 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 		goto out;
 	}
 	if (new_value < 0) {
-		pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
+		pr_err("%s: Invalid arp_interval value %d not in range 0-%d; rejected.\n",
 		       bond->dev->name, new_value, INT_MAX);
 		ret = -EINVAL;
 		goto out;
@@ -542,14 +542,15 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 	pr_info("%s: Setting ARP monitoring interval to %d.\n",
 		bond->dev->name, new_value);
 	bond->params.arp_interval = new_value;
-	if (bond->params.miimon) {
-		pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
-			bond->dev->name, bond->dev->name);
-		bond->params.miimon = 0;
-	}
-	if (!bond->params.arp_targets[0]) {
-		pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
-			bond->dev->name);
+	if (new_value) {
+		if (bond->params.miimon) {
+			pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
+				bond->dev->name, bond->dev->name);
+			bond->params.miimon = 0;
+		}
+		if (!bond->params.arp_targets[0])
+			pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
+				bond->dev->name);
 	}
 	if (bond->dev->flags & IFF_UP) {
 		/* If the interface is up, we may need to fire off
@@ -557,10 +558,13 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 		 * timer will get fired off when the open function
 		 * is called.
 		 */
-		cancel_delayed_work_sync(&bond->mii_work);
-		queue_delayed_work(bond->wq, &bond->arp_work, 0);
+		if (!new_value) {
+			cancel_delayed_work_sync(&bond->arp_work);
+		} else {
+			cancel_delayed_work_sync(&bond->mii_work);
+			queue_delayed_work(bond->wq, &bond->arp_work, 0);
+		}
 	}
-
 out:
 	rtnl_unlock();
 	return ret;
@@ -702,7 +706,7 @@ static ssize_t bonding_store_downdelay(struct device *d,
 	}
 	if (new_value < 0) {
 		pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
-		       bond->dev->name, new_value, 1, INT_MAX);
+		       bond->dev->name, new_value, 0, INT_MAX);
 		ret = -EINVAL;
 		goto out;
 	} else {
@@ -757,8 +761,8 @@ static ssize_t bonding_store_updelay(struct device *d,
 		goto out;
 	}
 	if (new_value < 0) {
-		pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
-		       bond->dev->name, new_value, 1, INT_MAX);
+		pr_err("%s: Invalid up delay value %d not in range %d-%d; rejected.\n",
+		       bond->dev->name, new_value, 0, INT_MAX);
 		ret = -EINVAL;
 		goto out;
 	} else {
@@ -968,37 +972,37 @@ static ssize_t bonding_store_miimon(struct device *d,
 	}
 	if (new_value < 0) {
 		pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
-		       bond->dev->name, new_value, 1, INT_MAX);
+		       bond->dev->name, new_value, 0, INT_MAX);
 		ret = -EINVAL;
 		goto out;
-	} else {
-		pr_info("%s: Setting MII monitoring interval to %d.\n",
-			bond->dev->name, new_value);
-		bond->params.miimon = new_value;
-		if (bond->params.updelay)
-			pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
-				bond->dev->name,
-				bond->params.updelay * bond->params.miimon);
-		if (bond->params.downdelay)
-			pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
-				bond->dev->name,
-				bond->params.downdelay * bond->params.miimon);
-		if (bond->params.arp_interval) {
-			pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
-				bond->dev->name);
-			bond->params.arp_interval = 0;
-			if (bond->params.arp_validate) {
-				bond->params.arp_validate =
-					BOND_ARP_VALIDATE_NONE;
-			}
-		}
-
-		if (bond->dev->flags & IFF_UP) {
-			/* If the interface is up, we may need to fire off
-			 * the MII timer. If the interface is down, the
-			 * timer will get fired off when the open function
-			 * is called.
-			 */
+	}
+	pr_info("%s: Setting MII monitoring interval to %d.\n",
+		bond->dev->name, new_value);
+	bond->params.miimon = new_value;
+	if (bond->params.updelay)
+		pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
+			bond->dev->name,
+			bond->params.updelay * bond->params.miimon);
+	if (bond->params.downdelay)
+		pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
+			bond->dev->name,
+			bond->params.downdelay * bond->params.miimon);
+	if (new_value && bond->params.arp_interval) {
+		pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
+			bond->dev->name);
+		bond->params.arp_interval = 0;
+		if (bond->params.arp_validate)
+			bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
+	}
+	if (bond->dev->flags & IFF_UP) {
+		/* If the interface is up, we may need to fire off
+		 * the MII timer. If the interface is down, the
+		 * timer will get fired off when the open function
+		 * is called.
+		 */
+		if (!new_value) {
+			cancel_delayed_work_sync(&bond->mii_work);
+		} else {
 			cancel_delayed_work_sync(&bond->arp_work);
 			queue_delayed_work(bond->wq, &bond->mii_work, 0);
 		}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 158/171 ] drivers: net: ethernet: davinci_emac: use netif_wake_queue() while restarting tx queue
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (156 preceding siblings ...)
  2013-04-11 20:27 ` [ 157/171 ] bonding: fix disabling of arp_interval and miimon Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 159/171 ] drivers: net: ethernet: cpsw: " Steven Rostedt
                   ` (12 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dan Franke, Sriramakrishnan A G, Mugunthan V N, Eric Dumazet,
	David S. Miller

[-- Attachment #1: 0158-drivers-net-ethernet-davinci_emac-use-netif_wake_que.patch --]
[-- Type: text/plain, Size: 1348 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mugunthan V N <mugunthanvnm@ti.com>

[ Upstream commit 7e51cde276ca820d526c6c21cf8147df595a36bf ]

To restart tx queue use netif_wake_queue() intead of netif_start_queue()
so that net schedule will restart transmission immediately which will
increase network performance while doing huge data transfers.

Reported-by: Dan Franke <dan.franke@schneider-electric.com>
Suggested-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/ti/davinci_emac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index fce89a0..93c040d 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1055,7 +1055,7 @@ static void emac_tx_handler(void *token, int len, int status)
 	atomic_dec(&priv->cur_tx);
 
 	if (unlikely(netif_queue_stopped(ndev)))
-		netif_start_queue(ndev);
+		netif_wake_queue(ndev);
 	ndev->stats.tx_packets++;
 	ndev->stats.tx_bytes += len;
 	dev_kfree_skb_any(skb);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 159/171 ] drivers: net: ethernet: cpsw: use netif_wake_queue() while restarting tx queue
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (157 preceding siblings ...)
  2013-04-11 20:27 ` [ 158/171 ] drivers: net: ethernet: davinci_emac: use netif_wake_queue() while restarting tx queue Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 160/171 ] aoe: reserve enough headroom on skbs Steven Rostedt
                   ` (11 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dan Franke, Sriramakrishnan A G, Mugunthan V N, Eric Dumazet,
	David S. Miller

[-- Attachment #1: 0159-drivers-net-ethernet-cpsw-use-netif_wake_queue-while.patch --]
[-- Type: text/plain, Size: 1316 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mugunthan V N <mugunthanvnm@ti.com>

[ Upstream commit b56d6b3fca6d1214dbc9c5655f26e5d4ec04afc8 ]

To restart tx queue use netif_wake_queue() intead of netif_start_queue()
so that net schedule will restart transmission immediately which will
increase network performance while doing huge data transfers.

Reported-by: Dan Franke <dan.franke@schneider-electric.com>
Suggested-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/ti/cpsw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 1e5d85b..0ab0a10 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -250,7 +250,7 @@ void cpsw_tx_handler(void *token, int len, int status)
 	struct cpsw_priv	*priv = netdev_priv(ndev);
 
 	if (unlikely(netif_queue_stopped(ndev)))
-		netif_start_queue(ndev);
+		netif_wake_queue(ndev);
 	priv->stats.tx_packets++;
 	priv->stats.tx_bytes += len;
 	dev_kfree_skb_any(skb);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 160/171 ] aoe: reserve enough headroom on skbs
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (158 preceding siblings ...)
  2013-04-11 20:27 ` [ 159/171 ] drivers: net: ethernet: cpsw: " Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 161/171 ] atl1e: drop pci-msi support because of packet corruption Steven Rostedt
                   ` (10 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: David Oostdyk, Eric Dumazet, Ed Cashin, David S. Miller

[-- Attachment #1: 0160-aoe-reserve-enough-headroom-on-skbs.patch --]
[-- Type: text/plain, Size: 1344 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 91c5746425aed8f7188a351f1224a26aa232e4b3 ]

Some network drivers use a non default hard_header_len

Transmitted skb should take into account dev->hard_header_len, or risk
crashes or expensive reallocations.

In the case of aoe, lets reserve MAX_HEADER bytes.

David reported a crash in defxx driver, solved by this patch.

Reported-by: David Oostdyk <daveo@ll.mit.edu>
Tested-by: David Oostdyk <daveo@ll.mit.edu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/aoe/aoecmd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 887f68f..db30542 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -30,8 +30,9 @@ new_skb(ulong len)
 {
 	struct sk_buff *skb;
 
-	skb = alloc_skb(len, GFP_ATOMIC);
+	skb = alloc_skb(len + MAX_HEADER, GFP_ATOMIC);
 	if (skb) {
+		skb_reserve(skb, MAX_HEADER);
 		skb_reset_mac_header(skb);
 		skb_reset_network_header(skb);
 		skb->protocol = __constant_htons(ETH_P_AOE);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 161/171 ] atl1e: drop pci-msi support because of packet corruption
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (159 preceding siblings ...)
  2013-04-11 20:27 ` [ 160/171 ] aoe: reserve enough headroom on skbs Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 162/171 ] DM9000B: driver initialization upgrade Steven Rostedt
                   ` (9 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: rebelyouth, Huang, Xiong, Christian Sünkenberg,
	Hannes Frederic Sowa, David S. Miller

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0161-atl1e-drop-pci-msi-support-because-of-packet-corrupt.patch --]
[-- Type: text/plain, Size: 2538 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

[ Upstream commit 188ab1b105c96656f6bcfb49d0d8bb1b1936b632 ]

Usage of pci-msi results in corrupted dma packet transfers to the host.

Reported-by: rebelyouth <rebelyouth.hacklab@gmail.com>
Cc: Huang, Xiong <xiong@qca.qualcomm.com>
Tested-by: Christian Sünkenberg <christian.suenkenberg@student.kit.edu>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/atheros/atl1e/atl1e.h      |    1 -
 drivers/net/ethernet/atheros/atl1e/atl1e_main.c |   19 ++-----------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e.h b/drivers/net/ethernet/atheros/atl1e/atl1e.h
index 829b5ad..edfdf6b 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e.h
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e.h
@@ -438,7 +438,6 @@ struct atl1e_adapter {
 	struct atl1e_hw        hw;
 	struct atl1e_hw_stats  hw_stats;
 
-	bool have_msi;
 	u32 wol;
 	u16 link_speed;
 	u16 link_duplex;
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index a98acc8..b986503 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1851,34 +1851,19 @@ static void atl1e_free_irq(struct atl1e_adapter *adapter)
 	struct net_device *netdev = adapter->netdev;
 
 	free_irq(adapter->pdev->irq, netdev);
-
-	if (adapter->have_msi)
-		pci_disable_msi(adapter->pdev);
 }
 
 static int atl1e_request_irq(struct atl1e_adapter *adapter)
 {
 	struct pci_dev    *pdev   = adapter->pdev;
 	struct net_device *netdev = adapter->netdev;
-	int flags = 0;
 	int err = 0;
 
-	adapter->have_msi = true;
-	err = pci_enable_msi(pdev);
-	if (err) {
-		netdev_dbg(netdev,
-			   "Unable to allocate MSI interrupt Error: %d\n", err);
-		adapter->have_msi = false;
-	}
-
-	if (!adapter->have_msi)
-		flags |= IRQF_SHARED;
-	err = request_irq(pdev->irq, atl1e_intr, flags, netdev->name, netdev);
+	err = request_irq(pdev->irq, atl1e_intr, IRQF_SHARED, netdev->name,
+			  netdev);
 	if (err) {
 		netdev_dbg(adapter->netdev,
 			   "Unable to allocate interrupt Error: %d\n", err);
-		if (adapter->have_msi)
-			pci_disable_msi(pdev);
 		return err;
 	}
 	netdev_dbg(netdev, "atl1e_request_irq OK\n");
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 162/171 ] DM9000B: driver initialization upgrade
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (160 preceding siblings ...)
  2013-04-11 20:27 ` [ 161/171 ] atl1e: drop pci-msi support because of packet corruption Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 163/171 ] ipv6: fix bad free of addrconf_init_net Steven Rostedt
                   ` (8 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Joseph CHANG, David S. Miller

[-- Attachment #1: 0162-DM9000B-driver-initialization-upgrade.patch --]
[-- Type: text/plain, Size: 8291 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Joseph CHANG <josright123@gmail.com>

[ Upstream commit 6741f40d198c6a5feb23653a1efd4ca47f93d83d ]

Fix bug for DM9000 revision B which contain a DSP PHY

DM9000B use DSP PHY instead previouse DM9000 revisions' analog PHY,
So need extra change in initialization, For
explicity PHY Reset and PHY init parameter, and
first DM9000_NCR reset need NCR_MAC_LBK bit by dm9000_probe().

Following DM9000_NCR reset cause by dm9000_open() clear the
NCR_MAC_LBK bit.

Without this fix, Power-up FIFO pointers error happen around 2%
rate among Davicom's customers' boards. With this fix, All above
cases can be solved.

Signed-off-by: Joseph CHANG <josright123@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/davicom/dm9000.c |  214 +++++++++++++++++----------------
 drivers/net/ethernet/davicom/dm9000.h |   11 +-
 2 files changed, 120 insertions(+), 105 deletions(-)

diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 36499d5..a9628b6 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -257,6 +257,107 @@ static void dm9000_dumpblk_32bit(void __iomem *reg, int count)
 		tmp = readl(reg);
 }
 
+/*
+ * Sleep, either by using msleep() or if we are suspending, then
+ * use mdelay() to sleep.
+ */
+static void dm9000_msleep(board_info_t *db, unsigned int ms)
+{
+	if (db->in_suspend)
+		mdelay(ms);
+	else
+		msleep(ms);
+}
+
+/* Read a word from phyxcer */
+static int
+dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
+{
+	board_info_t *db = netdev_priv(dev);
+	unsigned long flags;
+	unsigned int reg_save;
+	int ret;
+
+	mutex_lock(&db->addr_lock);
+
+	spin_lock_irqsave(&db->lock, flags);
+
+	/* Save previous register address */
+	reg_save = readb(db->io_addr);
+
+	/* Fill the phyxcer register into REG_0C */
+	iow(db, DM9000_EPAR, DM9000_PHY | reg);
+
+	/* Issue phyxcer read command */
+	iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS);
+
+	writeb(reg_save, db->io_addr);
+	spin_unlock_irqrestore(&db->lock, flags);
+
+	dm9000_msleep(db, 1);		/* Wait read complete */
+
+	spin_lock_irqsave(&db->lock, flags);
+	reg_save = readb(db->io_addr);
+
+	iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
+
+	/* The read data keeps on REG_0D & REG_0E */
+	ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
+
+	/* restore the previous address */
+	writeb(reg_save, db->io_addr);
+	spin_unlock_irqrestore(&db->lock, flags);
+
+	mutex_unlock(&db->addr_lock);
+
+	dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
+	return ret;
+}
+
+/* Write a word to phyxcer */
+static void
+dm9000_phy_write(struct net_device *dev,
+		 int phyaddr_unused, int reg, int value)
+{
+	board_info_t *db = netdev_priv(dev);
+	unsigned long flags;
+	unsigned long reg_save;
+
+	dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
+	mutex_lock(&db->addr_lock);
+
+	spin_lock_irqsave(&db->lock, flags);
+
+	/* Save previous register address */
+	reg_save = readb(db->io_addr);
+
+	/* Fill the phyxcer register into REG_0C */
+	iow(db, DM9000_EPAR, DM9000_PHY | reg);
+
+	/* Fill the written data into REG_0D & REG_0E */
+	iow(db, DM9000_EPDRL, value);
+	iow(db, DM9000_EPDRH, value >> 8);
+
+	/* Issue phyxcer write command */
+	iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW);
+
+	writeb(reg_save, db->io_addr);
+	spin_unlock_irqrestore(&db->lock, flags);
+
+	dm9000_msleep(db, 1);		/* Wait write complete */
+
+	spin_lock_irqsave(&db->lock, flags);
+	reg_save = readb(db->io_addr);
+
+	iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
+
+	/* restore the previous address */
+	writeb(reg_save, db->io_addr);
+
+	spin_unlock_irqrestore(&db->lock, flags);
+	mutex_unlock(&db->addr_lock);
+}
+
 /* dm9000_set_io
  *
  * select the specified set of io routines to use with the
@@ -794,6 +895,9 @@ dm9000_init_dm9000(struct net_device *dev)
 
 	iow(db, DM9000_GPCR, GPCR_GEP_CNTL);	/* Let GPIO0 output */
 
+	dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
+	dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */
+
 	ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
 
 	/* if wol is needed, then always set NCR_WAKEEN otherwise we end
@@ -1200,109 +1304,6 @@ dm9000_open(struct net_device *dev)
 	return 0;
 }
 
-/*
- * Sleep, either by using msleep() or if we are suspending, then
- * use mdelay() to sleep.
- */
-static void dm9000_msleep(board_info_t *db, unsigned int ms)
-{
-	if (db->in_suspend)
-		mdelay(ms);
-	else
-		msleep(ms);
-}
-
-/*
- *   Read a word from phyxcer
- */
-static int
-dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
-{
-	board_info_t *db = netdev_priv(dev);
-	unsigned long flags;
-	unsigned int reg_save;
-	int ret;
-
-	mutex_lock(&db->addr_lock);
-
-	spin_lock_irqsave(&db->lock,flags);
-
-	/* Save previous register address */
-	reg_save = readb(db->io_addr);
-
-	/* Fill the phyxcer register into REG_0C */
-	iow(db, DM9000_EPAR, DM9000_PHY | reg);
-
-	iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS);	/* Issue phyxcer read command */
-
-	writeb(reg_save, db->io_addr);
-	spin_unlock_irqrestore(&db->lock,flags);
-
-	dm9000_msleep(db, 1);		/* Wait read complete */
-
-	spin_lock_irqsave(&db->lock,flags);
-	reg_save = readb(db->io_addr);
-
-	iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
-
-	/* The read data keeps on REG_0D & REG_0E */
-	ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
-
-	/* restore the previous address */
-	writeb(reg_save, db->io_addr);
-	spin_unlock_irqrestore(&db->lock,flags);
-
-	mutex_unlock(&db->addr_lock);
-
-	dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
-	return ret;
-}
-
-/*
- *   Write a word to phyxcer
- */
-static void
-dm9000_phy_write(struct net_device *dev,
-		 int phyaddr_unused, int reg, int value)
-{
-	board_info_t *db = netdev_priv(dev);
-	unsigned long flags;
-	unsigned long reg_save;
-
-	dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
-	mutex_lock(&db->addr_lock);
-
-	spin_lock_irqsave(&db->lock,flags);
-
-	/* Save previous register address */
-	reg_save = readb(db->io_addr);
-
-	/* Fill the phyxcer register into REG_0C */
-	iow(db, DM9000_EPAR, DM9000_PHY | reg);
-
-	/* Fill the written data into REG_0D & REG_0E */
-	iow(db, DM9000_EPDRL, value);
-	iow(db, DM9000_EPDRH, value >> 8);
-
-	iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW);	/* Issue phyxcer write command */
-
-	writeb(reg_save, db->io_addr);
-	spin_unlock_irqrestore(&db->lock, flags);
-
-	dm9000_msleep(db, 1);		/* Wait write complete */
-
-	spin_lock_irqsave(&db->lock,flags);
-	reg_save = readb(db->io_addr);
-
-	iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
-
-	/* restore the previous address */
-	writeb(reg_save, db->io_addr);
-
-	spin_unlock_irqrestore(&db->lock, flags);
-	mutex_unlock(&db->addr_lock);
-}
-
 static void
 dm9000_shutdown(struct net_device *dev)
 {
@@ -1501,7 +1502,12 @@ dm9000_probe(struct platform_device *pdev)
 	db->flags |= DM9000_PLATF_SIMPLE_PHY;
 #endif
 
-	dm9000_reset(db);
+	/* Fixing bug on dm9000_probe, takeover dm9000_reset(db),
+	 * Need 'NCR_MAC_LBK' bit to indeed stable our DM9000 fifo
+	 * while probe stage.
+	 */
+
+	iow(db, DM9000_NCR, NCR_MAC_LBK | NCR_RST);
 
 	/* try multiple times, DM9000 sometimes gets the read wrong */
 	for (i = 0; i < 8; i++) {
diff --git a/drivers/net/ethernet/davicom/dm9000.h b/drivers/net/ethernet/davicom/dm9000.h
index 55688bd..9ce058a 100644
--- a/drivers/net/ethernet/davicom/dm9000.h
+++ b/drivers/net/ethernet/davicom/dm9000.h
@@ -69,7 +69,9 @@
 #define NCR_WAKEEN          (1<<6)
 #define NCR_FCOL            (1<<4)
 #define NCR_FDX             (1<<3)
-#define NCR_LBK             (3<<1)
+
+#define NCR_RESERVED        (3<<1)
+#define NCR_MAC_LBK         (1<<1)
 #define NCR_RST	            (1<<0)
 
 #define NSR_SPEED           (1<<7)
@@ -167,5 +169,12 @@
 #define ISR_LNKCHNG		(1<<5)
 #define ISR_UNDERRUN		(1<<4)
 
+/* Davicom MII registers.
+ */
+
+#define MII_DM_DSPCR		0x1b    /* DSP Control Register */
+
+#define DSPCR_INIT_PARAM	0xE100	/* DSP init parameter */
+
 #endif /* _DM9000X_H_ */
 
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 163/171 ] ipv6: fix bad free of addrconf_init_net
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (161 preceding siblings ...)
  2013-04-11 20:27 ` [ 162/171 ] DM9000B: driver initialization upgrade Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-09-24  6:36   ` zhuyj
  2013-04-11 20:27 ` [ 164/171 ] ipv6: dont accept multicast traffic with scope 0 Steven Rostedt
                   ` (7 subsequent siblings)
  170 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Hong Zhiguo, David S. Miller

[-- Attachment #1: 0163-ipv6-fix-bad-free-of-addrconf_init_net.patch --]
[-- Type: text/plain, Size: 1754 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hong Zhiguo <honkiko@gmail.com>

[ Upstream commit a79ca223e029aa4f09abb337accf1812c900a800 ]

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv6/addrconf.c |   26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index fd82a30..ec627b5 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4653,26 +4653,20 @@ static void addrconf_sysctl_unregister(struct inet6_dev *idev)
 
 static int __net_init addrconf_init_net(struct net *net)
 {
-	int err;
+	int err = -ENOMEM;
 	struct ipv6_devconf *all, *dflt;
 
-	err = -ENOMEM;
-	all = &ipv6_devconf;
-	dflt = &ipv6_devconf_dflt;
+	all = kmemdup(&ipv6_devconf, sizeof(ipv6_devconf), GFP_KERNEL);
+	if (all == NULL)
+		goto err_alloc_all;
 
-	if (!net_eq(net, &init_net)) {
-		all = kmemdup(all, sizeof(ipv6_devconf), GFP_KERNEL);
-		if (all == NULL)
-			goto err_alloc_all;
+	dflt = kmemdup(&ipv6_devconf_dflt, sizeof(ipv6_devconf_dflt), GFP_KERNEL);
+	if (dflt == NULL)
+		goto err_alloc_dflt;
 
-		dflt = kmemdup(dflt, sizeof(ipv6_devconf_dflt), GFP_KERNEL);
-		if (dflt == NULL)
-			goto err_alloc_dflt;
-	} else {
-		/* these will be inherited by all namespaces */
-		dflt->autoconf = ipv6_defaults.autoconf;
-		dflt->disable_ipv6 = ipv6_defaults.disable_ipv6;
-	}
+	/* these will be inherited by all namespaces */
+	dflt->autoconf = ipv6_defaults.autoconf;
+	dflt->disable_ipv6 = ipv6_defaults.disable_ipv6;
 
 	net->ipv6.devconf_all = all;
 	net->ipv6.devconf_dflt = dflt;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 164/171 ] ipv6: dont accept multicast traffic with scope 0
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (162 preceding siblings ...)
  2013-04-11 20:27 ` [ 163/171 ] ipv6: fix bad free of addrconf_init_net Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 165/171 ] ipv6: dont accept node local multicast traffic from the wire Steven Rostedt
                   ` (6 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Erik Hugne, YOSHIFUJI Hideaki, Hannes Frederic Sowa,
	David S. Miller

[-- Attachment #1: 0164-ipv6-don-t-accept-multicast-traffic-with-scope-0.patch --]
[-- Type: text/plain, Size: 1462 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

[ Upstream commit 20314092c1b41894d8c181bf9aa6f022be2416aa ]

v2:
a) moved before multicast source address check
b) changed comment to netdev style

Cc: Erik Hugne <erik.hugne@ericsson.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv6/ip6_input.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index b196852..db70b88 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -118,6 +118,15 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	    ipv6_addr_loopback(&hdr->daddr))
 		goto err;
 
+	/* RFC4291 2.7
+	 * Nodes must not originate a packet to a multicast address whose scope
+	 * field contains the reserved value 0; if such a packet is received, it
+	 * must be silently dropped.
+	 */
+	if (ipv6_addr_is_multicast(&hdr->daddr) &&
+	    IPV6_ADDR_MC_SCOPE(&hdr->daddr) == 0)
+		goto err;
+
 	/*
 	 * RFC4291 2.7
 	 * Multicast addresses must not be used as source addresses in IPv6
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 165/171 ] ipv6: dont accept node local multicast traffic from the wire
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (163 preceding siblings ...)
  2013-04-11 20:27 ` [ 164/171 ] ipv6: dont accept multicast traffic with scope 0 Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 166/171 ] ks8851: Fix interpretation of rxlen field Steven Rostedt
                   ` (5 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Erik Hugne, YOSHIFUJI Hideaki, Hannes Frederic Sowa,
	David S. Miller

[-- Attachment #1: 0165-ipv6-don-t-accept-node-local-multicast-traffic-from-.patch --]
[-- Type: text/plain, Size: 1945 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

[ Upstream commit 1c4a154e5253687c51123956dfcee9e9dfa8542d ]

Erik Hugne's errata proposal (Errata ID: 3480) to RFC4291 has been
verified: http://www.rfc-editor.org/errata_search.php?eid=3480

We have to check for pkt_type and loopback flag because either the
packets are allowed to travel over the loopback interface (in which case
pkt_type is PACKET_HOST and IFF_LOOPBACK flag is set) or they travel
over a non-loopback interface back to us (in which case PACKET_TYPE is
PACKET_LOOPBACK and IFF_LOOPBACK flag is not set).

Cc: Erik Hugne <erik.hugne@ericsson.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv6/ip6_input.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index db70b88..dee9964 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -118,6 +118,18 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	    ipv6_addr_loopback(&hdr->daddr))
 		goto err;
 
+	/* RFC4291 Errata ID: 3480
+	 * Interface-Local scope spans only a single interface on a
+	 * node and is useful only for loopback transmission of
+	 * multicast.  Packets with interface-local scope received
+	 * from another node must be discarded.
+	 */
+	if (!(skb->pkt_type == PACKET_LOOPBACK ||
+	      dev->flags & IFF_LOOPBACK) &&
+	    ipv6_addr_is_multicast(&hdr->daddr) &&
+	    IPV6_ADDR_MC_SCOPE(&hdr->daddr) == 1)
+		goto err;
+
 	/* RFC4291 2.7
 	 * Nodes must not originate a packet to a multicast address whose scope
 	 * field contains the reserved value 0; if such a packet is received, it
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 166/171 ] ks8851: Fix interpretation of rxlen field.
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (164 preceding siblings ...)
  2013-04-11 20:27 ` [ 165/171 ] ipv6: dont accept node local multicast traffic from the wire Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 167/171 ] net: add a synchronize_net() in netdev_rx_handler_unregister() Steven Rostedt
                   ` (4 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Max Nekludov, David S. Miller

[-- Attachment #1: 0166-ks8851-Fix-interpretation-of-rxlen-field.patch --]
[-- Type: text/plain, Size: 1359 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Max.Nekludov@us.elster.com" <Max.Nekludov@us.elster.com>

[ Upstream commit 14bc435ea54cb888409efb54fc6b76c13ef530e9 ]

According to the Datasheet (page 52):
15-12 Reserved
11-0 RXBC Receive Byte Count
This field indicates the present received frame byte size.

The code has a bug:
                 rxh = ks8851_rdreg32(ks, KS_RXFHSR);
                 rxstat = rxh & 0xffff;
                 rxlen = rxh >> 16; // BUG!!! 0xFFF mask should be applied

Signed-off-by: Max Nekludov <Max.Nekludov@us.elster.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/micrel/ks8851.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 1540ebe..a4cd9a0 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -547,7 +547,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
 	for (; rxfc != 0; rxfc--) {
 		rxh = ks8851_rdreg32(ks, KS_RXFHSR);
 		rxstat = rxh & 0xffff;
-		rxlen = rxh >> 16;
+		rxlen = (rxh >> 16) & 0xfff;
 
 		netif_dbg(ks, rx_status, ks->netdev,
 			  "rx: stat 0x%04x, len 0x%04x\n", rxstat, rxlen);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 167/171 ] net: add a synchronize_net() in netdev_rx_handler_unregister()
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (165 preceding siblings ...)
  2013-04-11 20:27 ` [ 166/171 ] ks8851: Fix interpretation of rxlen field Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 168/171 ] net: fq_codel: Fix off-by-one error Steven Rostedt
                   ` (3 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Eric Dumazet, Jiri Pirko, Paul E. McKenney, Paul E. McKenney,
	David S. Miller

[-- Attachment #1: 0167-net-add-a-synchronize_net-in-netdev_rx_handler_unreg.patch --]
[-- Type: text/plain, Size: 4427 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 00cfec37484761a44a3b6f4675a54caa618210ae ]

commit 35d48903e97819 (bonding: fix rx_handler locking) added a race
in bonding driver, reported by Steven Rostedt who did a very good
diagnosis :

<quoting Steven>

I'm currently debugging a crash in an old 3.0-rt kernel that one of our
customers is seeing. The bug happens with a stress test that loads and
unloads the bonding module in a loop (I don't know all the details as
I'm not the one that is directly interacting with the customer). But the
bug looks to be something that may still be present and possibly present
in mainline too. It will just be much harder to trigger it in mainline.

In -rt, interrupts are threads, and can schedule in and out just like
any other thread. Note, mainline now supports interrupt threads so this
may be easily reproducible in mainline as well. I don't have the ability
to tell the customer to try mainline or other kernels, so my hands are
somewhat tied to what I can do.

But according to a core dump, I tracked down that the eth irq thread
crashed in bond_handle_frame() here:

        slave = bond_slave_get_rcu(skb->dev);
        bond = slave->bond; <--- BUG

the slave returned was NULL and accessing slave->bond caused a NULL
pointer dereference.

Looking at the code that unregisters the handler:

void netdev_rx_handler_unregister(struct net_device *dev)
{

        ASSERT_RTNL();
        RCU_INIT_POINTER(dev->rx_handler, NULL);
        RCU_INIT_POINTER(dev->rx_handler_data, NULL);
}

Which is basically:
        dev->rx_handler = NULL;
        dev->rx_handler_data = NULL;

And looking at __netif_receive_skb() we have:

        rx_handler = rcu_dereference(skb->dev->rx_handler);
        if (rx_handler) {
                if (pt_prev) {
                        ret = deliver_skb(skb, pt_prev, orig_dev);
                        pt_prev = NULL;
                }
                switch (rx_handler(&skb)) {

My question to all of you is, what stops this interrupt from happening
while the bonding module is unloading?  What happens if the interrupt
triggers and we have this:

        CPU0                    CPU1
        ----                    ----
  rx_handler = skb->dev->rx_handler

                        netdev_rx_handler_unregister() {
                           dev->rx_handler = NULL;
                           dev->rx_handler_data = NULL;

  rx_handler()
   bond_handle_frame() {
    slave = skb->dev->rx_handler;
    bond = slave->bond; <-- NULL pointer dereference!!!

What protection am I missing in the bond release handler that would
prevent the above from happening?

</quoting Steven>

We can fix bug this in two ways. First is adding a test in
bond_handle_frame() and others to check if rx_handler_data is NULL.

A second way is adding a synchronize_net() in
netdev_rx_handler_unregister() to make sure that a rcu protected reader
has the guarantee to see a non NULL rx_handler_data.

The second way is better as it avoids an extra test in fast path.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: Paul E. McKenney <paulmck@us.ibm.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/core/dev.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index d283020..9509394 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3153,6 +3153,7 @@ int netdev_rx_handler_register(struct net_device *dev,
 	if (dev->rx_handler)
 		return -EBUSY;
 
+	/* Note: rx_handler_data must be set before rx_handler */
 	rcu_assign_pointer(dev->rx_handler_data, rx_handler_data);
 	rcu_assign_pointer(dev->rx_handler, rx_handler);
 
@@ -3173,6 +3174,11 @@ void netdev_rx_handler_unregister(struct net_device *dev)
 
 	ASSERT_RTNL();
 	RCU_INIT_POINTER(dev->rx_handler, NULL);
+	/* a reader seeing a non NULL rx_handler in a rcu_read_lock()
+	 * section has a guarantee to see a non NULL rx_handler_data
+	 * as well.
+	 */
+	synchronize_net();
 	RCU_INIT_POINTER(dev->rx_handler_data, NULL);
 }
 EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 168/171 ] net: fq_codel: Fix off-by-one error
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (166 preceding siblings ...)
  2013-04-11 20:27 ` [ 167/171 ] net: add a synchronize_net() in netdev_rx_handler_unregister() Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 169/171 ] pch_gbe: fix ip_summed checksum reporting on rx Steven Rostedt
                   ` (2 subsequent siblings)
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Vijay Subramanian, Eric Dumazet, David S. Miller

[-- Attachment #1: 0168-net-fq_codel-Fix-off-by-one-error.patch --]
[-- Type: text/plain, Size: 1077 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Vijay Subramanian <subramanian.vijay@gmail.com>

[ Upstream commit cd68ddd4c29ab523440299f24ff2417fe7a0dca6 ]

Currently, we hold a max of sch->limit -1 number of packets instead of
sch->limit packets. Fix this off-by-one error.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/sched/sch_fq_codel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 4e606fc..5578628 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -195,7 +195,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		flow->deficit = q->quantum;
 		flow->dropped = 0;
 	}
-	if (++sch->q.qlen < sch->limit)
+	if (++sch->q.qlen <= sch->limit)
 		return NET_XMIT_SUCCESS;
 
 	q->drop_overlimit++;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 169/171 ] pch_gbe: fix ip_summed checksum reporting on rx
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (167 preceding siblings ...)
  2013-04-11 20:27 ` [ 168/171 ] net: fq_codel: Fix off-by-one error Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 170/171 ] smsc75xx: fix jumbo frame support Steven Rostedt
  2013-04-11 20:27 ` [ 171/171 ] bonding: get netdev_rx_handler_unregister out of locks Steven Rostedt
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Veaceslav Falico, David S. Miller

[-- Attachment #1: 0169-pch_gbe-fix-ip_summed-checksum-reporting-on-rx.patch --]
[-- Type: text/plain, Size: 1402 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit 76a0e68129d7d24eb995a6871ab47081bbfa0acc ]

skb->ip_summed should be CHECKSUM_UNNECESSARY when the driver reports that
checksums were correct and CHECKSUM_NONE in any other case. They're
currently placed vice versa, which breaks the forwarding scenario. Fix it
by placing them as described above.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index feb85d5..bfc2d64 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1777,9 +1777,9 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter,
 
 			skb->protocol = eth_type_trans(skb, netdev);
 			if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK)
-				skb->ip_summed = CHECKSUM_NONE;
-			else
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
+			else
+				skb->ip_summed = CHECKSUM_NONE;
 
 			napi_gro_receive(&adapter->napi, skb);
 			(*work_done)++;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 170/171 ] smsc75xx: fix jumbo frame support
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (168 preceding siblings ...)
  2013-04-11 20:27 ` [ 169/171 ] pch_gbe: fix ip_summed checksum reporting on rx Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  2013-04-11 20:27 ` [ 171/171 ] bonding: get netdev_rx_handler_unregister out of locks Steven Rostedt
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Steve Glendinning, David S. Miller

[-- Attachment #1: 0170-smsc75xx-fix-jumbo-frame-support.patch --]
[-- Type: text/plain, Size: 2436 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Steve Glendinning <steve.glendinning@shawell.net>

[ Upstream commit 4c51e53689569398d656e631c17308d9b8e84650 ]

This patch enables RX of jumbo frames for LAN7500.

Previously the driver would transmit jumbo frames succesfully but
would drop received jumbo frames (incrementing the interface errors
count).

With this patch applied the device can succesfully receive jumbo
frames up to MTU 9000 (9014 bytes on the wire including ethernet
header).

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/usb/smsc75xx.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 376143e..0d9a895 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -724,8 +724,12 @@ static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size)
 static int smsc75xx_change_mtu(struct net_device *netdev, int new_mtu)
 {
 	struct usbnet *dev = netdev_priv(netdev);
+	int ret;
+
+	if (new_mtu > MAX_SINGLE_PACKET_SIZE)
+		return -EINVAL;
 
-	int ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu);
+	ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
 	check_warn_return(ret, "Failed to set mac rx frame length");
 
 	return usbnet_change_mtu(netdev, new_mtu);
@@ -983,7 +987,7 @@ static int smsc75xx_reset(struct usbnet *dev)
 
 	netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x", buf);
 
-	ret = smsc75xx_set_rx_max_frame_length(dev, 1514);
+	ret = smsc75xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
 	check_warn_return(ret, "Failed to set max rx frame length");
 
 	ret = smsc75xx_read_reg(dev, MAC_RX, &buf);
@@ -1127,8 +1131,8 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 			else if (rx_cmd_a & (RX_CMD_A_LONG | RX_CMD_A_RUNT))
 				dev->net->stats.rx_frame_errors++;
 		} else {
-			/* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */
-			if (unlikely(size > (ETH_FRAME_LEN + 12))) {
+			/* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
+			if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12))) {
 				netif_dbg(dev, rx_err, dev->net,
 					"size err rx_cmd_a=0x%08x", rx_cmd_a);
 				return 0;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* [ 171/171 ] bonding: get netdev_rx_handler_unregister out of locks
  2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
                   ` (169 preceding siblings ...)
  2013-04-11 20:27 ` [ 170/171 ] smsc75xx: fix jumbo frame support Steven Rostedt
@ 2013-04-11 20:27 ` Steven Rostedt
  170 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:27 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Veaceslav Falico, Eric Dumazet, David S. Miller

[-- Attachment #1: 0171-bonding-get-netdev_rx_handler_unregister-out-of-lock.patch --]
[-- Type: text/plain, Size: 1321 bytes --]

3.6.11.2 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Veaceslav Falico <vfalico@redhat.com>

[ Upstream commit fcd99434fb5c137274d2e15dd2a6a7455f0f29ff ]

Now that netdev_rx_handler_unregister contains synchronize_net(), we need
to call it outside of bond->lock, cause it might sleep. Also, remove the
already unneded synchronize_net().

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/net/bonding/bond_main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a9a07ce..83ae683 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1961,12 +1961,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 		return -EINVAL;
 	}
 
+	write_unlock_bh(&bond->lock);
 	/* unregister rx_handler early so bond_handle_frame wouldn't be called
 	 * for this slave anymore.
 	 */
 	netdev_rx_handler_unregister(slave_dev);
-	write_unlock_bh(&bond->lock);
-	synchronize_net();
 	write_lock_bh(&bond->lock);
 
 	if (!bond->params.fail_over_mac) {
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 189+ messages in thread

* Re: [ 024/171 ] sfc: lock TX queues when calling netif_device_detach()
  2013-04-11 20:25 ` [ 024/171 ] sfc: lock TX queues when calling netif_device_detach() Steven Rostedt
@ 2013-04-11 20:42   ` Ben Hutchings
  2013-04-11 20:54     ` Steven Rostedt
  0 siblings, 1 reply; 189+ messages in thread
From: Ben Hutchings @ 2013-04-11 20:42 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, stable

On Thu, 2013-04-11 at 16:25 -0400, Steven Rostedt wrote:

> 3.6.11.2 stable review patch.
> If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Daniel Pieczko <dpieczko@solarflare.com>
> 
> [ Upstream commit c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1 ]
> 
> The assertion of netif_device_present() at the top of
> efx_hard_start_xmit() may fail if we don't do this.

You should also cherry-pick commit 35205b211c8d 'sfc: Disable soft
interrupt handling during efx_device_detach_sync()' on top of this.

Ben.

> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  drivers/net/ethernet/sfc/efx.c      |    4 ++--
>  drivers/net/ethernet/sfc/efx.h      |   13 +++++++++++++
>  drivers/net/ethernet/sfc/selftest.c |    2 +-
>  3 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 65a8d49..073fd60 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -2224,7 +2224,7 @@ int efx_reset(struct efx_nic *efx, enum reset_type method)
>  	netif_info(efx, drv, efx->net_dev, "resetting (%s)\n",
>  		   RESET_TYPE(method));
>  
> -	netif_device_detach(efx->net_dev);
> +	efx_device_detach_sync(efx);
>  	efx_reset_down(efx, method);
>  
>  	rc = efx->type->reset(efx, method);
> @@ -2719,7 +2719,7 @@ static int efx_pm_freeze(struct device *dev)
>  
>  	efx->state = STATE_FINI;
>  
> -	netif_device_detach(efx->net_dev);
> +	efx_device_detach_sync(efx);
>  
>  	efx_stop_all(efx);
>  	efx_stop_interrupts(efx, false);
> diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
> index 70755c9..320cf7b 100644
> --- a/drivers/net/ethernet/sfc/efx.h
> +++ b/drivers/net/ethernet/sfc/efx.h
> @@ -162,4 +162,17 @@ extern void efx_link_status_changed(struct efx_nic *efx);
>  extern void efx_link_set_advertising(struct efx_nic *efx, u32);
>  extern void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
>  
> +static inline void efx_device_detach_sync(struct efx_nic *efx)
> +{
> +	struct net_device *dev = efx->net_dev;
> +
> +	/* Lock/freeze all TX queues so that we can be sure the
> +	 * TX scheduler is stopped when we're done and before
> +	 * netif_device_present() becomes false.
> +	 */
> +	netif_tx_lock(dev);
> +	netif_device_detach(dev);
> +	netif_tx_unlock(dev);
> +}
> +
>  #endif /* EFX_EFX_H */
> diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
> index 96068d1..57dec37 100644
> --- a/drivers/net/ethernet/sfc/selftest.c
> +++ b/drivers/net/ethernet/sfc/selftest.c
> @@ -721,7 +721,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
>  	/* Detach the device so the kernel doesn't transmit during the
>  	 * loopback test and the watchdog timeout doesn't fire.
>  	 */
> -	netif_device_detach(efx->net_dev);
> +	efx_device_detach_sync(efx);
>  
>  	if (efx->type->test_chip) {
>  		rc_reset = efx->type->test_chip(efx, tests);

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 024/171 ] sfc: lock TX queues when calling netif_device_detach()
  2013-04-11 20:42   ` Ben Hutchings
@ 2013-04-11 20:54     ` Steven Rostedt
  2013-04-11 20:57       ` Steven Rostedt
  0 siblings, 1 reply; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:54 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable

On Thu, 2013-04-11 at 21:42 +0100, Ben Hutchings wrote:
> On Thu, 2013-04-11 at 16:25 -0400, Steven Rostedt wrote:
> 
> > 3.6.11.2 stable review patch.
> > If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Daniel Pieczko <dpieczko@solarflare.com>
> > 
> > [ Upstream commit c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1 ]
> > 
> > The assertion of netif_device_present() at the top of
> > efx_hard_start_xmit() may fail if we don't do this.
> 
> You should also cherry-pick commit 35205b211c8d 'sfc: Disable soft
> interrupt handling during efx_device_detach_sync()' on top of this.
> 

Hmm, I had that in my quilt queue, but commented it out. I guess it
didn't apply well, and it was a bit too much to back port blindly. I'll
take another look.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 111/171 ] ipc: Restrict mounting the mqueue filesystem
  2013-04-11 20:26 ` [ 111/171 ] ipc: Restrict mounting the mqueue filesystem Steven Rostedt
@ 2013-04-11 20:55   ` Eric W. Biederman
  2013-04-11 20:59     ` Steven Rostedt
  0 siblings, 1 reply; 189+ messages in thread
From: Eric W. Biederman @ 2013-04-11 20:55 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, stable, Serge Hallyn

Steven Rostedt <rostedt@goodmis.org> writes:

> 3.6.11.2 stable review patch.
> If anyone has any objections, please let me know.

Mounting only with privilege in the user namespace only dates
back to 3.8 so this is not needed in 3.6.

Not that it should do any harm.

Eric

> ------------------
>
> From: "Eric W. Biederman" <ebiederm@xmission.com>
>
> [ Upstream commit a636b702ed1805e988ad3d8ff8b52c060f8b341c ]
>
> Only allow mounting the mqueue filesystem if the caller has CAP_SYS_ADMIN
> rights over the ipc namespace.   The principle here is if you create
> or have capabilities over it you can mount it, otherwise you get to live
> with what other people have mounted.
>
> This information is not particularly sensitive and mqueue essentially
> only reports which posix messages queues exist.  Still when creating a
> restricted environment for an application to live any extra
> information may be of use to someone with sufficient creativity.  The
> historical if imperfect way this information has been restricted has
> been not to allow mounts and restricting this to ipc namespace
> creators maintains the spirit of the historical restriction.
>
> Cc: stable@vger.kernel.org
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  ipc/mqueue.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 9e4cf7f..f1df4bc 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -331,8 +331,16 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type,
>  			 int flags, const char *dev_name,
>  			 void *data)
>  {
> -	if (!(flags & MS_KERNMOUNT))
> -		data = current->nsproxy->ipc_ns;
> +	if (!(flags & MS_KERNMOUNT)) {
> +		struct ipc_namespace *ns = current->nsproxy->ipc_ns;
> +		/* Don't allow mounting unless the caller has CAP_SYS_ADMIN
> +		 * over the ipc namespace.
> +		 */
> +		if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN))
> +			return ERR_PTR(-EPERM);
> +
> +		data = ns;
> +	}
>  	return mount_ns(fs_type, flags, data, mqueue_fill_super);
>  }

^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts
  2013-04-11 20:26 ` [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts Steven Rostedt
@ 2013-04-11 20:57   ` Eric W. Biederman
  2013-04-11 21:02     ` Steven Rostedt
  0 siblings, 1 reply; 189+ messages in thread
From: Eric W. Biederman @ 2013-04-11 20:57 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, stable, Serge Hallyn

Steven Rostedt <rostedt@goodmis.org> writes:

> 3.6.11.2 stable review patch.
> If anyone has any objections, please let me know.

Mounting only with privilege in the user namespace (where we use
MNT_LOCK_READONLY) only dates back to 3.8 so this is not needed in 3.6.

Not that it should do any harm, but there doesn't seem to be much point
in backporting this one.

Eric

> ------------------
>
> From: "Eric W. Biederman" <ebiederm@xmission.com>
>
> [ Upstream commit 90563b198e4c6674c63672fae1923da467215f45 ]
>
> When a read-only bind mount is copied from mount namespace in a higher
> privileged user namespace to a mount namespace in a lesser privileged
> user namespace, it should not be possible to remove the the read-only
> restriction.
>
> Add a MNT_LOCK_READONLY mount flag to indicate that a mount must
> remain read-only.
>
> CC: stable@vger.kernel.org
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  fs/namespace.c        |    3 +++
>  include/linux/mount.h |    2 ++
>  2 files changed, 5 insertions(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index c48b0d3..48c7edb 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -1702,6 +1702,9 @@ static int change_mount_flags(struct vfsmount *mnt, int ms_flags)
>  	if (readonly_request == __mnt_is_readonly(mnt))
>  		return 0;
>  
> +	if (mnt->mnt_flags & MNT_LOCK_READONLY)
> +		return -EPERM;
> +
>  	if (readonly_request)
>  		error = mnt_make_readonly(real_mount(mnt));
>  	else
> diff --git a/include/linux/mount.h b/include/linux/mount.h
> index d7029f4..73005f9 100644
> --- a/include/linux/mount.h
> +++ b/include/linux/mount.h
> @@ -47,6 +47,8 @@ struct mnt_namespace;
>  
>  #define MNT_INTERNAL	0x4000
>  
> +#define MNT_LOCK_READONLY	0x400000
> +
>  struct vfsmount {
>  	struct dentry *mnt_root;	/* root of the mounted tree */
>  	struct super_block *mnt_sb;	/* pointer to superblock */

^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 024/171 ] sfc: lock TX queues when calling netif_device_detach()
  2013-04-11 20:54     ` Steven Rostedt
@ 2013-04-11 20:57       ` Steven Rostedt
  0 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:57 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable

On Thu, 2013-04-11 at 16:54 -0400, Steven Rostedt wrote:
> On Thu, 2013-04-11 at 21:42 +0100, Ben Hutchings wrote:
> > On Thu, 2013-04-11 at 16:25 -0400, Steven Rostedt wrote:
> > 
> > > 3.6.11.2 stable review patch.
> > > If anyone has any objections, please let me know.
> > > 
> > > ------------------
> > > 
> > > From: Daniel Pieczko <dpieczko@solarflare.com>
> > > 
> > > [ Upstream commit c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1 ]
> > > 
> > > The assertion of netif_device_present() at the top of
> > > efx_hard_start_xmit() may fail if we don't do this.
> > 
> > You should also cherry-pick commit 35205b211c8d 'sfc: Disable soft
> > interrupt handling during efx_device_detach_sync()' on top of this.
> > 
> 
> Hmm, I had that in my quilt queue, but commented it out. I guess it
> didn't apply well, and it was a bit too much to back port blindly. I'll
> take another look.

Strange, it's a trivial patch that applied fine. I wonder why I
commented it out?

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 111/171 ] ipc: Restrict mounting the mqueue filesystem
  2013-04-11 20:55   ` Eric W. Biederman
@ 2013-04-11 20:59     ` Steven Rostedt
  0 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 20:59 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel, stable, Serge Hallyn

On Thu, 2013-04-11 at 13:55 -0700, Eric W. Biederman wrote:
> Steven Rostedt <rostedt@goodmis.org> writes:
> 
> > 3.6.11.2 stable review patch.
> > If anyone has any objections, please let me know.
> 
> Mounting only with privilege in the user namespace only dates
> back to 3.8 so this is not needed in 3.6.

Hmm, I didn't see anything in the change log to suggest that.

If a patch applies, and there's nothing in the change log that tells me
that it shouldn't be added, I add it ;-)

> 
> Not that it should do any harm.

OK, then, I guess I'll just keep it.

Thanks,

-- Steve

> 
> Eric
> 
> > ------------------
> >
> > From: "Eric W. Biederman" <ebiederm@xmission.com>
> >
> > [ Upstream commit a636b702ed1805e988ad3d8ff8b52c060f8b341c ]
> >
> > Only allow mounting the mqueue filesystem if the caller has CAP_SYS_ADMIN
> > rights over the ipc namespace.   The principle here is if you create
> > or have capabilities over it you can mount it, otherwise you get to live
> > with what other people have mounted.
> >
> > This information is not particularly sensitive and mqueue essentially
> > only reports which posix messages queues exist.  Still when creating a
> > restricted environment for an application to live any extra
> > information may be of use to someone with sufficient creativity.  The
> > historical if imperfect way this information has been restricted has
> > been not to allow mounts and restricting this to ipc namespace
> > creators maintains the spirit of the historical restriction.
> >
> > Cc: stable@vger.kernel.org
> > Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> > Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> > ---
> >  ipc/mqueue.c |   12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> > index 9e4cf7f..f1df4bc 100644
> > --- a/ipc/mqueue.c
> > +++ b/ipc/mqueue.c
> > @@ -331,8 +331,16 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type,
> >  			 int flags, const char *dev_name,
> >  			 void *data)
> >  {
> > -	if (!(flags & MS_KERNMOUNT))
> > -		data = current->nsproxy->ipc_ns;
> > +	if (!(flags & MS_KERNMOUNT)) {
> > +		struct ipc_namespace *ns = current->nsproxy->ipc_ns;
> > +		/* Don't allow mounting unless the caller has CAP_SYS_ADMIN
> > +		 * over the ipc namespace.
> > +		 */
> > +		if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN))
> > +			return ERR_PTR(-EPERM);
> > +
> > +		data = ns;
> > +	}
> >  	return mount_ns(fs_type, flags, data, mqueue_fill_super);
> >  }



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts
  2013-04-11 20:57   ` Eric W. Biederman
@ 2013-04-11 21:02     ` Steven Rostedt
  0 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 21:02 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel, stable, Serge Hallyn

On Thu, 2013-04-11 at 13:57 -0700, Eric W. Biederman wrote:
> Steven Rostedt <rostedt@goodmis.org> writes:
> 
> > 3.6.11.2 stable review patch.
> > If anyone has any objections, please let me know.
> 
> Mounting only with privilege in the user namespace (where we use
> MNT_LOCK_READONLY) only dates back to 3.8 so this is not needed in 3.6.
> 
> Not that it should do any harm, but there doesn't seem to be much point
> in backporting this one.

OK, I'll drop it.

Thanks!

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written
  2013-04-11 20:25 ` [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written Steven Rostedt
@ 2013-04-11 21:15   ` Ben Hutchings
  2013-04-11 21:22     ` Steven Rostedt
  2013-04-12 22:05     ` Ben Hutchings
  0 siblings, 2 replies; 189+ messages in thread
From: Ben Hutchings @ 2013-04-11 21:15 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, stable

Aside from #21-26 in this series, and the deadlock fix required on top
of #24, there are several more fixes for sfc that I think are suitable
for 3.6.11.y.

These commits were cherry-picked for 3.4.38 and can also be
cherry-picked cleanly on top of 3.6.11.1 plus the 7 patches you already
have:

d5e8cc6c946e sfc: Really disable flow control while flushing
bfeed902946a sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
9724a8504c87 sfc: Add parentheses around use of bitfield macro arguments
0a6e5008a9df sfc: Fix MCDI structure field lookup
450783747f42 sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
525d9e824018 sfc: Work-around flush timeout when flushes have completed
ef492f11efed sfc: Correctly initialise reset_method in siena_test_chip()
ebf98e797b4e sfc: Fix timekeeping in efx_mcdi_poll()

Please let me know whether you're prepared to include these in the
current update.  I can then run some automated tests with your selected
set of patches applied.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written
  2013-04-11 21:15   ` Ben Hutchings
@ 2013-04-11 21:22     ` Steven Rostedt
  2013-04-12 22:05     ` Ben Hutchings
  1 sibling, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 21:22 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable

On Thu, 2013-04-11 at 22:15 +0100, Ben Hutchings wrote:
> Aside from #21-26 in this series, and the deadlock fix required on top
> of #24, there are several more fixes for sfc that I think are suitable
> for 3.6.11.y.
> 
> These commits were cherry-picked for 3.4.38 and can also be
> cherry-picked cleanly on top of 3.6.11.1 plus the 7 patches you already
> have:
> 
> d5e8cc6c946e sfc: Really disable flow control while flushing
> bfeed902946a sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
> 9724a8504c87 sfc: Add parentheses around use of bitfield macro arguments
> 0a6e5008a9df sfc: Fix MCDI structure field lookup
> 450783747f42 sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
> 525d9e824018 sfc: Work-around flush timeout when flushes have completed
> ef492f11efed sfc: Correctly initialise reset_method in siena_test_chip()
> ebf98e797b4e sfc: Fix timekeeping in efx_mcdi_poll()
> 
> Please let me know whether you're prepared to include these in the
> current update.  I can then run some automated tests with your selected
> set of patches applied.

Thanks a lot! I'll start apply them tonight.

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* RE: [ 099/171 ] mwifiex: fix race when queuing commands
  2013-04-11 20:26 ` [ 099/171 ] mwifiex: fix race when queuing commands Steven Rostedt
@ 2013-04-11 21:29   ` Bing Zhao
  2013-04-11 22:08     ` Steven Rostedt
  0 siblings, 1 reply; 189+ messages in thread
From: Bing Zhao @ 2013-04-11 21:29 UTC (permalink / raw)
  To: Steven Rostedt, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
  Cc: Daniel Drake, Marco Cesarano, Amitkumar Karwar, John W. Linville

Hi Steven,

> 3.6.11.2 stable review patch.
> If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> [ Upstream commit 00d7ea11ff0783e24fe70778f3141270b561aaa1 ]
> 
> Running the following script repeatedly on XO-4 with SD8787
> produces command timeout and system lockup.

The patch 099/171 and 100/171 (mwifiex: skip pending commands after function shutdown) are intended for 3.8 to solve a race issue found on XO-4 platform.

For 3.7 and lower kernel versions, these patches are not verified.
I'd suggest do not merge them to 3.6.11.x to avoid potential side effects.

Later, if we get a user report of the same problem on 3.6, we can verify these patches on his/her platform and add these patches back.

Thanks,
Bing


^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 099/171 ] mwifiex: fix race when queuing commands
  2013-04-11 21:29   ` Bing Zhao
@ 2013-04-11 22:08     ` Steven Rostedt
  0 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-11 22:08 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Daniel Drake, Marco Cesarano, Amitkumar Karwar, John W. Linville

On Thu, 2013-04-11 at 14:29 -0700, Bing Zhao wrote:
> Hi Steven,
> 
> > 3.6.11.2 stable review patch.
> > If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Amitkumar Karwar <akarwar@marvell.com>
> > 
> > [ Upstream commit 00d7ea11ff0783e24fe70778f3141270b561aaa1 ]
> > 
> > Running the following script repeatedly on XO-4 with SD8787
> > produces command timeout and system lockup.
> 
> The patch 099/171 and 100/171 (mwifiex: skip pending commands after function shutdown) are intended for 3.8 to solve a race issue found on XO-4 platform.
> 
> For 3.7 and lower kernel versions, these patches are not verified.
> I'd suggest do not merge them to 3.6.11.x to avoid potential side effects.
> 
> Later, if we get a user report of the same problem on 3.6, we can verify these patches on his/her platform and add these patches back.
> 

OK, thanks for the update. I'll remove them from my queue.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written
  2013-04-11 21:15   ` Ben Hutchings
  2013-04-11 21:22     ` Steven Rostedt
@ 2013-04-12 22:05     ` Ben Hutchings
  2013-04-13  1:12       ` Steven Rostedt
  1 sibling, 1 reply; 189+ messages in thread
From: Ben Hutchings @ 2013-04-12 22:05 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, stable

On Thu, 2013-04-11 at 22:15 +0100, Ben Hutchings wrote:
> Aside from #21-26 in this series, and the deadlock fix required on top
> of #24, there are several more fixes for sfc that I think are suitable
> for 3.6.11.y.
> 
> These commits were cherry-picked for 3.4.38 and can also be
> cherry-picked cleanly on top of 3.6.11.1 plus the 7 patches you already
> have:
> 
> d5e8cc6c946e sfc: Really disable flow control while flushing
> bfeed902946a sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
> 9724a8504c87 sfc: Add parentheses around use of bitfield macro arguments
> 0a6e5008a9df sfc: Fix MCDI structure field lookup
> 450783747f42 sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
> 525d9e824018 sfc: Work-around flush timeout when flushes have completed
> ef492f11efed sfc: Correctly initialise reset_method in siena_test_chip()
> ebf98e797b4e sfc: Fix timekeeping in efx_mcdi_poll()
> 
> Please let me know whether you're prepared to include these in the
> current update.  I can then run some automated tests with your selected
> set of patches applied.

The test suite found a regression which I'd forgotten about.  It
was introduced in 3.6 by commit b7f514af7d6f 'sfc: Fix interface
statistics running backward' and fixed in 3.8 by commit 876be083b669
'sfc: Reset driver's MAC stats after MC reboot seen'.

That latter fix is, again, a clean cherry-pick onto 3.6.y.  I don't
think I'm going to be able to re-test with this but it's sufficiently
low-risk that I'd be happy for you to add it anyway.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written
  2013-04-12 22:05     ` Ben Hutchings
@ 2013-04-13  1:12       ` Steven Rostedt
  0 siblings, 0 replies; 189+ messages in thread
From: Steven Rostedt @ 2013-04-13  1:12 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable

On Fri, 2013-04-12 at 23:05 +0100, Ben Hutchings wrote:
> On Thu, 2013-04-11 at 22:15 +0100, Ben Hutchings wrote:
> > Aside from #21-26 in this series, and the deadlock fix required on top
> > of #24, there are several more fixes for sfc that I think are suitable
> > for 3.6.11.y.
> > 
> > These commits were cherry-picked for 3.4.38 and can also be
> > cherry-picked cleanly on top of 3.6.11.1 plus the 7 patches you already
> > have:
> > 
> > d5e8cc6c946e sfc: Really disable flow control while flushing
> > bfeed902946a sfc: Convert firmware subtypes to native byte order in efx_mcdi_get_board_cfg()
> > 9724a8504c87 sfc: Add parentheses around use of bitfield macro arguments
> > 0a6e5008a9df sfc: Fix MCDI structure field lookup
> > 450783747f42 sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
> > 525d9e824018 sfc: Work-around flush timeout when flushes have completed
> > ef492f11efed sfc: Correctly initialise reset_method in siena_test_chip()
> > ebf98e797b4e sfc: Fix timekeeping in efx_mcdi_poll()
> > 
> > Please let me know whether you're prepared to include these in the
> > current update.  I can then run some automated tests with your selected
> > set of patches applied.
> 
> The test suite found a regression which I'd forgotten about.  It
> was introduced in 3.6 by commit b7f514af7d6f 'sfc: Fix interface
> statistics running backward' and fixed in 3.8 by commit 876be083b669
> 'sfc: Reset driver's MAC stats after MC reboot seen'.
> 
> That latter fix is, again, a clean cherry-pick onto 3.6.y.  I don't
> think I'm going to be able to re-test with this but it's sufficiently
> low-risk that I'd be happy for you to add it anyway.

Thanks!

I included it, and will run some simple tests. If everything works, I'll
just keep it without another spamming of the mailing lists.

I wont post till after my 3.6.11.2-rt tests passes.

-- Steve



^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 163/171 ] ipv6: fix bad free of addrconf_init_net
  2013-04-11 20:27 ` [ 163/171 ] ipv6: fix bad free of addrconf_init_net Steven Rostedt
@ 2013-09-24  6:36   ` zhuyj
  0 siblings, 0 replies; 189+ messages in thread
From: zhuyj @ 2013-09-24  6:36 UTC (permalink / raw)
  To: Hong Zhiguo; +Cc: Steven Rostedt, linux-kernel, stable, David S. Miller

On 04/12/2013 04:27 AM, Steven Rostedt wrote:
On linux with stable kernel v3.4.39, when this patch (ipv6: fix bad free 
of addrconf_init_net) is applied. Then I run the following commands:

1. the default value of ipv6 forwarding is 0

2. we change it to 1 firstly via:
# vi /etc/sysctl.conf
Uncomment: net.ipv6.conf.all.forwarding=1
#sysctl �p
Then we can verify via
#sysctl �a | grep forwarding

3, then we create a new namespace via:
# ip netns add fib_100
# ip netns exec fib_100 sysctl -a | grep forwarding

We�ll see in this new name space, the value of ipv6 forwarding will be 
set to �1� in v3.4.38, but in v3.4.39, the value is still be �0�

without this patch (ipv6: fix bad free of addrconf_init_net), the value 
of ipv6 forwarding will be set to �1�.

Would you like to tell me which one (v4.3.39 and v4.3.38) is correct?

Best Regards!
Zhu Yanjun


^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 109/171 ] userns: Dont allow creation if the user is chrooted
  2013-04-11 20:26 ` [ 109/171 ] userns: Dont allow creation if the user is chrooted Steven Rostedt
@ 2013-10-22 11:15   ` Luis Henriques
  2013-10-22 17:45     ` Eric W. Biederman
  0 siblings, 1 reply; 189+ messages in thread
From: Luis Henriques @ 2013-10-22 11:15 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, stable, Serge Hallyn, Andy Lutomirski,
	Eric W. Biederman

On Thu, Apr 11, 2013 at 04:26:52PM -0400, Steven Rostedt wrote:
> 3.6.11.2 stable review patch.
> If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: "Eric W. Biederman" <ebiederm@xmission.com>
> 
> [ Upstream commit 3151527ee007b73a0ebd296010f1c0454a919c7d ]

While looking at some security bugs, I came across this one
(CVE-2013-1956).  All the references I could find refer to the 3.8
kernel only, and this was the only backport I could find to older
stable kernels.

Could someone clarify if this fix should be included in other stable
kernels?  Or the only affected kernels were the 3.8.0 to 3.8.5?

Cheers,
--
Luis

> 
> Guarantee that the policy of which files may be access that is
> established by setting the root directory will not be violated by
> user namespaces by verifying that the root directory points to the
> root of the mount namespace at the time of user namespace creation.
> 
> Changing the root is a privileged operation, and as a matter of policy
> it serves to limit unprivileged processes to files below the current
> root directory.
> 
> For reasons of simplicity and comprehensibility the privilege to
> change the root directory is gated solely on the CAP_SYS_CHROOT
> capability in the user namespace.  Therefore when creating a user
> namespace we must ensure that the policy of which files may be access
> can not be violated by changing the root directory.
> 
> Anyone who runs a processes in a chroot and would like to use user
> namespace can setup the same view of filesystems with a mount
> namespace instead.  With this result that this is not a practical
> limitation for using user namespaces.
> 
> Cc: stable@vger.kernel.org
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> Reported-by: Andy Lutomirski <luto@amacapital.net>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  fs/namespace.c            |   25 +++++++++++++++++++++++++
>  include/linux/fs_struct.h |    2 ++
>  kernel/user_namespace.c   |    9 +++++++++
>  3 files changed, 36 insertions(+)
> 
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 7bdf790..c48b0d3 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -2681,3 +2681,28 @@ bool our_mnt(struct vfsmount *mnt)
>  {
>  	return check_mnt(real_mount(mnt));
>  }
> +
> +bool current_chrooted(void)
> +{
> +	/* Does the current process have a non-standard root */
> +	struct path ns_root;
> +	struct path fs_root;
> +	bool chrooted;
> +
> +	/* Find the namespace root */
> +	ns_root.mnt = &current->nsproxy->mnt_ns->root->mnt;
> +	ns_root.dentry = ns_root.mnt->mnt_root;
> +	path_get(&ns_root);
> +	while (d_mountpoint(ns_root.dentry) && follow_down_one(&ns_root))
> +		;
> +
> +	get_fs_root(current->fs, &fs_root);
> +
> +	chrooted = !path_equal(&fs_root, &ns_root);
> +
> +	path_put(&fs_root);
> +	path_put(&ns_root);
> +
> +	return chrooted;
> +}
> +
> diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
> index 003dc0f..961cdaa 100644
> --- a/include/linux/fs_struct.h
> +++ b/include/linux/fs_struct.h
> @@ -51,4 +51,6 @@ static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
>  	spin_unlock(&fs->lock);
>  }
>  
> +extern bool current_chrooted(void);
> +
>  #endif /* _LINUX_FS_STRUCT_H */
> diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
> index 8660231..a74dc5b 100644
> --- a/kernel/user_namespace.c
> +++ b/kernel/user_namespace.c
> @@ -39,6 +39,15 @@ int create_user_ns(struct cred *new)
>  	kuid_t owner = new->euid;
>  	kgid_t group = new->egid;
>  
> +	/*
> +	 * Verify that we can not violate the policy of which files
> +	 * may be accessed that is specified by the root directory,
> +	 * by verifing that the root directory is at the root of the
> +	 * mount namespace which allows all files to be accessed.
> +	 */
> +	if (current_chrooted())
> +		return -EPERM;
> +
>  	/* The creator needs a mapping in the parent user namespace
>  	 * or else we won't be able to reasonably tell userspace who
>  	 * created a user_namespace.
> -- 
> 1.7.10.4
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 109/171 ] userns: Dont allow creation if the user is chrooted
  2013-10-22 11:15   ` Luis Henriques
@ 2013-10-22 17:45     ` Eric W. Biederman
  2013-10-23  9:32       ` Luis Henriques
  0 siblings, 1 reply; 189+ messages in thread
From: Eric W. Biederman @ 2013-10-22 17:45 UTC (permalink / raw)
  To: Luis Henriques
  Cc: Steven Rostedt, linux-kernel, stable, Serge Hallyn,
	Andy Lutomirski

Luis Henriques <luis.henriques@canonical.com> writes:

> On Thu, Apr 11, 2013 at 04:26:52PM -0400, Steven Rostedt wrote:
>> 3.6.11.2 stable review patch.
>> If anyone has any objections, please let me know.
>> 
>> ------------------
>> 
>> From: "Eric W. Biederman" <ebiederm@xmission.com>
>> 
>> [ Upstream commit 3151527ee007b73a0ebd296010f1c0454a919c7d ]
>
> While looking at some security bugs, I came across this one
> (CVE-2013-1956).  All the references I could find refer to the 3.8
> kernel only, and this was the only backport I could find to older
> stable kernels.
>
> Could someone clarify if this fix should be included in other stable
> kernels?  Or the only affected kernels were the 3.8.0 to 3.8.5?

Strictly speaking there are older kernels affected.  I think it was 3.5
that had my earliest user namespace bits, and this bug came in with the
first of those bits.  However prior to 3.8 simply not enough things were
converted for most people to build a kernel with user namespaces
enabled.  I don't think distro's will have user namespaces enabled prior
to 3.12 as that is when xfs the last hold out was finally converted.

Eric

^ permalink raw reply	[flat|nested] 189+ messages in thread

* Re: [ 109/171 ] userns: Dont allow creation if the user is chrooted
  2013-10-22 17:45     ` Eric W. Biederman
@ 2013-10-23  9:32       ` Luis Henriques
  0 siblings, 0 replies; 189+ messages in thread
From: Luis Henriques @ 2013-10-23  9:32 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Steven Rostedt, linux-kernel, stable, Serge Hallyn,
	Andy Lutomirski

On Tue, Oct 22, 2013 at 10:45:45AM -0700, Eric W. Biederman wrote:
> Luis Henriques <luis.henriques@canonical.com> writes:
> 
> > On Thu, Apr 11, 2013 at 04:26:52PM -0400, Steven Rostedt wrote:
> >> 3.6.11.2 stable review patch.
> >> If anyone has any objections, please let me know.
> >> 
> >> ------------------
> >> 
> >> From: "Eric W. Biederman" <ebiederm@xmission.com>
> >> 
> >> [ Upstream commit 3151527ee007b73a0ebd296010f1c0454a919c7d ]
> >
> > While looking at some security bugs, I came across this one
> > (CVE-2013-1956).  All the references I could find refer to the 3.8
> > kernel only, and this was the only backport I could find to older
> > stable kernels.
> >
> > Could someone clarify if this fix should be included in other stable
> > kernels?  Or the only affected kernels were the 3.8.0 to 3.8.5?
> 
> Strictly speaking there are older kernels affected.  I think it was 3.5
> that had my earliest user namespace bits, and this bug came in with the
> first of those bits.  However prior to 3.8 simply not enough things were
> converted for most people to build a kernel with user namespaces
> enabled.  I don't think distro's will have user namespaces enabled prior
> to 3.12 as that is when xfs the last hold out was finally converted.
> 
> Eric

That makes perfect sense to me.  Thanks a lot for the clarification,
Eric.

Cheers,
--
Luis

^ permalink raw reply	[flat|nested] 189+ messages in thread

end of thread, other threads:[~2013-10-23  9:32 UTC | newest]

Thread overview: 189+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 20:25 [ 000/171 ] 3.6.11.2-stable review Steven Rostedt
2013-04-11 20:25 ` [ 001/171 ] IP_GRE: Revert "IP_GRE: Fix kernel panic in IP_GRE with GRE csum" Steven Rostedt
2013-04-11 20:25 ` [ 002/171 ] ppp: Revert backport of "ppp: set qdisc_tx_busylock to avoid LOCKDEP splat" Steven Rostedt
2013-04-11 20:25 ` [ 003/171 ] net: qdisc busylock needs lockdep annotations Steven Rostedt
2013-04-11 20:25 ` [ 004/171 ] sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option Steven Rostedt
2013-04-11 20:25 ` [ 005/171 ] net/ipv4: Ensure that location of timestamp option is stored Steven Rostedt
2013-04-11 20:25 ` [ 006/171 ] netconsole: dont call __netpoll_cleanup() while atomic Steven Rostedt
2013-04-11 20:25 ` [ 007/171 ] batman-adv: verify tt len does not exceed packet len Steven Rostedt
2013-04-11 20:25 ` [ 008/171 ] bonding: dont call update_speed_duplex() under spinlocks Steven Rostedt
2013-04-11 20:25 ` [ 009/171 ] tg3: 5715 does not link up when autoneg off Steven Rostedt
2013-04-11 20:25 ` [ 010/171 ] sctp: Use correct sideffect command in duplicate cookie handling Steven Rostedt
2013-04-11 20:25 ` [ 011/171 ] sctp: dont break the loop while meeting the active_path so as to find the matched transport Steven Rostedt
2013-04-11 20:25 ` [ 012/171 ] ipv4: fix definition of FIB_TABLE_HASHSZ Steven Rostedt
2013-04-11 20:25 ` [ 013/171 ] tcp: fix skb_availroom() Steven Rostedt
2013-04-11 20:25 ` [ 014/171 ] skb: Propagate pfmemalloc on skb from head page only Steven Rostedt
2013-04-11 20:25 ` [ 015/171 ] rtnetlink: Mask the rta_type when range checking Steven Rostedt
2013-04-11 20:25 ` [ 016/171 ] bnx2x: add missing napi deletion in error path Steven Rostedt
2013-04-11 20:25 ` [ 017/171 ] vhost/net: fix heads usage of ubuf_info Steven Rostedt
2013-04-11 20:25 ` [ 018/171 ] bnx2x: fix occasional statistics off-by-4GB error Steven Rostedt
2013-04-11 20:25 ` [ 019/171 ] tcp: dont handle MTU reduction on LISTEN socket Steven Rostedt
2013-04-11 20:25 ` [ 020/171 ] inet: limit length of fragment queue hash table bucket lists Steven Rostedt
2013-04-11 20:25 ` [ 021/171 ] sfc: Properly sync RX DMA buffer when it is not the last in the page Steven Rostedt
2013-04-11 20:25 ` [ 022/171 ] sfc: Fix efx_rx_buf_offset() in the presence of swiotlb Steven Rostedt
2013-04-11 20:25 ` [ 023/171 ] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Steven Rostedt
2013-04-11 20:25 ` [ 024/171 ] sfc: lock TX queues when calling netif_device_detach() Steven Rostedt
2013-04-11 20:42   ` Ben Hutchings
2013-04-11 20:54     ` Steven Rostedt
2013-04-11 20:57       ` Steven Rostedt
2013-04-11 20:25 ` [ 025/171 ] sfc: Detach net device when stopping queues for reconfiguration Steven Rostedt
2013-04-11 20:25 ` [ 026/171 ] sfc: Only use TX push if a single descriptor is to be written Steven Rostedt
2013-04-11 21:15   ` Ben Hutchings
2013-04-11 21:22     ` Steven Rostedt
2013-04-12 22:05     ` Ben Hutchings
2013-04-13  1:12       ` Steven Rostedt
2013-04-11 20:25 ` [ 027/171 ] ALSA: hda/cirrus - Fix the digital beep registration Steven Rostedt
2013-04-11 20:25 ` [ 028/171 ] ALSA: hda - Fix typo in checking IEC958 emphasis bit Steven Rostedt
2013-04-11 20:25 ` [ 029/171 ] ALSA: snd-usb: mixer: propagate errors up the call chain Steven Rostedt
2013-04-11 20:25 ` [ 030/171 ] ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() Steven Rostedt
2013-04-11 20:25 ` [ 031/171 ] saner proc_get_inode() calling conventions Steven Rostedt
2013-04-11 20:25 ` [ 032/171 ] vfs,proc: guarantee unique inodes in /proc Steven Rostedt
2013-04-11 20:25 ` [ 033/171 ] Revert "drm/i915: try to train DP even harder" Steven Rostedt
2013-04-11 20:25 ` [ 034/171 ] drm/i915: restrict kernel address leak in debugfs Steven Rostedt
2013-04-11 20:25 ` [ 035/171 ] tracing: Fix race in snapshot swapping Steven Rostedt
2013-04-11 20:25 ` [ 036/171 ] tracing: Fix free of probe entry by calling call_rcu_sched() Steven Rostedt
2013-04-11 20:25 ` [ 037/171 ] tracing: Protect tracer flags with trace_types_lock Steven Rostedt
2013-04-11 20:25 ` [ 038/171 ] tracing: Keep overwrite in sync between regular and snapshot buffers Steven Rostedt
2013-04-11 20:25 ` [ 039/171 ] rtlwifi: rtl8192cu: Fix schedule while atomic bug splat Steven Rostedt
2013-04-11 20:25 ` [ 040/171 ] rtlwifi: rtl8192cu: Fix problem that prevents reassociation Steven Rostedt
2013-04-11 20:25 ` [ 041/171 ] mwifiex: fix potential out-of-boundary access to ibss rate table Steven Rostedt
2013-04-11 20:25 ` [ 042/171 ] drm/i915: bounds check execbuffer relocation count Steven Rostedt
2013-04-11 20:25 ` [ 043/171 ] KMS: fix EDID detailed timing vsync parsing Steven Rostedt
2013-04-11 20:25 ` [ 044/171 ] KMS: fix EDID detailed timing frame rate Steven Rostedt
2013-04-11 20:25 ` [ 045/171 ] mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting Steven Rostedt
2013-04-11 20:25 ` [ 046/171 ] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only Steven Rostedt
2013-04-11 20:25 ` [ 047/171 ] target/iscsi: Fix mutual CHAP auth on big-endian arches Steven Rostedt
2013-04-11 20:25 ` [ 048/171 ] target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os Steven Rostedt
2013-04-11 20:25 ` [ 049/171 ] dm verity: avoid deadlock Steven Rostedt
2013-04-11 20:25 ` [ 050/171 ] drm/mgag200: Bug fix: Modified pll algorithm for EH project Steven Rostedt
2013-04-11 20:25 ` [ 051/171 ] drm/radeon: add Richland pci ids Steven Rostedt
2013-04-11 20:25 ` [ 052/171 ] drm/radeon: add support for Richland APUs Steven Rostedt
2013-04-11 20:25 ` [ 053/171 ] drm/radeon/benchmark: make sure bo blit copy exists before using it Steven Rostedt
2013-04-11 20:25 ` [ 054/171 ] cifs: ignore everything in SPNEGO blob after mechTypes Steven Rostedt
2013-04-11 20:25 ` [ 055/171 ] jbd2: fix use after free in jbd2_journal_dirty_metadata() Steven Rostedt
2013-04-11 20:25 ` [ 056/171 ] ext4: fix the wrong number of the allocated blocks in ext4_split_extent() Steven Rostedt
2013-04-11 20:26 ` [ 057/171 ] usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player Steven Rostedt
2013-04-11 20:26 ` [ 058/171 ] ext4: use atomic64_t for the per-flexbg free_clusters count Steven Rostedt
2013-04-11 20:26 ` [ 059/171 ] ext4: fix data=journal fast mount/umount hang Steven Rostedt
2013-04-11 20:26 ` [ 060/171 ] IPoIB: Fix send lockup due to missed TX completion Steven Rostedt
2013-04-11 20:26 ` [ 061/171 ] clockevents: Dont allow dummy broadcast timers Steven Rostedt
2013-04-11 20:26 ` [ 062/171 ] x86-64: Fix the failure case in copy_user_handle_tail() Steven Rostedt
2013-04-11 20:26 ` [ 063/171 ] USB: xhci - fix bit definitions for IMAN register Steven Rostedt
2013-04-11 20:26 ` [ 064/171 ] USB: xhci: correctly enable interrupts Steven Rostedt
2013-04-11 20:26 ` [ 065/171 ] USB: cdc-acm: fix device unregistration Steven Rostedt
2013-04-11 20:26 ` [ 066/171 ] USB: EHCI: fix regression in QH unlinking Steven Rostedt
2013-04-11 20:26 ` [ 067/171 ] usb: gadget: ffs: fix enable multiple instances Steven Rostedt
2013-04-11 20:26 ` [ 068/171 ] USB: serial: fix interface refcounting Steven Rostedt
2013-04-11 20:26 ` [ 069/171 ] ACPI: Rework acpi_get_child() to be more efficient Steven Rostedt
2013-04-11 20:26 ` [ 070/171 ] udf: Fix bitmap overflow on large filesystems with small block size Steven Rostedt
2013-04-11 20:26 ` [ 071/171 ] USB: garmin_gps: fix memory leak on disconnect Steven Rostedt
2013-04-11 20:26 ` [ 072/171 ] USB: io_ti: fix get_icount for two port adapters Steven Rostedt
2013-04-11 20:26 ` [ 073/171 ] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation Steven Rostedt
2013-04-11 20:26 ` [ 074/171 ] SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked Steven Rostedt
2013-04-11 20:26 ` [ 075/171 ] tile: expect new initramfs name from hypervisor file system Steven Rostedt
2013-04-11 20:26 ` [ 076/171 ] Bluetooth: Add support for Dell[QCA 0cf3:0036] Steven Rostedt
2013-04-11 20:26 ` [ 077/171 ] Bluetooth: Add support for Dell[QCA 0cf3:817a] Steven Rostedt
2013-04-11 20:26 ` [ 078/171 ] staging: comedi: s626: fix continuous acquisition Steven Rostedt
2013-04-11 20:26 ` [ 079/171 ] sysfs: fix race between readdir and lseek Steven Rostedt
2013-04-11 20:26 ` [ 080/171 ] sysfs: handle failure path correctly for readdir() Steven Rostedt
2013-04-11 20:26 ` [ 081/171 ] can: sja1000: fix define conflict on SH Steven Rostedt
2013-04-11 20:26 ` [ 082/171 ] ath9k: limit tx path hang check to normal data queues Steven Rostedt
2013-04-11 20:26 ` [ 083/171 ] ath9k: avoid queueing hw check work when suspended Steven Rostedt
2013-04-11 20:26 ` [ 084/171 ] HID: usbhid: quirk for Realtek Multi-card reader Steven Rostedt
2013-04-11 20:26 ` [ 085/171 ] HID: usbhid: quirk for MSI GX680R led panel Steven Rostedt
2013-04-11 20:26 ` [ 086/171 ] HID: usbhid: fix build problem Steven Rostedt
2013-04-11 20:26 ` [ 087/171 ] rtlwifi: usb: add missing freeing of skbuff Steven Rostedt
2013-04-11 20:26 ` [ 088/171 ] b43: N-PHY: increase initial value of "mind" in RSSI calibration Steven Rostedt
2013-04-11 20:26 ` [ 089/171 ] b43: A fix for DMA transmission sequence errors Steven Rostedt
2013-04-11 20:26 ` [ 090/171 ] b43: N-PHY: use more bits for offset in RSSI calibration Steven Rostedt
2013-04-11 20:26 ` [ 091/171 ] tg3: fix length overflow in VPD firmware parsing Steven Rostedt
2013-04-11 20:26 ` [ 092/171 ] mac80211: always synchronize_net() during station removal Steven Rostedt
2013-04-11 20:26 ` [ 093/171 ] iommu/amd: Make sure dma_ops are set for hotplug devices Steven Rostedt
2013-04-11 20:26 ` [ 094/171 ] xen/blkback: correctly respond to unknown, non-native requests Steven Rostedt
2013-04-11 20:26 ` [ 095/171 ] xen-blkback: fix dispatch_rw_block_io() error path Steven Rostedt
2013-04-11 20:26 ` [ 096/171 ] tty: atmel_serial_probe(): index of atmel_ports[] fix Steven Rostedt
2013-04-11 20:26 ` [ 097/171 ] usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD Steven Rostedt
2013-04-11 20:26 ` [ 098/171 ] vt: synchronize_rcu() under spinlock is not nice Steven Rostedt
2013-04-11 20:26 ` [ 099/171 ] mwifiex: fix race when queuing commands Steven Rostedt
2013-04-11 21:29   ` Bing Zhao
2013-04-11 22:08     ` Steven Rostedt
2013-04-11 20:26 ` [ 100/171 ] mwifiex: skip pending commands after function shutdown Steven Rostedt
2013-04-11 20:26 ` [ 101/171 ] pnfs-block: removing DM device maybe cause oops when call dev_remove Steven Rostedt
2013-04-11 20:26 ` [ 102/171 ] NFSv4: Fix the string length returned by the idmapper Steven Rostedt
2013-04-11 20:26 ` [ 103/171 ] NFSv4.1: Fix a race in pNFS layoutcommit Steven Rostedt
2013-04-11 20:26 ` [ 104/171 ] NFSv4.1: Always clear the NFS_INO_LAYOUTCOMMIT in layoutreturn Steven Rostedt
2013-04-11 20:26 ` [ 105/171 ] net/irda: add missing error path release_sock call Steven Rostedt
2013-04-11 20:26 ` [ 106/171 ] Nest rename_lock inside vfsmount_lock Steven Rostedt
2013-04-11 20:26 ` [ 107/171 ] USB: EHCI: fix bug in iTD/siTD DMA pool allocation Steven Rostedt
2013-04-11 20:26 ` [ 108/171 ] usb: xhci: Fix TRB transfer length macro used for Event TRB Steven Rostedt
2013-04-11 20:26 ` [ 109/171 ] userns: Dont allow creation if the user is chrooted Steven Rostedt
2013-10-22 11:15   ` Luis Henriques
2013-10-22 17:45     ` Eric W. Biederman
2013-10-23  9:32       ` Luis Henriques
2013-04-11 20:26 ` [ 110/171 ] vfs: Add a mount flag to lock read only bind mounts Steven Rostedt
2013-04-11 20:57   ` Eric W. Biederman
2013-04-11 21:02     ` Steven Rostedt
2013-04-11 20:26 ` [ 111/171 ] ipc: Restrict mounting the mqueue filesystem Steven Rostedt
2013-04-11 20:55   ` Eric W. Biederman
2013-04-11 20:59     ` Steven Rostedt
2013-04-11 20:26 ` [ 112/171 ] Btrfs: use set_nlink if our i_nlink is 0 Steven Rostedt
2013-04-11 20:26 ` [ 113/171 ] Btrfs: fix race between mmap writes and compression Steven Rostedt
2013-04-11 20:26 ` [ 114/171 ] Btrfs: limit the global reserve to 512mb Steven Rostedt
2013-04-11 20:26 ` [ 115/171 ] Btrfs: dont drop path when printing out tree errors in scrub Steven Rostedt
2013-04-11 20:26 ` [ 116/171 ] USB: serial: add modem-status-change wait queue Steven Rostedt
2013-04-11 20:27 ` [ 117/171 ] USB: serial: fix hang when opening port Steven Rostedt
2013-04-11 20:27 ` [ 118/171 ] USB: quatech2: fix use-after-free in TIOCMIWAIT Steven Rostedt
2013-04-11 20:27 ` [ 119/171 ] USB: mos7840: fix broken TIOCMIWAIT Steven Rostedt
2013-04-11 20:27 ` [ 120/171 ] USB: io_ti: fix use-after-free in TIOCMIWAIT Steven Rostedt
2013-04-11 20:27 ` [ 121/171 ] USB: oti6858: " Steven Rostedt
2013-04-11 20:27 ` [ 122/171 ] USB: ftdi_sio: " Steven Rostedt
2013-04-11 20:27 ` [ 123/171 ] USB: pl2303: " Steven Rostedt
2013-04-11 20:27 ` [ 124/171 ] USB: mos7840: " Steven Rostedt
2013-04-11 20:27 ` [ 125/171 ] USB: spcp8x5: " Steven Rostedt
2013-04-11 20:27 ` [ 126/171 ] USB: ssu100: " Steven Rostedt
2013-04-11 20:27 ` [ 127/171 ] USB: ch341: " Steven Rostedt
2013-04-11 20:27 ` [ 128/171 ] USB: io_edgeport: " Steven Rostedt
2013-04-11 20:27 ` [ 129/171 ] USB: f81232: " Steven Rostedt
2013-04-11 20:27 ` [ 130/171 ] USB: ark3116: " Steven Rostedt
2013-04-11 20:27 ` [ 131/171 ] USB: mct_u232: " Steven Rostedt
2013-04-11 20:27 ` [ 132/171 ] USB: cypress_m8: " Steven Rostedt
2013-04-11 20:27 ` [ 133/171 ] USB: ti_usb_3410_5052: " Steven Rostedt
2013-04-11 20:27 ` [ 134/171 ] usb: gadget: udc-core: fix a regression during gadget driver unbinding Steven Rostedt
2013-04-11 20:27 ` [ 135/171 ] loop: prevent bdev freeing while device in use Steven Rostedt
2013-04-11 20:27 ` [ 136/171 ] ARM: cns3xxx: fix mapping of private memory region Steven Rostedt
2013-04-11 20:27 ` [ 137/171 ] ARM: kirkwood: Fix chip-delay for GoFlex Net Steven Rostedt
2013-04-11 20:27 ` [ 138/171 ] virtio: console: rename cvq_lock to c_ivq_lock Steven Rostedt
2013-04-11 20:27 ` [ 139/171 ] virtio: console: add locking around c_ovq operations Steven Rostedt
2013-04-11 20:27 ` [ 140/171 ] nfsd4: reject "negative" acl lengths Steven Rostedt
2013-04-11 20:27 ` [ 141/171 ] drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n() Steven Rostedt
2013-04-11 20:27 ` [ 142/171 ] drm/i915: Dont clobber crtc->fb when queue_flip fails Steven Rostedt
2013-04-11 20:27 ` [ 143/171 ] iwlwifi: dvm: dont send HCMD in restart flow Steven Rostedt
2013-04-11 20:27 ` [ 144/171 ] Btrfs: fix space leak when we fail to reserve metadata space Steven Rostedt
2013-04-11 20:27 ` [ 145/171 ] tracing: Prevent buffer overwrite disabled for latency tracers Steven Rostedt
2013-04-11 20:27 ` [ 146/171 ] net: remove a WARN_ON() in net_enable_timestamp() Steven Rostedt
2013-04-11 20:27 ` [ 147/171 ] sky2: Receive Overflows not counted Steven Rostedt
2013-04-11 20:27 ` [ 148/171 ] sky2: Threshold for Pause Packet is set wrong Steven Rostedt
2013-04-11 20:27 ` [ 149/171 ] tcp: preserve ACK clocking in TSO Steven Rostedt
2013-04-11 20:27 ` [ 150/171 ] tcp: undo spurious timeout after SACK reneging Steven Rostedt
2013-04-11 20:27 ` [ 151/171 ] 8021q: fix a potential use-after-free Steven Rostedt
2013-04-11 20:27 ` [ 152/171 ] thermal: shorten too long mcast group name Steven Rostedt
2013-04-11 20:27 ` [ 153/171 ] genetlink: trigger BUG_ON if a group name is too long Steven Rostedt
2013-04-11 20:27 ` [ 154/171 ] unix: fix a race condition in unix_release() Steven Rostedt
2013-04-11 20:27 ` [ 155/171 ] bonding: remove already created master sysfs link on failure Steven Rostedt
2013-04-11 20:27 ` [ 156/171 ] bonding: fix miimon and arp_interval delayed work race conditions Steven Rostedt
2013-04-11 20:27 ` [ 157/171 ] bonding: fix disabling of arp_interval and miimon Steven Rostedt
2013-04-11 20:27 ` [ 158/171 ] drivers: net: ethernet: davinci_emac: use netif_wake_queue() while restarting tx queue Steven Rostedt
2013-04-11 20:27 ` [ 159/171 ] drivers: net: ethernet: cpsw: " Steven Rostedt
2013-04-11 20:27 ` [ 160/171 ] aoe: reserve enough headroom on skbs Steven Rostedt
2013-04-11 20:27 ` [ 161/171 ] atl1e: drop pci-msi support because of packet corruption Steven Rostedt
2013-04-11 20:27 ` [ 162/171 ] DM9000B: driver initialization upgrade Steven Rostedt
2013-04-11 20:27 ` [ 163/171 ] ipv6: fix bad free of addrconf_init_net Steven Rostedt
2013-09-24  6:36   ` zhuyj
2013-04-11 20:27 ` [ 164/171 ] ipv6: dont accept multicast traffic with scope 0 Steven Rostedt
2013-04-11 20:27 ` [ 165/171 ] ipv6: dont accept node local multicast traffic from the wire Steven Rostedt
2013-04-11 20:27 ` [ 166/171 ] ks8851: Fix interpretation of rxlen field Steven Rostedt
2013-04-11 20:27 ` [ 167/171 ] net: add a synchronize_net() in netdev_rx_handler_unregister() Steven Rostedt
2013-04-11 20:27 ` [ 168/171 ] net: fq_codel: Fix off-by-one error Steven Rostedt
2013-04-11 20:27 ` [ 169/171 ] pch_gbe: fix ip_summed checksum reporting on rx Steven Rostedt
2013-04-11 20:27 ` [ 170/171 ] smsc75xx: fix jumbo frame support Steven Rostedt
2013-04-11 20:27 ` [ 171/171 ] bonding: get netdev_rx_handler_unregister out of locks Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).