stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review
@ 2013-10-11 10:40 Luis Henriques
  2013-10-11 10:40 ` [PATCH 001/100] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Luis Henriques
                   ` (97 more replies)
  0 siblings, 98 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Luis Henriques

This is the start of the review cycle for the Linux 3.5.7.23 stable kernel.

This version contains 100 new patches, summarized below.  The new patches are
posted as replies to this message and also available in this git branch:

http://kernel.ubuntu.com/git?p=ubuntu/linux.git;h=linux-3.5.y-review;a=shortlog

git://kernel.ubuntu.com/ubuntu/linux.git  linux-3.5.y-review

The review period for version 3.5.7.23 will be open for the next three days.
To report a problem, please reply to the relevant follow-up patch message.

For more information about the Linux 3.5.y.z extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Luis

--
 arch/powerpc/kernel/iommu.c                 |  2 +-
 arch/powerpc/kernel/sysfs.c                 | 18 +++++++-
 arch/powerpc/kernel/vio.c                   | 12 +++--
 arch/powerpc/lib/checksum_64.S              | 58 ++++++++++++++++-------
 arch/sparc/kernel/entry.S                   |  2 +-
 arch/sparc/kernel/ktlb.S                    |  3 +-
 arch/sparc/kernel/syscalls.S                |  8 ++--
 arch/sparc/kernel/trampoline_64.S           |  2 -
 arch/sparc/lib/ksyms.c                      |  9 ----
 arch/x86/kernel/reboot.c                    | 16 +++++++
 arch/x86/platform/efi/efi.c                 | 11 +++--
 block/cfq-iosched.c                         |  2 +-
 drivers/block/cciss.c                       |  1 +
 drivers/block/cpqarray.c                    |  1 +
 drivers/bluetooth/ath3k.c                   |  2 +
 drivers/bluetooth/btusb.c                   |  2 +
 drivers/dma/at_hdmac.c                      |  8 ++--
 drivers/dma/ep93xx_dma.c                    |  2 +-
 drivers/dma/fsldma.c                        |  2 +-
 drivers/dma/imx-dma.c                       | 35 +++++++-------
 drivers/dma/intel_mid_dma_regs.h            |  6 +--
 drivers/dma/pl330.c                         |  2 +-
 drivers/dma/ppc4xx/adma.c                   |  2 +-
 drivers/dma/ste_dma40_ll.h                  |  2 +-
 drivers/gpu/drm/ast/ast_drv.h               |  2 +-
 drivers/gpu/drm/i915/intel_dp.c             | 13 +++++-
 drivers/gpu/drm/radeon/atombios_encoders.c  |  8 +++-
 drivers/gpu/drm/radeon/radeon_connectors.c  | 34 ++++++++++++--
 drivers/gpu/drm/radeon/radeon_device.c      | 15 ++++--
 drivers/gpu/drm/ttm/ttm_tt.c                |  2 +-
 drivers/hid/hid-core.c                      | 72 +++++++++++++++++++++++++++--
 drivers/hid/hid-ids.h                       |  1 +
 drivers/hid/hid-input.c                     | 11 ++++-
 drivers/hid/hid-lg2ff.c                     | 19 ++------
 drivers/hid/hid-lg3ff.c                     | 29 +++---------
 drivers/hid/hid-lg4ff.c                     | 20 +-------
 drivers/hid/hid-lgff.c                      | 17 +------
 drivers/hid/hid-logitech-dj.c               | 10 +++-
 drivers/hid/hid-multitouch.c                | 26 ++++++-----
 drivers/hid/hid-speedlink.c                 | 11 +++--
 drivers/hid/hid-zpff.c                      | 18 ++------
 drivers/hid/usbhid/hid-quirks.c             |  2 +
 drivers/hwmon/applesmc.c                    | 11 ++++-
 drivers/infiniband/ulp/srpt/ib_srpt.c       | 14 +++---
 drivers/md/dm-snap-persistent.c             |  2 +-
 drivers/md/dm-snap.c                        |  5 +-
 drivers/net/bonding/bond_main.c             | 13 ++++--
 drivers/net/ethernet/broadcom/tg3.c         | 19 +++++++-
 drivers/net/ethernet/freescale/gianfar.c    | 11 ++++-
 drivers/net/ethernet/freescale/gianfar.h    | 11 ++++-
 drivers/net/ethernet/sfc/rx.c               |  3 +-
 drivers/net/ethernet/via/via-rhine.c        |  9 +++-
 drivers/net/ethernet/xilinx/ll_temac_main.c |  6 +++
 drivers/net/ppp/pptp.c                      |  2 +-
 drivers/net/usb/cdc_ether.c                 |  5 ++
 drivers/net/usb/dm9601.c                    |  2 +-
 drivers/net/wireless/mwifiex/11n_aggr.c     |  3 +-
 drivers/net/wireless/mwifiex/11n_aggr.h     |  2 +-
 drivers/net/wireless/mwifiex/main.c         |  5 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c    | 18 ++++----
 drivers/net/wireless/mwifiex/usb.c          |  7 ---
 drivers/net/wireless/mwifiex/wmm.c          |  3 +-
 drivers/net/wireless/p54/p54usb.c           |  1 +
 drivers/net/wireless/rtlwifi/wifi.h         |  2 +-
 drivers/scsi/esp_scsi.c                     | 14 +++---
 drivers/scsi/esp_scsi.h                     |  1 +
 drivers/staging/comedi/drivers/ni_65xx.c    | 26 +++++------
 drivers/staging/vt6656/main_usb.c           |  3 +-
 drivers/tty/hvc/hvc_xen.c                   |  1 +
 drivers/tty/serial/pch_uart.c               |  5 +-
 drivers/usb/core/devio.c                    | 16 +++++++
 drivers/usb/dwc3/dwc3-pci.c                 |  2 +
 drivers/usb/gadget/dummy_hcd.c              |  7 +--
 drivers/usb/gadget/f_fs.c                   | 60 +++++++++++-------------
 drivers/usb/host/ehci-pci.c                 |  2 +-
 drivers/usb/host/uhci-pci.c                 |  2 +-
 drivers/usb/host/xhci-hub.c                 |  2 +-
 drivers/usb/host/xhci-pci.c                 |  2 +-
 drivers/usb/host/xhci-ring.c                | 24 +++++++++-
 drivers/usb/host/xhci.c                     | 25 ++--------
 drivers/usb/host/xhci.h                     |  1 +
 drivers/usb/serial/option.c                 |  3 ++
 drivers/video/mxsfb.c                       |  1 +
 fs/ext4/namei.c                             |  3 +-
 fs/isofs/inode.c                            | 16 ++-----
 fs/notify/fanotify/fanotify.c               |  6 +++
 include/linux/hid.h                         |  5 ++
 include/linux/perf_event.h                  |  2 +-
 include/net/ip.h                            | 12 +++--
 include/net/ipip.h                          |  2 +-
 kernel/cgroup.c                             | 11 +++++
 kernel/events/core.c                        | 21 +++++----
 kernel/sched/fair.c                         | 14 ++++--
 kernel/workqueue.c                          |  9 ++++
 mm/oom_kill.c                               |  8 ++--
 net/bluetooth/hci_event.c                   |  6 ++-
 net/bridge/br_private.h                     |  1 +
 net/bridge/br_stp.c                         | 23 ++++++---
 net/bridge/br_stp_if.c                      | 12 ++++-
 net/caif/cfctrl.c                           |  3 +-
 net/core/flow_dissector.c                   |  4 +-
 net/core/netpoll.c                          |  9 ++--
 net/ipv4/igmp.c                             |  8 ++--
 net/ipv4/inetpeer.c                         |  4 +-
 net/ipv4/ip_output.c                        |  8 ++--
 net/ipv4/ipmr.c                             |  2 +-
 net/ipv4/raw.c                              |  2 +-
 net/ipv4/xfrm4_mode_tunnel.c                |  2 +-
 net/ipv6/ip6_output.c                       | 53 +++++++++------------
 net/ipv6/mcast.c                            |  4 +-
 net/netfilter/ipvs/ip_vs_xmit.c             |  2 +-
 net/sctp/ipv6.c                             | 42 ++++++-----------
 net/sctp/sm_sideeffect.c                    |  3 +-
 net/sctp/socket.c                           |  3 ++
 security/smack/smackfs.c                    |  2 +-
 sound/core/compress_offload.c               |  3 +-
 sound/soc/codecs/88pm860x-codec.c           |  3 ++
 sound/soc/codecs/max98095.c                 |  4 +-
 tools/perf/util/map.c                       |  1 +
 119 files changed, 715 insertions(+), 467 deletions(-)

Al Viro (1):
      USB: Fix breakage in ffs_fs_mount()

Alan Stern (2):
      usb: gadget: fix a bug and a WARN_ON in dummy-hcd
      USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd

Alex Deucher (3):
      drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2)
      drm/radeon: fix panel scaling with eDP and LVDS bridges
      drm/radeon: disable tests/benchmarks if accel is disabled

Amitkumar Karwar (1):
      mwifiex: fix hang issue for USB chipsets

Anatol Pomozov (1):
      cfq: explicitly use 64bit divide operation for 64bit arguments

Andi Kleen (1):
      perf tools: Handle JITed code in shared memory

Andre Guedes (2):
      Bluetooth: Fix security level for peripheral role
      Bluetooth: Fix encryption key size for peripheral role

Ansis Atteka (2):
      ip: use ip_hdr() in __ip_make_skb() to retrieve IP header
      ip: generate unique IP identificator if local fragmentation is allowed

Ben Hutchings (1):
      sfc: Fix efx_rx_buf_offset() for recycled pages

Ben Skeggs (1):
      drm/ttm: fix the tt_populated check in ttm_tt_destroy()

Benjamin Tissoires (3):
      HID: add usage_index in struct hid_usage.
      HID: validate feature and input report details
      HID: multitouch: validate indexes details

Bing Zhao (1):
      mwifiex: fix NULL pointer dereference in usb suspend handler

Chris Healy (1):
      resubmit bridge: fix message_age_timer calculation

Christian Lamparter (1):
      p54usb: add USB ID for Corega WLUSB2GTST USB adapter

Claudiu Manoil (1):
      gianfar: Change default HW Tx queue scheduling mode

Daisuke Nishimura (1):
      sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones

Dan Carpenter (4):
      cciss: fix info leak in cciss_ioctl32_passthru()
      cpqarray: fix info leak in ida_locked_ioctl()
      ASoC: max98095: a couple array underflows
      ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st()

Daniel Borkmann (2):
      net: sctp: fix smatch warning in sctp_send_asconf_del_ip
      net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit

Daniel Drake (1):
      mwifiex: fix memory corruption when unsetting multicast list

Dave Airlie (1):
      drm/ast: fix the ast open key function

Dave Jones (1):
      caif: Add missing braces to multiline if in cfctrl_linkup_request

David Rientjes (1):
      mm, memcg: give exiting processes access to memory reserves

David S. Miller (2):
      esp_scsi: Fix tag state corruption when autosensing.
      sparc64: Fix off by one in trampoline TLB mapping installation loop.

David Vrabel (1):
      xen/hvc: allow xenboot console to be used again

Eric Dumazet (1):
      net: flow_dissector: fix thoff for IPPROTO_AH

Fabio Porcedda (1):
      net: usb: cdc_ether: Use wwan interface for Telit modules

Florian Wolter (1):
      xhci: Fix race between ep halt and URB cancellation

Hannes Frederic Sowa (1):
      ipv6: udp packets following an UFO enqueued packet need also be handled by UFO

Heikki Krogerus (1):
      usb: dwc3: pci: add support for BayTrail

Henrik Rydberg (1):
      hwmon: (applesmc) Check key count before proceeding

Herbert Xu (1):
      bridge: Clamp forward_delay when enabling STP

Ian Abbott (1):
      staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice

Jack Wang (1):
      ib_srpt: always set response for task management

Jan Kara (1):
      isofs: Refuse RW mount of the filesystem instead of making it RO

Jani Nikula (1):
      drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER

Johan Hovold (2):
      serial: pch_uart: fix tty-kref leak in rx-error path
      serial: pch_uart: fix tty-kref leak in dma-rx path

Josh Boyer (1):
      x86, efi: Don't map Boot Services on i386

Kees Cook (4):
      HID: provide a helper for validating hid reports
      HID: zeroplus: validate output report details
      HID: LG: validate HID output report details
      HID: logitech-dj: validate output report details

Kirill Tkhai (4):
      sparc32: Fix exit flag passed from traced sys_sigreturn
      sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall
      sparc64: Fix ITLB handler of null page
      sparc64: Remove RWSEM export leftovers

Kurt Garloff (1):
      usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit

Larry Finger (1):
      rtlwifi: Align private space in rtl_priv struct

Li Zefan (1):
      cgroup: fail if monitored file and event_control are in different cgroup

Liam Girdwood (1):
      ALSA: compress: Fix compress device unregister.

Lino Sanfilippo (1):
      fanotify: dont merge permission events

Luis Henriques (1):
      Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()"

Madhavan Srinivasan (1):
      powerpc/sysfs: Disable writing to PURR in guest mode

Malcolm Priestley (1):
      staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.

Marek Vasut (1):
      video: mxsfb: Add missing break

Masanari Iida (1):
      dma: fix comments

Masoud Sharbiani (1):
      x86/reboot: Add quirk to make Dell C6100 use reboot=pci automatically

Mathias Nyman (2):
      xhci: Fix oops happening after address device timeout
      xhci: Ensure a command structure points to the correct trb on the command ring

Michael Grzeschik (3):
      dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic
      dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet
      dmaengine: imx-dma: fix callback path in tasklet

Michal Malý (1):
      USB: serial: option: Ignore card reader interface on Huawei E1750

Mikulas Patocka (2):
      dm snapshot: workaround for a false positive lockdep warning
      dm-snapshot: fix performance degradation due to small hash size

Neil Horman (1):
      bonding: Fix broken promiscuity reference counting issue

Nicholas Bellinger (1):
      ib_srpt: Destroy cm_id before destroying QP.

Nikolay Aleksandrov (1):
      netpoll: fix NULL pointer dereference in netpoll_cleanup

Nishanth Aravamudan (1):
      powerpc/iommu: Use GFP_KERNEL instead of GFP_ATOMIC in iommu_init_table()

Nithin Sujir (2):
      tg3: Don't turn off led on 5719 serdes port 0
      tg3: Expand led off fix to include 5720

Passion,Zhao (1):
      Smack: Fix the bug smackcipso can't set CIPSO correctly

Paul E. McKenney (2):
      powerpc: Fix parameter clobber in csum_partial_copy_generic()
      powerpc: Restore registers on error exit from csum_partial_copy_generic()

Peng Chen (1):
      Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012.

Peter Korsgaard (1):
      dm9601: fix IFF_ALLMULTI handling

Peter Zijlstra (2):
      perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu
      perf: Fix perf_cgroup_switch for sw-events

Prarit Bhargava (1):
      powerpc/vio: Fix modalias_show return values

Raphael Kubo da Costa (1):
      Bluetooth: Add support for BCM20702A0 [0b05, 17cb]

Ricardo Ribalda (1):
      ll_temac: Reset dma descriptors indexes on ndo_open

Roger Luethi (1):
      via-rhine: fix VLAN priority field (PCP, IEEE 802.1p)

Salam Noureddine (2):
      ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put
      ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put

Stefan Kriwanek (1):
      HID: Fix Speedlink VAD Cezanne support for some devices

Tejun Heo (1):
      workqueue: cond_resched() after processing each work item

Theodore Ts'o (1):
      ext4: avoid hang when mounting non-journal filesystems with orphan list

Vasily Titskiy (1):
      HID: usbhid: quirk for N-Trig DuoSense Touch Screen

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

* [PATCH 001/100] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2)
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 002/100] drm/ast: fix the ast open key function Luis Henriques
                   ` (96 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 91f3a6aaf280294b07c05dfe606e6c27b7ba3c72 upstream.

The OUTPUT_ENABLE action jumps past the point in the coder where
the data_offset is set on certain rs780 cards.  This worked
previously because the OUTPUT_ENABLE action is always called
immediately after the ENABLE action so the data_offset remained
set.  In 6f8bbaf568c7f2c497558bfd04654c0b9841ad57
(drm/radeon/atom: initialize more atom interpretor elements to 0),
we explictly reset data_offset to 0 between atom calls which then
caused this to fail.  The fix is to just skip calling the
OUTPUT_ENABLE action on the problematic chipsets.  The ENABLE
action does the same thing and more.  Ultimately, we could
probably drop the OUTPUT_ENABLE action all together on DCE3
asics.

fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=60791

v2: only rs880 seems to be affected

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/atombios_encoders.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index 66ecc38..64bc2bd 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -1425,8 +1425,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
 			atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
 			atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
 			atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
-			/* some early dce3.2 boards have a bug in their transmitter control table */
-			if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
+			/* some dce3.x boards have a bug in their transmitter control table.
+			 * ACTION_ENABLE_OUTPUT can probably be dropped since ACTION_ENABLE
+			 * does the same thing and more.
+			 */
+			if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&
+			    (rdev->family != CHIP_RS880))
 				atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
 		}
 		if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
-- 
1.8.3.2


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

* [PATCH 002/100] drm/ast: fix the ast open key function
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
  2013-10-11 10:40 ` [PATCH 001/100] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 003/100] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Luis Henriques
                   ` (95 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Dave Airlie, Luis Henriques

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

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

From: Dave Airlie <airlied@redhat.com>

commit 2e8378136f28bea960cec643d3fa5d843c9049ec upstream.

When porting from UMS I mistyped this from the wrong place, AST noticed
and pointed it out, so we should fix it to be like the X.org driver.

Reported-by: Y.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/ast/ast_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 85a6eeb..49920a7 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -176,7 +176,7 @@ uint8_t ast_get_index_reg_mask(struct ast_private *ast,
 
 static inline void ast_open_key(struct ast_private *ast)
 {
-	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xA1, 0xFF, 0x04);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8);
 }
 
 #define AST_VIDMEM_SIZE_8M    0x00800000
-- 
1.8.3.2


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

* [PATCH 003/100] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
  2013-10-11 10:40 ` [PATCH 001/100] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Luis Henriques
  2013-10-11 10:40 ` [PATCH 002/100] drm/ast: fix the ast open key function Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 004/100] HID: provide a helper for validating hid reports Luis Henriques
                   ` (94 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daisuke Nishimura, Peter Zijlstra, Ingo Molnar, Luis Henriques

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

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

From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

commit 6c9a27f5da9609fca46cb2b183724531b48f71ad upstream.

There is a small race between copy_process() and cgroup_attach_task()
where child->se.parent,cfs_rq points to invalid (old) ones.

        parent doing fork()      | someone moving the parent to another cgroup
  -------------------------------+---------------------------------------------
    copy_process()
      + dup_task_struct()
        -> parent->se is copied to child->se.
           se.parent,cfs_rq of them point to old ones.

                                     cgroup_attach_task()
                                       + cgroup_task_migrate()
                                         -> parent->cgroup is updated.
                                       + cpu_cgroup_attach()
                                         + sched_move_task()
                                           + task_move_group_fair()
                                             +- set_task_rq()
                                                -> se.parent,cfs_rq of parent
                                                   are updated.

      + cgroup_fork()
        -> parent->cgroup is copied to child->cgroup. (*1)
      + sched_fork()
        + task_fork_fair()
          -> se.parent,cfs_rq of child are accessed
             while they point to old ones. (*2)

In the worst case, this bug can lead to "use-after-free" and cause a panic,
because it's new cgroup's refcount that is incremented at (*1),
so the old cgroup(and related data) can be freed before (*2).

In fact, a panic caused by this bug was originally caught in RHEL6.4.

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [<ffffffff81051e3e>] sched_slice+0x6e/0xa0
    [...]
    Call Trace:
     [<ffffffff81051f25>] place_entity+0x75/0xa0
     [<ffffffff81056a3a>] task_fork_fair+0xaa/0x160
     [<ffffffff81063c0b>] sched_fork+0x6b/0x140
     [<ffffffff8106c3c2>] copy_process+0x5b2/0x1450
     [<ffffffff81063b49>] ? wake_up_new_task+0xd9/0x130
     [<ffffffff8106d2f4>] do_fork+0x94/0x460
     [<ffffffff81072a9e>] ? sys_wait4+0xae/0x100
     [<ffffffff81009598>] sys_clone+0x28/0x30
     [<ffffffff8100b393>] stub_clone+0x13/0x20
     [<ffffffff8100b072>] ? system_call_fastpath+0x16/0x1b

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/039601ceae06$733d3130$59b79390$@mxp.nes.nec.co.jp
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/sched/fair.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index eb12b9e..811a254 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4929,11 +4929,15 @@ static void task_fork_fair(struct task_struct *p)
 	cfs_rq = task_cfs_rq(current);
 	curr = cfs_rq->curr;
 
-	if (unlikely(task_cpu(p) != this_cpu)) {
-		rcu_read_lock();
-		__set_task_cpu(p, this_cpu);
-		rcu_read_unlock();
-	}
+	/*
+	 * Not only the cpu but also the task_group of the parent might have
+	 * been changed after parent->se.parent,cfs_rq were copied to
+	 * child->se.parent,cfs_rq. So call __set_task_cpu() to make those
+	 * of child point to valid ones.
+	 */
+	rcu_read_lock();
+	__set_task_cpu(p, this_cpu);
+	rcu_read_unlock();
 
 	update_curr(cfs_rq);
 
-- 
1.8.3.2


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

* [PATCH 004/100] HID: provide a helper for validating hid reports
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 003/100] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 005/100] HID: zeroplus: validate output report details Luis Henriques
                   ` (93 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kees Cook, Jiri Kosina, Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 331415ff16a12147d57d5c953f3a961b7ede348b upstream.

Many drivers need to validate the characteristics of their HID report
during initialization to avoid misusing the reports. This adds a common
helper to perform validation of the report exisitng, the field existing,
and the expected number of values within the field.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-core.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/hid.h    |  4 ++++
 2 files changed, 62 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 0d76d3f..d4111de 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -743,6 +743,64 @@ int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size)
 }
 EXPORT_SYMBOL_GPL(hid_parse_report);
 
+static const char * const hid_report_names[] = {
+	"HID_INPUT_REPORT",
+	"HID_OUTPUT_REPORT",
+	"HID_FEATURE_REPORT",
+};
+/**
+ * hid_validate_values - validate existing device report's value indexes
+ *
+ * @device: hid device
+ * @type: which report type to examine
+ * @id: which report ID to examine (0 for first)
+ * @field_index: which report field to examine
+ * @report_counts: expected number of values
+ *
+ * Validate the number of values in a given field of a given report, after
+ * parsing.
+ */
+struct hid_report *hid_validate_values(struct hid_device *hid,
+				       unsigned int type, unsigned int id,
+				       unsigned int field_index,
+				       unsigned int report_counts)
+{
+	struct hid_report *report;
+
+	if (type > HID_FEATURE_REPORT) {
+		hid_err(hid, "invalid HID report type %u\n", type);
+		return NULL;
+	}
+
+	if (id >= HID_MAX_IDS) {
+		hid_err(hid, "invalid HID report id %u\n", id);
+		return NULL;
+	}
+
+	/*
+	 * Explicitly not using hid_get_report() here since it depends on
+	 * ->numbered being checked, which may not always be the case when
+	 * drivers go to access report values.
+	 */
+	report = hid->report_enum[type].report_id_hash[id];
+	if (!report) {
+		hid_err(hid, "missing %s %u\n", hid_report_names[type], id);
+		return NULL;
+	}
+	if (report->maxfield <= field_index) {
+		hid_err(hid, "not enough fields in %s %u\n",
+			hid_report_names[type], id);
+		return NULL;
+	}
+	if (report->field[field_index]->report_count < report_counts) {
+		hid_err(hid, "not enough values in %s %u field %u\n",
+			hid_report_names[type], id, field_index);
+		return NULL;
+	}
+	return report;
+}
+EXPORT_SYMBOL_GPL(hid_validate_values);
+
 /**
  * hid_open_report - open a driver-specific device report
  *
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 69b6e30..cdf6171 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -745,6 +745,10 @@ void hid_output_report(struct hid_report *report, __u8 *data);
 struct hid_device *hid_allocate_device(void);
 struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
+struct hid_report *hid_validate_values(struct hid_device *hid,
+				       unsigned int type, unsigned int id,
+				       unsigned int field_index,
+				       unsigned int report_counts);
 int hid_open_report(struct hid_device *device);
 int hid_check_keys_pressed(struct hid_device *hid);
 int hid_connect(struct hid_device *hid, unsigned int connect_mask);
-- 
1.8.3.2


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

* [PATCH 005/100] HID: zeroplus: validate output report details
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 004/100] HID: provide a helper for validating hid reports Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 006/100] HID: LG: validate HID " Luis Henriques
                   ` (92 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kees Cook, Jiri Kosina, Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 78214e81a1bf43740ce89bb5efda78eac2f8ef83 upstream.

The zeroplus HID driver was not checking the size of allocated values
in fields it used. A HID device could send a malicious output report
that would cause the driver to write beyond the output report allocation
during initialization, causing a heap overflow:

[ 1442.728680] usb 1-1: New USB device found, idVendor=0c12, idProduct=0005
...
[ 1466.243173] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten

CVE-2013-2889

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-zpff.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c
index f6ba81d..f348f7f 100644
--- a/drivers/hid/hid-zpff.c
+++ b/drivers/hid/hid-zpff.c
@@ -70,21 +70,13 @@ static int zpff_init(struct hid_device *hid)
 	struct hid_report *report;
 	struct hid_input *hidinput = list_entry(hid->inputs.next,
 						struct hid_input, list);
-	struct list_head *report_list =
-			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	int error;
+	int i, error;
 
-	if (list_empty(report_list)) {
-		hid_err(hid, "no output report found\n");
-		return -ENODEV;
-	}
-
-	report = list_entry(report_list->next, struct hid_report, list);
-
-	if (report->maxfield < 4) {
-		hid_err(hid, "not enough fields in report\n");
-		return -ENODEV;
+	for (i = 0; i < 4; i++) {
+		report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
+		if (!report)
+			return -ENODEV;
 	}
 
 	zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL);
-- 
1.8.3.2


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

* [PATCH 006/100] HID: LG: validate HID output report details
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 005/100] HID: zeroplus: validate output report details Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 007/100] HID: add usage_index in struct hid_usage Luis Henriques
                   ` (91 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kees Cook, Jiri Kosina, Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 0fb6bd06e06792469acc15bbe427361b56ada528 upstream.

A HID device could send a malicious output report that would cause the
lg, lg3, and lg4 HID drivers to write beyond the output report allocation
during an event, causing a heap overflow:

[  325.245240] usb 1-1: New USB device found, idVendor=046d, idProduct=c287
...
[  414.518960] BUG kmalloc-4096 (Not tainted): Redzone overwritten

Additionally, while lg2 did correctly validate the report details, it was
cleaned up and shortened.

CVE-2013-2893

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-lg2ff.c | 19 +++----------------
 drivers/hid/hid-lg3ff.c | 29 ++++++-----------------------
 drivers/hid/hid-lg4ff.c | 20 +-------------------
 drivers/hid/hid-lgff.c  | 17 ++---------------
 4 files changed, 12 insertions(+), 73 deletions(-)

diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c
index 3c31bc6..128f011 100644
--- a/drivers/hid/hid-lg2ff.c
+++ b/drivers/hid/hid-lg2ff.c
@@ -66,26 +66,13 @@ int lg2ff_init(struct hid_device *hid)
 	struct hid_report *report;
 	struct hid_input *hidinput = list_entry(hid->inputs.next,
 						struct hid_input, list);
-	struct list_head *report_list =
-			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
 	int error;
 
-	if (list_empty(report_list)) {
-		hid_err(hid, "no output report found\n");
+	/* Check that the report looks ok */
+	report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);
+	if (!report)
 		return -ENODEV;
-	}
-
-	report = list_entry(report_list->next, struct hid_report, list);
-
-	if (report->maxfield < 1) {
-		hid_err(hid, "output report is empty\n");
-		return -ENODEV;
-	}
-	if (report->field[0]->report_count < 7) {
-		hid_err(hid, "not enough values in the field\n");
-		return -ENODEV;
-	}
 
 	lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL);
 	if (!lg2ff)
diff --git a/drivers/hid/hid-lg3ff.c b/drivers/hid/hid-lg3ff.c
index f98644c..91f981f 100644
--- a/drivers/hid/hid-lg3ff.c
+++ b/drivers/hid/hid-lg3ff.c
@@ -68,10 +68,11 @@ static int hid_lg3ff_play(struct input_dev *dev, void *data,
 	int x, y;
 
 /*
- * Maxusage should always be 63 (maximum fields)
- * likely a better way to ensure this data is clean
+ * Available values in the field should always be 63, but we only use up to
+ * 35. Instead, clear the entire area, however big it is.
  */
-	memset(report->field[0]->value, 0, sizeof(__s32)*report->field[0]->maxusage);
+	memset(report->field[0]->value, 0,
+	       sizeof(__s32) * report->field[0]->report_count);
 
 	switch (effect->type) {
 	case FF_CONSTANT:
@@ -131,32 +132,14 @@ static const signed short ff3_joystick_ac[] = {
 int lg3ff_init(struct hid_device *hid)
 {
 	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
-	struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	struct hid_report *report;
-	struct hid_field *field;
 	const signed short *ff_bits = ff3_joystick_ac;
 	int error;
 	int i;
 
-	/* Find the report to use */
-	if (list_empty(report_list)) {
-		hid_err(hid, "No output report found\n");
-		return -1;
-	}
-
 	/* Check that the report looks ok */
-	report = list_entry(report_list->next, struct hid_report, list);
-	if (!report) {
-		hid_err(hid, "NULL output report\n");
-		return -1;
-	}
-
-	field = report->field[0];
-	if (!field) {
-		hid_err(hid, "NULL field\n");
-		return -1;
-	}
+	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35))
+		return -ENODEV;
 
 	/* Assume single fixed device G940 */
 	for (i = 0; ff_bits[i] >= 0; i++)
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index f3390ee..e092923 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -424,34 +424,16 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde
 int lg4ff_init(struct hid_device *hid)
 {
 	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
-	struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	struct hid_report *report;
-	struct hid_field *field;
 	struct lg4ff_device_entry *entry;
 	struct lg_drv_data *drv_data;
 	struct usb_device_descriptor *udesc;
 	int error, i, j;
 	__u16 bcdDevice, rev_maj, rev_min;
 
-	/* Find the report to use */
-	if (list_empty(report_list)) {
-		hid_err(hid, "No output report found\n");
-		return -1;
-	}
-
 	/* Check that the report looks ok */
-	report = list_entry(report_list->next, struct hid_report, list);
-	if (!report) {
-		hid_err(hid, "NULL output report\n");
+	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
 		return -1;
-	}
-
-	field = report->field[0];
-	if (!field) {
-		hid_err(hid, "NULL field\n");
-		return -1;
-	}
 
 	/* Check what wheel has been connected */
 	for (i = 0; i < ARRAY_SIZE(lg4ff_devices); i++) {
diff --git a/drivers/hid/hid-lgff.c b/drivers/hid/hid-lgff.c
index 27bc54f..1d978daa 100644
--- a/drivers/hid/hid-lgff.c
+++ b/drivers/hid/hid-lgff.c
@@ -130,27 +130,14 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude)
 int lgff_init(struct hid_device* hid)
 {
 	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
-	struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	struct hid_report *report;
-	struct hid_field *field;
 	const signed short *ff_bits = ff_joystick;
 	int error;
 	int i;
 
-	/* Find the report to use */
-	if (list_empty(report_list)) {
-		hid_err(hid, "No output report found\n");
-		return -1;
-	}
-
 	/* Check that the report looks ok */
-	report = list_entry(report_list->next, struct hid_report, list);
-	field = report->field[0];
-	if (!field) {
-		hid_err(hid, "NULL field\n");
-		return -1;
-	}
+	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
+		return -ENODEV;
 
 	for (i = 0; i < ARRAY_SIZE(devices); i++) {
 		if (dev->id.vendor == devices[i].idVendor &&
-- 
1.8.3.2


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

* [PATCH 007/100] HID: add usage_index in struct hid_usage.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 006/100] HID: LG: validate HID " Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 008/100] HID: validate feature and input report details Luis Henriques
                   ` (90 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Tissoires, Jiri Kosina, Luis Henriques

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

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

From: Benjamin Tissoires <benjamin.tissoires@gmail.com>

commit f262d1fa2c651a5e2f92b6aee8779597631cd5d4 upstream.

Currently, there is no way to know the index of the current field
in the .input_mapping and .event callbacks  when this field is inside
an array of HID fields.
This patch adds this index to the struct hid_usage so that this
information is available to input_mapping and event callbacks.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[ luis: 3.5.y prereq for:
  cc6b54a HID: validate feature and input report details ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-core.c | 4 ++++
 include/linux/hid.h    | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d4111de..4043d73 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -94,6 +94,7 @@ EXPORT_SYMBOL_GPL(hid_register_report);
 static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
 {
 	struct hid_field *field;
+	int i;
 
 	if (report->maxfield == HID_MAX_FIELDS) {
 		hid_err(report->device, "too many fields in report\n");
@@ -112,6 +113,9 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned
 	field->value = (s32 *)(field->usage + usages);
 	field->report = report;
 
+	for (i = 0; i < usages; i++)
+		field->usage[i].usage_index = i;
+
 	return field;
 }
 
diff --git a/include/linux/hid.h b/include/linux/hid.h
index cdf6171..be1afbc 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -378,6 +378,7 @@ struct hid_collection {
 struct hid_usage {
 	unsigned  hid;			/* hid usage code */
 	unsigned  collection_index;	/* index into collection array */
+	unsigned  usage_index;		/* index into usage array */
 	/* hidinput data */
 	__u16     code;			/* input driver code */
 	__u8      type;			/* input driver type */
-- 
1.8.3.2


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

* [PATCH 008/100] HID: validate feature and input report details
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 007/100] HID: add usage_index in struct hid_usage Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 009/100] HID: logitech-dj: validate output " Luis Henriques
                   ` (89 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Tissoires, Jiri Kosina, Luis Henriques

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

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

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

commit cc6b54aa54bf40b762cab45a9fc8aa81653146eb upstream.

When dealing with usage_index, be sure to properly use unsigned instead of
int to avoid overflows.

When working on report fields, always validate that their report_counts are
in bounds.
Without this, a HID device could report a malicious feature report that
could trick the driver into a heap overflow:

[  634.885003] usb 1-1: New USB device found, idVendor=0596, idProduct=0500
...
[  676.469629] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten

CVE-2013-2897

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[ luis: backported to 3.5:
  - dropped changes to hid_report_raw_event() as these depend on
    commit b94e3c9 "HID: hid-core: optimize in case of hidraw" ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-core.c  | 10 ++++++----
 drivers/hid/hid-input.c | 11 ++++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 4043d73..adca1b0 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -226,9 +226,9 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
 {
 	struct hid_report *report;
 	struct hid_field *field;
-	int usages;
+	unsigned usages;
 	unsigned offset;
-	int i;
+	unsigned i;
 
 	report = hid_register_report(parser->device, report_type, parser->global.report_id);
 	if (!report) {
@@ -255,7 +255,8 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
 	if (!parser->local.usage_index) /* Ignore padding fields */
 		return 0;
 
-	usages = max_t(int, parser->local.usage_index, parser->global.report_count);
+	usages = max_t(unsigned, parser->local.usage_index,
+				 parser->global.report_count);
 
 	field = hid_register_field(report, usages, parser->global.report_count);
 	if (!field)
@@ -266,13 +267,14 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
 	field->application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);
 
 	for (i = 0; i < usages; i++) {
-		int j = i;
+		unsigned j = i;
 		/* Duplicate the last usage we parsed if we have excess values */
 		if (i >= parser->local.usage_index)
 			j = parser->local.usage_index - 1;
 		field->usage[i].hid = parser->local.usage[j];
 		field->usage[i].collection_index =
 			parser->local.collection_index[j];
+		field->usage[i].usage_index = i;
 	}
 
 	field->maxusage = usages;
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index c460b74..0c218f8 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -470,6 +470,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 	if (field->flags & HID_MAIN_ITEM_CONSTANT)
 		goto ignore;
 
+	/* Ignore if report count is out of bounds. */
+	if (field->report_count < 1)
+		goto ignore;
+
 	/* only LED usages are supported in output fields */
 	if (field->report_type == HID_OUTPUT_REPORT &&
 			(usage->hid & HID_USAGE_PAGE) != HID_UP_LED) {
@@ -1134,7 +1138,11 @@ static void report_features(struct hid_device *hid)
 
 	rep_enum = &hid->report_enum[HID_FEATURE_REPORT];
 	list_for_each_entry(rep, &rep_enum->report_list, list)
-		for (i = 0; i < rep->maxfield; i++)
+		for (i = 0; i < rep->maxfield; i++) {
+			/* Ignore if report count is out of bounds. */
+			if (rep->field[i]->report_count < 1)
+				continue;
+
 			for (j = 0; j < rep->field[i]->maxusage; j++) {
 				/* Verify if Battery Strength feature is available */
 				hidinput_setup_battery(hid, HID_FEATURE_REPORT, rep->field[i]);
@@ -1143,6 +1151,7 @@ static void report_features(struct hid_device *hid)
 					drv->feature_mapping(hid, rep->field[i],
 							     rep->field[i]->usage + j);
 			}
+		}
 }
 
 /*
-- 
1.8.3.2


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

* [PATCH 009/100] HID: logitech-dj: validate output report details
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 008/100] HID: validate feature and input report details Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 010/100] HID: multitouch: validate indexes details Luis Henriques
                   ` (88 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kees Cook, Benjamin Tissoires, Jiri Kosina, Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 297502abb32e225fb23801fcdb0e4f6f8e17099a upstream.

A HID device could send a malicious output report that would cause the
logitech-dj HID driver to leak kernel memory contents to the device, or
trigger a NULL dereference during initialization:

[  304.424553] usb 1-1: New USB device found, idVendor=046d, idProduct=c52b
...
[  304.780467] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
[  304.781409] IP: [<ffffffff815d50aa>] logi_dj_recv_send_report.isra.11+0x1a/0x90

CVE-2013-2895

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-logitech-dj.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 8758f38c..4288123 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -462,7 +462,7 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
 	struct hid_report *report;
 	struct hid_report_enum *output_report_enum;
 	u8 *data = (u8 *)(&dj_report->device_index);
-	int i;
+	unsigned int i;
 
 	output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT];
 	report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT];
@@ -472,7 +472,7 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
 		return -ENODEV;
 	}
 
-	for (i = 0; i < report->field[0]->report_count; i++)
+	for (i = 0; i < DJREPORT_SHORT_LENGTH - 1; i++)
 		report->field[0]->value[i] = data[i];
 
 	usbhid_submit_report(hdev, report, USB_DIR_OUT);
@@ -784,6 +784,12 @@ static int logi_dj_probe(struct hid_device *hdev,
 		goto hid_parse_fail;
 	}
 
+	if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, REPORT_ID_DJ_SHORT,
+				 0, DJREPORT_SHORT_LENGTH - 1)) {
+		retval = -ENODEV;
+		goto hid_parse_fail;
+	}
+
 	/* Starts the usb device and connects to upper interfaces hiddev and
 	 * hidraw */
 	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-- 
1.8.3.2


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

* [PATCH 010/100] HID: multitouch: validate indexes details
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 009/100] HID: logitech-dj: validate output " Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 011/100] drm/radeon: fix panel scaling with eDP and LVDS bridges Luis Henriques
                   ` (87 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Tissoires, Jiri Kosina, Luis Henriques

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

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

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

commit 8821f5dc187bdf16cfb32ef5aa8c3035273fa79a upstream.

When working on report indexes, always validate that they are in bounds.
Without this, a HID device could report a malicious feature report that
could trick the driver into a heap overflow:

[  634.885003] usb 1-1: New USB device found, idVendor=0596, idProduct=0500
...
[  676.469629] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten

Note that we need to change the indexes from s8 to s16 as they can
be between -1 and 255.

CVE-2013-2897

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-multitouch.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 348550a..fa3c904 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -82,9 +82,9 @@ struct mt_device {
 					   multitouch fields */
 	unsigned last_field_index;	/* last field index of the report */
 	unsigned last_slot_field;	/* the last field of a slot */
-	__s8 inputmode;		/* InputMode HID feature, -1 if non-existent */
-	__s8 inputmode_index;	/* InputMode HID feature index in the report */
-	__s8 maxcontact_report_id;	/* Maximum Contact Number HID feature,
+	__s16 inputmode;	/* InputMode HID feature, -1 if non-existent */
+	__s16 inputmode_index;	/* InputMode HID feature index in the report */
+	__s16 maxcontact_report_id;	/* Maximum Contact Number HID feature,
 				   -1 if non-existent */
 	__u8 num_received;	/* how many contacts we received */
 	__u8 num_expected;	/* expected last contact index */
@@ -261,20 +261,18 @@ static void mt_feature_mapping(struct hid_device *hdev,
 		struct hid_field *field, struct hid_usage *usage)
 {
 	struct mt_device *td = hid_get_drvdata(hdev);
-	int i;
 
 	switch (usage->hid) {
 	case HID_DG_INPUTMODE:
-		td->inputmode = field->report->id;
-		td->inputmode_index = 0; /* has to be updated below */
-
-		for (i=0; i < field->maxusage; i++) {
-			if (field->usage[i].hid == usage->hid) {
-				td->inputmode_index = i;
-				break;
-			}
+		/* Ignore if value index is out of bounds. */
+		if (usage->usage_index >= field->report_count) {
+			dev_err(&hdev->dev, "HID_DG_INPUTMODE out of range\n");
+			break;
 		}
 
+		td->inputmode = field->report->id;
+		td->inputmode_index = usage->usage_index;
+
 		break;
 	case HID_DG_CONTACTMAX:
 		td->maxcontact_report_id = field->report->id;
@@ -425,6 +423,10 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			td->last_field_index = field->index;
 			return 1;
 		case HID_DG_CONTACTCOUNT:
+			/* Ignore if indexes are out of bounds. */
+			if (field->index >= field->report->maxfield ||
+			    usage->usage_index >= field->report_count)
+				return 1;
 			td->last_field_index = field->index;
 			return 1;
 		case HID_DG_CONTACTMAX:
-- 
1.8.3.2


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

* [PATCH 011/100] drm/radeon: fix panel scaling with eDP and LVDS bridges
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 010/100] HID: multitouch: validate indexes details Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 012/100] net: usb: cdc_ether: Use wwan interface for Telit modules Luis Henriques
                   ` (86 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 855f5f1d882a34e4e9dd27b299737cd3508a5624 upstream.

We were using the wrong set_properly callback so we always
ended up with Full scaling even if something else (Center or
Full aspect) was selected.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 34 +++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index a7e797c..bfe1f75 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -1479,6 +1479,24 @@ struct drm_connector_funcs radeon_dp_connector_funcs = {
 	.force = radeon_dvi_force,
 };
 
+static const struct drm_connector_funcs radeon_edp_connector_funcs = {
+	.dpms = drm_helper_connector_dpms,
+	.detect = radeon_dp_detect,
+	.fill_modes = drm_helper_probe_single_connector_modes,
+	.set_property = radeon_lvds_set_property,
+	.destroy = radeon_dp_connector_destroy,
+	.force = radeon_dvi_force,
+};
+
+static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = {
+	.dpms = drm_helper_connector_dpms,
+	.detect = radeon_dp_detect,
+	.fill_modes = drm_helper_probe_single_connector_modes,
+	.set_property = radeon_lvds_set_property,
+	.destroy = radeon_dp_connector_destroy,
+	.force = radeon_dvi_force,
+};
+
 void
 radeon_add_atom_connector(struct drm_device *dev,
 			  uint32_t connector_id,
@@ -1570,8 +1588,6 @@ radeon_add_atom_connector(struct drm_device *dev,
 			goto failed;
 		radeon_dig_connector->igp_lane_info = igp_lane_info;
 		radeon_connector->con_priv = radeon_dig_connector;
-		drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
-		drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
 		if (i2c_bus->valid) {
 			/* add DP i2c bus */
 			if (connector_type == DRM_MODE_CONNECTOR_eDP)
@@ -1588,6 +1604,10 @@ radeon_add_atom_connector(struct drm_device *dev,
 		case DRM_MODE_CONNECTOR_VGA:
 		case DRM_MODE_CONNECTOR_DVIA:
 		default:
+			drm_connector_init(dev, &radeon_connector->base,
+					   &radeon_dp_connector_funcs, connector_type);
+			drm_connector_helper_add(&radeon_connector->base,
+						 &radeon_dp_connector_helper_funcs);
 			connector->interlace_allowed = true;
 			connector->doublescan_allowed = true;
 			radeon_connector->dac_load_detect = true;
@@ -1600,6 +1620,10 @@ radeon_add_atom_connector(struct drm_device *dev,
 		case DRM_MODE_CONNECTOR_HDMIA:
 		case DRM_MODE_CONNECTOR_HDMIB:
 		case DRM_MODE_CONNECTOR_DisplayPort:
+			drm_connector_init(dev, &radeon_connector->base,
+					   &radeon_dp_connector_funcs, connector_type);
+			drm_connector_helper_add(&radeon_connector->base,
+						 &radeon_dp_connector_helper_funcs);
 			drm_connector_attach_property(&radeon_connector->base,
 						      rdev->mode_info.underscan_property,
 						      UNDERSCAN_OFF);
@@ -1624,6 +1648,10 @@ radeon_add_atom_connector(struct drm_device *dev,
 			break;
 		case DRM_MODE_CONNECTOR_LVDS:
 		case DRM_MODE_CONNECTOR_eDP:
+			drm_connector_init(dev, &radeon_connector->base,
+					   &radeon_lvds_bridge_connector_funcs, connector_type);
+			drm_connector_helper_add(&radeon_connector->base,
+						 &radeon_dp_connector_helper_funcs);
 			drm_connector_attach_property(&radeon_connector->base,
 						      dev->mode_config.scaling_mode_property,
 						      DRM_MODE_SCALE_FULLSCREEN);
@@ -1787,7 +1815,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 				goto failed;
 			radeon_dig_connector->igp_lane_info = igp_lane_info;
 			radeon_connector->con_priv = radeon_dig_connector;
-			drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
+			drm_connector_init(dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type);
 			drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
 			if (i2c_bus->valid) {
 				/* add DP i2c bus */
-- 
1.8.3.2


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

* [PATCH 012/100] net: usb: cdc_ether: Use wwan interface for Telit modules
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 011/100] drm/radeon: fix panel scaling with eDP and LVDS bridges Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 013/100] usb: gadget: fix a bug and a WARN_ON in dummy-hcd Luis Henriques
                   ` (85 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fabio Porcedda, David S. Miller, Luis Henriques

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

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

From: Fabio Porcedda <fabio.porcedda@gmail.com>

commit 0092820407901a0b2c4e343e85f96bb7abfcded1 upstream.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/usb/cdc_ether.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index e7d4238..81182fb 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -707,6 +707,11 @@ static const struct usb_device_id	products [] = {
 	.bInterfaceProtocol	= USB_CDC_PROTO_NONE,
 	.driver_info = (unsigned long)&wwan_info,
 }, {
+	/* Telit modules */
+	USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,
+			USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+	.driver_info = (kernel_ulong_t) &wwan_info,
+}, {
 	USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
 			USB_CDC_PROTO_NONE),
 	.driver_info = (unsigned long) &cdc_info,
-- 
1.8.3.2


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

* [PATCH 013/100] usb: gadget: fix a bug and a WARN_ON in dummy-hcd
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 012/100] net: usb: cdc_ether: Use wwan interface for Telit modules Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 014/100] drm/ttm: fix the tt_populated check in ttm_tt_destroy() Luis Henriques
                   ` (84 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, Felipe Balbi, Luis Henriques

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

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

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

commit 5f5610f69be3a925b1f79af27150bb7377bc9ad6 upstream.

This patch fixes a NULL pointer dereference and a WARN_ON in
dummy-hcd.  These things were the result of moving to the UDC core
framework, and possibly of changes to that framework.

Now unloading a gadget driver causes the UDC to be stopped after the
gadget driver is unbound, not before.  Therefore the "driver" argument
to dummy_udc_stop() can be NULL, so we must not try to print the
driver's name without checking first.

Also, the UDC framework automatically unregisters the gadget when the
UDC is deleted.  Therefore a sysfs attribute file attached to the
gadget must be removed before the UDC is deleted, not after.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/dummy_hcd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4ad1f1c..1e0f8cd 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -921,8 +921,9 @@ static int dummy_udc_stop(struct usb_gadget *g,
 	struct dummy_hcd	*dum_hcd = gadget_to_dummy_hcd(g);
 	struct dummy		*dum = dum_hcd->dum;
 
-	dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
-			driver->driver.name);
+	if (driver)
+		dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
+				driver->driver.name);
 
 	dum->driver = NULL;
 
@@ -1011,9 +1012,9 @@ static int dummy_udc_remove(struct platform_device *pdev)
 {
 	struct dummy	*dum = platform_get_drvdata(pdev);
 
-	usb_del_gadget_udc(&dum->gadget);
 	platform_set_drvdata(pdev, NULL);
 	device_remove_file(&dum->gadget.dev, &dev_attr_function);
+	usb_del_gadget_udc(&dum->gadget);
 	device_unregister(&dum->gadget.dev);
 	return 0;
 }
-- 
1.8.3.2


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

* [PATCH 014/100] drm/ttm: fix the tt_populated check in ttm_tt_destroy()
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 013/100] usb: gadget: fix a bug and a WARN_ON in dummy-hcd Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 015/100] sfc: Fix efx_rx_buf_offset() for recycled pages Luis Henriques
                   ` (83 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ben Skeggs, Jerome Glisse, Dave Airlie, Luis Henriques

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

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

From: Ben Skeggs <bskeggs@redhat.com>

commit 182b17c8dc4e83aab000ce86587b6810e515da87 upstream.

After a vmalloc failure in ttm_dma_tt_alloc_page_directory(),
ttm_dma_tt_init() will call ttm_tt_destroy() to cleanup, and end up
inside the driver's unpopulate() hook when populate() has never yet
been called.

On nouveau, the first issue to be hit because of this is that
dma_address[] may be a NULL pointer.  After working around this,
ttm_pool_unpopulate() may potentially hit the same issue with
the pages[] array.

It seems to make more sense to avoid calling unpopulate on already
unpopulated TTMs than to add checks to all the implementations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index fa09daf..ea10bbe 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -170,7 +170,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
 		ttm_tt_unbind(ttm);
 	}
 
-	if (likely(ttm->pages != NULL)) {
+	if (ttm->state == tt_unbound) {
 		ttm->bdev->driver->ttm_tt_unpopulate(ttm);
 	}
 
-- 
1.8.3.2


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

* [PATCH 015/100] sfc: Fix efx_rx_buf_offset() for recycled pages
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 014/100] drm/ttm: fix the tt_populated check in ttm_tt_destroy() Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 016/100] perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu Luis Henriques
                   ` (82 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ben Hutchings, Luis Henriques

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

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

From: Ben Hutchings <bhutchings@solarflare.com>

This bug fix is only for stable branches older than 3.10.  The bug was
fixed upstream by commit 2768935a4660 ('sfc: reuse pages to avoid DMA
mapping/unmapping costs'), but that change is totally unsuitable for
stable.

Commit b590ace09d51 ('sfc: Fix efx_rx_buf_offset() in the presence of
swiotlb') added an explicit page_offset member to struct
efx_rx_buffer, which must be set consistently with the u.page and
dma_addr fields.  However, it failed to add the necessary assignment
in efx_resurrect_rx_buffer().  It also did not correct the calculation
of efx_rx_buffer::dma_addr in efx_resurrect_rx_buffer(), which assumes
that DMA-mapping a page will result in a page-aligned DMA address
(exactly what swiotlb violates).

Add the assignment of efx_rx_buffer::page_offset and change the
calculation of dma_addr to make use of it.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/sfc/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index f8f7fc8..617e625 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -306,8 +306,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
 
 	index = rx_queue->added_count & rx_queue->ptr_mask;
 	new_buf = efx_rx_buffer(rx_queue, index);
-	new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
 	new_buf->u.page = rx_buf->u.page;
+	new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
+	new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
 	new_buf->len = rx_buf->len;
 	new_buf->flags = EFX_RX_BUF_PAGE;
 	++rx_queue->added_count;
-- 
1.8.3.2


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

* [PATCH 016/100] perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 015/100] sfc: Fix efx_rx_buf_offset() for recycled pages Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 017/100] perf: Fix perf_cgroup_switch for sw-events Luis Henriques
                   ` (81 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Zijlstra, Ingo Molnar, Li Zefan, Luis Henriques

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

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

From: Peter Zijlstra <a.p.zijlstra@chello.nl>

commit 3f1f33206c16c7b3839d71372bc2ac3f305aa802 upstream.

Stephane thought the perf_cpu_context::active_pmu name confusing and
suggested using 'unique_pmu' instead.

This pointer is a pointer to a 'random' pmu sharing the cpuctx
instance, therefore limiting a for_each_pmu loop to those where
cpuctx->unique_pmu matches the pmu we get a loop over unique cpuctx
instances.

Suggested-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-kxyjqpfj2fn9gt7kwu5ag9ks@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/perf_event.h |  2 +-
 kernel/events/core.c       | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c65c7d1..3faf0d4 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1065,7 +1065,7 @@ struct perf_cpu_context {
 	int				exclusive;
 	struct list_head		rotation_list;
 	int				jiffies_interval;
-	struct pmu			*active_pmu;
+	struct pmu			*unique_pmu;
 	struct perf_cgroup		*cgrp;
 };
 
diff --git a/kernel/events/core.c b/kernel/events/core.c
index dd815c3..b3a6de5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4331,7 +4331,7 @@ static void perf_event_task_event(struct perf_task_event *task_event)
 	rcu_read_lock();
 	list_for_each_entry_rcu(pmu, &pmus, entry) {
 		cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
-		if (cpuctx->active_pmu != pmu)
+		if (cpuctx->unique_pmu != pmu)
 			goto next;
 		perf_event_task_ctx(&cpuctx->ctx, task_event);
 
@@ -4477,7 +4477,7 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
 	rcu_read_lock();
 	list_for_each_entry_rcu(pmu, &pmus, entry) {
 		cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
-		if (cpuctx->active_pmu != pmu)
+		if (cpuctx->unique_pmu != pmu)
 			goto next;
 		perf_event_comm_ctx(&cpuctx->ctx, comm_event);
 
@@ -4673,7 +4673,7 @@ got_name:
 	rcu_read_lock();
 	list_for_each_entry_rcu(pmu, &pmus, entry) {
 		cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
-		if (cpuctx->active_pmu != pmu)
+		if (cpuctx->unique_pmu != pmu)
 			goto next;
 		perf_event_mmap_ctx(&cpuctx->ctx, mmap_event,
 					vma->vm_flags & VM_EXEC);
@@ -5748,8 +5748,8 @@ static void update_pmu_context(struct pmu *pmu, struct pmu *old_pmu)
 
 		cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu);
 
-		if (cpuctx->active_pmu == old_pmu)
-			cpuctx->active_pmu = pmu;
+		if (cpuctx->unique_pmu == old_pmu)
+			cpuctx->unique_pmu = pmu;
 	}
 }
 
@@ -5885,7 +5885,7 @@ skip_type:
 		cpuctx->ctx.pmu = pmu;
 		cpuctx->jiffies_interval = 1;
 		INIT_LIST_HEAD(&cpuctx->rotation_list);
-		cpuctx->active_pmu = pmu;
+		cpuctx->unique_pmu = pmu;
 	}
 
 got_cpu_context:
-- 
1.8.3.2


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

* [PATCH 017/100] perf: Fix perf_cgroup_switch for sw-events
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 016/100] perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 018/100] cfq: explicitly use 64bit divide operation for 64bit arguments Luis Henriques
                   ` (80 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Zijlstra, Ingo Molnar, Li Zefan, Luis Henriques

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

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

From: Peter Zijlstra <a.p.zijlstra@chello.nl>

commit 95cf59ea72331d0093010543b8951bb43f262cac upstream.

Jiri reported that he could trigger the WARN_ON_ONCE() in
perf_cgroup_switch() using sw-events. This is because sw-events share
a cpuctx with multiple PMUs.

Use the ->unique_pmu pointer to limit the pmu iteration to unique
cpuctx instances.

Reported-and-Tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-so7wi2zf3jjzrwcutm2mkz0j@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/events/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index b3a6de5..3ea14c1 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -368,6 +368,8 @@ void perf_cgroup_switch(struct task_struct *task, int mode)
 
 	list_for_each_entry_rcu(pmu, &pmus, entry) {
 		cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
+		if (cpuctx->unique_pmu != pmu)
+			continue; /* ensure we process each cpuctx once */
 
 		/*
 		 * perf_cgroup_events says at least one
@@ -391,9 +393,10 @@ void perf_cgroup_switch(struct task_struct *task, int mode)
 
 			if (mode & PERF_CGROUP_SWIN) {
 				WARN_ON_ONCE(cpuctx->cgrp);
-				/* set cgrp before ctxsw in to
-				 * allow event_filter_match() to not
-				 * have to pass task around
+				/*
+				 * set cgrp before ctxsw in to allow
+				 * event_filter_match() to not have to pass
+				 * task around
 				 */
 				cpuctx->cgrp = perf_cgroup_from_task(task);
 				cpu_ctx_sched_in(cpuctx, EVENT_ALL, task);
-- 
1.8.3.2


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

* [PATCH 018/100] cfq: explicitly use 64bit divide operation for 64bit arguments
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 017/100] perf: Fix perf_cgroup_switch for sw-events Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 019/100] perf tools: Handle JITed code in shared memory Luis Henriques
                   ` (79 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anatol Pomozov, Jens Axboe, Jonghwan Choi, Luis Henriques

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

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

From: Anatol Pomozov <anatol.pomozov@gmail.com>

commit f3cff25f05f2ac29b2ee355e611b0657482f6f1d upstream.

'samples' is 64bit operant, but do_div() second parameter is 32.
do_div silently truncates high 32 bits and calculated result
is invalid.

In case if low 32bit of 'samples' are zeros then do_div() produces
kernel crash.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Jonghwan Choi <jhbird.choi@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 block/cfq-iosched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index fb52df9..4d27120 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1484,7 +1484,7 @@ static u64 cfqg_prfill_avg_queue_size(struct seq_file *sf,
 
 	if (samples) {
 		v = blkg_stat_read(&cfqg->stats.avg_queue_size_sum);
-		do_div(v, samples);
+		v = div64_u64(v, samples);
 	}
 	__blkg_prfill_u64(sf, pd, v);
 	return 0;
-- 
1.8.3.2


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

* [PATCH 019/100] perf tools: Handle JITed code in shared memory
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 018/100] cfq: explicitly use 64bit divide operation for 64bit arguments Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 020/100] isofs: Refuse RW mount of the filesystem instead of making it RO Luis Henriques
                   ` (78 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andi Kleen, Arnaldo Carvalho de Melo, Vinson Lee, Luis Henriques

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

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

From: Andi Kleen <ak@linux.intel.com>

commit 89365e6c9ad4c0e090e4c6a4b67a3ce319381d89 upstream.

Need to check for /dev/zero.

Most likely more strings are missing too.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1366848182-30449-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/perf/util/map.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 81072b6..34d8298 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -16,6 +16,7 @@ const char *map_type__name[MAP__NR_TYPES] = {
 static inline int is_anon_memory(const char *filename)
 {
 	return !strcmp(filename, "//anon") ||
+	       !strcmp(filename, "/dev/zero (deleted)") ||
 	       !strcmp(filename, "/anon_hugepage (deleted)");
 }
 
-- 
1.8.3.2


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

* [PATCH 020/100] isofs: Refuse RW mount of the filesystem instead of making it RO
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 019/100] perf tools: Handle JITed code in shared memory Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 021/100] HID: Fix Speedlink VAD Cezanne support for some devices Luis Henriques
                   ` (77 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Luis Henriques

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

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

From: Jan Kara <jack@suse.cz>

commit 17b7f7cf58926844e1dd40f5eb5348d481deca6a upstream.

Refuse RW mount of isofs filesystem. So far we just silently changed it
to RO mount but when the media is writeable, block layer won't notice
this change and thus will think device is used RW and will block eject
button of the drive. That is unexpected by users because for
non-writeable media eject button works just fine.

Userspace mount(8) command handles this just fine and retries mounting
with MS_RDONLY set so userspace shouldn't see any regression.  Plus any
tool mounting isofs is likely confronted with the case of read-only
media where block layer already refuses to mount the filesystem without
MS_RDONLY set so our behavior shouldn't be anything new for it.

Reported-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/isofs/inode.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 29037c3..e92a342 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -119,8 +119,8 @@ static void destroy_inodecache(void)
 
 static int isofs_remount(struct super_block *sb, int *flags, char *data)
 {
-	/* we probably want a lot more here */
-	*flags |= MS_RDONLY;
+	if (!(*flags & MS_RDONLY))
+		return -EROFS;
 	return 0;
 }
 
@@ -769,15 +769,6 @@ root_found:
 	 */
 	s->s_maxbytes = 0x80000000000LL;
 
-	/*
-	 * The CDROM is read-only, has no nodes (devices) on it, and since
-	 * all of the files appear to be owned by root, we really do not want
-	 * to allow suid.  (suid or devices will not show up unless we have
-	 * Rock Ridge extensions)
-	 */
-
-	s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
-
 	/* Set this for reference. Its not currently used except on write
 	   which we don't have .. */
 
@@ -1536,6 +1527,9 @@ struct inode *isofs_iget(struct super_block *sb,
 static struct dentry *isofs_mount(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data)
 {
+	/* We don't support read-write mounts */
+	if (!(flags & MS_RDONLY))
+		return ERR_PTR(-EACCES);
 	return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
 }
 
-- 
1.8.3.2


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

* [PATCH 021/100] HID: Fix Speedlink VAD Cezanne support for some devices
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 020/100] isofs: Refuse RW mount of the filesystem instead of making it RO Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 022/100] HID: usbhid: quirk for N-Trig DuoSense Touch Screen Luis Henriques
                   ` (76 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stefan Kriwanek, Jiri Kosina, Luis Henriques

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

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

From: Stefan Kriwanek <dev@stefankriwanek.de>

commit 06bb5219118fb098f4b0c7dcb484b28a52bf1c14 upstream.

Some devices of the "Speedlink VAD Cezanne" model need more aggressive fixing
than already done.

I made sure through testing that this patch would not interfere with the proper
working of a device that is bug-free. (The driver drops EV_REL events with
abs(val) >= 256, which are not achievable even on the highest laser resolution
hardware setting.)

Signed-off-by: Stefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-speedlink.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-speedlink.c b/drivers/hid/hid-speedlink.c
index 6020137..2b03c9b 100644
--- a/drivers/hid/hid-speedlink.c
+++ b/drivers/hid/hid-speedlink.c
@@ -3,7 +3,7 @@
  *  Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from
  *  the HID descriptor.
  *
- *  Copyright (c) 2011 Stefan Kriwanek <mail@stefankriwanek.de>
+ *  Copyright (c) 2011, 2013 Stefan Kriwanek <dev@stefankriwanek.de>
  */
 
 /*
@@ -48,8 +48,13 @@ static int speedlink_event(struct hid_device *hdev, struct hid_field *field,
 		struct hid_usage *usage, __s32 value)
 {
 	/* No other conditions due to usage_table. */
-	/* Fix "jumpy" cursor (invalid events sent by device). */
-	if (value == 256)
+
+	/* This fixes the "jumpy" cursor occuring due to invalid events sent
+	 * by the device. Some devices only send them with value==+256, others
+	 * don't. However, catching abs(value)>=256 is restrictive enough not
+	 * to interfere with devices that were bug-free (has been tested).
+	 */
+	if (abs(value) >= 256)
 		return 1;
 	/* Drop useless distance 0 events (on button clicks etc.) as well */
 	if (value == 0)
-- 
1.8.3.2


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

* [PATCH 022/100] HID: usbhid: quirk for N-Trig DuoSense Touch Screen
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 021/100] HID: Fix Speedlink VAD Cezanne support for some devices Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 023/100] Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()" Luis Henriques
                   ` (75 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vasily Titskiy, Jiri Kosina, Luis Henriques

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

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

From: Vasily Titskiy <qehgt0@gmail.com>

commit 9e0bf92c223dabe0789714f8f85f6e26f8f9cda4 upstream.

The DuoSense touchscreen device causes a 10 second timeout. This fix
removes the delay.

Signed-off-by: Vasily Titskiy <qehgt0@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-ids.h           | 1 +
 drivers/hid/usbhid/hid-quirks.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 7561d73..16641fd 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -610,6 +610,7 @@
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16   0x0012
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17   0x0013
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18   0x0014
+#define USB_DEVICE_ID_NTRIG_DUOSENSE 0x1500
 
 #define USB_VENDOR_ID_ONTRAK		0x0a07
 #define USB_DEVICE_ID_ONTRAK_ADU100	0x0064
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 0401e3f..4c37560 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -106,6 +106,8 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
+	{ USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
+
 	{ 0, 0 }
 };
 
-- 
1.8.3.2


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

* [PATCH 023/100] Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()"
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 022/100] HID: usbhid: quirk for N-Trig DuoSense Touch Screen Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 024/100] workqueue: cond_resched() after processing each work item Luis Henriques
                   ` (74 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Miller, Michal Kubecek, Luis Henriques

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

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

From: Luis Henriques <luis.henriques@canonical.com>

This reverts commit 01ee5a524eaa7928e8ee1ae4a0051084cfcaf904 which is
commit f6e80abeab928b7c47cc1fbf53df13b4398a2bec upstream.

Michal Kubecek reported:

Please revert backports of mainline commit

   f6e80abe  sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()

 in stable branches before 3.7, in particular

   stable-3.0.y  b23270416da409bd4e637a5acbe31a1126235fb6  (v3.0.52)
   stable-3.4.y  c2f5b7507ac5d808f29287d77ee6148358d7fbfe  (v3.4.19)

 Mainline commit f6e80abe was introduced in v3.7-rc2 as a follow-up fix
 to commit

   edfee033  sctp: check src addr when processing SACK to update transport state

 (from v3.7-rc1) which changed the interpretation of third argument to
 sctp_cmd_process_sack() and sctp_outq_sack(). But as commit edfee033 has
 never been backported to stable branches, backport of commit f6e80abe
 actually breaks the code rather than fixing it.

Cc: David Miller <davem@redhat.com>
Cc: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/sm_sideeffect.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index c461b1c..8716da1 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1609,9 +1609,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
 					asoc->outqueue.outstanding_bytes;
 			sackh.num_gap_ack_blocks = 0;
 			sackh.num_dup_tsns = 0;
-			chunk->subh.sack_hdr = &sackh;
 			sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK,
-					SCTP_CHUNK(chunk));
+					SCTP_SACKH(&sackh));
 			break;
 
 		case SCTP_CMD_DISCARD_PACKET:
-- 
1.8.3.2


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

* [PATCH 024/100] workqueue: cond_resched() after processing each work item
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 023/100] Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()" Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 025/100] cgroup: fail if monitored file and event_control are in different cgroup Luis Henriques
                   ` (73 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Luis Henriques

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

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

From: Tejun Heo <tj@kernel.org>

commit b22ce2785d97423846206cceec4efee0c4afd980 upstream.

If !PREEMPT, a kworker running work items back to back can hog CPU.
This becomes dangerous when a self-requeueing work item which is
waiting for something to happen races against stop_machine.  Such
self-requeueing work item would requeue itself indefinitely hogging
the kworker and CPU it's running on while stop_machine would wait for
that CPU to enter stop_machine while preventing anything else from
happening on all other CPUs.  The two would deadlock.

Jamie Liu reports that this deadlock scenario exists around
scsi_requeue_run_queue() and libata port multiplier support, where one
port may exclude command processing from other ports.  With the right
timing, scsi_requeue_run_queue() can end up requeueing itself trying
to execute an IO which is asked to be retried while another device has
an exclusive access, which in turn can't make forward progress due to
stop_machine.

Fix it by invoking cond_resched() after executing each work item.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Jamie Liu <jamieliu@google.com>
References: http://thread.gmane.org/gmane.linux.kernel/1552567
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/workqueue.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0395ca8..89743ae 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1920,6 +1920,15 @@ __acquires(&gcwq->lock)
 		dump_stack();
 	}
 
+	/*
+	 * The following prevents a kworker from hogging CPU on !PREEMPT
+	 * kernels, where a requeueing work item waiting for something to
+	 * happen could deadlock with stop_machine as such work item could
+	 * indefinitely requeue itself while all other CPUs are trapped in
+	 * stop_machine.
+	 */
+	cond_resched();
+
 	spin_lock_irq(&gcwq->lock);
 
 	/* clear cpu intensive status */
-- 
1.8.3.2


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

* [PATCH 025/100] cgroup: fail if monitored file and event_control are in different cgroup
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 024/100] workqueue: cond_resched() after processing each work item Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 026/100] tg3: Don't turn off led on 5719 serdes port 0 Luis Henriques
                   ` (72 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Li Zefan, Tejun Heo, Weng Meiling, Luis Henriques

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

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

From: Li Zefan <lizefan@huawei.com>

commit f169007b2773f285e098cb84c74aac0154d65ff7 upstream.

If we pass fd of memory.usage_in_bytes of cgroup A to cgroup.event_control
of cgroup B, then we won't get memory usage notification from A but B!

What's worse, if A and B are in different mount hierarchy, we'll end up
accessing NULL pointer!

Disallow this kind of invalid usage.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Weng Meiling <wengmeiling.weng@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/cgroup.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3b3fa5b..7720f52 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3712,6 +3712,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
 				      const char *buffer)
 {
 	struct cgroup_event *event = NULL;
+	struct cgroup *cgrp_cfile;
 	unsigned int efd, cfd;
 	struct file *efile = NULL;
 	struct file *cfile = NULL;
@@ -3767,6 +3768,16 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
 		goto fail;
 	}
 
+	/*
+	 * The file to be monitored must be in the same cgroup as
+	 * cgroup.event_control is.
+	 */
+	cgrp_cfile = __d_cgrp(cfile->f_dentry->d_parent);
+	if (cgrp_cfile != cgrp) {
+		ret = -EINVAL;
+		goto fail;
+	}
+
 	if (!event->cft->register_event || !event->cft->unregister_event) {
 		ret = -EINVAL;
 		goto fail;
-- 
1.8.3.2


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

* [PATCH 026/100] tg3: Don't turn off led on 5719 serdes port 0
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 025/100] cgroup: fail if monitored file and event_control are in different cgroup Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 027/100] tg3: Expand led off fix to include 5720 Luis Henriques
                   ` (71 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nithin Nayak Sujir, Michael Chan, David S. Miller, Luis Henriques

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

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

From: Nithin Sujir <nsujir@broadcom.com>

commit 989038e217e94161862a959e82f9a1ecf8dda152 upstream.

Turning off led on port 0 of the 5719 serdes causes all other ports to
lose power and stop functioning. Add tg3_phy_led_bug() function to check
for this condition. We use a switch() in tg3_phy_led_bug() for
consistency with the tg3_phy_power_bug() function.

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>
[ luis: backported to 3.5:
  - use GET_ASIC_REV() macro instead of tg3_asic_rev() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 504b4f0..5e01182 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -2783,6 +2783,19 @@ static bool tg3_phy_power_bug(struct tg3 *tp)
 	return false;
 }
 
+static bool tg3_phy_led_bug(struct tg3 *tp)
+{
+	switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
+	case ASIC_REV_5719:
+		if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
+		    !tp->pci_fn)
+			return true;
+		return false;
+	}
+
+	return false;
+}
+
 static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
 {
 	u32 val;
@@ -2827,8 +2840,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
 		}
 		return;
 	} else if (do_low_power) {
-		tg3_writephy(tp, MII_TG3_EXT_CTRL,
-			     MII_TG3_EXT_CTRL_FORCE_LED_OFF);
+		if (!tg3_phy_led_bug(tp))
+			tg3_writephy(tp, MII_TG3_EXT_CTRL,
+				     MII_TG3_EXT_CTRL_FORCE_LED_OFF);
 
 		val = MII_TG3_AUXCTL_PCTL_100TX_LPWR |
 		      MII_TG3_AUXCTL_PCTL_SPR_ISOLATE |
-- 
1.8.3.2


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

* [PATCH 027/100] tg3: Expand led off fix to include 5720
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 026/100] tg3: Don't turn off led on 5719 serdes port 0 Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 028/100] cciss: fix info leak in cciss_ioctl32_passthru() Luis Henriques
                   ` (70 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nithin Nayak Sujir, Michael Chan, David S. Miller, Luis Henriques

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

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

From: Nithin Sujir <nsujir@broadcom.com>

commit 300cf9b93f74c3d969a0ad50bdac65416107c44c upstream.

Commit 989038e217e94161862a959e82f9a1ecf8dda152 ("tg3: Don't turn off
led on 5719 serdes port 0") added code to skip turning led off on port
0 of the 5719 since it powered down other ports. This workaround needs
to be enabled on the 5720 as well.

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: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 5e01182..18657a9 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -2787,6 +2787,7 @@ static bool tg3_phy_led_bug(struct tg3 *tp)
 {
 	switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
 	case ASIC_REV_5719:
+	case ASIC_REV_5720:
 		if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
 		    !tp->pci_fn)
 			return true;
-- 
1.8.3.2


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

* [PATCH 028/100] cciss: fix info leak in cciss_ioctl32_passthru()
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 027/100] tg3: Expand led off fix to include 5720 Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:40 ` [PATCH 029/100] cpqarray: fix info leak in ida_locked_ioctl() Luis Henriques
                   ` (69 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 58f09e00ae095e46ef9edfcf3a5fd9ccdfad065e upstream.

The arg64 struct has a hole after ->buf_size which isn't cleared.  Or if
any of the calls to copy_from_user() fail then that would cause an
information leak as well.

This was assigned CVE-2013-2147.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/block/cciss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index d3446f6..d7ad865 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1186,6 +1186,7 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |=
 	    copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
-- 
1.8.3.2


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

* [PATCH 029/100] cpqarray: fix info leak in ida_locked_ioctl()
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 028/100] cciss: fix info leak in cciss_ioctl32_passthru() Luis Henriques
@ 2013-10-11 10:40 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 030/100] mm, memcg: give exiting processes access to memory reserves Luis Henriques
                   ` (68 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:40 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 627aad1c01da6f881e7f98d71fd928ca0c316b1a upstream.

The pciinfo struct has a two byte hole after ->dev_fn so stack
information could be leaked to the user.

This was assigned CVE-2013-2147.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/block/cpqarray.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 9125bbe..504bc16 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -1195,6 +1195,7 @@ out_passthru:
 		ida_pci_info_struct pciinfo;
 
 		if (!arg) return -EINVAL;
+		memset(&pciinfo, 0, sizeof(pciinfo));
 		pciinfo.bus = host->pci_dev->bus->number;
 		pciinfo.dev_fn = host->pci_dev->devfn;
 		pciinfo.board_id = host->board_id;
-- 
1.8.3.2


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

* [PATCH 030/100] mm, memcg: give exiting processes access to memory reserves
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2013-10-11 10:40 ` [PATCH 029/100] cpqarray: fix info leak in ida_locked_ioctl() Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 031/100] video: mxsfb: Add missing break Luis Henriques
                   ` (67 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Rientjes, Andrew Morton, Linus Torvalds, Qiang Huang,
	Luis Henriques

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

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

From: David Rientjes <rientjes@google.com>

commit 465adcf1ea7b2e49b2e0899366624f5532b64012 upstream.

A memcg may livelock when oom if the process that grabs the hierarchy's
oom lock is never the first process with PF_EXITING set in the memcg's
task iteration.

The oom killer, both global and memcg, will defer if it finds an
eligible process that is in the process of exiting and it is not being
ptraced.  The idea is to allow it to exit without using memory reserves
before needlessly killing another process.

This normally works fine except in the memcg case with a large number of
threads attached to the oom memcg.  In this case, the memcg oom killer
only gets called for the process that grabs the hierarchy's oom lock;
all others end up blocked on the memcg's oom waitqueue.  Thus, if the
process that grabs the hierarchy's oom lock is never the first
PF_EXITING process in the memcg's task iteration, the oom killer is
constantly deferred without anything making progress.

The fix is to give PF_EXITING processes access to memory reserves so
that we've marked them as oom killed without any iteration.  This allows
__mem_cgroup_try_charge() to succeed so that the process may exit.  This
makes the memcg oom killer exemption for TIF_MEMDIE tasks, now
immediately granted for processes with pending SIGKILLs and those in the
exit path, to be equivalent to what is done for the global oom killer.

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[Qiang: backported to 3.4:
 - move the changes from memcontrol.c to oom_kill.c]
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/oom_kill.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index ac300c9..b45c813 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -549,11 +549,11 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
 	struct task_struct *p;
 
 	/*
-	 * If current has a pending SIGKILL, then automatically select it.  The
-	 * goal is to allow it to allocate so that it may quickly exit and free
-	 * its memory.
+	 * If current has a pending SIGKILL or is exiting, then automatically
+	 * select it.  The goal is to allow it to allocate so that it may
+	 * quickly exit and free its memory.
 	 */
-	if (fatal_signal_pending(current)) {
+	if (fatal_signal_pending(current) || current->flags & PF_EXITING) {
 		set_thread_flag(TIF_MEMDIE);
 		return;
 	}
-- 
1.8.3.2


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

* [PATCH 031/100] video: mxsfb: Add missing break
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 030/100] mm, memcg: give exiting processes access to memory reserves Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 032/100] xhci: Fix race between ep halt and URB cancellation Luis Henriques
                   ` (66 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marek Vasut, Fabio Estevam, Shawn Guo, Tomi Valkeinen,
	Luis Henriques

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

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

From: Marek Vasut <marex@denx.de>

commit 6d0bb818041a02be682abadb3ba35ff608f7d60a upstream.

Add missing break into the restore function.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/video/mxsfb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index fc2c4381..dc7b4fc 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -616,6 +616,7 @@ static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
 		break;
 	case 3:
 		bits_per_pixel = 32;
+		break;
 	case 1:
 	default:
 		return -EINVAL;
-- 
1.8.3.2


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

* [PATCH 032/100] xhci: Fix race between ep halt and URB cancellation
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 031/100] video: mxsfb: Add missing break Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 033/100] serial: pch_uart: fix tty-kref leak in rx-error path Luis Henriques
                   ` (65 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Florian Wolter, Sarah Sharp, Jonghwan Choi, Luis Henriques

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

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

From: Florian Wolter <wolly84@web.de>

commit 526867c3ca0caa2e3e846cb993b0f961c33c2abb upstream.

The halted state of a endpoint cannot be cleared over CLEAR_HALT from a
user process, because the stopped_td variable was overwritten in the
handle_stopped_endpoint() function. So the xhci_endpoint_reset() function will
refuse the reset and communication with device can not run over this endpoint.
https://bugzilla.kernel.org/show_bug.cgi?id=60699

Signed-off-by: Florian Wolter <wolly84@web.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-ring.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 37cecce..36d1290 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -847,8 +847,12 @@ remove_finished_td:
 		/* Otherwise ring the doorbell(s) to restart queued transfers */
 		ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
 	}
-	ep->stopped_td = NULL;
-	ep->stopped_trb = NULL;
+
+	/* Clear stopped_td and stopped_trb if endpoint is not halted */
+	if (!(ep->ep_state & EP_HALTED)) {
+		ep->stopped_td = NULL;
+		ep->stopped_trb = NULL;
+	}
 
 	/*
 	 * Drop the lock and complete the URBs in the cancelled TD list.
-- 
1.8.3.2


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

* [PATCH 033/100] serial: pch_uart: fix tty-kref leak in rx-error path
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 032/100] xhci: Fix race between ep halt and URB cancellation Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 034/100] serial: pch_uart: fix tty-kref leak in dma-rx path Luis Henriques
                   ` (64 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques

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

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

From: Johan Hovold <jhovold@gmail.com>

commit fc0919c68cb2f75bb1af759315f9d7e2a9443c28 upstream.

Fix tty-kref leak introduced by commit 384e301e ("pch_uart: fix a
deadlock when pch_uart as console") which never put its tty reference.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/pch_uart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 4798e94..9e97a39 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1064,6 +1064,8 @@ static void pch_uart_err_ir(struct eg20t_port *priv, unsigned int lsr)
 	if (tty == NULL) {
 		for (i = 0; error_msg[i] != NULL; i++)
 			dev_err(&priv->pdev->dev, error_msg[i]);
+	} else {
+		tty_kref_put(tty);
 	}
 }
 
-- 
1.8.3.2


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

* [PATCH 034/100] serial: pch_uart: fix tty-kref leak in dma-rx path
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 033/100] serial: pch_uart: fix tty-kref leak in rx-error path Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 035/100] x86, efi: Don't map Boot Services on i386 Luis Henriques
                   ` (63 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques

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

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

From: Johan Hovold <jhovold@gmail.com>

commit 19b85cfb190eb9980eaf416bff96aef4159a430e upstream.

Fix tty_kref leak when tty_buffer_request room fails in dma-rx path.

Note that the tty ref isn't really needed anymore, but as the leak has
always been there, fixing it before removing should makes it easier to
backport the fix.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/pch_uart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 9e97a39..206c58c 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -643,11 +643,12 @@ static int dma_push_rx(struct eg20t_port *priv, int size)
 		dev_warn(port->dev, "Rx overrun: dropping %u bytes\n",
 			 size - room);
 	if (!room)
-		return room;
+		goto out;
 
 	tty_insert_flip_string(tty, sg_virt(&priv->sg_rx), size);
 
 	port->icount.rx += room;
+out:
 	tty_kref_put(tty);
 
 	return room;
-- 
1.8.3.2


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

* [PATCH 035/100] x86, efi: Don't map Boot Services on i386
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 034/100] serial: pch_uart: fix tty-kref leak in dma-rx path Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 036/100] ALSA: compress: Fix compress device unregister Luis Henriques
                   ` (62 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Josh Triplett, Matthew Garrett, H. Peter Anvin, Ingo Molnar,
	Thomas Gleixner, Greg Kroah-Hartman, Josh Boyer, Matt Fleming,
	Luis Henriques

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

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

From: Josh Boyer <jwboyer@redhat.com>

commit 700870119f49084da004ab588ea2b799689efaf7 upstream.

Add patch to fix 32bit EFI service mapping (rhbz 726701)

Multiple people are reporting hitting the following WARNING on i386,

  WARNING: at arch/x86/mm/ioremap.c:102 __ioremap_caller+0x3d3/0x440()
  Modules linked in:
  Pid: 0, comm: swapper Not tainted 3.9.0-rc7+ #95
  Call Trace:
   [<c102b6af>] warn_slowpath_common+0x5f/0x80
   [<c1023fb3>] ? __ioremap_caller+0x3d3/0x440
   [<c1023fb3>] ? __ioremap_caller+0x3d3/0x440
   [<c102b6ed>] warn_slowpath_null+0x1d/0x20
   [<c1023fb3>] __ioremap_caller+0x3d3/0x440
   [<c106007b>] ? get_usage_chars+0xfb/0x110
   [<c102d937>] ? vprintk_emit+0x147/0x480
   [<c1418593>] ? efi_enter_virtual_mode+0x1e4/0x3de
   [<c102406a>] ioremap_cache+0x1a/0x20
   [<c1418593>] ? efi_enter_virtual_mode+0x1e4/0x3de
   [<c1418593>] efi_enter_virtual_mode+0x1e4/0x3de
   [<c1407984>] start_kernel+0x286/0x2f4
   [<c1407535>] ? repair_env_string+0x51/0x51
   [<c1407362>] i386_start_kernel+0x12c/0x12f

Due to the workaround described in commit 916f676f8 ("x86, efi: Retain
boot service code until after switching to virtual mode") EFI Boot
Service regions are mapped for a period during boot. Unfortunately, with
the limited size of the i386 direct kernel map it's possible that some
of the Boot Service regions will not be directly accessible, which
causes them to be ioremap()'d, triggering the above warning as the
regions are marked as E820_RAM in the e820 memmap.

There are currently only two situations where we need to map EFI Boot
Service regions,

  1. To workaround the firmware bug described in 916f676f8
  2. To access the ACPI BGRT image

but since we haven't seen an i386 implementation that requires either,
this simple fix should suffice for now.

[ Added to changelog - Matt ]

Reported-by: Bryan O'Donoghue <bryan.odonoghue.lkml@nexus-software.ie>
Acked-by: Tom Zanussi <tom.zanussi@intel.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/platform/efi/efi.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index ca4e1ad..cfe8b9c 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -861,10 +861,13 @@ void __init efi_enter_virtual_mode(void)
 
 	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
 		md = p;
-		if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
-		    md->type != EFI_BOOT_SERVICES_CODE &&
-		    md->type != EFI_BOOT_SERVICES_DATA)
-			continue;
+		if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
+#ifdef CONFIG_X86_64
+			if (md->type != EFI_BOOT_SERVICES_CODE &&
+			    md->type != EFI_BOOT_SERVICES_DATA)
+#endif
+				continue;
+		}
 
 		size = md->num_pages << EFI_PAGE_SHIFT;
 		end = md->phys_addr + size;
-- 
1.8.3.2


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

* [PATCH 036/100] ALSA: compress: Fix compress device unregister.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 035/100] x86, efi: Don't map Boot Services on i386 Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 037/100] dm snapshot: workaround for a false positive lockdep warning Luis Henriques
                   ` (61 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Liam Girdwood, Takashi Iwai, Luis Henriques

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

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

From: Liam Girdwood <liam.r.girdwood@linux.intel.com>

commit 4028b6c4c03f213260e9290ff3a6b5439aad07ce upstream.

snd_unregister_device() should return the device type and not stream
direction.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/core/compress_offload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 956c75d..794f37a 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -665,7 +665,8 @@ static int snd_compress_dev_disconnect(struct snd_device *device)
 	struct snd_compr *compr;
 
 	compr = device->device_data;
-	snd_unregister_device(compr->direction, compr->card, compr->device);
+	snd_unregister_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card,
+		compr->device);
 	return 0;
 }
 
-- 
1.8.3.2


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

* [PATCH 037/100] dm snapshot: workaround for a false positive lockdep warning
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 036/100] ALSA: compress: Fix compress device unregister Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 038/100] dm-snapshot: fix performance degradation due to small hash size Luis Henriques
                   ` (60 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Mike Snitzer, Luis Henriques

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit 5ea330a75bd86b2b2a01d7b85c516983238306fb upstream.

The kernel reports a lockdep warning if a snapshot is invalidated because
it runs out of space.

The lockdep warning was triggered by commit 0976dfc1d0cd80a4e9dfaf87bd87
("workqueue: Catch more locking problems with flush_work()") in v3.5.

The warning is false positive.  The real cause for the warning is that
the lockdep engine treats different instances of md->lock as a single
lock.

This patch is a workaround - we use flush_workqueue instead of flush_work.
This code path is not performance sensitive (it is called only on
initialization or invalidation), thus it doesn't matter that we flush the
whole workqueue.

The real fix for the problem would be to teach the lockdep engine to treat
different instances of md->lock as separate locks.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/dm-snap-persistent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 3ac4156..4caa8e6 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -256,7 +256,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
 	 */
 	INIT_WORK_ONSTACK(&req.work, do_metadata);
 	queue_work(ps->metadata_wq, &req.work);
-	flush_work(&req.work);
+	flush_workqueue(ps->metadata_wq);
 
 	return req.result;
 }
-- 
1.8.3.2


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

* [PATCH 038/100] dm-snapshot: fix performance degradation due to small hash size
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 037/100] dm snapshot: workaround for a false positive lockdep warning Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 039/100] x86/reboot: Add quirk to make Dell C6100 use reboot=pci automatically Luis Henriques
                   ` (59 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Mike Snitzer, Luis Henriques

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit 60e356f381954d79088d0455e357db48cfdd6857 upstream.

LVM2, since version 2.02.96, creates origin with zero size, then loads
the snapshot driver and then loads the origin.  Consequently, the
snapshot driver sees the origin size zero and sets the hash size to the
lower bound 64.  Such small hash table causes performance degradation.

This patch changes it so that the hash size is determined by the size of
snapshot volume, not minimum of origin and snapshot size.  It doesn't
make sense to set the snapshot size significantly larger than the origin
size, so we do not need to take origin size into account when
calculating the hash size.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/dm-snap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 8bd2d5f..330bfd6 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -721,17 +721,16 @@ static int calc_max_buckets(void)
  */
 static int init_hash_tables(struct dm_snapshot *s)
 {
-	sector_t hash_size, cow_dev_size, origin_dev_size, max_buckets;
+	sector_t hash_size, cow_dev_size, max_buckets;
 
 	/*
 	 * Calculate based on the size of the original volume or
 	 * the COW volume...
 	 */
 	cow_dev_size = get_dev_size(s->cow->bdev);
-	origin_dev_size = get_dev_size(s->origin->bdev);
 	max_buckets = calc_max_buckets();
 
-	hash_size = min(origin_dev_size, cow_dev_size) >> s->store->chunk_shift;
+	hash_size = cow_dev_size >> s->store->chunk_shift;
 	hash_size = min(hash_size, max_buckets);
 
 	if (hash_size < 64)
-- 
1.8.3.2


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

* [PATCH 039/100] x86/reboot: Add quirk to make Dell C6100 use reboot=pci automatically
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 038/100] dm-snapshot: fix performance degradation due to small hash size Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 040/100] drm/radeon: disable tests/benchmarks if accel is disabled Luis Henriques
                   ` (58 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Masoud Sharbiani, Vinson Lee, Robin Holt, Russell King,
	Guan Xuetao, Ingo Molnar, Luis Henriques

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

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

From: Masoud Sharbiani <msharbiani@twitter.com>

commit 4f0acd31c31f03ba42494c8baf6c0465150e2621 upstream.

Dell PowerEdge C6100 machines fail to completely reboot about 20% of the time.

Signed-off-by: Masoud Sharbiani <msharbiani@twitter.com>
Signed-off-by: Vinson Lee <vlee@twitter.com>
Cc: Robin Holt <holt@sgi.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Link: http://lkml.kernel.org/r/1379717947-18042-1-git-send-email-vlee@freedesktop.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/reboot.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 2a29384..d1ef8a7 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -459,6 +459,22 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
 		},
 	},
+	{	/* Handle problems with rebooting on the Dell PowerEdge C6100. */
+		.callback = set_pci_reboot,
+		.ident = "Dell PowerEdge C6100",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
+		},
+	},
+	{	/* Some C6100 machines were shipped with vendor being 'Dell'. */
+		.callback = set_pci_reboot,
+		.ident = "Dell PowerEdge C6100",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
+		},
+	},
 	{ }
 };
 
-- 
1.8.3.2


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

* [PATCH 040/100] drm/radeon: disable tests/benchmarks if accel is disabled
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 039/100] x86/reboot: Add quirk to make Dell C6100 use reboot=pci automatically Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 041/100] xhci: Fix oops happening after address device timeout Luis Henriques
                   ` (57 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 4a1132a023eb48cf10522d84c5908d43b612c041 upstream.

The tests are only usable if the acceleration engines have
been successfully initialized.

Based on an initial patch from: Alex Ivanov <gnidorah@p0n4ik.tk>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_device.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index d14044e..719702d1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -834,13 +834,22 @@ int radeon_device_init(struct radeon_device *rdev,
 			return r;
 	}
 	if ((radeon_testing & 1)) {
-		radeon_test_moves(rdev);
+		if (rdev->accel_working)
+			radeon_test_moves(rdev);
+		else
+			DRM_INFO("radeon: acceleration disabled, skipping move tests\n");
 	}
 	if ((radeon_testing & 2)) {
-		radeon_test_syncing(rdev);
+		if (rdev->accel_working)
+			radeon_test_syncing(rdev);
+		else
+			DRM_INFO("radeon: acceleration disabled, skipping sync tests\n");
 	}
 	if (radeon_benchmarking) {
-		radeon_benchmark(rdev, radeon_benchmarking);
+		if (rdev->accel_working)
+			radeon_benchmark(rdev, radeon_benchmarking);
+		else
+			DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
 	}
 	return 0;
 }
-- 
1.8.3.2


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

* [PATCH 041/100] xhci: Fix oops happening after address device timeout
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 040/100] drm/radeon: disable tests/benchmarks if accel is disabled Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 042/100] xhci: Ensure a command structure points to the correct trb on the command ring Luis Henriques
                   ` (56 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Sarah Sharp, Luis Henriques

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit 284d20552461466b04d6bfeafeb1c47a8891b591 upstream.

When a command times out, the command ring is first aborted,
and then stopped. If the command ring is empty when it is stopped
the stop event will point to next command which is not yet set.
xHCI tries to handle this next event often causing an oops.

Don't handle command completion events on stopped cmd ring if ring is
empty.

This patch should be backported to kernels as old as 3.7, that contain
the commit b92cc66c047ff7cf587b318fe377061a353c120f "xHCI: add aborting
command ring function"

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Reported-by: Giovanni <giovanni.nervi@yahoo.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-ring.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 36d1290..2c4df52 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1394,6 +1394,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
 			inc_deq(xhci, xhci->cmd_ring);
 			return;
 		}
+		/* There is no command to handle if we get a stop event when the
+		 * command ring is empty, event->cmd_trb points to the next
+		 * unset command
+		 */
+		if (xhci->cmd_ring->dequeue == xhci->cmd_ring->enqueue)
+			return;
 	}
 
 	switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3])
-- 
1.8.3.2


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

* [PATCH 042/100] xhci: Ensure a command structure points to the correct trb on the command ring
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 041/100] xhci: Fix oops happening after address device timeout Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 043/100] drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER Luis Henriques
                   ` (55 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Sarah Sharp, Luis Henriques

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit ec7e43e2d98173483866fe2e4e690143626b659c upstream.

If a command on the command ring needs to be cancelled before it is handled
it can be turned to a no-op operation when the ring is stopped.
We want to store the command ring enqueue pointer in the command structure
when the command in enqueued for the cancellation case.

Some commands used to store the command ring dequeue pointers instead of enqueue
(these often worked because enqueue happends to equal dequeue quite often)

Other commands correctly used the enqueue pointer but did not check if it pointed
to a valid trb or a link trb, this caused for example stop endpoint command to timeout in
xhci_stop_device() in about 2% of suspend/resume cases.

This should also solve some weird behavior happening in command cancellation cases.

This patch is based on a patch submitted by Sarah Sharp to linux-usb, but
then forgotten:
    http://marc.info/?l=linux-usb&m=136269803207465&w=2

This patch should be backported to kernels as old as 3.7, that contain
the commit b92cc66c047ff7cf587b318fe377061a353c120f "xHCI: add aborting
command ring function"

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-hub.c  |  2 +-
 drivers/usb/host/xhci-ring.c | 10 ++++++++++
 drivers/usb/host/xhci.c      | 25 +++++--------------------
 drivers/usb/host/xhci.h      |  1 +
 4 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 7534bb4..b83a7b8 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -287,7 +287,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
 		if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue)
 			xhci_queue_stop_endpoint(xhci, slot_id, i, suspend);
 	}
-	cmd->command_trb = xhci->cmd_ring->enqueue;
+	cmd->command_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 	list_add_tail(&cmd->cmd_list, &virt_dev->cmd_list);
 	xhci_queue_stop_endpoint(xhci, slot_id, 0, suspend);
 	xhci_ring_cmd_db(xhci);
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 2c4df52..fde2282 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -122,6 +122,16 @@ static int enqueue_is_link_trb(struct xhci_ring *ring)
 	return TRB_TYPE_LINK_LE32(link->control);
 }
 
+union xhci_trb *xhci_find_next_enqueue(struct xhci_ring *ring)
+{
+	/* Enqueue pointer can be left pointing to the link TRB,
+	 * we must handle that
+	 */
+	if (TRB_TYPE_LINK_LE32(ring->enqueue->link.control))
+		return ring->enq_seg->next->trbs;
+	return ring->enqueue;
+}
+
 /* Updates trb to point to the next TRB in the ring, and updates seg if the next
  * TRB is in a new segment.  This does not skip over link TRBs, and it does not
  * effect the ring dequeue or enqueue pointers.
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2acae4d..eb31daa 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2582,15 +2582,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
 	if (command) {
 		cmd_completion = command->completion;
 		cmd_status = &command->status;
-		command->command_trb = xhci->cmd_ring->enqueue;
-
-		/* Enqueue pointer can be left pointing to the link TRB,
-		 * we must handle that
-		 */
-		if (TRB_TYPE_LINK_LE32(command->command_trb->link.control))
-			command->command_trb =
-				xhci->cmd_ring->enq_seg->next->trbs;
-
+		command->command_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 		list_add_tail(&command->cmd_list, &virt_dev->cmd_list);
 	} else {
 		cmd_completion = &virt_dev->cmd_completion;
@@ -2598,7 +2590,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
 	}
 	init_completion(cmd_completion);
 
-	cmd_trb = xhci->cmd_ring->dequeue;
+	cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 	if (!ctx_change)
 		ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma,
 				udev->slot_id, must_succeed);
@@ -3383,14 +3375,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
 
 	/* Attempt to submit the Reset Device command to the command ring */
 	spin_lock_irqsave(&xhci->lock, flags);
-	reset_device_cmd->command_trb = xhci->cmd_ring->enqueue;
-
-	/* Enqueue pointer can be left pointing to the link TRB,
-	 * we must handle that
-	 */
-	if (TRB_TYPE_LINK_LE32(reset_device_cmd->command_trb->link.control))
-		reset_device_cmd->command_trb =
-			xhci->cmd_ring->enq_seg->next->trbs;
+	reset_device_cmd->command_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 
 	list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list);
 	ret = xhci_queue_reset_device(xhci, slot_id);
@@ -3594,7 +3579,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
 	union xhci_trb *cmd_trb;
 
 	spin_lock_irqsave(&xhci->lock, flags);
-	cmd_trb = xhci->cmd_ring->dequeue;
+	cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 	ret = xhci_queue_slot_control(xhci, TRB_ENABLE_SLOT, 0);
 	if (ret) {
 		spin_unlock_irqrestore(&xhci->lock, flags);
@@ -3721,7 +3706,7 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
 	xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
 
 	spin_lock_irqsave(&xhci->lock, flags);
-	cmd_trb = xhci->cmd_ring->dequeue;
+	cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring);
 	ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma,
 					udev->slot_id);
 	if (ret) {
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 30c3a1d..9a97918 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1819,6 +1819,7 @@ int xhci_cancel_cmd(struct xhci_hcd *xhci, struct xhci_command *command,
 		union xhci_trb *cmd_trb);
 void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
 		unsigned int ep_index, unsigned int stream_id);
+union xhci_trb *xhci_find_next_enqueue(struct xhci_ring *ring);
 
 /* xHCI roothub code */
 void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
-- 
1.8.3.2


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

* [PATCH 043/100] drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 042/100] xhci: Ensure a command structure points to the correct trb on the command ring Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 044/100] staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier Luis Henriques
                   ` (54 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jani Nikula, Daniel Vetter, Luis Henriques

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

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

From: Jani Nikula <jani.nikula@intel.com>

commit 8d16f258217f2f583af1fd57c5144aa4bbe73e48 upstream.

There is no clear cut rules or specs for the retry interval, as there
are many factors that affect overall response time. Increase the
interval, and even more so on branch devices which may have limited i2c
bit rates.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reference: https://bugs.freedesktop.org/show_bug.cgi?id=60263
Tested-by: Nicolas Suzor <nic@suzor.com>
Reviewed-by: Todd Previte <tprevite@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b6f6963..0224d43 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -631,7 +631,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
 			DRM_DEBUG_KMS("aux_ch native nack\n");
 			return -EREMOTEIO;
 		case AUX_NATIVE_REPLY_DEFER:
-			udelay(100);
+			/*
+			 * For now, just give more slack to branch devices. We
+			 * could check the DPCD for I2C bit rate capabilities,
+			 * and if available, adjust the interval. We could also
+			 * be more careful with DP-to-Legacy adapters where a
+			 * long legacy cable may force very low I2C bit rates.
+			 */
+			if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+			    DP_DWN_STRM_PORT_PRESENT)
+				usleep_range(500, 600);
+			else
+				usleep_range(300, 400);
 			continue;
 		default:
 			DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
-- 
1.8.3.2


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

* [PATCH 044/100] staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 043/100] drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 045/100] USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd Luis Henriques
                   ` (53 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Malcolm Priestley, Greg Kroah-Hartman, Luis Henriques

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

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

From: Malcolm Priestley <tvboxspy@gmail.com>

commit e3eb270fab7734427dd8171a93e4946fe28674bc upstream.

The vt6656 is prone to resetting on the usb bus.

It seems there is a race condition and wpa supplicant is
trying to open the device via iw_handlers before its actually
closed at a stage that the buffers are being removed.

The device is longer considered open when the
buffers are being removed. So move ~DEVICE_FLAGS_OPENED
flag to before freeing the device buffers.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/vt6656/main_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index fa6dbe0..c829863 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1220,6 +1220,8 @@ device_release_WPADEV(pDevice);
     memset(pMgmt->abyCurrBSSID, 0, 6);
     pMgmt->eCurrState = WMAC_STATE_IDLE;
 
+	pDevice->flags &= ~DEVICE_FLAGS_OPENED;
+
     device_free_tx_bufs(pDevice);
     device_free_rx_bufs(pDevice);
     device_free_int_bufs(pDevice);
@@ -1231,7 +1233,6 @@ device_release_WPADEV(pDevice);
     usb_free_urb(pDevice->pInterruptURB);
 
     BSSvClearNodeDBTable(pDevice, 0);
-    pDevice->flags &=(~DEVICE_FLAGS_OPENED);
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");
 
-- 
1.8.3.2


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

* [PATCH 045/100] USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 044/100] staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 046/100] usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit Luis Henriques
                   ` (52 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, Sarah Sharp, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit f875fdbf344b9fde207f66b392c40845dd7e5aa6 upstream.

Since uhci-hcd, ehci-hcd, and xhci-hcd support runtime PM, the .pm
field in their pci_driver structures should be protected by CONFIG_PM
rather than CONFIG_PM_SLEEP.  The corresponding change has already
been made for ohci-hcd.

Without this change, controllers won't do runtime suspend if system
suspend or hibernation isn't enabled.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/ehci-pci.c | 2 +-
 drivers/usb/host/uhci-pci.c | 2 +-
 drivers/usb/host/xhci-pci.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 0909783..3302c27 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -549,7 +549,7 @@ static struct pci_driver ehci_pci_driver = {
 	.remove =	usb_hcd_pci_remove,
 	.shutdown = 	usb_hcd_pci_shutdown,
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 	.driver =	{
 		.pm =	&usb_hcd_pci_pm_ops
 	},
diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c
index c300bd2f7..0f228c4 100644
--- a/drivers/usb/host/uhci-pci.c
+++ b/drivers/usb/host/uhci-pci.c
@@ -293,7 +293,7 @@ static struct pci_driver uhci_pci_driver = {
 	.remove =	usb_hcd_pci_remove,
 	.shutdown =	uhci_shutdown,
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 	.driver =	{
 		.pm =	&usb_hcd_pci_pm_ops
 	},
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index be08444..5e3ef3e 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -343,7 +343,7 @@ static struct pci_driver xhci_pci_driver = {
 	/* suspend and resume implemented later */
 
 	.shutdown = 	usb_hcd_pci_shutdown,
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 	.driver = {
 		.pm = &usb_hcd_pci_pm_ops
 	},
-- 
1.8.3.2


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

* [PATCH 046/100] usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 045/100] USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 047/100] hwmon: (applesmc) Check key count before proceeding Luis Henriques
                   ` (51 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kurt Garloff, Greg Kroah-Hartman, Luis Henriques

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

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

From: Kurt Garloff <kurt@garloff.de>

commit 831abf76643555a99b80a3b54adfa7e4fa0a3259 upstream.

Trying to read data from the Pegasus Technologies NoteTaker (0e20:0101)
[1] with the Windows App (EasyNote) works natively but fails when
Windows is running under KVM (and the USB device handed to KVM).

The reason is a USB control message
 usb 4-2.2: control urb: bRequestType=22 bRequest=09 wValue=0200 wIndex=0001 wLength=0008
This goes to endpoint address 0x01 (wIndex); however, endpoint address
0x01 does not exist. There is an endpoint 0x81 though (same number,
but other direction); the app may have meant that endpoint instead.

The kernel thus rejects the IO and thus we see the failure.

Apparently, Linux is more strict here than Windows ... we can't change
the Win app easily, so that's a problem.

It seems that the Win app/driver is buggy here and the driver does not
behave fully according to the USB HID class spec that it claims to
belong to.  The device seems to happily deal with that though (and
seems to not really care about this value much).

So the question is whether the Linux kernel should filter here.
Rejecting has the risk that somewhat non-compliant userspace apps/
drivers (most likely in a virtual machine) are prevented from working.
Not rejecting has the risk of confusing an overly sensitive device with
such a transfer. Given the fact that Windows does not filter it makes
this risk rather small though.

The patch makes the kernel more tolerant: If the endpoint address in
wIndex does not exist, but an endpoint with toggled direction bit does,
it will let the transfer through. (It does NOT change the message.)

With attached patch, the app in Windows in KVM works.
 usb 4-2.2: check_ctrlrecip: process 13073 (qemu-kvm) requesting ep 01 but needs 81

I suspect this will mostly affect apps in virtual environments; as on
Linux the apps would have been adapted to the stricter handling of the
kernel. I have done that for mine[2].

[1] http://www.pegatech.com/
[2] https://sourceforge.net/projects/notetakerpen/

Signed-off-by: Kurt Garloff <kurt@garloff.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/core/devio.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index f70b887..ea97827 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -684,6 +684,22 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
 		if ((index & ~USB_DIR_IN) == 0)
 			return 0;
 		ret = findintfep(ps->dev, index);
+		if (ret < 0) {
+			/*
+			 * Some not fully compliant Win apps seem to get
+			 * index wrong and have the endpoint number here
+			 * rather than the endpoint address (with the
+			 * correct direction). Win does let this through,
+			 * so we'll not reject it here but leave it to
+			 * the device to not break KVM. But we warn.
+			 */
+			ret = findintfep(ps->dev, index ^ 0x80);
+			if (ret >= 0)
+				dev_info(&ps->dev->dev,
+					"%s: process %i (%s) requesting ep %02x but needs %02x\n",
+					__func__, task_pid_nr(current),
+					current->comm, index, index ^ 0x80);
+		}
 		if (ret >= 0)
 			ret = checkintf(ps, ret);
 		break;
-- 
1.8.3.2


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

* [PATCH 047/100] hwmon: (applesmc) Check key count before proceeding
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 046/100] usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 048/100] USB: Fix breakage in ffs_fs_mount() Luis Henriques
                   ` (50 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Henrik Rydberg, Guenter Roeck, Luis Henriques

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

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

From: Henrik Rydberg <rydberg@euromail.se>

commit 5f4513864304672e6ea9eac60583eeac32e679f2 upstream.

After reports from Chris and Josh Boyer of a rare crash in applesmc,
Guenter pointed at the initialization problem fixed below. The patch
has not been verified to fix the crash, but should be applied
regardless.

Reported-by: <jwboyer@fedoraproject.org>
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hwmon/applesmc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 2cde9ec..0882b25 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -489,16 +489,25 @@ static int applesmc_init_smcreg_try(void)
 {
 	struct applesmc_registers *s = &smcreg;
 	bool left_light_sensor, right_light_sensor;
+	unsigned int count;
 	u8 tmp[1];
 	int ret;
 
 	if (s->init_complete)
 		return 0;
 
-	ret = read_register_count(&s->key_count);
+	ret = read_register_count(&count);
 	if (ret)
 		return ret;
 
+	if (s->cache && s->key_count != count) {
+		pr_warn("key count changed from %d to %d\n",
+			s->key_count, count);
+		kfree(s->cache);
+		s->cache = NULL;
+	}
+	s->key_count = count;
+
 	if (!s->cache)
 		s->cache = kcalloc(s->key_count, sizeof(*s->cache), GFP_KERNEL);
 	if (!s->cache)
-- 
1.8.3.2


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

* [PATCH 048/100] USB: Fix breakage in ffs_fs_mount()
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 047/100] hwmon: (applesmc) Check key count before proceeding Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 049/100] usb: dwc3: pci: add support for BayTrail Luis Henriques
                   ` (49 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Al Viro, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 2606b28aabd7dea1766c23a105e1124c95409c96 upstream.

	There's a bunch of failure exits in ffs_fs_mount() with
seriously broken recovery logics.  Most of that appears to stem
from misunderstanding of the ->kill_sb() semantics; unlike
->put_super() it is called for *all* superblocks of given type,
no matter how (in)complete the setup had been.  ->put_super()
is called only if ->s_root is not NULL; any failure prior to
setting ->s_root will have the call of ->put_super() skipped.
->kill_sb(), OTOH, awaits every superblock that has come from
sget().

Current behaviour of ffs_fs_mount():

We have struct ffs_sb_fill_data data on stack there.  We do
	ffs_dev = functionfs_acquire_dev_callback(dev_name);
and store that in data.private_data.  Then we call mount_nodev(),
passing it ffs_sb_fill() as a callback.  That will either fail
outright, or manage to call ffs_sb_fill().  There we allocate an
instance of struct ffs_data, slap the value of ffs_dev (picked
from data.private_data) into ffs->private_data and overwrite
data.private_data by storing ffs into an overlapping member
(data.ffs_data).  Then we store ffs into sb->s_fs_info and attempt
to set the rest of the things up (root inode, root dentry, then
create /ep0 there).  Any of those might fail.  Should that
happen, we get ffs_fs_kill_sb() called before mount_nodev()
returns.  If mount_nodev() fails for any reason whatsoever,
we proceed to
	functionfs_release_dev_callback(data.ffs_data);

That's broken in a lot of ways.  Suppose the thing has failed in
allocation of e.g. root inode or dentry.  We have
	functionfs_release_dev_callback(ffs);
	ffs_data_put(ffs);
done by ffs_fs_kill_sb() (ffs accessed via sb->s_fs_info), followed by
	functionfs_release_dev_callback(ffs);
from ffs_fs_mount() (via data.ffs_data).  Note that the second
functionfs_release_dev_callback() has every chance to be done to freed memory.

Suppose we fail *before* root inode allocation.  What happens then?
ffs_fs_kill_sb() doesn't do anything to ffs (it's either not called at all,
or it doesn't have a pointer to ffs stored in sb->s_fs_info).  And
	functionfs_release_dev_callback(data.ffs_data);
is called by ffs_fs_mount(), but here we are in nasal daemon country - we
are reading from a member of union we'd never stored into.  In practice,
we'll get what we used to store into the overlapping field, i.e. ffs_dev.
And then we get screwed, since we treat it (struct gfs_ffs_obj * in
disguise, returned by functionfs_acquire_dev_callback()) as struct
ffs_data *, pick what would've been ffs_data ->private_data from it
(*well* past the actual end of the struct gfs_ffs_obj - struct ffs_data
is much bigger) and poke in whatever it points to.

FWIW, there's a minor leak on top of all that in case if ffs_sb_fill()
fails on kstrdup() - ffs is obviously forgotten.

The thing is, there is no point in playing all those games with union.
Just allocate and initialize ffs_data *before* calling mount_nodev() and
pass a pointer to it via data.ffs_data.  And once it's stored in
sb->s_fs_info, clear data.ffs_data, so that ffs_fs_mount() knows that
it doesn't need to kill the sucker manually - from that point on
we'll have it done by ->kill_sb().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/f_fs.c | 60 ++++++++++++++++++++---------------------------
 1 file changed, 26 insertions(+), 34 deletions(-)

diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index dcd1c7f..3df7513 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -1031,37 +1031,19 @@ struct ffs_sb_fill_data {
 	struct ffs_file_perms perms;
 	umode_t root_mode;
 	const char *dev_name;
-	union {
-		/* set by ffs_fs_mount(), read by ffs_sb_fill() */
-		void *private_data;
-		/* set by ffs_sb_fill(), read by ffs_fs_mount */
-		struct ffs_data *ffs_data;
-	};
+	struct ffs_data *ffs_data;
 };
 
 static int ffs_sb_fill(struct super_block *sb, void *_data, int silent)
 {
 	struct ffs_sb_fill_data *data = _data;
 	struct inode	*inode;
-	struct ffs_data	*ffs;
+	struct ffs_data	*ffs = data->ffs_data;
 
 	ENTER();
 
-	/* Initialise data */
-	ffs = ffs_data_new();
-	if (unlikely(!ffs))
-		goto Enomem;
-
 	ffs->sb              = sb;
-	ffs->dev_name        = kstrdup(data->dev_name, GFP_KERNEL);
-	if (unlikely(!ffs->dev_name))
-		goto Enomem;
-	ffs->file_perms      = data->perms;
-	ffs->private_data    = data->private_data;
-
-	/* used by the caller of this function */
-	data->ffs_data       = ffs;
-
+	data->ffs_data       = NULL;
 	sb->s_fs_info        = ffs;
 	sb->s_blocksize      = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
@@ -1077,17 +1059,14 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent)
 				  &data->perms);
 	sb->s_root = d_make_root(inode);
 	if (unlikely(!sb->s_root))
-		goto Enomem;
+		return -ENOMEM;
 
 	/* EP0 file */
 	if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs,
 					 &ffs_ep0_operations, NULL)))
-		goto Enomem;
+		return -ENOMEM;
 
 	return 0;
-
-Enomem:
-	return -ENOMEM;
 }
 
 static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
@@ -1182,6 +1161,7 @@ ffs_fs_mount(struct file_system_type *t, int flags,
 	struct dentry *rv;
 	int ret;
 	void *ffs_dev;
+	struct ffs_data	*ffs;
 
 	ENTER();
 
@@ -1189,18 +1169,30 @@ ffs_fs_mount(struct file_system_type *t, int flags,
 	if (unlikely(ret < 0))
 		return ERR_PTR(ret);
 
+	ffs = ffs_data_new();
+	if (unlikely(!ffs))
+		return ERR_PTR(-ENOMEM);
+	ffs->file_perms = data.perms;
+
+	ffs->dev_name = kstrdup(dev_name, GFP_KERNEL);
+	if (unlikely(!ffs->dev_name)) {
+		ffs_data_put(ffs);
+		return ERR_PTR(-ENOMEM);
+	}
+
 	ffs_dev = functionfs_acquire_dev_callback(dev_name);
-	if (IS_ERR(ffs_dev))
-		return ffs_dev;
+	if (IS_ERR(ffs_dev)) {
+		ffs_data_put(ffs);
+		return ERR_CAST(ffs_dev);
+	}
+	ffs->private_data = ffs_dev;
+	data.ffs_data = ffs;
 
-	data.dev_name = dev_name;
-	data.private_data = ffs_dev;
 	rv = mount_nodev(t, flags, &data, ffs_sb_fill);
-
-	/* data.ffs_data is set by ffs_sb_fill */
-	if (IS_ERR(rv))
+	if (IS_ERR(rv) && data.ffs_data) {
 		functionfs_release_dev_callback(data.ffs_data);
-
+		ffs_data_put(data.ffs_data);
+	}
 	return rv;
 }
 
-- 
1.8.3.2


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

* [PATCH 049/100] usb: dwc3: pci: add support for BayTrail
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 048/100] USB: Fix breakage in ffs_fs_mount() Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 050/100] caif: Add missing braces to multiline if in cfctrl_linkup_request Luis Henriques
                   ` (48 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Heikki Krogerus, Felipe Balbi, Luis Henriques

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

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

From: Heikki Krogerus <heikki.krogerus@linux.intel.com>

commit b62cd96de3161dfb125a769030eec35a4cab3d3a upstream.

Add PCI id for Intel BayTrail.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/dwc3/dwc3-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index a9ca9ad..5699bc4 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -47,6 +47,7 @@
 /* FIXME define these in <linux/pci_ids.h> */
 #define PCI_VENDOR_ID_SYNOPSYS		0x16c3
 #define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3	0xabcd
+#define PCI_DEVICE_ID_INTEL_BYT		0x0f37
 
 struct dwc3_pci {
 	struct device		*dev;
@@ -155,6 +156,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = {
 		PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
 				PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
 	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
 	{  }	/* Terminating Entry */
 };
 MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
-- 
1.8.3.2


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

* [PATCH 050/100] caif: Add missing braces to multiline if in cfctrl_linkup_request
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 049/100] usb: dwc3: pci: add support for BayTrail Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 051/100] net: sctp: fix smatch warning in sctp_send_asconf_del_ip Luis Henriques
                   ` (47 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dave Jones, David S. Miller, Luis Henriques

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

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

From: Dave Jones <davej@redhat.com>

commit 0c1db731bfcf3a9fd6c58132134f8b0f423552f0 upstream.

The indentation here implies this was meant to be a multi-line if.

Introduced several years back in commit c85c2951d4da1236e32f1858db418221e624aba5
("caif: Handle dev_queue_xmit errors.")

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/caif/cfctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
index 047cd0e..61fe8d2 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -291,9 +291,10 @@ int cfctrl_linkup_request(struct cflayer *layer,
 
 		count = cfctrl_cancel_req(&cfctrl->serv.layer,
 						user_layer);
-		if (count != 1)
+		if (count != 1) {
 			pr_err("Could not remove request (%d)", count);
 			return -ENODEV;
+		}
 	}
 	return 0;
 }
-- 
1.8.3.2


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

* [PATCH 051/100] net: sctp: fix smatch warning in sctp_send_asconf_del_ip
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 050/100] caif: Add missing braces to multiline if in cfctrl_linkup_request Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 052/100] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Luis Henriques
                   ` (46 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Neil Horman, Daniel Borkmann, Michio Honda, David S. Miller,
	Luis Henriques

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

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

From: Daniel Borkmann <dborkman@redhat.com>

commit 88362ad8f9a6cea787420b57cc27ccacef000dbe upstream.

This was originally reported in [1] and posted by Neil Horman [2], he said:

  Fix up a missed null pointer check in the asconf code. If we don't find
  a local address, but we pass in an address length of more than 1, we may
  dereference a NULL laddr pointer. Currently this can't happen, as the only
  users of the function pass in the value 1 as the addrcnt parameter, but
  its not hot path, and it doesn't hurt to check for NULL should that ever
  be the case.

The callpath from sctp_asconf_mgmt() looks okay. But this could be triggered
from sctp_setsockopt_bindx() call with SCTP_BINDX_REM_ADDR and addrcnt > 1
while passing all possible addresses from the bind list to SCTP_BINDX_REM_ADDR
so that we do *not* find a single address in the association's bind address
list that is not in the packed array of addresses. If this happens when we
have an established association with ASCONF-capable peers, then we could get
a NULL pointer dereference as we only check for laddr == NULL && addrcnt == 1
and call later sctp_make_asconf_update_ip() with NULL laddr.

BUT: this actually won't happen as sctp_bindx_rem() will catch such a case
and return with an error earlier. As this is incredably unintuitive and error
prone, add a check to catch at least future bugs here. As Neil says, its not
hot path. Introduced by 8a07eb0a5 ("sctp: Add ASCONF operation on the
single-homed host").

 [1] http://www.spinics.net/lists/linux-sctp/msg02132.html
 [2] http://www.spinics.net/lists/linux-sctp/msg02133.html

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Michio Honda <micchie@sfc.wide.ad.jp>
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: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/socket.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 7e40284..d01802a 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -814,6 +814,9 @@ static int sctp_send_asconf_del_ip(struct sock		*sk,
 			goto skip_mkasconf;
 		}
 
+		if (laddr == NULL)
+			return -EINVAL;
+
 		/* We do not need RCU protection throughout this loop
 		 * because this is done under a socket lock from the
 		 * setsockopt call.
-- 
1.8.3.2


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

* [PATCH 052/100] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (50 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 051/100] net: sctp: fix smatch warning in sctp_send_asconf_del_ip Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 053/100] resubmit bridge: fix message_age_timer calculation Luis Henriques
                   ` (45 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Borkmann, Steffen Klassert, Hannes Frederic Sowa,
	David S. Miller, Luis Henriques

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

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

From: Daniel Borkmann <dborkman@redhat.com>

commit 95ee62083cb6453e056562d91f597552021e6ae7 upstream.

Alan Chester reported an issue with IPv6 on SCTP that IPsec traffic is not
being encrypted, whereas on IPv4 it is. Setting up an AH + ESP transport
does not seem to have the desired effect:

SCTP + IPv4:

  22:14:20.809645 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto AH (51), length 116)
    192.168.0.2 > 192.168.0.5: AH(spi=0x00000042,sumlen=16,seq=0x1): ESP(spi=0x00000044,seq=0x1), length 72
  22:14:20.813270 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto AH (51), length 340)
    192.168.0.5 > 192.168.0.2: AH(spi=0x00000043,sumlen=16,seq=0x1):

SCTP + IPv6:

  22:31:19.215029 IP6 (class 0x02, hlim 64, next-header SCTP (132) payload length: 364)
    fe80::222:15ff:fe87:7fc.3333 > fe80::92e6:baff:fe0d:5a54.36767: sctp
    1) [INIT ACK] [init tag: 747759530] [rwnd: 62464] [OS: 10] [MIS: 10]

Moreover, Alan says:

  This problem was seen with both Racoon and Racoon2. Other people have seen
  this with OpenSwan. When IPsec is configured to encrypt all upper layer
  protocols the SCTP connection does not initialize. After using Wireshark to
  follow packets, this is because the SCTP packet leaves Box A unencrypted and
  Box B believes all upper layer protocols are to be encrypted so it drops
  this packet, causing the SCTP connection to fail to initialize. When IPsec
  is configured to encrypt just SCTP, the SCTP packets are observed unencrypted.

In fact, using `socat sctp6-listen:3333 -` on one end and transferring "plaintext"
string on the other end, results in cleartext on the wire where SCTP eventually
does not report any errors, thus in the latter case that Alan reports, the
non-paranoid user might think he's communicating over an encrypted transport on
SCTP although he's not (tcpdump ... -X):

  ...
  0x0030: 5d70 8e1a 0003 001a 177d eb6c 0000 0000  ]p.......}.l....
  0x0040: 0000 0000 706c 6169 6e74 6578 740a 0000  ....plaintext...

Only in /proc/net/xfrm_stat we can see XfrmInTmplMismatch increasing on the
receiver side. Initial follow-up analysis from Alan's bug report was done by
Alexey Dobriyan. Also thanks to Vlad Yasevich for feedback on this.

SCTP has its own implementation of sctp_v6_xmit() not calling inet6_csk_xmit().
This has the implication that it probably never really got updated along with
changes in inet6_csk_xmit() and therefore does not seem to invoke xfrm handlers.

SCTP's IPv4 xmit however, properly calls ip_queue_xmit() to do the work. Since
a call to inet6_csk_xmit() would solve this problem, but result in unecessary
route lookups, let us just use the cached flowi6 instead that we got through
sctp_v6_get_dst(). Since all SCTP packets are being sent through sctp_packet_transmit(),
we do the route lookup / flow caching in sctp_transport_route(), hold it in
tp->dst and skb_dst_set() right after that. If we would alter fl6->daddr in
sctp_v6_xmit() to np->opt->srcrt, we possibly could run into the same effect
of not having xfrm layer pick it up, hence, use fl6_update_dst() in sctp_v6_get_dst()
instead to get the correct source routed dst entry, which we assign to the skb.

Also source address routing example from 625034113 ("sctp: fix sctp to work with
ipv6 source address routing") still works with this patch! Nevertheless, in RFC5095
it is actually 'recommended' to not use that anyway due to traffic amplification [1].
So it seems we're not supposed to do that anyway in sctp_v6_xmit(). Moreover, if
we overwrite the flow destination here, the lower IPv6 layer will be unable to
put the correct destination address into IP header, as routing header is added in
ipv6_push_nfrag_opts() but then probably with wrong final destination. Things aside,
result of this patch is that we do not have any XfrmInTmplMismatch increase plus on
the wire with this patch it now looks like:

SCTP + IPv6:

  08:17:47.074080 IP6 2620:52:0:102f:7a2b:cbff:fe27:1b0a > 2620:52:0:102f:213:72ff:fe32:7eba:
    AH(spi=0x00005fb4,seq=0x1): ESP(spi=0x00005fb5,seq=0x1), length 72
  08:17:47.074264 IP6 2620:52:0:102f:213:72ff:fe32:7eba > 2620:52:0:102f:7a2b:cbff:fe27:1b0a:
    AH(spi=0x00003d54,seq=0x1): ESP(spi=0x00003d55,seq=0x1), length 296

This fixes Kernel Bugzilla 24412. This security issue seems to be present since
2.6.18 kernels. Lets just hope some big passive adversary in the wild didn't have
its fun with that. lksctp-tools IPv6 regression test suite passes as well with
this patch.

 [1] http://www.secdev.org/conf/IPv6_RH_security-csw07.pdf

Reported-by: Alan Chester <alan.chester@tekelec.com>
Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/ipv6.c | 42 +++++++++++++-----------------------------
 1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 91f4791..53a7f03 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -205,45 +205,24 @@ out:
 		in6_dev_put(idev);
 }
 
-/* Based on tcp_v6_xmit() in tcp_ipv6.c. */
 static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
 {
 	struct sock *sk = skb->sk;
 	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct flowi6 fl6;
-
-	memset(&fl6, 0, sizeof(fl6));
-
-	fl6.flowi6_proto = sk->sk_protocol;
-
-	/* Fill in the dest address from the route entry passed with the skb
-	 * and the source address from the transport.
-	 */
-	fl6.daddr = transport->ipaddr.v6.sin6_addr;
-	fl6.saddr = transport->saddr.v6.sin6_addr;
-
-	fl6.flowlabel = np->flow_label;
-	IP6_ECN_flow_xmit(sk, fl6.flowlabel);
-	if (ipv6_addr_type(&fl6.saddr) & IPV6_ADDR_LINKLOCAL)
-		fl6.flowi6_oif = transport->saddr.v6.sin6_scope_id;
-	else
-		fl6.flowi6_oif = sk->sk_bound_dev_if;
-
-	if (np->opt && np->opt->srcrt) {
-		struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
-		fl6.daddr = *rt0->addr;
-	}
+	struct flowi6 *fl6 = &transport->fl.u.ip6;
 
 	SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n",
 			  __func__, skb, skb->len,
-			  &fl6.saddr, &fl6.daddr);
+			  &fl6->saddr, &fl6->daddr);
 
-	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
+	IP6_ECN_flow_xmit(sk, fl6->flowlabel);
 
 	if (!(transport->param_flags & SPP_PMTUD_ENABLE))
 		skb->local_df = 1;
 
-	return ip6_xmit(sk, skb, &fl6, np->opt, np->tclass);
+	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
+
+	return ip6_xmit(sk, skb, fl6, np->opt, np->tclass);
 }
 
 /* Returns the dst cache entry for the given source and destination ip
@@ -256,10 +235,12 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
 	struct dst_entry *dst = NULL;
 	struct flowi6 *fl6 = &fl->u.ip6;
 	struct sctp_bind_addr *bp;
+	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct sctp_sockaddr_entry *laddr;
 	union sctp_addr *baddr = NULL;
 	union sctp_addr *daddr = &t->ipaddr;
 	union sctp_addr dst_saddr;
+	struct in6_addr *final_p, final;
 	__u8 matchlen = 0;
 	__u8 bmatchlen;
 	sctp_scope_t scope;
@@ -282,7 +263,8 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
 		SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl6->saddr);
 	}
 
-	dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);
+	final_p = fl6_update_dst(fl6, np->opt, &final);
+	dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
 	if (!asoc || saddr)
 		goto out;
 
@@ -333,10 +315,12 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
 		}
 	}
 	rcu_read_unlock();
+
 	if (baddr) {
 		fl6->saddr = baddr->v6.sin6_addr;
 		fl6->fl6_sport = baddr->v6.sin6_port;
-		dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);
+		final_p = fl6_update_dst(fl6, np->opt, &final);
+		dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
 	}
 
 out:
-- 
1.8.3.2


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

* [PATCH 053/100] resubmit bridge: fix message_age_timer calculation
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 052/100] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 054/100] bridge: Clamp forward_delay when enabling STP Luis Henriques
                   ` (44 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Healy, David S. Miller, Luis Henriques

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

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

From: Chris Healy <cphealy@gmail.com>

commit 9a0620133ccce9dd35c00a96405c8d80938c2cc0 upstream.

This changes the message_age_timer calculation to use the BPDU's max age as
opposed to the local bridge's max age.  This is in accordance with section
8.6.2.3.2 Step 2 of the 802.1D-1998 sprecification.

With the current implementation, when running with very large bridge
diameters, convergance will not always occur even if a root bridge is
configured to have a longer max age.

Tested successfully on bridge diameters of ~200.

Signed-off-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/bridge/br_stp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index af9a120..2e46d07 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -189,7 +189,7 @@ static void br_record_config_information(struct net_bridge_port *p,
 	p->designated_age = jiffies - bpdu->message_age;
 
 	mod_timer(&p->message_age_timer, jiffies
-		  + (p->br->max_age - bpdu->message_age));
+		  + (bpdu->max_age - bpdu->message_age));
 }
 
 /* called under bridge lock */
-- 
1.8.3.2


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

* [PATCH 054/100] bridge: Clamp forward_delay when enabling STP
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 053/100] resubmit bridge: fix message_age_timer calculation Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 055/100] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header Luis Henriques
                   ` (43 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Herbert Xu, David S. Miller, Luis Henriques

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

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

From: Herbert Xu <herbert@gondor.apana.org.au>

commit be4f154d5ef0ca147ab6bcd38857a774133f5450 upstream.

At some point limits were added to forward_delay.  However, the
limits are only enforced when STP is enabled.  This created a
scenario where you could have a value outside the allowed range
while STP is disabled, which then stuck around even after STP
is enabled.

This patch fixes this by clamping the value when we enable STP.

I had to move the locking around a bit to ensure that there is
no window where someone could insert a value outside the range
while we're in the middle of enabling STP.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/bridge/br_private.h |  1 +
 net/bridge/br_stp.c     | 21 +++++++++++++++------
 net/bridge/br_stp_if.c  | 12 ++++++++++--
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index a768b24..68d9266 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -512,6 +512,7 @@ extern struct net_bridge_port *br_get_port(struct net_bridge *br,
 extern void br_init_port(struct net_bridge_port *p);
 extern void br_become_designated_port(struct net_bridge_port *p);
 
+extern void __br_set_forward_delay(struct net_bridge *br, unsigned long t);
 extern int br_set_forward_delay(struct net_bridge *br, unsigned long x);
 extern int br_set_hello_time(struct net_bridge *br, unsigned long x);
 extern int br_set_max_age(struct net_bridge *br, unsigned long x);
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 2e46d07..73920c2 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -517,18 +517,27 @@ int br_set_max_age(struct net_bridge *br, unsigned long val)
 
 }
 
+void __br_set_forward_delay(struct net_bridge *br, unsigned long t)
+{
+	br->bridge_forward_delay = t;
+	if (br_is_root_bridge(br))
+		br->forward_delay = br->bridge_forward_delay;
+}
+
 int br_set_forward_delay(struct net_bridge *br, unsigned long val)
 {
 	unsigned long t = clock_t_to_jiffies(val);
+	int err = -ERANGE;
 
+	spin_lock_bh(&br->lock);
 	if (br->stp_enabled != BR_NO_STP &&
 	    (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY))
-		return -ERANGE;
+		goto unlock;
 
-	spin_lock_bh(&br->lock);
-	br->bridge_forward_delay = t;
-	if (br_is_root_bridge(br))
-		br->forward_delay = br->bridge_forward_delay;
+	__br_set_forward_delay(br, t);
+	err = 0;
+
+unlock:
 	spin_unlock_bh(&br->lock);
-	return 0;
+	return err;
 }
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 9d5a414..7ba2ed5 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -129,6 +129,14 @@ static void br_stp_start(struct net_bridge *br)
 	char *envp[] = { NULL };
 
 	r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
+
+	spin_lock_bh(&br->lock);
+
+	if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY)
+		__br_set_forward_delay(br, BR_MIN_FORWARD_DELAY);
+	else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY)
+		__br_set_forward_delay(br, BR_MAX_FORWARD_DELAY);
+
 	if (r == 0) {
 		br->stp_enabled = BR_USER_STP;
 		br_debug(br, "userspace STP started\n");
@@ -137,10 +145,10 @@ static void br_stp_start(struct net_bridge *br)
 		br_debug(br, "using kernel STP\n");
 
 		/* To start timers on any ports left in blocking */
-		spin_lock_bh(&br->lock);
 		br_port_state_selection(br);
-		spin_unlock_bh(&br->lock);
 	}
+
+	spin_unlock_bh(&br->lock);
 }
 
 static void br_stp_stop(struct net_bridge *br)
-- 
1.8.3.2


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

* [PATCH 055/100] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 054/100] bridge: Clamp forward_delay when enabling STP Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 056/100] ip: generate unique IP identificator if local fragmentation is allowed Luis Henriques
                   ` (42 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ansis Atteka, David S. Miller, Luis Henriques

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

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

From: Ansis Atteka <aatteka@nicira.com>

commit 749154aa56b57652a282cbde57a57abc278d1205 upstream.

skb->data already points to IP header, but for the sake of
consistency we can also use ip_hdr() to retrieve it.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ip_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 451f97c..50009a1 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1342,7 +1342,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
 	else
 		ttl = ip_select_ttl(inet, &rt->dst);
 
-	iph = (struct iphdr *)skb->data;
+	iph = ip_hdr(skb);
 	iph->version = 4;
 	iph->ihl = 5;
 	iph->tos = inet->tos;
-- 
1.8.3.2


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

* [PATCH 056/100] ip: generate unique IP identificator if local fragmentation is allowed
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 055/100] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 057/100] netpoll: fix NULL pointer dereference in netpoll_cleanup Luis Henriques
                   ` (41 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ansis Atteka, David S. Miller, Luis Henriques

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

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

From: Ansis Atteka <aatteka@nicira.com>

commit 703133de331a7a7df47f31fb9de51dc6f68a9de8 upstream.

If local fragmentation is allowed, then ip_select_ident() and
ip_select_ident_more() need to generate unique IDs to ensure
correct defragmentation on the peer.

For example, if IPsec (tunnel mode) has to encrypt large skbs
that have local_df bit set, then all IP fragments that belonged
to different ESP datagrams would have used the same identificator.
If one of these IP fragments would get lost or reordered, then
peer could possibly stitch together wrong IP fragments that did
not belong to the same datagram. This would lead to a packet loss
or data corruption.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.5 (based on davem backport to 3.4):
  - adjusted context
  - modified to __IPTUNNEL_XMIT macro ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ppp/pptp.c          |  2 +-
 include/net/ip.h                | 12 ++++++++----
 include/net/ipip.h              |  2 +-
 net/ipv4/igmp.c                 |  4 ++--
 net/ipv4/inetpeer.c             |  4 ++--
 net/ipv4/ip_output.c            |  6 +++---
 net/ipv4/ipmr.c                 |  2 +-
 net/ipv4/raw.c                  |  2 +-
 net/ipv4/xfrm4_mode_tunnel.c    |  2 +-
 net/netfilter/ipvs/ip_vs_xmit.c |  2 +-
 10 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 162464f..7f10588 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -281,7 +281,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 	nf_reset(skb);
 
 	skb->ip_summed = CHECKSUM_NONE;
-	ip_select_ident(iph, &rt->dst, NULL);
+	ip_select_ident(skb, &rt->dst, NULL);
 	ip_send_check(iph);
 
 	ip_local_out(skb);
diff --git a/include/net/ip.h b/include/net/ip.h
index 83e0619..d34f531 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -246,9 +246,11 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
 
 extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
 
-static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk)
+static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)
 {
-	if (iph->frag_off & htons(IP_DF)) {
+	struct iphdr *iph = ip_hdr(skb);
+
+	if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {
 		/* This is only to work around buggy Windows95/2000
 		 * VJ compression implementations.  If the ID field
 		 * does not change, they drop every other packet in
@@ -260,9 +262,11 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
 		__ip_select_ident(iph, dst, 0);
 }
 
-static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more)
+static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk, int more)
 {
-	if (iph->frag_off & htons(IP_DF)) {
+	struct iphdr *iph = ip_hdr(skb);
+
+	if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {
 		if (sk && inet_sk(sk)->inet_daddr) {
 			iph->id = htons(inet_sk(sk)->inet_id);
 			inet_sk(sk)->inet_id += 1 + more;
diff --git a/include/net/ipip.h b/include/net/ipip.h
index a93cf6d..1157ab8 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -50,7 +50,7 @@ struct ip_tunnel_prl_entry {
 	int pkt_len = skb->len - skb_transport_offset(skb);		\
 									\
 	skb->ip_summed = CHECKSUM_NONE;					\
-	ip_select_ident(iph, &rt->dst, NULL);				\
+	ip_select_ident(skb, &rt->dst, NULL);				\
 									\
 	err = ip_local_out(skb);					\
 	if (likely(net_xmit_eval(err) == 0)) {				\
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 6699f23..ca66431 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -343,7 +343,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 	pip->saddr    = fl4.saddr;
 	pip->protocol = IPPROTO_IGMP;
 	pip->tot_len  = 0;	/* filled in later */
-	ip_select_ident(pip, &rt->dst, NULL);
+	ip_select_ident(skb, &rt->dst, NULL);
 	((u8 *)&pip[1])[0] = IPOPT_RA;
 	((u8 *)&pip[1])[1] = 4;
 	((u8 *)&pip[1])[2] = 0;
@@ -687,7 +687,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
 	iph->daddr    = dst;
 	iph->saddr    = fl4.saddr;
 	iph->protocol = IPPROTO_IGMP;
-	ip_select_ident(iph, &rt->dst, NULL);
+	ip_select_ident(skb, &rt->dst, NULL);
 	((u8 *)&iph[1])[0] = IPOPT_RA;
 	((u8 *)&iph[1])[1] = 4;
 	((u8 *)&iph[1])[2] = 0;
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index dfba343..d63a926 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -32,8 +32,8 @@
  *  At the moment of writing this notes identifier of IP packets is generated
  *  to be unpredictable using this code only for packets subjected
  *  (actually or potentially) to defragmentation.  I.e. DF packets less than
- *  PMTU in size uses a constant ID and do not use this code (see
- *  ip_select_ident() in include/net/ip.h).
+ *  PMTU in size when local fragmentation is disabled use a constant ID and do
+ *  not use this code (see ip_select_ident() in include/net/ip.h).
  *
  *  Route cache entries hold references to our nodes.
  *  New cache entries get references via lookup by destination IP address in
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 50009a1..7ee32c6 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -161,7 +161,7 @@ int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
 	iph->daddr    = (opt && opt->opt.srr ? opt->opt.faddr : daddr);
 	iph->saddr    = saddr;
 	iph->protocol = sk->sk_protocol;
-	ip_select_ident(iph, &rt->dst, sk);
+	ip_select_ident(skb, &rt->dst, sk);
 
 	if (opt && opt->opt.optlen) {
 		iph->ihl += opt->opt.optlen>>2;
@@ -403,7 +403,7 @@ packet_routed:
 		ip_options_build(skb, &inet_opt->opt, inet->inet_daddr, rt, 0);
 	}
 
-	ip_select_ident_more(iph, &rt->dst, sk,
+	ip_select_ident_more(skb, &rt->dst, sk,
 			     (skb_shinfo(skb)->gso_segs ?: 1) - 1);
 
 	skb->priority = sk->sk_priority;
@@ -1347,7 +1347,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
 	iph->ihl = 5;
 	iph->tos = inet->tos;
 	iph->frag_off = df;
-	ip_select_ident(iph, &rt->dst, sk);
+	ip_select_ident(skb, &rt->dst, sk);
 	iph->ttl = ttl;
 	iph->protocol = sk->sk_protocol;
 	ip_copy_addrs(iph, fl4);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 9be3d17..f780fa3 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1572,7 +1572,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
 	iph->protocol	=	IPPROTO_IPIP;
 	iph->ihl	=	5;
 	iph->tot_len	=	htons(skb->len);
-	ip_select_ident(iph, skb_dst(skb), NULL);
+	ip_select_ident(skb, skb_dst(skb), NULL);
 	ip_send_check(iph);
 
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index d53aa77..0753bd7 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -384,7 +384,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
 		iph->check   = 0;
 		iph->tot_len = htons(length);
 		if (!iph->id)
-			ip_select_ident(iph, &rt->dst, NULL);
+			ip_select_ident(skb, &rt->dst, NULL);
 
 		iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
 	}
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index ed4bf11..938553e 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -54,7 +54,7 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
 
 	top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
 		0 : (XFRM_MODE_SKB_CB(skb)->frag_off & htons(IP_DF));
-	ip_select_ident(top_iph, dst->child, NULL);
+	ip_select_ident(skb, dst->child, NULL);
 
 	top_iph->ttl = ip4_dst_hoplimit(dst->child);
 
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 7fd66de..ec78ab6 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -853,7 +853,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
 	iph->daddr		=	cp->daddr.ip;
 	iph->saddr		=	saddr;
 	iph->ttl		=	old_iph->ttl;
-	ip_select_ident(iph, &rt->dst, NULL);
+	ip_select_ident(skb, &rt->dst, NULL);
 
 	/* Another hack: avoid icmp_send in ip_fragment */
 	skb->local_df = 1;
-- 
1.8.3.2


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

* [PATCH 057/100] netpoll: fix NULL pointer dereference in netpoll_cleanup
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 056/100] ip: generate unique IP identificator if local fragmentation is allowed Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 058/100] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO Luis Henriques
                   ` (40 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nikolay Aleksandrov, David S. Miller, Luis Henriques

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

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

From: Nikolay Aleksandrov <nikolay@redhat.com>

commit d0fe8c888b1fd1a2f84b9962cabcb98a70988aec upstream.

I've been hitting a NULL ptr deref while using netconsole because the
np->dev check and the pointer manipulation in netpoll_cleanup are done
without rtnl and the following sequence happens when having a netconsole
over a vlan and we remove the vlan while disabling the netconsole:
	CPU 1					CPU2
					removes vlan and calls the notifier
enters store_enabled(), calls
netdev_cleanup which checks np->dev
and then waits for rtnl
					executes the netconsole netdev
					release notifier making np->dev
					== NULL and releases rtnl
continues to dereference a member of
np->dev which at this point is == NULL

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/netpoll.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index f9f40b9..5e81c49 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -920,15 +920,14 @@ EXPORT_SYMBOL_GPL(__netpoll_cleanup);
 
 void netpoll_cleanup(struct netpoll *np)
 {
-	if (!np->dev)
-		return;
-
 	rtnl_lock();
+	if (!np->dev)
+		goto out;
 	__netpoll_cleanup(np);
-	rtnl_unlock();
-
 	dev_put(np->dev);
 	np->dev = NULL;
+out:
+	rtnl_unlock();
 }
 EXPORT_SYMBOL(netpoll_cleanup);
 
-- 
1.8.3.2


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

* [PATCH 058/100] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 057/100] netpoll: fix NULL pointer dereference in netpoll_cleanup Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 059/100] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Luis Henriques
                   ` (39 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: YOSHIFUJI Hideaki, Hannes Frederic Sowa, David S. Miller,
	Luis Henriques

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

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

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

commit 2811ebac2521ceac84f2bdae402455baa6a7fb47 upstream.

In the following scenario the socket is corked:
If the first UDP packet is larger then the mtu we try to append it to the
write queue via ip6_ufo_append_data. A following packet, which is smaller
than the mtu would be appended to the already queued up gso-skb via
plain ip6_append_data. This causes random memory corruptions.

In ip6_ufo_append_data we also have to be careful to not queue up the
same skb multiple times. So setup the gso frame only when no first skb
is available.

This also fixes a shortcoming where we add the current packet's length to
cork->length but return early because of a packet > mtu with dontfrag set
(instead of sutracting it again).

Found with trinity.

Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/ip6_output.c | 53 +++++++++++++++++++++------------------------------
 1 file changed, 22 insertions(+), 31 deletions(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 8fa50aa..d00f1ad 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1135,6 +1135,8 @@ static inline int ip6_ufo_append_data(struct sock *sk,
 	 * udp datagram
 	 */
 	if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) {
+		struct frag_hdr fhdr;
+
 		skb = sock_alloc_send_skb(sk,
 			hh_len + fragheaderlen + transhdrlen + 20,
 			(flags & MSG_DONTWAIT), &err);
@@ -1155,12 +1157,6 @@ static inline int ip6_ufo_append_data(struct sock *sk,
 
 		skb->ip_summed = CHECKSUM_PARTIAL;
 		skb->csum = 0;
-	}
-
-	err = skb_append_datato_frags(sk,skb, getfrag, from,
-				      (length - transhdrlen));
-	if (!err) {
-		struct frag_hdr fhdr;
 
 		/* Specify the length of each IPv6 datagram fragment.
 		 * It has to be a multiple of 8.
@@ -1171,15 +1167,10 @@ static inline int ip6_ufo_append_data(struct sock *sk,
 		ipv6_select_ident(&fhdr, rt);
 		skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
 		__skb_queue_tail(&sk->sk_write_queue, skb);
-
-		return 0;
 	}
-	/* There is not enough support do UPD LSO,
-	 * so follow normal path
-	 */
-	kfree_skb(skb);
 
-	return err;
+	return skb_append_datato_frags(sk, skb, getfrag, from,
+				       (length - transhdrlen));
 }
 
 static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src,
@@ -1351,27 +1342,27 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
 	 * --yoshfuji
 	 */
 
-	cork->length += length;
-	if (length > mtu) {
-		int proto = sk->sk_protocol;
-		if (dontfrag && (proto == IPPROTO_UDP || proto == IPPROTO_RAW)){
-			ipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);
-			return -EMSGSIZE;
-		}
-
-		if (proto == IPPROTO_UDP &&
-		    (rt->dst.dev->features & NETIF_F_UFO)) {
+	if ((length > mtu) && dontfrag && (sk->sk_protocol == IPPROTO_UDP ||
+					   sk->sk_protocol == IPPROTO_RAW)) {
+		ipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);
+		return -EMSGSIZE;
+	}
 
-			err = ip6_ufo_append_data(sk, getfrag, from, length,
-						  hh_len, fragheaderlen,
-						  transhdrlen, mtu, flags, rt);
-			if (err)
-				goto error;
-			return 0;
-		}
+	skb = skb_peek_tail(&sk->sk_write_queue);
+	cork->length += length;
+	if (((length > mtu) ||
+	     (skb && skb_is_gso(skb))) &&
+	    (sk->sk_protocol == IPPROTO_UDP) &&
+	    (rt->dst.dev->features & NETIF_F_UFO)) {
+		err = ip6_ufo_append_data(sk, getfrag, from, length,
+					  hh_len, fragheaderlen,
+					  transhdrlen, mtu, flags, rt);
+		if (err)
+			goto error;
+		return 0;
 	}
 
-	if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL)
+	if (!skb)
 		goto alloc_new_skb;
 
 	while (length > 0) {
-- 
1.8.3.2


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

* [PATCH 059/100] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p)
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (57 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 058/100] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 060/100] net: flow_dissector: fix thoff for IPPROTO_AH Luis Henriques
                   ` (38 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Roger Luethi, Peter Boström, David S. Miller, Luis Henriques

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

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

From: Roger Luethi <rl@hellgate.ch>

commit 207070f5221e2a901d56a49df9cde47d9b716cd7 upstream.

Outgoing packets sent by via-rhine have their VLAN PCP field off by one
(when hardware acceleration is enabled). The TX descriptor expects only VID
and PCP (without a CFI/DEI bit).

Peter Boström noticed and reported the bug.

Signed-off-by: Roger Luethi <rl@hellgate.ch>
Cc: Peter Boström <peter.bostrom@netrounds.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/via/via-rhine.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 046526e0..4c1099e 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -32,7 +32,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #define DRV_NAME	"via-rhine"
-#define DRV_VERSION	"1.5.0"
+#define DRV_VERSION	"1.5.1"
 #define DRV_RELDATE	"2010-10-09"
 
 #include <linux/types.h>
@@ -1684,7 +1684,12 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
 		cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
 
 	if (unlikely(vlan_tx_tag_present(skb))) {
-		rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16);
+		u16 vid_pcp = vlan_tx_tag_get(skb);
+
+		/* drop CFI/DEI bit, register needs VID and PCP */
+		vid_pcp = (vid_pcp & VLAN_VID_MASK) |
+			  ((vid_pcp & VLAN_PRIO_MASK) >> 1);
+		rp->tx_ring[entry].tx_status = cpu_to_le32((vid_pcp) << 16);
 		/* request tagging */
 		rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000);
 	}
-- 
1.8.3.2


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

* [PATCH 060/100] net: flow_dissector: fix thoff for IPPROTO_AH
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (58 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 059/100] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 061/100] bonding: Fix broken promiscuity reference counting issue Luis Henriques
                   ` (37 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, Daniel Borkmann, Nikolay Aleksandrov,
	David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit b86783587b3d1d552326d955acee37eac48800f1 upstream.

In commit 8ed781668dd49 ("flow_keys: include thoff into flow_keys for
later usage"), we missed that existing code was using nhoff as a
temporary variable that could not always contain transport header
offset.

This is not a problem for TCP/UDP because port offset (@poff)
is 0 for these protocols.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/flow_dissector.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index a225089..2774788 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -133,8 +133,8 @@ ipv6:
 	if (poff >= 0) {
 		__be32 *ports, _ports;
 
-		nhoff += poff;
-		ports = skb_header_pointer(skb, nhoff, sizeof(_ports), &_ports);
+		ports = skb_header_pointer(skb, nhoff + poff,
+					   sizeof(_ports), &_ports);
 		if (ports)
 			flow->ports = *ports;
 	}
-- 
1.8.3.2


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

* [PATCH 061/100] bonding: Fix broken promiscuity reference counting issue
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (59 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 060/100] net: flow_dissector: fix thoff for IPPROTO_AH Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 062/100] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put Luis Henriques
                   ` (36 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jay Vosburgh, Andy Gospodarek, Mark Wu, David S. Miller,
	Luis Henriques

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

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

From: Neil Horman <nhorman@tuxdriver.com>

commit 5a0068deb611109c5ba77358be533f763f395ee4 upstream.

Recently grabbed this report:
https://bugzilla.redhat.com/show_bug.cgi?id=1005567

Of an issue in which the bonding driver, with an attached vlan encountered the
following errors when bond0 was taken down and back up:

dummy1: promiscuity touches roof, set promiscuity failed. promiscuity feature of
device might be broken.

The error occurs because, during __bond_release_one, if we release our last
slave, we take on a random mac address and issue a NETDEV_CHANGEADDR
notification.  With an attached vlan, the vlan may see that the vlan and bond
mac address were in sync, but no longer are.  This triggers a call to dev_uc_add
and dev_set_rx_mode, which enables IFF_PROMISC on the bond device.  Then, when
we complete __bond_release_one, we use the current state of the bond flags to
determine if we should decrement the promiscuity of the releasing slave.  But
since the bond changed promiscuity state during the release operation, we
incorrectly decrement the slave promisc count when it wasn't in promiscuous mode
to begin with, causing the above error

Fix is pretty simple, just cache the bonding flags at the start of the function
and use those when determining the need to set promiscuity.

This is also needed for the ALLMULTI flag

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Mark Wu <wudxw@linux.vnet.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
Reported-by: Mark Wu <wudxw@linux.vnet.ibm.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/bonding/bond_main.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index c7fd229c..5edf072 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1942,6 +1942,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 	struct bonding *bond = netdev_priv(bond_dev);
 	struct slave *slave, *oldcurrent;
 	struct sockaddr addr;
+	int old_flags = bond_dev->flags;
 	netdev_features_t old_features = bond_dev->features;
 
 	/* slave is not a slave or master is not master of this slave */
@@ -2075,12 +2076,18 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 	 * already taken care of above when we detached the slave
 	 */
 	if (!USES_PRIMARY(bond->params.mode)) {
-		/* unset promiscuity level from slave */
-		if (bond_dev->flags & IFF_PROMISC)
+		/* unset promiscuity level from slave
+		 * NOTE: The NETDEV_CHANGEADDR call above may change the value
+		 * of the IFF_PROMISC flag in the bond_dev, but we need the
+		 * value of that flag before that change, as that was the value
+		 * when this slave was attached, so we cache at the start of the
+		 * function and use it here. Same goes for ALLMULTI below
+		 */
+		if (old_flags & IFF_PROMISC)
 			dev_set_promiscuity(slave_dev, -1);
 
 		/* unset allmulti level from slave */
-		if (bond_dev->flags & IFF_ALLMULTI)
+		if (old_flags & IFF_ALLMULTI)
 			dev_set_allmulti(slave_dev, -1);
 
 		/* flush master's mc_list from slave */
-- 
1.8.3.2


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

* [PATCH 062/100] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (60 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 061/100] bonding: Fix broken promiscuity reference counting issue Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 063/100] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put Luis Henriques
                   ` (35 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Salam Noureddine, David S. Miller, Luis Henriques

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

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

From: Salam Noureddine <noureddine@aristanetworks.com>

commit e2401654dd0f5f3fb7a8d80dad9554d73d7ca394 upstream.

It is possible for the timer handlers to run after the call to
ip_mc_down so use in_dev_put instead of __in_dev_put in the handler
function in order to do proper cleanup when the refcnt reaches 0.
Otherwise, the refcnt can reach zero without the in_device being
destroyed and we end up leaking a reference to the net_device and
see messages like the following,

unregister_netdevice: waiting for eth0 to become free. Usage count = 1

Tested on linux-3.4.43.

Signed-off-by: Salam Noureddine <noureddine@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/igmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index ca66431..be7dba8 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -709,7 +709,7 @@ static void igmp_gq_timer_expire(unsigned long data)
 
 	in_dev->mr_gq_running = 0;
 	igmpv3_send_report(in_dev, NULL);
-	__in_dev_put(in_dev);
+	in_dev_put(in_dev);
 }
 
 static void igmp_ifc_timer_expire(unsigned long data)
@@ -721,7 +721,7 @@ static void igmp_ifc_timer_expire(unsigned long data)
 		in_dev->mr_ifc_count--;
 		igmp_ifc_start_timer(in_dev, IGMP_Unsolicited_Report_Interval);
 	}
-	__in_dev_put(in_dev);
+	in_dev_put(in_dev);
 }
 
 static void igmp_ifc_event(struct in_device *in_dev)
-- 
1.8.3.2


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

* [PATCH 063/100] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (61 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 062/100] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 064/100] dm9601: fix IFF_ALLMULTI handling Luis Henriques
                   ` (34 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Salam Noureddine, David S. Miller, Luis Henriques

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

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

From: Salam Noureddine <noureddine@aristanetworks.com>

commit 9260d3e1013701aa814d10c8fc6a9f92bd17d643 upstream.

It is possible for the timer handlers to run after the call to
ipv6_mc_down so use in6_dev_put instead of __in6_dev_put in the
handler function in order to do proper cleanup when the refcnt
reaches 0. Otherwise, the refcnt can reach zero without the
inet6_dev being destroyed and we end up leaking a reference to
the net_device and see messages like the following,

unregister_netdevice: waiting for eth0 to become free. Usage count = 1

Tested on linux-3.4.43.

Signed-off-by: Salam Noureddine <noureddine@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.5 (based on davem backport to 3.4):
  - dropped changes to mld_dad_timer_expire() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/mcast.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 2e97228..4441a0f 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2149,7 +2149,7 @@ static void mld_gq_timer_expire(unsigned long data)
 
 	idev->mc_gq_running = 0;
 	mld_send_report(idev, NULL);
-	__in6_dev_put(idev);
+	in6_dev_put(idev);
 }
 
 static void mld_ifc_timer_expire(unsigned long data)
@@ -2162,7 +2162,7 @@ static void mld_ifc_timer_expire(unsigned long data)
 		if (idev->mc_ifc_count)
 			mld_ifc_start_timer(idev, idev->mc_maxdelay);
 	}
-	__in6_dev_put(idev);
+	in6_dev_put(idev);
 }
 
 static void mld_ifc_event(struct inet6_dev *idev)
-- 
1.8.3.2


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

* [PATCH 064/100] dm9601: fix IFF_ALLMULTI handling
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (62 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 063/100] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 065/100] ll_temac: Reset dma descriptors indexes on ndo_open Luis Henriques
                   ` (33 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Korsgaard, David S. Miller, Luis Henriques

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

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

From: Peter Korsgaard <peter@korsgaard.com>

commit bf0ea6380724beb64f27a722dfc4b0edabff816e upstream.

Pass-all-multicast is controlled by bit 3 in RX control, not bit 2
(pass undersized frames).

Reported-by: Joseph Chang <joseph_chang@davicom.com.tw>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/usb/dm9601.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index e0433ce..e55db3a 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -384,7 +384,7 @@ static void dm9601_set_multicast(struct net_device *net)
 		rx_ctl |= 0x02;
 	} else if (net->flags & IFF_ALLMULTI ||
 		   netdev_mc_count(net) > DM_MAX_MCAST) {
-		rx_ctl |= 0x04;
+		rx_ctl |= 0x08;
 	} else if (!netdev_mc_empty(net)) {
 		struct netdev_hw_addr *ha;
 
-- 
1.8.3.2


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

* [PATCH 065/100] ll_temac: Reset dma descriptors indexes on ndo_open
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (63 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 064/100] dm9601: fix IFF_ALLMULTI handling Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 066/100] gianfar: Change default HW Tx queue scheduling mode Luis Henriques
                   ` (32 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ricardo Ribalda Delgado, David S. Miller, Luis Henriques

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

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

From: Ricardo Ribalda <ricardo.ribalda@gmail.com>

commit 7167cf0e8cd10287b7912b9ffcccd9616f382922 upstream.

The dma descriptors indexes are only initialized on the probe function.

If a packet is on the buffer when temac_stop is called, the dma
descriptors indexes can be left on a incorrect state where no other
package can be sent.

So an interface could be left in an usable state after ifdow/ifup.

This patch makes sure that the descriptors indexes are in a proper
status when the device is open.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 1eaf712..26e487b 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -308,6 +308,12 @@ static int temac_dma_bd_init(struct net_device *ndev)
 		       lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
 	lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p);
 
+	/* Init descriptor indexes */
+	lp->tx_bd_ci = 0;
+	lp->tx_bd_next = 0;
+	lp->tx_bd_tail = 0;
+	lp->rx_bd_ci = 0;
+
 	return 0;
 
 out:
-- 
1.8.3.2


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

* [PATCH 066/100] gianfar: Change default HW Tx queue scheduling mode
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (64 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 065/100] ll_temac: Reset dma descriptors indexes on ndo_open Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 067/100] fanotify: dont merge permission events Luis Henriques
                   ` (31 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Claudiu Manoil, David S. Miller, Christian Engelmayer,
	Luis Henriques

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

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

From: Claudiu Manoil <claudiu.manoil@freescale.com>

commit b98b8babd6e3370fadb7c6eaacb00eb2f6344a6c upstream.

This is primarily to address transmission timeout occurrences, when
multiple H/W Tx queues are being used concurrently. Because in
the priority scheduling mode the controller does not service the
Tx queues equally (but in ascending index order), Tx timeouts are
being triggered rightaway for a basic test with multiple simultaneous
connections like:
iperf -c <server_ip> -n 100M -P 8

resulting in kernel trace:
NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out
------------[ cut here ]------------
WARNING: at net/sched/sch_generic.c:255
...
and controller reset during intense traffic, and possibly further
complications.

This patch changes the default H/W Tx scheduling setting (TXSCHED)
for multi-queue devices, from priority scheduling mode to a weighted
round robin mode with equal weights for all H/W Tx queues, and
addresses the issue above.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 11 ++++++++++-
 drivers/net/ethernet/freescale/gianfar.h | 11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index ccc2b3b..285049f 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -394,7 +394,13 @@ static void gfar_init_mac(struct net_device *ndev)
 	if (ndev->features & NETIF_F_IP_CSUM)
 		tctrl |= TCTRL_INIT_CSUM;
 
-	tctrl |= TCTRL_TXSCHED_PRIO;
+	if (priv->prio_sched_en)
+		tctrl |= TCTRL_TXSCHED_PRIO;
+	else {
+		tctrl |= TCTRL_TXSCHED_WRRS;
+		gfar_write(&regs->tr03wt, DEFAULT_WRRS_WEIGHT);
+		gfar_write(&regs->tr47wt, DEFAULT_WRRS_WEIGHT);
+	}
 
 	gfar_write(&regs->tctrl, tctrl);
 
@@ -1153,6 +1159,9 @@ static int gfar_probe(struct platform_device *ofdev)
 	priv->rx_filer_enable = 1;
 	/* Enable most messages by default */
 	priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
+	/* use pritority h/w tx queue scheduling for single queue devices */
+	if (priv->num_tx_queues == 1)
+		priv->prio_sched_en = 1;
 
 	/* Carrier starts down, phylib will bring it up */
 	netif_carrier_off(dev);
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 27d8aeb..22eabc1 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -301,8 +301,16 @@ extern const char gfar_driver_version[];
 #define TCTRL_TFCPAUSE		0x00000008
 #define TCTRL_TXSCHED_MASK	0x00000006
 #define TCTRL_TXSCHED_INIT	0x00000000
+/* priority scheduling */
 #define TCTRL_TXSCHED_PRIO	0x00000002
+/* weighted round-robin scheduling (WRRS) */
 #define TCTRL_TXSCHED_WRRS	0x00000004
+/* default WRRS weight and policy setting,
+ * tailored to the tr03wt and tr47wt registers:
+ * equal weight for all Tx Qs, measured in 64byte units
+ */
+#define DEFAULT_WRRS_WEIGHT	0x18181818
+
 #define TCTRL_INIT_CSUM		(TCTRL_TUCSEN | TCTRL_IPCSEN)
 
 #define IEVENT_INIT_CLEAR	0xffffffff
@@ -1096,7 +1104,8 @@ struct gfar_private {
 		extended_hash:1,
 		bd_stash_en:1,
 		rx_filer_enable:1,
-		wol_en:1; /* Wake-on-LAN enabled */
+		wol_en:1, /* Wake-on-LAN enabled */
+		prio_sched_en:1; /* Enable priorty based Tx scheduling in Hw */
 	unsigned short padding;
 
 	/* PHY stuff */
-- 
1.8.3.2


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

* [PATCH 067/100] fanotify: dont merge permission events
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (65 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 066/100] gianfar: Change default HW Tx queue scheduling mode Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 068/100] sparc32: Fix exit flag passed from traced sys_sigreturn Luis Henriques
                   ` (30 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lino Sanfilippo, Eric Paris, Luis Henriques

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

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

From: Lino Sanfilippo <LinoSanfilippo@gmx.de>

commit 03a1cec1f17ac1a6041996b3e40f96b5a2f90e1b upstream.

Boyd Yang reported a problem for the case that multiple threads of the same
thread group are waiting for a reponse for a permission event.
In this case it is possible that some of the threads are never woken up, even
if the response for the event has been received
(see http://marc.info/?l=linux-kernel&m=131822913806350&w=2).

The reason is that we are currently merging permission events if they belong to
the same thread group. But we are not prepared to wake up more than one waiter
for each event. We do

wait_event(group->fanotify_data.access_waitq, event->response ||
			atomic_read(&group->fanotify_data.bypass_perm));
and after that
  event->response = 0;

which is the reason that even if we woke up all waiters for the same event
some of them may see event->response being already set 0 again, then go back to
sleep and block forever.

With this patch we avoid that more than one thread is waiting for a response
by not merging permission events for the same thread group any more.

Reported-by: Boyd Yang <boyd.yang@gmail.com>
Signed-off-by: Lino Sanfilippo <LinoSanfilipp@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/notify/fanotify/fanotify.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index a506360..0c2f912 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -18,6 +18,12 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
 	    old->tgid == new->tgid) {
 		switch (old->data_type) {
 		case (FSNOTIFY_EVENT_PATH):
+#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+			/* dont merge two permission events */
+			if ((old->mask & FAN_ALL_PERM_EVENTS) &&
+			    (new->mask & FAN_ALL_PERM_EVENTS))
+				return false;
+#endif
 			if ((old->path.mnt == new->path.mnt) &&
 			    (old->path.dentry == new->path.dentry))
 				return true;
-- 
1.8.3.2


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

* [PATCH 068/100] sparc32: Fix exit flag passed from traced sys_sigreturn
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (66 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 067/100] fanotify: dont merge permission events Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 069/100] sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall Luis Henriques
                   ` (29 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kirill Tkhai, David Miller, Luis Henriques

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

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

From: Kirill Tkhai <tkhai@yandex.ru>

commit 7a3b0f89e3fea680f93932691ca41a68eee7ab5e upstream.

Pass 1 in %o1 to indicate that syscall_trace accounts exit.

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: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/kernel/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index dcaa1cf..1670d10 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -860,7 +860,7 @@ sys_sigreturn:
 	 nop
 
 	call	syscall_trace
-	 nop
+	 mov	1, %o1
 
 1:
 	/* We don't want to muck with user registers like a
-- 
1.8.3.2


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

* [PATCH 069/100] sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (67 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 068/100] sparc32: Fix exit flag passed from traced sys_sigreturn Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 070/100] esp_scsi: Fix tag state corruption when autosensing Luis Henriques
                   ` (28 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kirill Tkhai, David Miller, Luis Henriques

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

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

From: Kirill Tkhai <tkhai@yandex.ru>

commit ab2abda6377723e0d5fbbfe5f5aa16a5523344d1 upstream.

(From v1 to v2: changed comment)

On the way linux_sparc_syscall32->linux_syscall_trace32->goto 2f,
register %o5 doesn't clear its second 32-bit.

Fix that.

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: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/kernel/syscalls.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 7f5f65d..817187d 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -147,7 +147,7 @@ linux_syscall_trace32:
 	srl	%i4, 0, %o4
 	srl	%i1, 0, %o1
 	srl	%i2, 0, %o2
-	ba,pt	%xcc, 2f
+	ba,pt	%xcc, 5f
 	 srl	%i3, 0, %o3
 
 linux_syscall_trace:
@@ -177,13 +177,13 @@ linux_sparc_syscall32:
 	srl	%i1, 0, %o1				! IEU0	Group
 	ldx	[%g6 + TI_FLAGS], %l0		! Load
 
-	srl	%i5, 0, %o5				! IEU1
+	srl	%i3, 0, %o3				! IEU0
 	srl	%i2, 0, %o2				! IEU0	Group
 	andcc	%l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
 	bne,pn	%icc, linux_syscall_trace32		! CTI
 	 mov	%i0, %l5				! IEU1
-	call	%l7					! CTI	Group brk forced
-	 srl	%i3, 0, %o3				! IEU0
+5:	call	%l7					! CTI	Group brk forced
+	 srl	%i5, 0, %o5				! IEU1
 	ba,a,pt	%xcc, 3f
 
 	/* Linux native system calls enter here... */
-- 
1.8.3.2


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

* [PATCH 070/100] esp_scsi: Fix tag state corruption when autosensing.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (68 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 069/100] sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 071/100] sparc64: Fix ITLB handler of null page Luis Henriques
                   ` (27 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Luis Henriques

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

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

From: "David S. Miller" <davem@davemloft.net>

commit 21af8107f27878813d0364733c0b08813c2c192a upstream.

Meelis Roos reports a crash in esp_free_lun_tag() in the presense
of a disk which has died.

The issue is that when we issue an autosense command, we do so by
hijacking the original command that caused the check-condition.

When we do so we clear out the ent->tag[] array when we issue it via
find_and_prep_issuable_command().  This is so that the autosense
command is forced to be issued non-tagged.

That is problematic, because it is the value of ent->tag[] which
determines whether we issued the original scsi command as tagged
vs. non-tagged (see esp_alloc_lun_tag()).

And that, in turn, is what trips up the sanity checks in
esp_free_lun_tag().  That function needs the original ->tag[] values
in order to free up the tag slot properly.

Fix this by remembering the original command's tag values, and
having esp_alloc_lun_tag() and esp_free_lun_tag() use them.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/esp_scsi.c | 14 ++++++++------
 drivers/scsi/esp_scsi.h |  1 +
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 34552bf..55548dc 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -530,7 +530,7 @@ static int esp_need_to_nego_sync(struct esp_target_data *tp)
 static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
 			     struct esp_lun_data *lp)
 {
-	if (!ent->tag[0]) {
+	if (!ent->orig_tag[0]) {
 		/* Non-tagged, slot already taken?  */
 		if (lp->non_tagged_cmd)
 			return -EBUSY;
@@ -564,9 +564,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
 			return -EBUSY;
 	}
 
-	BUG_ON(lp->tagged_cmds[ent->tag[1]]);
+	BUG_ON(lp->tagged_cmds[ent->orig_tag[1]]);
 
-	lp->tagged_cmds[ent->tag[1]] = ent;
+	lp->tagged_cmds[ent->orig_tag[1]] = ent;
 	lp->num_tagged++;
 
 	return 0;
@@ -575,9 +575,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
 static void esp_free_lun_tag(struct esp_cmd_entry *ent,
 			     struct esp_lun_data *lp)
 {
-	if (ent->tag[0]) {
-		BUG_ON(lp->tagged_cmds[ent->tag[1]] != ent);
-		lp->tagged_cmds[ent->tag[1]] = NULL;
+	if (ent->orig_tag[0]) {
+		BUG_ON(lp->tagged_cmds[ent->orig_tag[1]] != ent);
+		lp->tagged_cmds[ent->orig_tag[1]] = NULL;
 		lp->num_tagged--;
 	} else {
 		BUG_ON(lp->non_tagged_cmd != ent);
@@ -667,6 +667,8 @@ static struct esp_cmd_entry *find_and_prep_issuable_command(struct esp *esp)
 			ent->tag[0] = 0;
 			ent->tag[1] = 0;
 		}
+		ent->orig_tag[0] = ent->tag[0];
+		ent->orig_tag[1] = ent->tag[1];
 
 		if (esp_alloc_lun_tag(ent, lp) < 0)
 			continue;
diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h
index 28e22ac..cd68805 100644
--- a/drivers/scsi/esp_scsi.h
+++ b/drivers/scsi/esp_scsi.h
@@ -271,6 +271,7 @@ struct esp_cmd_entry {
 #define ESP_CMD_FLAG_AUTOSENSE	0x04 /* Doing automatic REQUEST_SENSE */
 
 	u8			tag[2];
+	u8			orig_tag[2];
 
 	u8			status;
 	u8			message;
-- 
1.8.3.2


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

* [PATCH 071/100] sparc64: Fix ITLB handler of null page
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (69 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 070/100] esp_scsi: Fix tag state corruption when autosensing Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 072/100] sparc64: Remove RWSEM export leftovers Luis Henriques
                   ` (26 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kirill Tkhai, David Miller, Luis Henriques

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

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

From: Kirill Tkhai <tkhai@yandex.ru>

commit 1c2696cdaad84580545a2e9c0879ff597880b1a9 upstream.

1)Use kvmap_itlb_longpath instead of kvmap_dtlb_longpath.

2)Handle page #0 only, don't handle page #1: bleu -> blu

 (KERNBASE is 0x400000, so #1 does not exist too. But everything
  is possible in the future. Fix to not to have problems later.)

3)Remove unused kvmap_itlb_nonlinear.

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: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/kernel/ktlb.S | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/ktlb.S b/arch/sparc/kernel/ktlb.S
index 79f3103..7c00735 100644
--- a/arch/sparc/kernel/ktlb.S
+++ b/arch/sparc/kernel/ktlb.S
@@ -25,11 +25,10 @@ kvmap_itlb:
 	 */
 kvmap_itlb_4v:
 
-kvmap_itlb_nonlinear:
 	/* Catch kernel NULL pointer calls.  */
 	sethi		%hi(PAGE_SIZE), %g5
 	cmp		%g4, %g5
-	bleu,pn		%xcc, kvmap_dtlb_longpath
+	blu,pn		%xcc, kvmap_itlb_longpath
 	 nop
 
 	KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_itlb_load)
-- 
1.8.3.2


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

* [PATCH 072/100] sparc64: Remove RWSEM export leftovers
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (70 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 071/100] sparc64: Fix ITLB handler of null page Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 073/100] sparc64: Fix off by one in trampoline TLB mapping installation loop Luis Henriques
                   ` (25 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kirill Tkhai, David Miller, Luis Henriques

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

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

From: Kirill Tkhai <tkhai@yandex.ru>

commit 61d9b9355b0d427bd1e732bd54628ff9103e496f upstream.

The functions

			__down_read
			__down_read_trylock
			__down_write
			__down_write_trylock
			__up_read
			__up_write
			__downgrade_write

are implemented inline, so remove corresponding EXPORT_SYMBOLs
(They lead to compile errors on RT kernel).

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: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/lib/ksyms.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
index 3b31218..6a169df 100644
--- a/arch/sparc/lib/ksyms.c
+++ b/arch/sparc/lib/ksyms.c
@@ -98,15 +98,6 @@ EXPORT_SYMBOL(___copy_from_user);
 EXPORT_SYMBOL(___copy_in_user);
 EXPORT_SYMBOL(__clear_user);
 
-/* RW semaphores */
-EXPORT_SYMBOL(__down_read);
-EXPORT_SYMBOL(__down_read_trylock);
-EXPORT_SYMBOL(__down_write);
-EXPORT_SYMBOL(__down_write_trylock);
-EXPORT_SYMBOL(__up_read);
-EXPORT_SYMBOL(__up_write);
-EXPORT_SYMBOL(__downgrade_write);
-
 /* Atomic counter implementation. */
 EXPORT_SYMBOL(atomic_add);
 EXPORT_SYMBOL(atomic_add_ret);
-- 
1.8.3.2


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

* [PATCH 073/100] sparc64: Fix off by one in trampoline TLB mapping installation loop.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (71 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 072/100] sparc64: Remove RWSEM export leftovers Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 074/100] ASoC: max98095: a couple array underflows Luis Henriques
                   ` (24 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Luis Henriques

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

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

From: "David S. Miller" <davem@davemloft.net>

commit 63d499662aeec1864ec36d042aca8184ea6a938e upstream.

Reported-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/kernel/trampoline_64.S | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/sparc/kernel/trampoline_64.S b/arch/sparc/kernel/trampoline_64.S
index da1b781..8fa84a3 100644
--- a/arch/sparc/kernel/trampoline_64.S
+++ b/arch/sparc/kernel/trampoline_64.S
@@ -131,7 +131,6 @@ startup_continue:
 	clr		%l5
 	sethi		%hi(num_kernel_image_mappings), %l6
 	lduw		[%l6 + %lo(num_kernel_image_mappings)], %l6
-	add		%l6, 1, %l6
 
 	mov		15, %l7
 	BRANCH_IF_ANY_CHEETAH(g1,g5,2f)
@@ -224,7 +223,6 @@ niagara_lock_tlb:
 	clr		%l5
 	sethi		%hi(num_kernel_image_mappings), %l6
 	lduw		[%l6 + %lo(num_kernel_image_mappings)], %l6
-	add		%l6, 1, %l6
 
 1:
 	mov		HV_FAST_MMU_MAP_PERM_ADDR, %o5
-- 
1.8.3.2


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

* [PATCH 074/100] ASoC: max98095: a couple array underflows
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (72 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 073/100] sparc64: Fix off by one in trampoline TLB mapping installation loop Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 075/100] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st() Luis Henriques
                   ` (23 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Mark Brown, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit f8d7b13e14357ed19d2ca2799539600418dc3939 upstream.

The ->put() function are called from snd_ctl_elem_write() with user
supplied data.  The limit checks here could underflow leading to a
crash.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/max98095.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 35179e2..bf80366 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -1863,7 +1863,7 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
 	struct max98095_pdata *pdata = max98095->pdata;
 	int channel = max98095_get_eq_channel(kcontrol->id.name);
 	struct max98095_cdata *cdata;
-	int sel = ucontrol->value.integer.value[0];
+	unsigned int sel = ucontrol->value.integer.value[0];
 	struct max98095_eq_cfg *coef_set;
 	int fs, best, best_val, i;
 	int regmask, regsave;
@@ -2016,7 +2016,7 @@ static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol,
 	struct max98095_pdata *pdata = max98095->pdata;
 	int channel = max98095_get_bq_channel(codec, kcontrol->id.name);
 	struct max98095_cdata *cdata;
-	int sel = ucontrol->value.integer.value[0];
+	unsigned int sel = ucontrol->value.integer.value[0];
 	struct max98095_biquad_cfg *coef_set;
 	int fs, best, best_val, i;
 	int regmask, regsave;
-- 
1.8.3.2


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

* [PATCH 075/100] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st()
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (73 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 074/100] ASoC: max98095: a couple array underflows Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 076/100] Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012 Luis Henriques
                   ` (22 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Mark Brown, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit d967967e8d1116fb38bad25e58714b5dddd03cca upstream.

This is called from snd_ctl_elem_write() with user supplied data so we
need to add some bounds checking.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/88pm860x-codec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 9fd3b68..3ff2b94 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -351,6 +351,9 @@ static int snd_soc_put_volsw_2r_st(struct snd_kcontrol *kcontrol,
 	val = ucontrol->value.integer.value[0];
 	val2 = ucontrol->value.integer.value[1];
 
+	if (val >= ARRAY_SIZE(st_table) || val2 >= ARRAY_SIZE(st_table))
+		return -EINVAL;
+
 	err = snd_soc_update_bits(codec, reg, 0x3f, st_table[val].m);
 	if (err < 0)
 		return err;
-- 
1.8.3.2


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

* [PATCH 076/100] Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (74 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 075/100] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st() Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 077/100] Bluetooth: Fix security level for peripheral role Luis Henriques
                   ` (21 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peng Chen, Gustavo Padovan, Luis Henriques

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

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

From: Peng Chen <pengchen@qti.qualcomm.com>

commit 0a3658cccdf5326ea508efeb1879b0e2508bb0c3 upstream.

usb device info:

T:  Bus=06 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 15 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0cf3 ProdID=e005 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

Signed-off-by: Peng Chen <pengchen@qca.qualcomm.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 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 5a757be..8c5508b 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x04CA, 0x3008) },
 	{ USB_DEVICE(0x13d3, 0x3362) },
 	{ USB_DEVICE(0x0CF3, 0xE004) },
+	{ USB_DEVICE(0x0CF3, 0xE005) },
 	{ USB_DEVICE(0x0930, 0x0219) },
 	{ USB_DEVICE(0x0489, 0xe057) },
 	{ USB_DEVICE(0x13d3, 0x3393) },
@@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index e17340f..b29109e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -154,6 +154,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
-- 
1.8.3.2


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

* [PATCH 077/100] Bluetooth: Fix security level for peripheral role
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (75 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 076/100] Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012 Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 078/100] Bluetooth: Fix encryption key size " Luis Henriques
                   ` (20 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andre Guedes, Gustavo Padovan, Luis Henriques

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

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

From: Andre Guedes <andre.guedes@openbossa.org>

commit f8776218e8546397be64ad2bc0ebf4748522d6e3 upstream.

While playing the peripheral role, the host gets a LE Long Term Key
Request Event from the controller when a connection is established
with a bonded device. The host then informs the LTK which should be
used for the connection. Once the link is encrypted, the host gets
an Encryption Change Event.

Therefore we should set conn->pending_sec_level instead of conn->
sec_level in hci_le_ltk_request_evt. This way, conn->sec_level is
properly updated in hci_encrypt_change_evt.

Moreover, since we have a LTK associated to the device, we have at
least BT_SECURITY_MEDIUM security level.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/bluetooth/hci_event.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 843d048..9871e8b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3452,7 +3452,9 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
 	cp.handle = cpu_to_le16(conn->handle);
 
 	if (ltk->authenticated)
-		conn->sec_level = BT_SECURITY_HIGH;
+		conn->pending_sec_level = BT_SECURITY_HIGH;
+	else
+		conn->pending_sec_level = BT_SECURITY_MEDIUM;
 
 	hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
 
-- 
1.8.3.2


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

* [PATCH 078/100] Bluetooth: Fix encryption key size for peripheral role
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (76 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 077/100] Bluetooth: Fix security level for peripheral role Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 079/100] Bluetooth: Add support for BCM20702A0 [0b05, 17cb] Luis Henriques
                   ` (19 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andre Guedes, Gustavo Padovan, Luis Henriques

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

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

From: Andre Guedes <andre.guedes@openbossa.org>

commit 89cbb4da0abee2f39d75f67f9fd57f7410c8b65c upstream.

This patch fixes the connection encryption key size information when
the host is playing the peripheral role. We should set conn->enc_key_
size in hci_le_ltk_request_evt, otherwise it is left uninitialized.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/bluetooth/hci_event.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 9871e8b..7797c9d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3456,6 +3456,8 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
 	else
 		conn->pending_sec_level = BT_SECURITY_MEDIUM;
 
+	conn->enc_key_size = ltk->enc_size;
+
 	hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
 
 	if (ltk->type & HCI_SMP_STK) {
-- 
1.8.3.2


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

* [PATCH 079/100] Bluetooth: Add support for BCM20702A0 [0b05, 17cb]
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (77 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 078/100] Bluetooth: Fix encryption key size " Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 080/100] rtlwifi: Align private space in rtl_priv struct Luis Henriques
                   ` (18 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Raphael Kubo da Costa, Gustavo Padovan, Luis Henriques

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

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

From: Raphael Kubo da Costa <rakuco@FreeBSD.org>

commit 38a172bef8c93ecbfd69715fd88396988e4073fd upstream.

Yet another vendor specific ID for this chipset; this one for the ASUS
USB-BT400 Bluetooth 4.0 adapter.

T:  Bus=03 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0b05 ProdID=17cb Rev=01.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=000272C64400
C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Signed-off-by: Raphael Kubo da Costa <rakuco@FreeBSD.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btusb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b29109e..a5eef4e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -108,6 +108,7 @@ static struct usb_device_id btusb_table[] = {
 
 	/* Broadcom BCM20702A0 */
 	{ USB_DEVICE(0x0b05, 0x17b5) },
+	{ USB_DEVICE(0x0b05, 0x17cb) },
 	{ USB_DEVICE(0x04ca, 0x2003) },
 	{ USB_DEVICE(0x0489, 0xe042) },
 	{ USB_DEVICE(0x413c, 0x8197) },
-- 
1.8.3.2


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

* [PATCH 080/100] rtlwifi: Align private space in rtl_priv struct
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (78 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 079/100] Bluetooth: Add support for BCM20702A0 [0b05, 17cb] Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 081/100] p54usb: add USB ID for Corega WLUSB2GTST USB adapter Luis Henriques
                   ` (17 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, John W. Linville, Luis Henriques

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

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

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

commit 60ce314d1750fef843e9db70050e09e49f838b69 upstream.

The private array at the end of the rtl_priv struct is not aligned.
On ARM architecture, this causes an alignment trap and is fixed by aligning
that array with __align(sizeof(void *)). That should properly align that
space according to the requirements of all architectures.

Reported-by: Jason Andrews <jasona@cadence.com>
Tested-by: Jason Andrews <jasona@cadence.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/wifi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index cdaa21f..dec7c55 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1701,7 +1701,7 @@ struct rtl_priv {
 	   that it points to the data allocated
 	   beyond  this structure like:
 	   rtl_pci_priv or rtl_usb_priv */
-	u8 priv[0];
+	u8 priv[0] __aligned(sizeof(void *));
 };
 
 #define rtl_priv(hw)		(((struct rtl_priv *)(hw)->priv))
-- 
1.8.3.2


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

* [PATCH 081/100] p54usb: add USB ID for Corega WLUSB2GTST USB adapter
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (79 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 080/100] rtlwifi: Align private space in rtl_priv struct Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 082/100] mwifiex: fix hang issue for USB chipsets Luis Henriques
                   ` (16 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christian Lamparter, John W. Linville, Luis Henriques

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

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

From: Christian Lamparter <chunkeey@googlemail.com>

commit 1e43692cdb7cc445d6347d8a5207d9cef0c71434 upstream.

Added USB ID for Corega WLUSB2GTST USB adapter.

Reported-by: Joerg Kalisch <the_force@gmx.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/p54/p54usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 3d4dd4d..a8f1702d 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -83,6 +83,7 @@ static struct usb_device_id p54u_table[] = {
 	{USB_DEVICE(0x06a9, 0x000e)},	/* Westell 802.11g USB (A90-211WG-01) */
 	{USB_DEVICE(0x06b9, 0x0121)},	/* Thomson SpeedTouch 121g */
 	{USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
+	{USB_DEVICE(0x07aa, 0x0020)},	/* Corega WLUSB2GTST USB */
 	{USB_DEVICE(0x0803, 0x4310)},	/* Zoom 4410a */
 	{USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
 	{USB_DEVICE(0x083a, 0x4531)},	/* T-Com Sinus 154 data II */
-- 
1.8.3.2


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

* [PATCH 082/100] mwifiex: fix hang issue for USB chipsets
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (80 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 081/100] p54usb: add USB ID for Corega WLUSB2GTST USB adapter Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 083/100] mwifiex: fix NULL pointer dereference in usb suspend handler Luis Henriques
                   ` (15 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Amitkumar Karwar, Bing Zhao, John W. Linville, Luis Henriques

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

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

From: Amitkumar Karwar <akarwar@marvell.com>

commit bd1c6142edce787b8ac1be15635f845aa9905333 upstream.

Bug 60815 - Interface hangs in mwifiex_usb
https://bugzilla.kernel.org/show_bug.cgi?id=60815

We have 4 bytes of interface header for packets delivered to SDIO
and PCIe, but not for USB interface.

In Tx AMSDU case, currently 4 bytes of garbage data is unnecessarily
appended for USB packets. This sometimes leads to a firmware hang,
because it may not interpret the data packet correctly.

Problem is fixed by removing this redundant headroom for USB.

Tested-by: Dmitry Khromov <icechrome@gmail.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: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/mwifiex/11n_aggr.c | 3 ++-
 drivers/net/wireless/mwifiex/11n_aggr.h | 2 +-
 drivers/net/wireless/mwifiex/wmm.c      | 3 +--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index ab84eb9..8a0667c 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -153,7 +153,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv,
  */
 int
 mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
-			  struct mwifiex_ra_list_tbl *pra_list, int headroom,
+			  struct mwifiex_ra_list_tbl *pra_list,
 			  int ptrindex, unsigned long ra_list_flags)
 			  __releases(&priv->wmm.ra_list_spinlock)
 {
@@ -163,6 +163,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
 	int pad = 0, ret;
 	struct mwifiex_tx_param tx_param;
 	struct txpd *ptx_pd = NULL;
+	int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN;
 
 	skb_src = skb_peek(&pra_list->skb_head);
 	if (!skb_src) {
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h
index 900e1c6..892098d 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.h
+++ b/drivers/net/wireless/mwifiex/11n_aggr.h
@@ -26,7 +26,7 @@
 int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
 				struct sk_buff *skb);
 int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
-			      struct mwifiex_ra_list_tbl *ptr, int headroom,
+			      struct mwifiex_ra_list_tbl *ptr,
 			      int ptr_index, unsigned long flags)
 			      __releases(&priv->wmm.ra_list_spinlock);
 
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 3fa4d41..8ac61da 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -1246,8 +1246,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
 		if (mwifiex_is_amsdu_allowed(priv, tid) &&
 		    mwifiex_is_11n_aggragation_possible(priv, ptr,
 							adapter->tx_buf_size))
-			mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
-						  ptr_index, flags);
+			mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags);
 			/* ra_list_spinlock has been freed in
 			   mwifiex_11n_aggregate_pkt() */
 		else
-- 
1.8.3.2


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

* [PATCH 083/100] mwifiex: fix NULL pointer dereference in usb suspend handler
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (81 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 082/100] mwifiex: fix hang issue for USB chipsets Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 084/100] USB: serial: option: Ignore card reader interface on Huawei E1750 Luis Henriques
                   ` (14 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bing Zhao, John W. Linville, Luis Henriques

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

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

From: Bing Zhao <bzhao@marvell.com>

commit 346ece0b7ba2730b4d633b9e371fe55488803102 upstream.

Bug 60815 - Interface hangs in mwifiex_usb
https://bugzilla.kernel.org/show_bug.cgi?id=60815

[ 2.883807] BUG: unable to handle kernel NULL pointer dereference
            at 0000000000000048
[ 2.883813] IP: [<ffffffff815a65e0>] pfifo_fast_enqueue+0x90/0x90

[ 2.883834] CPU: 1 PID: 3220 Comm: kworker/u8:90 Not tainted
            3.11.1-monotone-l0 #6
[ 2.883834] Hardware name: Microsoft Corporation Surface with
            Windows 8 Pro/Surface with Windows 8 Pro,
            BIOS 1.03.0450 03/29/2013

On Surface Pro, suspend to ram gives a NULL pointer dereference in
pfifo_fast_enqueue(). The stack trace reveals that the offending
call is clearing carrier in mwifiex_usb suspend handler.

Since commit 1499d9f "mwifiex: don't drop carrier flag over suspend"
has removed the carrier flag handling over suspend/resume in SDIO
and PCIe drivers, I'm removing it in USB driver too. This also fixes
the bug for Surface Pro.

Tested-by: Dmitry Khromov <icechrome@gmail.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/mwifiex/usb.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c
index 22a5916..7fda0ab 100644
--- a/drivers/net/wireless/mwifiex/usb.c
+++ b/drivers/net/wireless/mwifiex/usb.c
@@ -446,9 +446,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message)
 	 */
 	adapter->is_suspended = true;
 
-	for (i = 0; i < adapter->priv_num; i++)
-		netif_carrier_off(adapter->priv[i]->netdev);
-
 	if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb)
 		usb_kill_urb(card->rx_cmd.urb);
 
@@ -508,10 +505,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
 						  MWIFIEX_RX_CMD_BUF_SIZE);
 	}
 
-	for (i = 0; i < adapter->priv_num; i++)
-		if (adapter->priv[i]->media_connected)
-			netif_carrier_on(adapter->priv[i]->netdev);
-
 	/* Disable Host Sleep */
 	if (adapter->hs_activated)
 		mwifiex_cancel_hs(mwifiex_get_priv(adapter,
-- 
1.8.3.2


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

* [PATCH 084/100] USB: serial: option: Ignore card reader interface on Huawei E1750
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (82 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 083/100] mwifiex: fix NULL pointer dereference in usb suspend handler Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 085/100] ib_srpt: Destroy cm_id before destroying QP Luis Henriques
                   ` (13 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michal Malý, Bjørn Mork, Greg Kroah-Hartman,
	Luis Henriques

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

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

From: =?UTF-8?q?Michal=20Mal=C3=BD?= <madcatxster@prifuk.cz>

commit eb2addd4044b4b2ce77693bde5bc810536dd96ee upstream.

Hi,

my Huawei 3G modem has an embedded Smart Card reader which causes
trouble when the modem is being detected (a bunch of "<warn>  (ttyUSBx):
open blocked by driver for more than 7 seconds!" in messages.log). This
trivial patch corrects the problem for me. The modem identifies itself
as "12d1:1406 Huawei Technologies Co., Ltd. E1750" in lsusb although the
description on the body says "Model E173u-1"

Signed-off-by: Michal Malý <madcatxster@prifuk.cz>
Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/option.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 7785df0..d0c2d20 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -81,6 +81,7 @@ static void option_instat_callback(struct urb *urb);
 
 #define HUAWEI_VENDOR_ID			0x12D1
 #define HUAWEI_PRODUCT_E173			0x140C
+#define HUAWEI_PRODUCT_E1750			0x1406
 #define HUAWEI_PRODUCT_K4505			0x1464
 #define HUAWEI_PRODUCT_K3765			0x1465
 #define HUAWEI_PRODUCT_K4605			0x14C6
@@ -581,6 +582,8 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
 		.driver_info = (kernel_ulong_t) &net_intf1_blacklist },
+	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1750, 0xff, 0xff, 0xff),
+		.driver_info = (kernel_ulong_t) &net_intf2_blacklist },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
-- 
1.8.3.2


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

* [PATCH 085/100] ib_srpt: Destroy cm_id before destroying QP.
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (83 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 084/100] USB: serial: option: Ignore card reader interface on Huawei E1750 Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:41 ` [PATCH 088/100] powerpc/sysfs: Disable writing to PURR in guest mode Luis Henriques
                   ` (12 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Nicholas Bellinger, Luis Henriques

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

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

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

commit 0b41d6ca616ddeb3b6c0a80e8770b6f53cd42806 upstream.

This patch fixes a bug where ib_destroy_cm_id() was incorrectly being called
after srpt_destroy_ch_ib() had destroyed the active QP.

This would result in the following failed SRP_LOGIN_REQ messages:

Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff1762bd, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c903009f8f41)
Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff1758f9, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 2 (guid=0xfe80000000000000:0x2c903009f8f42)
Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff175941, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 2 (guid=0xfe80000000000000:0x2c90300a3cfb2)
Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)
mlx4_core 0000:84:00.0: command 0x19 failed: fw status = 0x9
rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)
mlx4_core 0000:84:00.0: command 0x19 failed: fw status = 0x9
rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)

Reported-by: Navin Ahuja <navin.ahuja@saratoga-speed.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 5f6b7f6..0ff33b0 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2372,6 +2372,8 @@ static void srpt_release_channel_work(struct work_struct *w)
 	transport_deregister_session(ch->sess);
 	ch->sess = NULL;
 
+	ib_destroy_cm_id(ch->cm_id);
+
 	srpt_destroy_ch_ib(ch);
 
 	srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
@@ -2382,8 +2384,6 @@ static void srpt_release_channel_work(struct work_struct *w)
 	list_del(&ch->list);
 	spin_unlock_irq(&sdev->spinlock);
 
-	ib_destroy_cm_id(ch->cm_id);
-
 	if (ch->release_done)
 		complete(ch->release_done);
 
-- 
1.8.3.2


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

* [PATCH 088/100] powerpc/sysfs: Disable writing to PURR in guest mode
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (84 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 085/100] ib_srpt: Destroy cm_id before destroying QP Luis Henriques
@ 2013-10-11 10:41 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 090/100] powerpc/vio: Fix modalias_show return values Luis Henriques
                   ` (11 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Madhavan Srinivasan, Benjamin Herrenschmidt, Luis Henriques

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

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

From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>

commit d1211af3049f4c9c1d8d4eb8f8098cc4f4f0d0c7 upstream.

arch/powerpc/kernel/sysfs.c exports PURR with write permission.
This may be valid for kernel in phyp mode. But writing to
the file in guest mode causes crash due to a priviledge violation

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/sysfs.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 8302af6..bbe9965 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -17,6 +17,7 @@
 #include <asm/machdep.h>
 #include <asm/smp.h>
 #include <asm/pmc.h>
+#include <asm/firmware.h>
 
 #include "cacheinfo.h"
 
@@ -179,15 +180,25 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR);
 SYSFS_PMCSETUP(dscr, SPRN_DSCR);
 SYSFS_PMCSETUP(pir, SPRN_PIR);
 
+/*
+  Lets only enable read for phyp resources and
+  enable write when needed with a separate function.
+  Lets be conservative and default to pseries.
+*/
 static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
 static DEVICE_ATTR(spurr, 0600, show_spurr, NULL);
 static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
-static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
+static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
 static DEVICE_ATTR(pir, 0400, show_pir, NULL);
 
 unsigned long dscr_default = 0;
 EXPORT_SYMBOL(dscr_default);
 
+static void add_write_permission_dev_attr(struct device_attribute *attr)
+{
+	attr->attr.mode |= 0200;
+}
+
 static ssize_t show_dscr_default(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
@@ -394,8 +405,11 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
 	if (cpu_has_feature(CPU_FTR_MMCRA))
 		device_create_file(s, &dev_attr_mmcra);
 
-	if (cpu_has_feature(CPU_FTR_PURR))
+	if (cpu_has_feature(CPU_FTR_PURR)) {
+		if (!firmware_has_feature(FW_FEATURE_LPAR))
+			add_write_permission_dev_attr(&dev_attr_purr);
 		device_create_file(s, &dev_attr_purr);
+	}
 
 	if (cpu_has_feature(CPU_FTR_SPURR))
 		device_create_file(s, &dev_attr_spurr);
-- 
1.8.3.2


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

* [PATCH 090/100] powerpc/vio: Fix modalias_show return values
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (85 preceding siblings ...)
  2013-10-11 10:41 ` [PATCH 088/100] powerpc/sysfs: Disable writing to PURR in guest mode Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 091/100] ib_srpt: always set response for task management Luis Henriques
                   ` (10 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Prarit Bhargava, Benjamin Herrenschmidt, Luis Henriques

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

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

From: Prarit Bhargava <prarit@redhat.com>

commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 upstream.

modalias_show() should return an empty string on error, not -ENODEV.

This causes the following false and annoying error:

> find /sys/devices -name modalias -print0 | xargs -0 cat >/dev/null
cat: /sys/devices/vio/4000/modalias: No such device
cat: /sys/devices/vio/4001/modalias: No such device
cat: /sys/devices/vio/4002/modalias: No such device
cat: /sys/devices/vio/4004/modalias: No such device
cat: /sys/devices/vio/modalias: No such device

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/vio.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index cb87301..b161bae 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1520,11 +1520,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 	const char *cp;
 
 	dn = dev->of_node;
-	if (!dn)
-		return -ENODEV;
+	if (!dn) {
+		strcat(buf, "\n");
+		return strlen(buf);
+	}
 	cp = of_get_property(dn, "compatible", NULL);
-	if (!cp)
-		return -ENODEV;
+	if (!cp) {
+		strcat(buf, "\n");
+		return strlen(buf);
+	}
 
 	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
 }
-- 
1.8.3.2


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

* [PATCH 091/100] ib_srpt: always set response for task management
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (86 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 090/100] powerpc/vio: Fix modalias_show return values Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 092/100] xen/hvc: allow xenboot console to be used again Luis Henriques
                   ` (9 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jack Wang, Nicholas Bellinger, Luis Henriques

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

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

From: Jack Wang <jinpu.wang@profitbricks.com>

commit c807f64340932e19f0d2ac9b30c8381e1f60663a upstream.

The SRP specification requires:

  "Response data shall be provided in any SRP_RSP response that is sent in
   response to an SRP_TSK_MGMT request (see 6.7). The information in the
   RSP_CODE field (see table 24) shall indicate the completion status of
   the task management function."

So fix this to avoid the SRP initiator interprets task management functions
that succeeded as failed.

Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 0ff33b0..10f88e6 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1609,7 +1609,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch,
 	int resp_data_len;
 	int resp_len;
 
-	resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4;
+	resp_data_len = 4;
 	resp_len = sizeof(*srp_rsp) + resp_data_len;
 
 	srp_rsp = ioctx->ioctx.buf;
@@ -1621,11 +1621,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch,
 				    + atomic_xchg(&ch->req_lim_delta, 0));
 	srp_rsp->tag = tag;
 
-	if (rsp_code != SRP_TSK_MGMT_SUCCESS) {
-		srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
-		srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
-		srp_rsp->data[3] = rsp_code;
-	}
+	srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
+	srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
+	srp_rsp->data[3] = rsp_code;
 
 	return resp_len;
 }
-- 
1.8.3.2


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

* [PATCH 092/100] xen/hvc: allow xenboot console to be used again
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (87 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 091/100] ib_srpt: always set response for task management Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:53   ` David Vrabel
  2013-10-11 10:42 ` [PATCH 093/100] Smack: Fix the bug smackcipso can't set CIPSO correctly Luis Henriques
                   ` (8 subsequent siblings)
  97 siblings, 1 reply; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Vrabel, Greg Kroah-Hartman, Jiri Slaby, Luis Henriques

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

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

From: David Vrabel <david.vrabel@citrix.com>

commit a9fbf4d591da6cd1d3eaab826c7c15f77fc8f6a3 upstream.

Commit d0380e6c3c0f6edb986d8798a23acfaf33d5df23 (early_printk:
consolidate random copies of identical code) added in 3.10 introduced
a check for con->index == -1 in early_console_register().

Initialize index to -1 for the xenboot console so earlyprintk=xen
works again.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/hvc/hvc_xen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 944eaeb..78873df 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -634,6 +634,7 @@ struct console xenboot_console = {
 	.name		= "xenboot",
 	.write		= xenboot_write_console,
 	.flags		= CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
+	.index		= -1,
 };
 #endif	/* CONFIG_EARLY_PRINTK */
 
-- 
1.8.3.2


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

* [PATCH 093/100] Smack: Fix the bug smackcipso can't set CIPSO correctly
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (88 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 092/100] xen/hvc: allow xenboot console to be used again Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 094/100] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice Luis Henriques
                   ` (7 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Passion,Zhao, Tim Gardner, Luis Henriques

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

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

From: "Passion,Zhao" <passion.zhao@intel.com>

commit 0fcfee61d63b82c1eefb5b1a914240480f17d63f upstream.

Bug report: https://tizendev.org/bugs/browse/TDIS-3891

The reason is userspace libsmack only use "smackfs/cipso2" long-label interface,
but the code's logical is still for orginal fixed length label. Now update
smack_cipso_apply() to support flexible label (<=256 including tailing '\0')

There is also a bug in kernel/security/smack/smackfs.c:
When smk_set_cipso() parsing the CIPSO setting from userspace, the offset of
CIPSO level should be "strlen(label)+1" instead of "strlen(label)"

Signed-off-by: Passion,Zhao <passion.zhao@intel.com>
Cc: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 security/smack/smackfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index cb6d904..fccf04f 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -819,7 +819,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf,
 	if (format == SMK_FIXED24_FMT)
 		rule += SMK_LABELLEN;
 	else
-		rule += strlen(skp->smk_known);
+		rule += strlen(skp->smk_known) + 1;
 
 	ret = sscanf(rule, "%d", &maplevel);
 	if (ret != 1 || maplevel > SMACK_CIPSO_MAXLEVEL)
-- 
1.8.3.2


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

* [PATCH 094/100] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (89 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 093/100] Smack: Fix the bug smackcipso can't set CIPSO correctly Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 095/100] mwifiex: fix memory corruption when unsetting multicast list Luis Henriques
                   ` (6 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ian Abbott, Greg Kroah-Hartman, Luis Henriques

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

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

From: Ian Abbott <abbotti@mev.co.uk>

commit 677a31565692d596ef42ea589b53ba289abf4713 upstream.

The `insn_bits` handler `ni_65xx_dio_insn_bits()` has a `for` loop that
currently writes (optionally) and reads back up to 5 "ports" consisting
of 8 channels each.  It reads up to 32 1-bit channels but can only read
and write a whole port at once - it needs to handle up to 5 ports as the
first channel it reads might not be aligned on a port boundary.  It
breaks out of the loop early if the next port it handles is beyond the
final port on the card.  It also breaks out early on the 5th port in the
loop if the first channel was aligned.  Unfortunately, it doesn't check
that the current port it is dealing with belongs to the comedi subdevice
the `insn_bits` handler is acting on.  That's a bug.

Redo the `for` loop to terminate after the final port belonging to the
subdevice, changing the loop variable in the process to simplify things
a bit.  The `for` loop could now try and handle more than 5 ports if the
subdevice has more than 40 channels, but the test `if (bitshift >= 32)`
ensures it will break out early after 4 or 5 ports (depending on whether
the first channel is aligned on a port boundary).  (`bitshift` will be
between -7 and 7 inclusive on the first iteration, increasing by 8 for
each subsequent operation.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Ian: This patch applies to kernels 2.6.34.y through to 3.5.y inclusive.
  Similar patch already queued for 3.10.y and 3.11.y by Greg-KH.
  I can post similar patches for kernels 3.6.y to 3.9.y on request.
  Similar patch for 2.6.32.y ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/comedi/drivers/ni_65xx.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c
index 0d27a93..c36efe0 100644
--- a/drivers/staging/comedi/drivers/ni_65xx.c
+++ b/drivers/staging/comedi/drivers/ni_65xx.c
@@ -411,29 +411,25 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev,
 				 struct comedi_subdevice *s,
 				 struct comedi_insn *insn, unsigned int *data)
 {
-	unsigned base_bitfield_channel;
-	const unsigned max_ports_per_bitfield = 5;
+	int base_bitfield_channel;
 	unsigned read_bits = 0;
-	unsigned j;
+	int last_port_offset = ni_65xx_port_by_channel(s->n_chan - 1);
+	int port_offset;
+
 	if (insn->n != 2)
 		return -EINVAL;
 	base_bitfield_channel = CR_CHAN(insn->chanspec);
-	for (j = 0; j < max_ports_per_bitfield; ++j) {
-		const unsigned port_offset =
-			ni_65xx_port_by_channel(base_bitfield_channel) + j;
-		const unsigned port =
-			sprivate(s)->base_port + port_offset;
-		unsigned base_port_channel;
+	for (port_offset = ni_65xx_port_by_channel(base_bitfield_channel);
+	     port_offset <= last_port_offset; port_offset++) {
+		unsigned port = sprivate(s)->base_port + port_offset;
+		int base_port_channel = port_offset * ni_65xx_channels_per_port;
 		unsigned port_mask, port_data, port_read_bits;
-		int bitshift;
-		if (port >= ni_65xx_total_num_ports(board(dev)))
+		int bitshift = base_port_channel - base_bitfield_channel;
+
+		if (bitshift >= 32)
 			break;
-		base_port_channel = port_offset * ni_65xx_channels_per_port;
 		port_mask = data[0];
 		port_data = data[1];
-		bitshift = base_port_channel - base_bitfield_channel;
-		if (bitshift >= 32 || bitshift <= -32)
-			break;
 		if (bitshift > 0) {
 			port_mask >>= bitshift;
 			port_data >>= bitshift;
-- 
1.8.3.2


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

* [PATCH 095/100] mwifiex: fix memory corruption when unsetting multicast list
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (90 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 094/100] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 096/100] ext4: avoid hang when mounting non-journal filesystems with orphan list Luis Henriques
                   ` (5 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Drake, John W. Linville, Luis Henriques

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

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

From: Daniel Drake <dsd@laptop.org>

commit 6390d88529835a8ad3563fe01a5da89fa52d6db2 upstream.

When trying to unset a previously-set multicast list (i.e. the new list
has 0 entries), mwifiex_set_multicast_list() was calling down to
mwifiex_request_set_multicast_list() while leaving
mcast_list.num_multicast_addr as an uninitialized value.

We were arriving at mwifiex_cmd_mac_multicast_adr() which would then
proceed to do an often huge memcpy of
mcast_list.num_multicast_addr*ETH_ALEN bytes, causing memory corruption
and hard to debug crashes.

Fix this by setting mcast_list.num_multicast_addr to 0 when no multicast
list is provided. Similarly, fix up the logic in
mwifiex_request_set_multicast_list() to unset the multicast list that
was previously sent to the hardware in such cases.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/mwifiex/main.c      |  5 ++---
 drivers/net/wireless/mwifiex/sta_ioctl.c | 18 ++++++++----------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 4be4d43..20e50e5 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -571,9 +571,8 @@ static void mwifiex_set_multicast_list(struct net_device *dev)
 		mcast_list.mode = MWIFIEX_ALL_MULTI_MODE;
 	} else {
 		mcast_list.mode = MWIFIEX_MULTICAST_MODE;
-		if (netdev_mc_count(dev))
-			mcast_list.num_multicast_addr =
-				mwifiex_copy_mcast_addr(&mcast_list, dev);
+		mcast_list.num_multicast_addr =
+			mwifiex_copy_mcast_addr(&mcast_list, dev);
 	}
 	mwifiex_request_set_multicast_list(priv, &mcast_list);
 }
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index fc6ae9b..2ea3a20 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -113,16 +113,14 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
 		} else {
 			priv->curr_pkt_filter &=
 				~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
-			if (mcast_list->num_multicast_addr) {
-				dev_dbg(priv->adapter->dev,
-					"info: Set multicast list=%d\n",
-				       mcast_list->num_multicast_addr);
-				/* Send multicast addresses to firmware */
-				ret = mwifiex_send_cmd_async(priv,
-					HostCmd_CMD_MAC_MULTICAST_ADR,
-					HostCmd_ACT_GEN_SET, 0,
-					mcast_list);
-			}
+			dev_dbg(priv->adapter->dev,
+				"info: Set multicast list=%d\n",
+				mcast_list->num_multicast_addr);
+			/* Send multicast addresses to firmware */
+			ret = mwifiex_send_cmd_async(priv,
+				HostCmd_CMD_MAC_MULTICAST_ADR,
+				HostCmd_ACT_GEN_SET, 0,
+				mcast_list);
 		}
 	}
 	dev_dbg(priv->adapter->dev,
-- 
1.8.3.2


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

* [PATCH 096/100] ext4: avoid hang when mounting non-journal filesystems with orphan list
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (91 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 095/100] mwifiex: fix memory corruption when unsetting multicast list Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 097/100] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic Luis Henriques
                   ` (4 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Theodore Ts'o, Jan Kara, Jiri Slaby, Luis Henriques

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

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

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

commit 0e9a9a1ad619e7e987815d20262d36a2f95717ca upstream.

When trying to mount a file system which does not contain a journal,
but which does have a orphan list containing an inode which needs to
be truncated, the mount call with hang forever in
ext4_orphan_cleanup() because ext4_orphan_del() will return
immediately without removing the inode from the orphan list, leading
to an uninterruptible loop in kernel code which will busy out one of
the CPU's on the system.

This can be trivially reproduced by trying to mount the file system
found in tests/f_orphan_extents_inode/image.gz from the e2fsprogs
source tree.  If a malicious user were to put this on a USB stick, and
mount it on a Linux desktop which has automatic mounts enabled, this
could be considered a potential denial of service attack.  (Not a big
deal in practice, but professional paranoids worry about such things,
and have even been known to allocate CVE numbers for such problems.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: Jan Kara <jack@suse.cz>
[ js: This is a fix for CVE-2013-2015. ]
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ext4/namei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 43a35db..27a99f7 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2432,7 +2432,8 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode)
 	int err = 0;
 
 	/* ext4_handle_valid() assumes a valid handle_t pointer */
-	if (handle && !ext4_handle_valid(handle))
+	if (handle && !ext4_handle_valid(handle) &&
+	    !(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS))
 		return 0;
 
 	mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock);
-- 
1.8.3.2


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

* [PATCH 097/100] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (92 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 096/100] ext4: avoid hang when mounting non-journal filesystems with orphan list Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 098/100] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet Luis Henriques
                   ` (3 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael Grzeschik, Vinod Koul, Jonghwan Choi, Luis Henriques

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

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

From: Michael Grzeschik <m.grzeschik@pengutronix.de>

commit edc530fe7ee5a562680615d2e7cd205879c751a7 upstream.

When perparing cyclic_dma buffers by the sound layer, it will dump the
following lockdep trace. The leading snd_pcm_action_single get called
with read_lock_irq called. To fix this, we change the kcalloc call from
GFP_KERNEL to GFP_ATOMIC.

WARNING: at kernel/lockdep.c:2740 lockdep_trace_alloc+0xcc/0x114()
DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
Modules linked in:
CPU: 0 PID: 832 Comm: aplay Not tainted 3.11.0-20130823+ #903
Backtrace:
[<c000b98c>] (dump_backtrace+0x0/0x10c) from [<c000bb28>] (show_stack+0x18/0x1c)
 r6:c004c090 r5:00000009 r4:c2e0bd18 r3:00404000
[<c000bb10>] (show_stack+0x0/0x1c) from [<c02f397c>] (dump_stack+0x20/0x28)
[<c02f395c>] (dump_stack+0x0/0x28) from [<c001531c>] (warn_slowpath_common+0x54/0x70)
[<c00152c8>] (warn_slowpath_common+0x0/0x70) from [<c00153dc>] (warn_slowpath_fmt+0x38/0x40)
 r8:00004000 r7:a3b90000 r6:000080d0 r5:60000093 r4:c2e0a000 r3:00000009
[<c00153a4>] (warn_slowpath_fmt+0x0/0x40) from [<c004c090>] (lockdep_trace_alloc+0xcc/0x114)
 r3:c03955d8 r2:c03907db
[<c004bfc4>] (lockdep_trace_alloc+0x0/0x114) from [<c008f16c>] (__kmalloc+0x34/0x118)
 r6:000080d0 r5:c3800120 r4:000080d0 r3:c040a0f8
[<c008f138>] (__kmalloc+0x0/0x118) from [<c019c95c>] (imxdma_prep_dma_cyclic+0x64/0x168)
 r7:a3b90000 r6:00000004 r5:c39d8420 r4:c3847150
[<c019c8f8>] (imxdma_prep_dma_cyclic+0x0/0x168) from [<c024618c>] (snd_dmaengine_pcm_trigger+0xa8/0x160)
[<c02460e4>] (snd_dmaengine_pcm_trigger+0x0/0x160) from [<c0241fa8>] (soc_pcm_trigger+0x90/0xb4)
 r8:c058c7b0 r7:c3b8140c r6:c39da560 r5:00000001 r4:c3b81000
[<c0241f18>] (soc_pcm_trigger+0x0/0xb4) from [<c022ece4>] (snd_pcm_do_start+0x2c/0x38)
 r7:00000000 r6:00000003 r5:c058c7b0 r4:c3b81000
[<c022ecb8>] (snd_pcm_do_start+0x0/0x38) from [<c022e958>] (snd_pcm_action_single+0x40/0x6c)
[<c022e918>] (snd_pcm_action_single+0x0/0x6c) from [<c022ea64>] (snd_pcm_action_lock_irq+0x7c/0x9c)
 r7:00000003 r6:c3b810f0 r5:c3b810f0 r4:c3b81000
[<c022e9e8>] (snd_pcm_action_lock_irq+0x0/0x9c) from [<c023009c>] (snd_pcm_common_ioctl1+0x7f8/0xfd0)
 r8:c3b7f888 r7:005407b8 r6:c2c991c0 r5:c3b81000 r4:c3b81000 r3:00004142
[<c022f8a4>] (snd_pcm_common_ioctl1+0x0/0xfd0) from [<c023117c>] (snd_pcm_playback_ioctl1+0x464/0x488)
[<c0230d18>] (snd_pcm_playback_ioctl1+0x0/0x488) from [<c02311d4>] (snd_pcm_playback_ioctl+0x34/0x40)
 r8:c3b7f888 r7:00004142 r6:00000004 r5:c2c991c0 r4:005407b8
[<c02311a0>] (snd_pcm_playback_ioctl+0x0/0x40) from [<c00a14a4>] (vfs_ioctl+0x30/0x44)
[<c00a1474>] (vfs_ioctl+0x0/0x44) from [<c00a1fe8>] (do_vfs_ioctl+0x55c/0x5c0)
[<c00a1a8c>] (do_vfs_ioctl+0x0/0x5c0) from [<c00a208c>] (SyS_ioctl+0x40/0x68)
[<c00a204c>] (SyS_ioctl+0x0/0x68) from [<c0009380>] (ret_fast_syscall+0x0/0x44)
 r8:c0009544 r7:00000036 r6:bedeaa58 r5:00000000 r4:000000c0

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/dma/imx-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 8aa9113..332f28d 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -824,7 +824,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
 		kfree(imxdmac->sg_list);
 
 	imxdmac->sg_list = kcalloc(periods + 1,
-			sizeof(struct scatterlist), GFP_KERNEL);
+			sizeof(struct scatterlist), GFP_ATOMIC);
 	if (!imxdmac->sg_list)
 		return NULL;
 
-- 
1.8.3.2


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

* [PATCH 098/100] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (93 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 097/100] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 099/100] dma: fix comments Luis Henriques
                   ` (2 subsequent siblings)
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael Grzeschik, Vinod Koul, Jonghwan Choi, Luis Henriques

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

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

From: Michael Grzeschik <m.grzeschik@pengutronix.de>

commit 5a276fa6bdf82fd442046969603968c83626ce0b upstream.

The tasklet and irqhandler are using spin_lock while other routines are
using spin_lock_irqsave/restore. This leads to lockdep issues as
described bellow. This patch is changing the code to use
spinlock_irq_save/restore in both code pathes.

As imxdma_xfer_desc always gets called with spin_lock_irqsave lock held,
this patch also removes the spare call inside the routine to avoid
double locking.

[  403.358162] =================================
[  403.362549] [ INFO: inconsistent lock state ]
[  403.366945] 3.10.0-20130823+ #904 Not tainted
[  403.371331] ---------------------------------
[  403.375721] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[  403.381769] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
[  403.386762]  (&(&imxdma->lock)->rlock){?.-...}, at: [<c019d77c>] imxdma_tasklet+0x20/0x134
[  403.395201] {IN-HARDIRQ-W} state was registered at:
[  403.400108]   [<c004b264>] mark_lock+0x2a0/0x6b4
[  403.404798]   [<c004d7c8>] __lock_acquire+0x650/0x1a64
[  403.410004]   [<c004f15c>] lock_acquire+0x94/0xa8
[  403.414773]   [<c02f74e4>] _raw_spin_lock+0x54/0x8c
[  403.419720]   [<c019d094>] dma_irq_handler+0x78/0x254
[  403.424845]   [<c0061124>] handle_irq_event_percpu+0x38/0x1b4
[  403.430670]   [<c00612e4>] handle_irq_event+0x44/0x64
[  403.435789]   [<c0063a70>] handle_level_irq+0xd8/0xf0
[  403.440903]   [<c0060a20>] generic_handle_irq+0x28/0x38
[  403.446194]   [<c0009cc4>] handle_IRQ+0x68/0x8c
[  403.450789]   [<c0008714>] avic_handle_irq+0x3c/0x48
[  403.455811]   [<c0008f84>] __irq_svc+0x44/0x74
[  403.460314]   [<c0040b04>] cpu_startup_entry+0x88/0xf4
[  403.465525]   [<c02f00d0>] rest_init+0xb8/0xe0
[  403.470045]   [<c03e07dc>] start_kernel+0x28c/0x2d4
[  403.474986]   [<a0008040>] 0xa0008040
[  403.478709] irq event stamp: 50854
[  403.482140] hardirqs last  enabled at (50854): [<c001c6b8>] tasklet_action+0x38/0xdc
[  403.489954] hardirqs last disabled at (50853): [<c001c6a0>] tasklet_action+0x20/0xdc
[  403.497761] softirqs last  enabled at (50850): [<c001bc64>] _local_bh_enable+0x14/0x18
[  403.505741] softirqs last disabled at (50851): [<c001c268>] irq_exit+0x88/0xdc
[  403.513026]
[  403.513026] other info that might help us debug this:
[  403.519593]  Possible unsafe locking scenario:
[  403.519593]
[  403.525548]        CPU0
[  403.528020]        ----
[  403.530491]   lock(&(&imxdma->lock)->rlock);
[  403.534828]   <Interrupt>
[  403.537474]     lock(&(&imxdma->lock)->rlock);
[  403.541983]
[  403.541983]  *** DEADLOCK ***
[  403.541983]
[  403.547951] no locks held by swapper/0.
[  403.551813]
[  403.551813] stack backtrace:
[  403.556222] CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.0-20130823+ #904
[  403.563039] Backtrace:
[  403.565581] [<c000b98c>] (dump_backtrace+0x0/0x10c) from [<c000bb28>] (show_stack+0x18/0x1c)
[  403.574054]  r6:00000000 r5:c05c51d8 r4:c040bd58 r3:00200000
[  403.579872] [<c000bb10>] (show_stack+0x0/0x1c) from [<c02f398c>] (dump_stack+0x20/0x28)
[  403.587955] [<c02f396c>] (dump_stack+0x0/0x28) from [<c02f29c8>] (print_usage_bug.part.28+0x224/0x28c)
[  403.597340] [<c02f27a4>] (print_usage_bug.part.28+0x0/0x28c) from [<c004b404>] (mark_lock+0x440/0x6b4)
[  403.606682]  r8:c004a41c r7:00000000 r6:c040bd58 r5:c040c040 r4:00000002
[  403.613566] [<c004afc4>] (mark_lock+0x0/0x6b4) from [<c004d844>] (__lock_acquire+0x6cc/0x1a64)
[  403.622244] [<c004d178>] (__lock_acquire+0x0/0x1a64) from [<c004f15c>] (lock_acquire+0x94/0xa8)
[  403.631010] [<c004f0c8>] (lock_acquire+0x0/0xa8) from [<c02f74e4>] (_raw_spin_lock+0x54/0x8c)
[  403.639614] [<c02f7490>] (_raw_spin_lock+0x0/0x8c) from [<c019d77c>] (imxdma_tasklet+0x20/0x134)
[  403.648434]  r6:c3847010 r5:c040e890 r4:c38470d4
[  403.653194] [<c019d75c>] (imxdma_tasklet+0x0/0x134) from [<c001c70c>] (tasklet_action+0x8c/0xdc)
[  403.662013]  r8:c0599160 r7:00000000 r6:00000000 r5:c040e890 r4:c3847114 r3:c019d75c
[  403.670042] [<c001c680>] (tasklet_action+0x0/0xdc) from [<c001bd4c>] (__do_softirq+0xe4/0x1f0)
[  403.678687]  r7:00000101 r6:c0402000 r5:c059919c r4:00000001
[  403.684498] [<c001bc68>] (__do_softirq+0x0/0x1f0) from [<c001c268>] (irq_exit+0x88/0xdc)
[  403.692652] [<c001c1e0>] (irq_exit+0x0/0xdc) from [<c0009cc8>] (handle_IRQ+0x6c/0x8c)
[  403.700514]  r4:00000030 r3:00000110
[  403.704192] [<c0009c5c>] (handle_IRQ+0x0/0x8c) from [<c0008714>] (avic_handle_irq+0x3c/0x48)
[  403.712664]  r5:c0403f28 r4:c0593ebc
[  403.716343] [<c00086d8>] (avic_handle_irq+0x0/0x48) from [<c0008f84>] (__irq_svc+0x44/0x74)
[  403.724733] Exception stack(0xc0403f28 to 0xc0403f70)
[  403.729841] 3f20:                   00000001 00000004 00000000 20000013 c0402000 c04104a8
[  403.738078] 3f40: 00000002 c0b69620 a0004000 41069264 a03fb5f4 c0403f7c c0403f40 c0403f70
[  403.746301] 3f60: c004b92c c0009e74 20000013 ffffffff
[  403.751383]  r6:ffffffff r5:20000013 r4:c0009e74 r3:c004b92c
[  403.757210] [<c0009e30>] (arch_cpu_idle+0x0/0x4c) from [<c0040b04>] (cpu_startup_entry+0x88/0xf4)
[  403.766161] [<c0040a7c>] (cpu_startup_entry+0x0/0xf4) from [<c02f00d0>] (rest_init+0xb8/0xe0)
[  403.774753] [<c02f0018>] (rest_init+0x0/0xe0) from [<c03e07dc>] (start_kernel+0x28c/0x2d4)
[  403.783051]  r6:c03fc484 r5:ffffffff r4:c040a0e0
[  403.787797] [<c03e0550>] (start_kernel+0x0/0x2d4) from [<a0008040>] (0xa0008040)

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/dma/imx-dma.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 332f28d..9e77cc5 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -374,17 +374,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac)
 	struct imxdma_engine *imxdma = imxdmac->imxdma;
 	int chno = imxdmac->channel;
 	struct imxdma_desc *desc;
+	unsigned long flags;
 
-	spin_lock(&imxdma->lock);
+	spin_lock_irqsave(&imxdma->lock, flags);
 	if (list_empty(&imxdmac->ld_active)) {
-		spin_unlock(&imxdma->lock);
+		spin_unlock_irqrestore(&imxdma->lock, flags);
 		goto out;
 	}
 
 	desc = list_first_entry(&imxdmac->ld_active,
 				struct imxdma_desc,
 				node);
-	spin_unlock(&imxdma->lock);
+	spin_unlock_irqrestore(&imxdma->lock, flags);
 
 	if (desc->sg) {
 		u32 tmp;
@@ -456,7 +457,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 {
 	struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan);
 	struct imxdma_engine *imxdma = imxdmac->imxdma;
-	unsigned long flags;
 	int slot = -1;
 	int i;
 
@@ -464,7 +464,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 	switch (d->type) {
 	case IMXDMA_DESC_INTERLEAVED:
 		/* Try to get a free 2D slot */
-		spin_lock_irqsave(&imxdma->lock, flags);
 		for (i = 0; i < IMX_DMA_2D_SLOTS; i++) {
 			if ((imxdma->slots_2d[i].count > 0) &&
 			((imxdma->slots_2d[i].xsr != d->x) ||
@@ -474,10 +473,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 			slot = i;
 			break;
 		}
-		if (slot < 0) {
-			spin_unlock_irqrestore(&imxdma->lock, flags);
+		if (slot < 0)
 			return -EBUSY;
-		}
 
 		imxdma->slots_2d[slot].xsr = d->x;
 		imxdma->slots_2d[slot].ysr = d->y;
@@ -486,7 +483,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 
 		imxdmac->slot_2d = slot;
 		imxdmac->enabled_2d = true;
-		spin_unlock_irqrestore(&imxdma->lock, flags);
 
 		if (slot == IMX_DMA_2D_SLOT_A) {
 			d->config_mem &= ~CCR_MSEL_B;
@@ -562,8 +558,9 @@ static void imxdma_tasklet(unsigned long data)
 	struct imxdma_channel *imxdmac = (void *)data;
 	struct imxdma_engine *imxdma = imxdmac->imxdma;
 	struct imxdma_desc *desc;
+	unsigned long flags;
 
-	spin_lock(&imxdma->lock);
+	spin_lock_irqsave(&imxdma->lock, flags);
 
 	if (list_empty(&imxdmac->ld_active)) {
 		/* Someone might have called terminate all */
@@ -600,7 +597,7 @@ static void imxdma_tasklet(unsigned long data)
 				 __func__, imxdmac->channel);
 	}
 out:
-	spin_unlock(&imxdma->lock);
+	spin_unlock_irqrestore(&imxdma->lock, flags);
 }
 
 static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
-- 
1.8.3.2


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

* [PATCH 099/100] dma: fix comments
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (94 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 098/100] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
  2013-10-11 10:42 ` [PATCH 100/100] dmaengine: imx-dma: fix callback path in tasklet Luis Henriques
       [not found] ` <1381488130-30235-88-git-send-email-luis.henriques@canonical.com>
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Masanari Iida, Jiri Kosina, Luis Henriques

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

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

From: Masanari Iida <standby24x7@gmail.com>

commit d73111c6d43f08d697a3d986fe3bd8ca796a2096 upstream.

Correct spelling typo in drivers/dma.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[ luis: backported to 3.5: required to make 6e35f9b "dmaengine: imx-dma:
   fix callback path in tasklet" a clean cherry-pick ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/dma/at_hdmac.c           | 8 ++++----
 drivers/dma/ep93xx_dma.c         | 2 +-
 drivers/dma/fsldma.c             | 2 +-
 drivers/dma/imx-dma.c            | 4 ++--
 drivers/dma/intel_mid_dma_regs.h | 6 +++---
 drivers/dma/pl330.c              | 2 +-
 drivers/dma/ppc4xx/adma.c        | 2 +-
 drivers/dma/ste_dma40_ll.h       | 2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 4058430..fffd143 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -169,9 +169,9 @@ static void atc_desc_put(struct at_dma_chan *atchan, struct at_desc *desc)
 }
 
 /**
- * atc_desc_chain - build chain adding a descripor
- * @first: address of first descripor of the chain
- * @prev: address of previous descripor of the chain
+ * atc_desc_chain - build chain adding a descriptor
+ * @first: address of first descriptor of the chain
+ * @prev: address of previous descriptor of the chain
  * @desc: descriptor to queue
  *
  * Called from prep_* functions
@@ -797,7 +797,7 @@ err_out:
 }
 
 /**
- * atc_dma_cyclic_fill_desc - Fill one period decriptor
+ * atc_dma_cyclic_fill_desc - Fill one period descriptor
  */
 static int
 atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index c64917e..bb02fd9 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -1118,7 +1118,7 @@ fail:
  * @chan: channel
  * @dma_addr: DMA mapped address of the buffer
  * @buf_len: length of the buffer (in bytes)
- * @period_len: lenght of a single period
+ * @period_len: length of a single period
  * @dir: direction of the operation
  * @context: operation context (ignored)
  *
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 8f84761..094437b 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1015,7 +1015,7 @@ static irqreturn_t fsldma_chan_irq(int irq, void *data)
 	/*
 	 * Programming Error
 	 * The DMA_INTERRUPT async_tx is a NULL transfer, which will
-	 * triger a PE interrupt.
+	 * trigger a PE interrupt.
 	 */
 	if (stat & FSL_DMA_SR_PE) {
 		chan_dbg(chan, "irq: Programming Error INT\n");
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 9e77cc5..2eb396e 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -571,8 +571,8 @@ static void imxdma_tasklet(unsigned long data)
 	if (desc->desc.callback)
 		desc->desc.callback(desc->desc.callback_param);
 
-	/* If we are dealing with a cyclic descriptor keep it on ld_active
-	 * and dont mark the descripor as complete.
+	/* If we are dealing with a cyclic descriptor, keep it on ld_active
+	 * and dont mark the descriptor as complete.
 	 * Only in non-cyclic cases it would be marked as complete
 	 */
 	if (imxdma_chan_is_doing_cyclic(imxdmac))
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
index 1bfa926..17b4219 100644
--- a/drivers/dma/intel_mid_dma_regs.h
+++ b/drivers/dma/intel_mid_dma_regs.h
@@ -168,9 +168,9 @@ union intel_mid_dma_cfg_hi {
  * @active_list: current active descriptors
  * @queue: current queued up descriptors
  * @free_list: current free descriptors
- * @slave: dma slave struture
- * @descs_allocated: total number of decsiptors allocated
- * @dma: dma device struture pointer
+ * @slave: dma slave structure
+ * @descs_allocated: total number of descriptors allocated
+ * @dma: dma device structure pointer
  * @busy: bool representing if ch is busy (active txn) or not
  * @in_use: bool representing if ch is in use or not
  * @raw_tfr: raw trf interrupt received
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index de4ec1a..0d5a996 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -522,7 +522,7 @@ enum desc_status {
 	/* In the DMAC pool */
 	FREE,
 	/*
-	 * Allocted to some channel during prep_xxx
+	 * Allocated to some channel during prep_xxx
 	 * Also may be sitting on the work_list.
 	 */
 	PREP,
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index ced9882..f72348d 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4446,7 +4446,7 @@ static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev)
 		ret = -ENOMEM;
 		goto err_dma_alloc;
 	}
-	dev_dbg(&ofdev->dev, "allocted descriptor pool virt 0x%p phys 0x%llx\n",
+	dev_dbg(&ofdev->dev, "allocated descriptor pool virt 0x%p phys 0x%llx\n",
 		adev->dma_desc_pool_virt, (u64)adev->dma_desc_pool);
 
 	regs = ioremap(res.start, resource_size(&res));
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index 51e8e53..6d47373 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -202,7 +202,7 @@
 /* LLI related structures */
 
 /**
- * struct d40_phy_lli - The basic configration register for each physical
+ * struct d40_phy_lli - The basic configuration register for each physical
  * channel.
  *
  * @reg_cfg: The configuration register.
-- 
1.8.3.2


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

* [PATCH 100/100] dmaengine: imx-dma: fix callback path in tasklet
  2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
                   ` (95 preceding siblings ...)
  2013-10-11 10:42 ` [PATCH 099/100] dma: fix comments Luis Henriques
@ 2013-10-11 10:42 ` Luis Henriques
       [not found] ` <1381488130-30235-88-git-send-email-luis.henriques@canonical.com>
  97 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael Grzeschik, Vinod Koul, Jonghwan Choi, Luis Henriques

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

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

From: Michael Grzeschik <m.grzeschik@pengutronix.de>

commit fcaaba6c7136fe47e5a13352f99a64b019b6d2c5 upstream.

We need to free the ld_active list head before jumping into the callback
routine. Otherwise the callback could run into issue_pending and change
our ld_active list head we just going to free. This will run the channel
list into an currupted and undefined state.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/dma/imx-dma.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 2eb396e..39e07e5 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -564,13 +564,11 @@ static void imxdma_tasklet(unsigned long data)
 
 	if (list_empty(&imxdmac->ld_active)) {
 		/* Someone might have called terminate all */
-		goto out;
+		spin_unlock_irqrestore(&imxdma->lock, flags);
+		return;
 	}
 	desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node);
 
-	if (desc->desc.callback)
-		desc->desc.callback(desc->desc.callback_param);
-
 	/* If we are dealing with a cyclic descriptor, keep it on ld_active
 	 * and dont mark the descriptor as complete.
 	 * Only in non-cyclic cases it would be marked as complete
@@ -598,6 +596,10 @@ static void imxdma_tasklet(unsigned long data)
 	}
 out:
 	spin_unlock_irqrestore(&imxdma->lock, flags);
+
+	if (desc->desc.callback)
+		desc->desc.callback(desc->desc.callback_param);
+
 }
 
 static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
-- 
1.8.3.2


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

* Re: [PATCH 092/100] xen/hvc: allow xenboot console to be used again
  2013-10-11 10:42 ` [PATCH 092/100] xen/hvc: allow xenboot console to be used again Luis Henriques
@ 2013-10-11 10:53   ` David Vrabel
  2013-10-11 11:04     ` Luis Henriques
  0 siblings, 1 reply; 101+ messages in thread
From: David Vrabel @ 2013-10-11 10:53 UTC (permalink / raw)
  To: Luis Henriques
  Cc: linux-kernel, stable, kernel-team, Greg Kroah-Hartman, Jiri Slaby

On 11/10/13 11:42, Luis Henriques wrote:
> 3.5.7.23 -stable review patch.  If anyone has any objections, please let me know.

It's harmless to backport this, but it is only needed in 3.10 and later
(unless you've backported d0380e6c).

> From: David Vrabel <david.vrabel@citrix.com>
> 
> commit a9fbf4d591da6cd1d3eaab826c7c15f77fc8f6a3 upstream.
> 
> Commit d0380e6c3c0f6edb986d8798a23acfaf33d5df23 (early_printk:
> consolidate random copies of identical code) added in 3.10 introduced
> a check for con->index == -1 in early_console_register().
> 
> Initialize index to -1 for the xenboot console so earlyprintk=xen
> works again.
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  drivers/tty/hvc/hvc_xen.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
> index 944eaeb..78873df 100644
> --- a/drivers/tty/hvc/hvc_xen.c
> +++ b/drivers/tty/hvc/hvc_xen.c
> @@ -634,6 +634,7 @@ struct console xenboot_console = {
>  	.name		= "xenboot",
>  	.write		= xenboot_write_console,
>  	.flags		= CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
> +	.index		= -1,
>  };
>  #endif	/* CONFIG_EARLY_PRINTK */
>  

David

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

* Re: [PATCH 092/100] xen/hvc: allow xenboot console to be used again
  2013-10-11 10:53   ` David Vrabel
@ 2013-10-11 11:04     ` Luis Henriques
  0 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-11 11:04 UTC (permalink / raw)
  To: David Vrabel
  Cc: linux-kernel, stable, kernel-team, Greg Kroah-Hartman, Jiri Slaby

David Vrabel <david.vrabel@citrix.com> writes:

> On 11/10/13 11:42, Luis Henriques wrote:
>> 3.5.7.23 -stable review patch.  If anyone has any objections, please let me know.
>
> It's harmless to backport this, but it is only needed in 3.10 and later
> (unless you've backported d0380e6c).

Ups, you're right.  I'll drop this from the 3.5 queue.  Thanks!

Cheers,
-- 
Luis


>
>> From: David Vrabel <david.vrabel@citrix.com>
>> 
>> commit a9fbf4d591da6cd1d3eaab826c7c15f77fc8f6a3 upstream.
>> 
>> Commit d0380e6c3c0f6edb986d8798a23acfaf33d5df23 (early_printk:
>> consolidate random copies of identical code) added in 3.10 introduced
>> a check for con->index == -1 in early_console_register().
>> 
>> Initialize index to -1 for the xenboot console so earlyprintk=xen
>> works again.
>> 
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>> ---
>>  drivers/tty/hvc/hvc_xen.c | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
>> index 944eaeb..78873df 100644
>> --- a/drivers/tty/hvc/hvc_xen.c
>> +++ b/drivers/tty/hvc/hvc_xen.c
>> @@ -634,6 +634,7 @@ struct console xenboot_console = {
>>  	.name		= "xenboot",
>>  	.write		= xenboot_write_console,
>>  	.flags		= CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
>> +	.index		= -1,
>>  };
>>  #endif	/* CONFIG_EARLY_PRINTK */
>>  
>
> David

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

* Re: [PATCH 087/100] powerpc: Restore registers on error exit from csum_partial_copy_generic()
       [not found] ` <1381488130-30235-88-git-send-email-luis.henriques@canonical.com>
@ 2013-10-14 10:16   ` Luis Henriques
  0 siblings, 0 replies; 101+ messages in thread
From: Luis Henriques @ 2013-10-14 10:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: stable, kernel-team, Paul E. McKenney, Anton Blanchard,
	Benjamin Herrenschmidt

Luis Henriques <luis.henriques@canonical.com> writes:

> 3.5.7.23 -stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> commit 8f21bd0090052e740944f9397e2be5ac7957ded7 upstream.

I'm dropping this patch as it is causing some build failures on
powerpc configs.

Cheers,
-- 
Luis


>
> The csum_partial_copy_generic() function saves the PowerPC
>non-volatile
> r14, r15, and r16 registers for the main checksum-and-copy loop.
> Unfortunately, it fails to restore them upon error exit from this loop,
> which results in silent corruption of these registers in the presumably
> rare event of an access exception within that loop.
>
> This commit therefore restores these register on error exit from the loop.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  arch/powerpc/lib/checksum_64.S | 54 +++++++++++++++++++++++++++++++-----------
>  1 file changed, 40 insertions(+), 14 deletions(-)
>
> diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S
> index afa2eba..d0e8390 100644
> --- a/arch/powerpc/lib/checksum_64.S
> +++ b/arch/powerpc/lib/checksum_64.S
> @@ -229,19 +229,35 @@ _GLOBAL(csum_partial)
>  	blr
>  
>  
> -	.macro source
> +	.macro srcnr
>  100:
>  	.section __ex_table,"a"
>  	.align 3
> -	.llong 100b,.Lsrc_error
> +	.llong 100b,.Lsrc_error_nr
>  	.previous
>  	.endm
>  
> -	.macro dest
> +	.macro source
> +150:
> +	.section __ex_table,"a"
> +	.align 3
> +	.llong 150b,.Lsrc_error
> +	.previous
> +	.endm
> +
> +	.macro dstnr
>  200:
>  	.section __ex_table,"a"
>  	.align 3
> -	.llong 200b,.Ldest_error
> +	.llong 200b,.Ldest_error_nr
> +	.previous
> +	.endm
> +
> +	.macro dest
> +250:
> +	.section __ex_table,"a"
> +	.align 3
> +	.llong 250b,.Ldest_error
>  	.previous
>  	.endm
>  
> @@ -277,11 +293,11 @@ _GLOBAL(csum_partial_copy_generic)
>  	mtctr	r6
>  
>  1:
> -source;	lhz	r6,0(r3)		/* align to doubleword */
> +srcnr;	lhz	r6,0(r3)		/* align to doubleword */
>  	subi	r5,r5,2
>  	addi	r3,r3,2
>  	adde	r0,r0,r6
> -dest;	sth	r6,0(r4)
> +dstnr;	sth	r6,0(r4)
>  	addi	r4,r4,2
>  	bdnz	1b
>  
> @@ -395,10 +411,10 @@ dest;	std	r16,56(r4)
>  
>  	mtctr	r6
>  3:
> -source;	ld	r6,0(r3)
> +srcnr;	ld	r6,0(r3)
>  	addi	r3,r3,8
>  	adde	r0,r0,r6
> -dest;	std	r6,0(r4)
> +dstnr;	std	r6,0(r4)
>  	addi	r4,r4,8
>  	bdnz	3b
>  
> @@ -408,10 +424,10 @@ dest;	std	r6,0(r4)
>  	srdi.	r6,r5,2
>  	beq	.Lcopy_tail_halfword
>  
> -source;	lwz	r6,0(r3)
> +srcnr;	lwz	r6,0(r3)
>  	addi	r3,r3,4
>  	adde	r0,r0,r6
> -dest;	stw	r6,0(r4)
> +dstnr;	stw	r6,0(r4)
>  	addi	r4,r4,4
>  	subi	r5,r5,4
>  
> @@ -419,10 +435,10 @@ dest;	stw	r6,0(r4)
>  	srdi.	r6,r5,1
>  	beq	.Lcopy_tail_byte
>  
> -source;	lhz	r6,0(r3)
> +srcnr;	lhz	r6,0(r3)
>  	addi	r3,r3,2
>  	adde	r0,r0,r6
> -dest;	sth	r6,0(r4)
> +dstnr;	sth	r6,0(r4)
>  	addi	r4,r4,2
>  	subi	r5,r5,2
>  
> @@ -430,10 +446,10 @@ dest;	sth	r6,0(r4)
>  	andi.	r6,r5,1
>  	beq	.Lcopy_finish
>  
> -source;	lbz	r6,0(r3)
> +srcnr;	lbz	r6,0(r3)
>  	sldi	r9,r6,8			/* Pad the byte out to 16 bits */
>  	adde	r0,r0,r9
> -dest;	stb	r6,0(r4)
> +dstnr;	stb	r6,0(r4)
>  
>  .Lcopy_finish:
>  	addze	r0,r0			/* add in final carry */
> @@ -443,6 +459,11 @@ dest;	stb	r6,0(r4)
>  	blr
>  
>  .Lsrc_error:
> +	ld	r14,STK_REG(R14)(r1)
> +	ld	r15,STK_REG(R15)(r1)
> +	ld	r16,STK_REG(R16)(r1)
> +	addi	r1,r1,STACKFRAMESIZE
> +.Lsrc_error_nr:
>  	cmpdi	0,r7,0
>  	beqlr
>  	li	r6,-EFAULT
> @@ -450,6 +471,11 @@ dest;	stb	r6,0(r4)
>  	blr
>  
>  .Ldest_error:
> +	ld	r14,STK_REG(R14)(r1)
> +	ld	r15,STK_REG(R15)(r1)
> +	ld	r16,STK_REG(R16)(r1)
> +	addi	r1,r1,STACKFRAMESIZE
> +.Ldest_error_nr:
>  	cmpdi	0,r8,0
>  	beqlr
>  	li	r6,-EFAULT

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

end of thread, other threads:[~2013-10-14 10:16 UTC | newest]

Thread overview: 101+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 10:40 [ 3.5.y.z extended stable ] Linux 3.5.7.23 stable review Luis Henriques
2013-10-11 10:40 ` [PATCH 001/100] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Luis Henriques
2013-10-11 10:40 ` [PATCH 002/100] drm/ast: fix the ast open key function Luis Henriques
2013-10-11 10:40 ` [PATCH 003/100] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Luis Henriques
2013-10-11 10:40 ` [PATCH 004/100] HID: provide a helper for validating hid reports Luis Henriques
2013-10-11 10:40 ` [PATCH 005/100] HID: zeroplus: validate output report details Luis Henriques
2013-10-11 10:40 ` [PATCH 006/100] HID: LG: validate HID " Luis Henriques
2013-10-11 10:40 ` [PATCH 007/100] HID: add usage_index in struct hid_usage Luis Henriques
2013-10-11 10:40 ` [PATCH 008/100] HID: validate feature and input report details Luis Henriques
2013-10-11 10:40 ` [PATCH 009/100] HID: logitech-dj: validate output " Luis Henriques
2013-10-11 10:40 ` [PATCH 010/100] HID: multitouch: validate indexes details Luis Henriques
2013-10-11 10:40 ` [PATCH 011/100] drm/radeon: fix panel scaling with eDP and LVDS bridges Luis Henriques
2013-10-11 10:40 ` [PATCH 012/100] net: usb: cdc_ether: Use wwan interface for Telit modules Luis Henriques
2013-10-11 10:40 ` [PATCH 013/100] usb: gadget: fix a bug and a WARN_ON in dummy-hcd Luis Henriques
2013-10-11 10:40 ` [PATCH 014/100] drm/ttm: fix the tt_populated check in ttm_tt_destroy() Luis Henriques
2013-10-11 10:40 ` [PATCH 015/100] sfc: Fix efx_rx_buf_offset() for recycled pages Luis Henriques
2013-10-11 10:40 ` [PATCH 016/100] perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu Luis Henriques
2013-10-11 10:40 ` [PATCH 017/100] perf: Fix perf_cgroup_switch for sw-events Luis Henriques
2013-10-11 10:40 ` [PATCH 018/100] cfq: explicitly use 64bit divide operation for 64bit arguments Luis Henriques
2013-10-11 10:40 ` [PATCH 019/100] perf tools: Handle JITed code in shared memory Luis Henriques
2013-10-11 10:40 ` [PATCH 020/100] isofs: Refuse RW mount of the filesystem instead of making it RO Luis Henriques
2013-10-11 10:40 ` [PATCH 021/100] HID: Fix Speedlink VAD Cezanne support for some devices Luis Henriques
2013-10-11 10:40 ` [PATCH 022/100] HID: usbhid: quirk for N-Trig DuoSense Touch Screen Luis Henriques
2013-10-11 10:40 ` [PATCH 023/100] Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()" Luis Henriques
2013-10-11 10:40 ` [PATCH 024/100] workqueue: cond_resched() after processing each work item Luis Henriques
2013-10-11 10:40 ` [PATCH 025/100] cgroup: fail if monitored file and event_control are in different cgroup Luis Henriques
2013-10-11 10:40 ` [PATCH 026/100] tg3: Don't turn off led on 5719 serdes port 0 Luis Henriques
2013-10-11 10:40 ` [PATCH 027/100] tg3: Expand led off fix to include 5720 Luis Henriques
2013-10-11 10:40 ` [PATCH 028/100] cciss: fix info leak in cciss_ioctl32_passthru() Luis Henriques
2013-10-11 10:40 ` [PATCH 029/100] cpqarray: fix info leak in ida_locked_ioctl() Luis Henriques
2013-10-11 10:41 ` [PATCH 030/100] mm, memcg: give exiting processes access to memory reserves Luis Henriques
2013-10-11 10:41 ` [PATCH 031/100] video: mxsfb: Add missing break Luis Henriques
2013-10-11 10:41 ` [PATCH 032/100] xhci: Fix race between ep halt and URB cancellation Luis Henriques
2013-10-11 10:41 ` [PATCH 033/100] serial: pch_uart: fix tty-kref leak in rx-error path Luis Henriques
2013-10-11 10:41 ` [PATCH 034/100] serial: pch_uart: fix tty-kref leak in dma-rx path Luis Henriques
2013-10-11 10:41 ` [PATCH 035/100] x86, efi: Don't map Boot Services on i386 Luis Henriques
2013-10-11 10:41 ` [PATCH 036/100] ALSA: compress: Fix compress device unregister Luis Henriques
2013-10-11 10:41 ` [PATCH 037/100] dm snapshot: workaround for a false positive lockdep warning Luis Henriques
2013-10-11 10:41 ` [PATCH 038/100] dm-snapshot: fix performance degradation due to small hash size Luis Henriques
2013-10-11 10:41 ` [PATCH 039/100] x86/reboot: Add quirk to make Dell C6100 use reboot=pci automatically Luis Henriques
2013-10-11 10:41 ` [PATCH 040/100] drm/radeon: disable tests/benchmarks if accel is disabled Luis Henriques
2013-10-11 10:41 ` [PATCH 041/100] xhci: Fix oops happening after address device timeout Luis Henriques
2013-10-11 10:41 ` [PATCH 042/100] xhci: Ensure a command structure points to the correct trb on the command ring Luis Henriques
2013-10-11 10:41 ` [PATCH 043/100] drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER Luis Henriques
2013-10-11 10:41 ` [PATCH 044/100] staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier Luis Henriques
2013-10-11 10:41 ` [PATCH 045/100] USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd Luis Henriques
2013-10-11 10:41 ` [PATCH 046/100] usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit Luis Henriques
2013-10-11 10:41 ` [PATCH 047/100] hwmon: (applesmc) Check key count before proceeding Luis Henriques
2013-10-11 10:41 ` [PATCH 048/100] USB: Fix breakage in ffs_fs_mount() Luis Henriques
2013-10-11 10:41 ` [PATCH 049/100] usb: dwc3: pci: add support for BayTrail Luis Henriques
2013-10-11 10:41 ` [PATCH 050/100] caif: Add missing braces to multiline if in cfctrl_linkup_request Luis Henriques
2013-10-11 10:41 ` [PATCH 051/100] net: sctp: fix smatch warning in sctp_send_asconf_del_ip Luis Henriques
2013-10-11 10:41 ` [PATCH 052/100] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Luis Henriques
2013-10-11 10:41 ` [PATCH 053/100] resubmit bridge: fix message_age_timer calculation Luis Henriques
2013-10-11 10:41 ` [PATCH 054/100] bridge: Clamp forward_delay when enabling STP Luis Henriques
2013-10-11 10:41 ` [PATCH 055/100] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header Luis Henriques
2013-10-11 10:41 ` [PATCH 056/100] ip: generate unique IP identificator if local fragmentation is allowed Luis Henriques
2013-10-11 10:41 ` [PATCH 057/100] netpoll: fix NULL pointer dereference in netpoll_cleanup Luis Henriques
2013-10-11 10:41 ` [PATCH 058/100] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO Luis Henriques
2013-10-11 10:41 ` [PATCH 059/100] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Luis Henriques
2013-10-11 10:41 ` [PATCH 060/100] net: flow_dissector: fix thoff for IPPROTO_AH Luis Henriques
2013-10-11 10:41 ` [PATCH 061/100] bonding: Fix broken promiscuity reference counting issue Luis Henriques
2013-10-11 10:41 ` [PATCH 062/100] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put Luis Henriques
2013-10-11 10:41 ` [PATCH 063/100] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put Luis Henriques
2013-10-11 10:41 ` [PATCH 064/100] dm9601: fix IFF_ALLMULTI handling Luis Henriques
2013-10-11 10:41 ` [PATCH 065/100] ll_temac: Reset dma descriptors indexes on ndo_open Luis Henriques
2013-10-11 10:41 ` [PATCH 066/100] gianfar: Change default HW Tx queue scheduling mode Luis Henriques
2013-10-11 10:41 ` [PATCH 067/100] fanotify: dont merge permission events Luis Henriques
2013-10-11 10:41 ` [PATCH 068/100] sparc32: Fix exit flag passed from traced sys_sigreturn Luis Henriques
2013-10-11 10:41 ` [PATCH 069/100] sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall Luis Henriques
2013-10-11 10:41 ` [PATCH 070/100] esp_scsi: Fix tag state corruption when autosensing Luis Henriques
2013-10-11 10:41 ` [PATCH 071/100] sparc64: Fix ITLB handler of null page Luis Henriques
2013-10-11 10:41 ` [PATCH 072/100] sparc64: Remove RWSEM export leftovers Luis Henriques
2013-10-11 10:41 ` [PATCH 073/100] sparc64: Fix off by one in trampoline TLB mapping installation loop Luis Henriques
2013-10-11 10:41 ` [PATCH 074/100] ASoC: max98095: a couple array underflows Luis Henriques
2013-10-11 10:41 ` [PATCH 075/100] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st() Luis Henriques
2013-10-11 10:41 ` [PATCH 076/100] Bluetooth: Add a new PID/VID 0cf3/e005 for AR3012 Luis Henriques
2013-10-11 10:41 ` [PATCH 077/100] Bluetooth: Fix security level for peripheral role Luis Henriques
2013-10-11 10:41 ` [PATCH 078/100] Bluetooth: Fix encryption key size " Luis Henriques
2013-10-11 10:41 ` [PATCH 079/100] Bluetooth: Add support for BCM20702A0 [0b05, 17cb] Luis Henriques
2013-10-11 10:41 ` [PATCH 080/100] rtlwifi: Align private space in rtl_priv struct Luis Henriques
2013-10-11 10:41 ` [PATCH 081/100] p54usb: add USB ID for Corega WLUSB2GTST USB adapter Luis Henriques
2013-10-11 10:41 ` [PATCH 082/100] mwifiex: fix hang issue for USB chipsets Luis Henriques
2013-10-11 10:41 ` [PATCH 083/100] mwifiex: fix NULL pointer dereference in usb suspend handler Luis Henriques
2013-10-11 10:41 ` [PATCH 084/100] USB: serial: option: Ignore card reader interface on Huawei E1750 Luis Henriques
2013-10-11 10:41 ` [PATCH 085/100] ib_srpt: Destroy cm_id before destroying QP Luis Henriques
2013-10-11 10:41 ` [PATCH 088/100] powerpc/sysfs: Disable writing to PURR in guest mode Luis Henriques
2013-10-11 10:42 ` [PATCH 090/100] powerpc/vio: Fix modalias_show return values Luis Henriques
2013-10-11 10:42 ` [PATCH 091/100] ib_srpt: always set response for task management Luis Henriques
2013-10-11 10:42 ` [PATCH 092/100] xen/hvc: allow xenboot console to be used again Luis Henriques
2013-10-11 10:53   ` David Vrabel
2013-10-11 11:04     ` Luis Henriques
2013-10-11 10:42 ` [PATCH 093/100] Smack: Fix the bug smackcipso can't set CIPSO correctly Luis Henriques
2013-10-11 10:42 ` [PATCH 094/100] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice Luis Henriques
2013-10-11 10:42 ` [PATCH 095/100] mwifiex: fix memory corruption when unsetting multicast list Luis Henriques
2013-10-11 10:42 ` [PATCH 096/100] ext4: avoid hang when mounting non-journal filesystems with orphan list Luis Henriques
2013-10-11 10:42 ` [PATCH 097/100] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic Luis Henriques
2013-10-11 10:42 ` [PATCH 098/100] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet Luis Henriques
2013-10-11 10:42 ` [PATCH 099/100] dma: fix comments Luis Henriques
2013-10-11 10:42 ` [PATCH 100/100] dmaengine: imx-dma: fix callback path in tasklet Luis Henriques
     [not found] ` <1381488130-30235-88-git-send-email-luis.henriques@canonical.com>
2013-10-14 10:16   ` [PATCH 087/100] powerpc: Restore registers on error exit from csum_partial_copy_generic() Luis Henriques

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).