Commit Graph

58983 Commits

Author SHA1 Message Date
Mark Brown
6ea1971e5c Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-10-11 19:26:58 +01:00
Mark Brown
fa4b900fca Merge remote-tracking branch 'lsk/v3.10/topic/big.LITTLE' into linux-linaro-lsk 2013-10-11 19:26:24 +01:00
Jon Medhurst
68f98fec62 Merge tag 'big-LITTLE-MP-13.10' into for-lsk 2013-10-11 17:12:02 +01:00
Chris Redpath
5ecaba3d9f smp: smp_cross_call function pointer tracing
generic tracing for smp_cross_call function calls

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-10-11 15:07:18 +01:00
Chris Redpath
2353c1f800 arm: ipi raise/start/end tracing
Add tracepoints for IPI raise events, and start and end of the
ipi handler.

Used to inspect the source of CPU wake-ups which are not already
traced - all other reasons for a CPU to wake-up are already
covered.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-10-11 15:07:18 +01:00
Chris Redpath
7b8e0b3f2a sched: HMP: Additional trace points for debugging HMP behaviour
1. Replace magic numbers in code for migration trace.
   Trace points still emit a number as force=<n> field:
     force=0 : wakeup migration
     force=1 : forced migration
     force=2 : offload migration
     force=3 : idle pull migration

2. Add trace to expose offload decision-making.
   Also adds tracing rq->nr_running so that you can
   look back to see what state the RQ was in at the time.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-10-11 15:07:17 +01:00
Mark Brown
626c75a015 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-10-06 14:31:06 +01:00
Mark Brown
a3dfd8c063 This is the 3.10.15 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (GNU/Linux)
 
 iQIcBAABAgAGBQJSUB6KAAoJEDjbvchgkmk+Kq8P/2ehUrXv8VCbW1GO4U7aYqsn
 S8dj19FRuSDYX9D6VbZYMEkNLljiJKjTwH8bmbUPOI6Wd6xkdmL77RA7VLpbUGxt
 I7YpPAKiAWGq9jWNWEDPtSzKITOVh1FrYUB15ISJhcOif3U3ox1xTcfsHAlJmtL/
 9uYx2kUMv70iuW3cnrwaBLS0tSI3hL/aeF8pf2nIA77+pgj6OfKTM8pLpf0tIyIg
 R9q61syVwMba3dVQT6hcbAsqDfxcFAEasP3WT82mPW+s0usO43PS0nl8lirmjvQv
 /d/npoeDZDs5vicS8bGygiV6mDr778nVbJtWheUSyBX0R78u89lfyYL6s27FHbIX
 eBMGu3lGcP7lz8fN1fPvPz+M1QzIcvb+PLrqSkfAgKiPNW4I7bWQe1jxbUUhB48H
 eSP22xSXP0KkxdK5N5BJwAAT00ENFfL9NRTIsjHWTZs0sq4I3FYU3EznZ5IwXalN
 rwR2gWyVv0df+t4825rszSBv8E+9noamOpLUx1a82pgdb0n99+xtob1DSLI65LLD
 KXFAok60a6+s4bESwhnWPQM9NSUQ0C+Q+RHv3AKg+Cdn4UJGPp+LMizTtiENCkAD
 AGl+v2fZtTdiNInWlR1dQbTzcWhn3OUziplTarr2W3X4QvqW4c1Utr+eS32AZkGh
 VmHkeePBH+cAYSQHHBeV
 =ymNh
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.15' into linux-linaro-lsk

This is the 3.10.15 stable release
2013-10-06 14:30:53 +01:00
Mike Snitzer
e9d60f6991 dm mpath: disable WRITE SAME if it fails
commit f84cb8a46a upstream.

Workaround the SCSI layer's problematic WRITE SAME heuristics by
disabling WRITE SAME in the DM multipath device's queue_limits if an
underlying device disabled it.

The WRITE SAME heuristics, with both the original commit 5db44863b6
("[SCSI] sd: Implement support for WRITE SAME") and the updated commit
66c28f971 ("[SCSI] sd: Update WRITE SAME heuristics"), default to enabling
WRITE SAME(10) even without successfully determining it is supported.
After the first failed WRITE SAME the SCSI layer will disable WRITE SAME
for the device (by setting sdkp->device->no_write_same which results in
'max_write_same_sectors' in device's queue_limits to be set to 0).

When a device is stacked ontop of such a SCSI device any changes to that
SCSI device's queue_limits do not automatically propagate up the stack.
As such, a DM multipath device will not have its WRITE SAME support
disabled.  This causes the block layer to continue to issue WRITE SAME
requests to the mpath device which causes paths to fail and (if mpath IO
isn't configured to queue when no paths are available) it will result in
actual IO errors to the upper layers.

This fix doesn't help configurations that have additional devices
stacked ontop of the mpath device (e.g. LVM created linear DM devices
ontop).  A proper fix that restacks all the queue_limits from the bottom
of the device stack up will need to be explored if SCSI will continue to
use this model of optimistically allowing op codes and then disabling
them after they fail for the first time.

Before this patch:

EXT4-fs (dm-6): mounted filesystem with ordered data mode. Opts: (null)
device-mapper: multipath: XXX snitm debugging: got -EREMOTEIO (-121)
device-mapper: multipath: XXX snitm debugging: failing WRITE SAME IO with error=-121
end_request: critical target error, dev dm-6, sector 528
dm-6: WRITE SAME failed. Manually zeroing.
device-mapper: multipath: Failing path 8:112.
end_request: I/O error, dev dm-6, sector 4616
dm-6: WRITE SAME failed. Manually zeroing.
end_request: I/O error, dev dm-6, sector 4616
end_request: I/O error, dev dm-6, sector 5640
end_request: I/O error, dev dm-6, sector 6664
end_request: I/O error, dev dm-6, sector 7688
end_request: I/O error, dev dm-6, sector 524288
Buffer I/O error on device dm-6, logical block 65536
lost page write due to I/O error on dm-6
JBD2: Error -5 detected when updating journal superblock for dm-6-8.
end_request: I/O error, dev dm-6, sector 524296
Aborting journal on device dm-6-8.
end_request: I/O error, dev dm-6, sector 524288
Buffer I/O error on device dm-6, logical block 65536
lost page write due to I/O error on dm-6
JBD2: Error -5 detected when updating journal superblock for dm-6-8.

# cat /sys/block/sdh/queue/write_same_max_bytes
0
# cat /sys/block/dm-6/queue/write_same_max_bytes
33553920

After this patch:

EXT4-fs (dm-6): mounted filesystem with ordered data mode. Opts: (null)
device-mapper: multipath: XXX snitm debugging: got -EREMOTEIO (-121)
device-mapper: multipath: XXX snitm debugging: WRITE SAME I/O failed with error=-121
end_request: critical target error, dev dm-6, sector 528
dm-6: WRITE SAME failed. Manually zeroing.

# cat /sys/block/sdh/queue/write_same_max_bytes
0
# cat /sys/block/dm-6/queue/write_same_max_bytes
0

It should be noted that WRITE SAME support wasn't enabled in DM
multipath until v3.10.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-05 07:13:11 -07:00
Mark Brown
7d89516d24 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-10-04 00:30:46 +01:00
Mark Brown
18d8ff256f This is the 3.10.14 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (GNU/Linux)
 
 iQIcBAABAgAGBQJSSvXIAAoJEDjbvchgkmk+PXsP/0PdzaphWC5BTRGYgm/iTSXA
 7sPBBEEVXdQwbzXu4lpRvMbxoa+JV0RdHJXwnkqqneb6JKTlhEuUj28SA58ZPY+f
 4nXU8QI63+nqYT9cfzhllvlIxwvgbWeEVC6f8Fgbr1n8wUer38cWlvImW3WmuEe1
 EOErgYzSUmQE391lvIi55PuBqeGP5JhJquOFVb8Mr3A7nnhe1ARgnp78cNY/gP8F
 3sfCSKhAAUP+N6Kd0FNU7EPM6UFsqh2T3TPdu1+r41r0rJDbVebdV91JozyRmuxN
 LPHumMrS8rykpkFS0xPo03r6ANLvq3nBbfpDZp+lrGiWowN0E+vV73x3CdrJ6ol8
 gxQ3+H6JjHu/CU3Hq8rLX97bgk1H6fY99Cjy8egiZyHkyBoWVQEiWtm1jXftHVz4
 Z+IY+Zh53R6xJKFfQRaNiiFhrgUpgClSrmYaqXYcNVldWN8fbvvqwW1nUwvBF+f6
 or8wDrj8YMgCAEQnl/Siq9gaHUqWxPUSOfTc/W/tzdZ10JEOz5FMg8u8ZwkPBSre
 CbFDcq2mRFbXnz+FP69mBEBYvthSFQrWZ7HUsGVnWvvc+diLlTTh+0ifXut+mPHG
 vHcT6RjndQSCDWTz3bVYOQI1Wq99vUPicHPcXXcrJMHPYWZpedGN/BF6V+qJUNVD
 lebGa0Op8y148hyjsc8l
 =82Dz
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.14' into linux-linaro-lsk

This is the 3.10.14 stable release
2013-10-04 00:30:17 +01:00
Tom Stellard
c7384791a7 drm/radeon/si: Add support for CP DMA to CS checker for compute v2
commit e5b9e7503e upstream.

Also add a new RADEON_INFO query to check that CP DMA packets are
supported on the compute ring.

CP DMA has been supported since the 3.8 kernel, but due to an oversight
we forgot to teach the CS checker that the CP DMA packet was legal for
the compute ring on Southern Islands GPUs.

This patch fixes a bug where the radeon driver will incorrectly reject a legal
CP DMA packet from user space.  I would like to have the patch
backported to stable so that we don't have to require Mesa users to use a
bleeding edge kernel in order to take advantage of this feature which
is already present in the stable kernels (3.8 and newer).

v2:
  - Don't bump kms version, so this patch can be backported to stable
    kernels.

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01 09:17:47 -07:00
Kees Cook
791abfbee8 HID: provide a helper for validating hid reports
commit 331415ff16 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01 09:17:46 -07:00
John Stultz
63946e8616 timekeeping: Fix HRTICK related deadlock from ntp lock changes
commit 7bd3601446 upstream.

Gerlando Falauto reported that when HRTICK is enabled, it is
possible to trigger system deadlocks. These were hard to
reproduce, as HRTICK has been broken in the past, but seemed
to be connected to the timekeeping_seq lock.

Since seqlock/seqcount's aren't supported w/ lockdep, I added
some extra spinlock based locking and triggered the following
lockdep output:

[   15.849182] ntpd/4062 is trying to acquire lock:
[   15.849765]  (&(&pool->lock)->rlock){..-...}, at: [<ffffffff810aa9b5>] __queue_work+0x145/0x480
[   15.850051]
[   15.850051] but task is already holding lock:
[   15.850051]  (timekeeper_lock){-.-.-.}, at: [<ffffffff810df6df>] do_adjtimex+0x7f/0x100

<snip>

[   15.850051] Chain exists of: &(&pool->lock)->rlock --> &p->pi_lock --> timekeeper_lock
[   15.850051]  Possible unsafe locking scenario:
[   15.850051]
[   15.850051]        CPU0                    CPU1
[   15.850051]        ----                    ----
[   15.850051]   lock(timekeeper_lock);
[   15.850051]                                lock(&p->pi_lock);
[   15.850051] lock(timekeeper_lock);
[   15.850051] lock(&(&pool->lock)->rlock);
[   15.850051]
[   15.850051]  *** DEADLOCK ***

The deadlock was introduced by 06c017fdd4 ("timekeeping:
Hold timekeepering locks in do_adjtimex and hardpps") in 3.10

This patch avoids this deadlock, by moving the call to
schedule_delayed_work() outside of the timekeeper lock
critical section.

Reported-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Tested-by: Lin Ming <minggr@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: http://lkml.kernel.org/r/1378943457-27314-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01 09:17:45 -07:00
Mark Brown
67a681c033 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-09-27 10:44:04 +01:00
Mark Brown
2a04587736 This is the 3.10.13 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJSRM7zAAoJEDjbvchgkmk+Z5kQAMc4SZhh0xlSJCsdQ18LECTE
 9wpNicjy1KgarAudg23H5y4UkfA/VLVQigyuWMJyRUnL8dxs7rc8no/t1Pl6XydV
 Bs+2JM6sHL34+N2YGFeUfoILkY5770N4nmcjISRwUnkikvqqwZZACsTTdd//JnEJ
 EBmRTXftlqMAQsNyeAx9Gvtvc7gWw4mQZLYRipSsUmtTJfbjIY7VJ1uC/VZ/F0/P
 NDjgjNipgbPUz8aTlRhBWknjt4hK0VXoIIsW3vcN1DfUg6sMgfQJG9Kd+4uCpJ5X
 38N1w/jYRMOw8sVnnaftoZYSaTOCd2vPD+ngMLP616ucd1t27TgvGdMmq2r0oIs+
 j0rWDagtPCfex11LI+XhcAabfwZ0JCfTMLWPJG5E86GBoLtHv5fAAqLYaZhWBeqC
 oEJyKp1Nu/9luiEfXbU+UW153BZLI0b9loRFva4NJyKLNCMvVTKMaNu4VEzlNI2e
 FaQTumG3jRMhA2HXufXF+FeaU2NQczXdKeftZJZ9FeZLKsCJnag7A2JR6z0zHoPZ
 xuDoFmRWovUlk0SgB/ReuOT9vLgmNPzvl6SyBYiy+PqoXZAOe3ztRrpRTSzh56WR
 uDm5Y9ECp85F66ewd4aNX13gX1nzrxA4f7rWfzlRlC7TeHtV/97vcRCqK12+jqSg
 ySPiwMHSAULElexQoNiG
 =9inU
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.13' into linux-linaro-lsk

This is the 3.10.13 stable release
2013-09-27 10:43:52 +01:00
Andrzej Hajda
cd08ebc07c media: v4l2: added missing mutex.h include to v4l2-ctrls.h
commit a19dec6ea9 upstream.

This patch fixes following error:
include/media/v4l2-ctrls.h:193:15: error: field ‘_lock’ has incomplete type
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_lock’:
include/media/v4l2-ctrls.h:570:2: error: implicit declaration of
	function ‘mutex_lock’ [-Werror=implicit-function-declaration]
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_unlock’:
include/media/v4l2-ctrls.h:579:2: error: implicit declaration of
	function ‘mutex_unlock’ [-Werror=implicit-function-declaration]

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:26 -07:00
Kees Cook
56085cec9e HID: validate HID report id size
commit 43622021d2 upstream.

The "Report ID" field of a HID report is used to build indexes of
reports. The kernel's index of these is limited to 256 entries, so any
malicious device that sets a Report ID greater than 255 will trigger
memory corruption on the host:

[ 1347.156239] BUG: unable to handle kernel paging request at ffff88094958a878
[ 1347.156261] IP: [<ffffffff813e4da0>] hid_register_report+0x2a/0x8b

CVE-2013-2888

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:16 -07:00
Aravind Gopalakrishnan
5e3db40138 pci_ids: Add PCI device ID functions 3 and 4 for newer F15h models.
commit 6bdaa63c29 upstream.

Add PCI device IDs for AMD F15h, model 30h. They will be used in
amd_nb.c and amd64_edac.c

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:14 -07:00
Al Viro
a168ad2687 Introduce [compat_]save_altstack_ex() to unbreak x86 SMAP
commit bd1c149aa9 upstream.

For performance reasons, when SMAP is in use, SMAP is left open for an
entire put_user_try { ... } put_user_catch(); block, however, calling
__put_user() in the middle of that block will close SMAP as the
STAC..CLAC constructs intentionally do not nest.

Furthermore, using __put_user() rather than put_user_ex() here is bad
for performance.

Thus, introduce new [compat_]save_altstack_ex() helpers that replace
__[compat_]save_altstack() for x86, being currently the only
architecture which supports put_user_try { ... } put_user_catch().

Reported-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/n/tip-es5p6y64if71k8p5u08agv9n@git.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:13 -07:00
Tejun Heo
215840ab83 rculist: list_first_or_null_rcu() should use list_entry_rcu()
commit c34ac00cae upstream.

list_first_or_null() should test whether the list is empty and return
pointer to the first entry if not in a RCU safe manner.  It's broken
in several ways.

* It compares __kernel @__ptr with __rcu @__next triggering the
  following sparse warning.

  net/core/dev.c:4331:17: error: incompatible types in comparison expression (different address spaces)

* It doesn't perform rcu_dereference*() and computes the entry address
  using container_of() directly from the __rcu pointer which is
  inconsitent with other rculist interface.  As a result, all three
  in-kernel users - net/core/dev.c, macvlan, cgroup - are buggy.  They
  dereference the pointer w/o going through read barrier.

* While ->next dereference passes through list_next_rcu(), the
  compiler is still free to fetch ->next more than once and thus
  nullify the "__ptr != __next" condition check.

Fix it by making list_first_or_null_rcu() dereference ->next directly
using ACCESS_ONCE() and then use list_entry_rcu() on it like other
rculist accessors.

v2: Paul pointed out that the compiler may fetch the pointer more than
    once nullifying the condition check.  ACCESS_ONCE() added on
    ->next dereference.

v3: Restored () around macro param which was accidentally removed.
    Spotted by Paul.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:13 -07:00
Alan Stern
94cc662c4b USB: fix build error when CONFIG_PM_SLEEP isn't enabled
commit 9d8924297c upstream.

This patch fixes a build error that occurs when CONFIG_PM is enabled
and CONFIG_PM_SLEEP isn't:

>> drivers/usb/host/ohci-pci.c:294:10: error: 'usb_hcd_pci_pm_ops' undeclared here (not in a function)
      .pm = &usb_hcd_pci_pm_ops

Since the usb_hcd_pci_pm_ops structure is defined and used when
CONFIG_PM is enabled, its declaration should not be protected by
CONFIG_PM_SLEEP.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:12 -07:00
Mark Brown
dafe3258c5 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-09-15 13:43:45 +01:00
Mark Brown
4ed4d44eb2 This is the 3.10.12 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (GNU/Linux)
 
 iQIcBAABAgAGBQJSNGrLAAoJEDjbvchgkmk+6ScP/3O1V3lsaCC6Q3uCr3zF0u9q
 sX6RTKyamIrblOZtaP5/OhVc/4oODW1I3LXEOzPOClSZdTzq+s6nA6JrnZ7wBLRs
 BGNxLpDG9IFxlqagnZdbc7e2UBGnCfbnAnK3PHEuuqeYhqQ6N9wv3AGBtcbE/yID
 2e9q9ZxbVSKxdGe453gSV3uHbMiMIQNi6rgaCetG0ncPDQjCqf4cLAswWnrocXTl
 +dHRaMx9F5ZBGWG574ZpMCspAkuzpZI94nikEvDlBMkI7i8tl4+csJPmY2ZfVw+C
 NQZkeO1/CzV3XOP5gXboWZpI+US8dkXW5XnlEQQXUw7r/T7jxLYnboPu3JksS8pj
 ufR84lA3GLZkDqpi0IFizOlhFyDZsnzin1cM+1tFfVeaj3M9sy0JQbO79ef0VtBN
 u8OqPge3M6kZNMBIKith56okSIpe1OqnNTtpWrmmwW9dsi4/ulr9vaam1mRIoLGk
 PAH6+5A6m74lFZ7W/+AaBTSlg8aevLaq5Qbg+Y01SBwdGJqjycc83ic5+dI6VRWk
 XZrTzwnbxK0YTYgElbcCdtY58MJVVqZ90sEvsG70zZ0aonLfaqkUDckEXfnwCkF/
 NQam2aNRNjtwjDvR/PzIG+J8AmYO6qug4hhNtkN84qGVsilb9abee7/f9e8cifRW
 d6ROPHd/C03vEF+YcIf2
 =cL5c
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.12' into linux-linaro-lsk

This is the 3.10.12 stable release
2013-09-15 13:43:21 +01:00
Jiri Bohac
2aae409672 ICMPv6: treat dest unreachable codes 5 and 6 as EACCES, not EPROTO
[ Upstream commit 61e76b178d ]

RFC 4443 has defined two additional codes for ICMPv6 type 1 (destination
unreachable) messages:
        5 - Source address failed ingress/egress policy
	6 - Reject route to destination

Now they are treated as protocol error and icmpv6_err_convert() converts them
to EPROTO.

RFC 4443 says:
	"Codes 5 and 6 are more informative subsets of code 1."

Treat codes 5 and 6 as code 1 (EACCES)

Btw, connect() returning -EPROTO confuses firefox, so that fallback to
other/IPv4 addresses does not work:
https://bugzilla.mozilla.org/show_bug.cgi?id=910773

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-14 06:54:56 -07:00
Jesper Dangaard Brouer
c06ab09127 net_sched: restore "linklayer atm" handling
[ Upstream commit 8a8e3d84b1 ]

commit 56b765b79 ("htb: improved accuracy at high rates")
broke the "linklayer atm" handling.

 tc class add ... htb rate X ceil Y linklayer atm

The linklayer setting is implemented by modifying the rate table
which is send to the kernel.  No direct parameter were
transferred to the kernel indicating the linklayer setting.

The commit 56b765b79 ("htb: improved accuracy at high rates")
removed the use of the rate table system.

To keep compatible with older iproute2 utils, this patch detects
the linklayer by parsing the rate table.  It also supports future
versions of iproute2 to send this linklayer parameter to the
kernel directly. This is done by using the __reserved field in
struct tc_ratespec, to convey the choosen linklayer option, but
only using the lower 4 bits of this field.

Linklayer detection is limited to speeds below 100Mbit/s, because
at high rates the rtab is gets too inaccurate, so bad that
several fields contain the same values, this resembling the ATM
detect.  Fields even start to contain "0" time to send, e.g. at
1000Mbit/s sending a 96 bytes packet cost "0", thus the rtab have
been more broken than we first realized.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-14 06:54:55 -07:00
Hannes Frederic Sowa
a829a28873 ipv6: drop packets with multiple fragmentation headers
[ Upstream commit f46078cfcd ]

It is not allowed for an ipv6 packet to contain multiple fragmentation
headers. So discard packets which were already reassembled by
fragmentation logic and send back a parameter problem icmp.

The updates for RFC 6980 will come in later, I have to do a bit more
research here.

Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-14 06:54:55 -07:00
Pravin B Shelar
e8d1167877 ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id.
[ Upstream commit 4221f40513 ]

Using inner-id for tunnel id is not safe in some rare cases.
E.g. packets coming from multiple sources entering same tunnel
can have same id. Therefore on tunnel packet receive we
could have packets from two different stream but with same
source and dst IP with same ip-id which could confuse ip packet
reassembly.

Following patch reverts optimization from commit
490ab08127 (IP_GRE: Fix IP-Identification.)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
CC: Jarno Rajahalme <jrajahalme@nicira.com>
CC: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-14 06:54:55 -07:00
Pravin B Shelar
a8077ef001 genl: Hold reference on correct module while netlink-dump.
[ Upstream commit 33c6b1f6b1 ]

netlink dump operations take module as parameter to hold
reference for entire netlink dump duration.
Currently it holds ref only on genl module which is not correct
when we use ops registered to genl from another module.
Following patch adds module pointer to genl_ops so that netlink
can hold ref count on it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
CC: Jesse Gross <jesse@nicira.com>
CC: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-14 06:54:55 -07:00
Mark Brown
ed9d23700e Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-09-08 13:24:43 +01:00
Mark Brown
bf06bec1f8 This is the 3.10.11 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (GNU/Linux)
 
 iQIcBAABAgAGBQJSLAbCAAoJEDjbvchgkmk+QB0P/jVGyaELYebEBgHTX0fWSMWT
 QxFSqR4cUMrztNGDh82xiDkewOx3Kk/uF5302jgukWduy3Xb4Eohx1TVSPynYrT9
 f949w/MgJmXJsXoFRNuYQAMI/oA7pR3skK3v44yDfETcePDmPvA+ChttICTKs45r
 D+Vjwh4tmwgNbDaneViBJn1sFzl469EUEfzSXQhp4al9L8qsxzRTjVZ3I3E71gUo
 EjWoSjNyBzsMoKG8wUY7ZAtIOVpnYjNOuwFfN94kp9ACVAHmapk3VE2Hw/WIZ5JM
 F/BaechsXOhto3GVN7scTL8vJCpDGvAsTF+PE4p1qN64PbyjV/fZy2U4ksTH9hzw
 aNzHpQICubKa+fi6/cBWHDkWL3I9ww5nrC8czck7zQO09LZ9bfU34IahZn1vIOeE
 iltfeQ/VfPnjctgbLGvms2Vlut3GRCEhIhYC6FhqUC+IG2yA2X49RSt0ljmmx41C
 XnSJaIN/fi94nOWmbc85ZT0twLG7666TnaBIYpQmWoVa03FpG3jLFL0MiVm3hIKp
 JU8YUF8gOHaJniEvLPcbBXthZL8mMZDAOevtqKz+RlYc+y0lpjIcK4TAk6KDBoiE
 Gi+I2yAjdWjmEDqqTyVTaAQwV65zFXLKlIS3JWJxG0fvL5BXahvr2jf7DL5eTgRN
 I7Uoezlhro3Lu0zXiPUl
 =yzJf
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.11' into linux-linaro-lsk

This is the 3.10.11 stable release
2013-09-08 13:24:29 +01:00
Felix Fietkau
9ddc34b565 mac80211: add a flag to indicate CCK support for HT clients
commit 2dfca312a9 upstream.

brcm80211 cannot handle sending frames with CCK rates as part of an
A-MPDU session. Other drivers may have issues too. Set the flag in all
drivers that have been tested with CCK rates.

This fixes a reported brcmsmac regression introduced in
commit ef47a5e4f1
"mac80211/minstrel_ht: fix cck rate sampling"

Reported-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-07 22:09:59 -07:00
Kevin Hilman
f1179e006e regmap: Add another missing header for !CONFIG_REGMAP stubs
commit 3f0fa9a808 upstream.

The use of WARN_ON() needs the definitions from bug.h, without it
you can get:

include/linux/regmap.h: In function 'regmap_write':
include/linux/regmap.h:525:2: error: implicit declaration of function 'WARN_ONCE' [-Werror=implicit-function-declaration]

Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-07 22:09:58 -07:00
Mark Brown
72bce45fde Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-08-29 18:40:30 +01:00
Mark Brown
965abff8d8 This is the 3.10.10 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (GNU/Linux)
 
 iQIcBAABAgAGBQJSH3tGAAoJEDjbvchgkmk+dGkP/3pDIrQI04HQIdaS4eHQTZOx
 1iW2amQzdi8TFsaU3qx2eZbpxuO7QJTKdo+RhgOvpvSTv4dWjMU7xVk90TJrjjoX
 yWkh5DhOHswB/LunPIL828Z6/2A3yc/2RVIvh5jBcniPpeLVjXBnIwpaOThFIy0H
 ar8LnK4cydCBciOIaJVNIbLzW3YDLINdv6rfscGESefC5HjyE3+4DrEKIJEsgQig
 fpP4PVPK/ONuustdxyQHcGNCQKtHEa0y9eiSICqKPxhp8Tgv44MpCBvYRiaPo7c+
 y2/w+UgA0Lu7jpS6KehAjg74EhtOWxQZAvaTXgcOYtrdzGSiWSnJzf/3wwoF/8s5
 9BeQLNgwJLZscke+JDPpNZKuMB4JO3EG/fHnSC1TqExoGYwXvn9sHVSKmVkKvAOW
 aj3uUkcdfQGn+ZJlj9s05fJE+zyUAl58Gjjg7QznsDFxnG5kVJfWOsLx7A3O4IAH
 hAnYhypDUo7aOXM/AhFSX/Qux09MGJxjDPQv1YjZ0TF/hNdetXW3wzekBil20Nfa
 My2rf6ilvS/px2tnkreESHIV6r607uA7IezyEoEKYA77jjjmZVCV8XeKTKjriEy4
 l2NH4Zc6tHyxGLHro5Ui1Of4PSTcA1p/NXddbMKkzY7v6wB+jvrYULD5iIH24wgP
 FMddAaQBnjRQX8CueytF
 =Un/X
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.10' into linux-linaro-lsk

This is the 3.10.10 stable release
2013-08-29 18:40:17 +01:00
Radu Caragea
ff1a668bc0 x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member
commit 41aacc1eea upstream.

This is the updated version of df54d6fa54 ("x86 get_unmapped_area():
use proper mmap base for bottom-up direction") that only randomizes the
mmap base address once.

Signed-off-by: Radu Caragea <sinaelgl@gmail.com>
Reported-and-tested-by: Jeff Shorey <shoreyjeff@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Adrian Sendroiu <molecula2788@gmail.com>
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-29 09:47:39 -07:00
Linus Torvalds
bd4b69c1f7 Revert "x86 get_unmapped_area(): use proper mmap base for bottom-up direction"
commit 5ea80f76a5 upstream.

This reverts commit df54d6fa54.

The commit isn't necessarily wrong, but because it recalculates the
random mmap_base every time, it seems to confuse user memory allocators
that expect contiguous mmap allocations even when the mmap address isn't
specified.

In particular, the MATLAB Java runtime seems to be unhappy. See

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

So we'll want to apply the random offset only once, and Radu has a patch
for that.  Revert this older commit in order to apply the other one.

Reported-by: Jeff Shorey <shoreyjeff@gmail.com>
Cc: Radu Caragea <sinaelgl@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-29 09:47:39 -07:00
Martin Peschke
bda5d1efa0 SCSI: zfcp: fix lock imbalance by reworking request queue locking
commit d79ff14262 upstream.

This patch adds wait_event_interruptible_lock_irq_timeout(), which is a
straight-forward descendant of wait_event_interruptible_timeout() and
wait_event_interruptible_lock_irq().

The zfcp driver used to call wait_event_interruptible_timeout()
in combination with some intricate and error-prone locking. Using
wait_event_interruptible_lock_irq_timeout() as a replacement
nicely cleans up that locking.

This rework removes a situation that resulted in a locking imbalance
in zfcp_qdio_sbal_get():

BUG: workqueue leaked lock or atomic: events/1/0xffffff00/10
    last function: zfcp_fc_wka_port_offline+0x0/0xa0 [zfcp]

It was introduced by commit c2af7545aa
"[SCSI] zfcp: Do not wait for SBALs on stopped queue", which had a new
code path related to ZFCP_STATUS_ADAPTER_QDIOUP that took an early exit
without a required lock being held. The problem occured when a
special, non-SCSI I/O request was being submitted in process context,
when the adapter's queues had been torn down. In this case the bug
surfaced when the Fibre Channel port connection for a well-known address
was closed during a concurrent adapter shut-down procedure, which is a
rare constellation.

This patch also fixes these warnings from the sparse tool (make C=1):

drivers/s390/scsi/zfcp_qdio.c:224:12: warning: context imbalance in
 'zfcp_qdio_sbal_check' - wrong count at exit
drivers/s390/scsi/zfcp_qdio.c:244:5: warning: context imbalance in
 'zfcp_qdio_sbal_get' - unexpected unlock

Last but not least, we get rid of that crappy lock-unlock-lock
sequence at the beginning of the critical section.

It is okay to call zfcp_erp_adapter_reopen() with req_q_lock held.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-29 09:47:39 -07:00
Oleg Nesterov
8169887b69 tracing: trace_remove_event_call() should fail if call/file is in use
commit 2816c551c7 upstream.

Change trace_remove_event_call(call) to return the error if this
call is active. This is what the callers assume but can't verify
outside of the tracing locks. Both trace_kprobe.c/trace_uprobe.c
need the additional changes, unregister_trace_probe() should abort
if trace_remove_event_call() fails.

The caller is going to free this call/file so we must ensure that
nobody can use them after trace_remove_event_call() succeeds.
debugfs should be fine after the previous changes and event_remove()
does TRACE_REG_UNREGISTER, but still there are 2 reasons why we need
the additional checks:

- There could be a perf_event(s) attached to this tp_event, so the
  patch checks ->perf_refcount.

- TRACE_REG_UNREGISTER can be suppressed by FTRACE_EVENT_FL_SOFT_MODE,
  so we simply check FTRACE_EVENT_FL_ENABLED protected by event_mutex.

Link: http://lkml.kernel.org/r/20130729175033.GB26284@redhat.com

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-29 09:47:34 -07:00
Rafael J. Wysocki
6e4fdb8035 ACPI: Try harder to resolve _ADR collisions for bridges
commit 60f75b8e97 upstream.

In theory, under a given ACPI namespace node there should be only
one child device object with _ADR whose value matches a given bus
address exactly.  In practice, however, there are systems in which
multiple child device objects under a given parent have _ADR matching
exactly the same address.  In those cases we use _STA to determine
which of the multiple matching devices is enabled, since some systems
are known to indicate which ACPI device object to associate with the
given physical (usually PCI) device this way.

Unfortunately, as it turns out, there are systems in which many
device objects under the same parent have _ADR matching exactly the
same bus address and none of them has _STA, in which case they all
should be regarded as enabled according to the spec.  Still, if
those device objects are supposed to represent bridges (e.g. this
is the case for device objects corresponding to PCIe ports), we can
try harder and skip the ones that have no child device objects in the
ACPI namespace.  With luck, we can avoid using device objects that we
are not expected to use this way.

Although this only works for bridges whose children also have ACPI
namespace representation, it is sufficient to address graphics
adapter detection issues on some systems, so rework the code finding
a matching device ACPI handle for a given bus address to implement
this idea.

Introduce a new function, acpi_find_child(), taking three arguments:
the ACPI handle of the device's parent, a bus address suitable for
the device's bus type and a bool indicating if the device is a
bridge and make it work as outlined above.  Reimplement the function
currently used for this purpose, acpi_get_child(), as a call to
acpi_find_child() with the last argument set to 'false' and make
the PCI subsystem use acpi_find_child() with the bridge information
passed as the last argument to it.  [Lan Tianyu notices that it is
not sufficient to use pci_is_bridge() for that, because the device's
subordinate pointer hasn't been set yet at this point, so use
hdr_type instead.]

This change fixes a regression introduced inadvertently by commit
33f767d (ACPI: Rework acpi_get_child() to be more efficient) which
overlooked the fact that for acpi_walk_namespace() "post-order" means
"after all children have been visited" rather than "on the way back",
so for device objects without children and for namespace walks of
depth 1, as in the acpi_get_child() case, the "post-order" callbacks
ordering is actually the same as the ordering of "pre-order" ones.
Since that commit changed the namespace walk in acpi_get_child() to
terminate after finding the first matching object instead of going
through all of them and returning the last one, it effectively
changed the result returned by that function in some rare cases and
that led to problems (the switch from a "pre-order" to a "post-order"
callback was supposed to prevent that from happening, but it was
ineffective).

As it turns out, the systems where the change made by commit
33f767d actually matters are those where there are multiple ACPI
device objects representing the same PCIe port (which effectively
is a bridge).  Moreover, only one of them, and the one we are
expected to use, has child device objects in the ACPI namespace,
so the regression can be addressed as described above.

References: https://bugzilla.kernel.org/show_bug.cgi?id=60561
Reported-by: Peter Wu <lekensteyn@gmail.com>
Tested-by: Vladimir Lalov <mail@vlalov.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Peter Wu <lekensteyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-29 09:47:29 -07:00
Mark Brown
6e93543c4e Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-08-21 12:53:17 +01:00
Mark Brown
4c4ca6a49f This is the 3.10.9 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJSE/B5AAoJEDjbvchgkmk+N4EQAK7PJ9biDy/99fUGkHmOKoTo
 8GqhQo1xb7rbIQ5j4dYrVLDp2PyOweSKusE4fH17AbQ1CqTxcRRHOeJHqRtXBm4J
 JG4byUqgUwEyvLBYFagTazm7RsFz42EGvravHbjskcX0aZX20x7xBGge9YlBbUzv
 +TUDL7ihaAmtURdF02NDMFgci74L/hfNQQdOcCxo37bwmZc6rgpW5dfYjW70+NR0
 eVlz3Mn+9XqR2PEDvymjtUgfJsBK9eu6vNBajznIRyeZLromozBuf53840hfdLo1
 eizyBn1OGcB1MWn1IQMZBFlVyfpu/Q1z3F+feSHgLqa2Q6XCqJH2g5XqhEcrKGM0
 kDW82Nssr8+3rSL3hKkl454EvV4WQNnZa5XWZCWutwj6MXnsWfaxGNVU0vZXaLQJ
 hG3dDTcqgq4hD/Tyz2eGpSWuzWdC4kA+JAEAsWScMIxivElqgI26AB1TVxqouj9F
 8k2PoVXsH7Pdz3JscEsNdINgW/iJDlQ+KQlhr1g/IGC4fu0bNATXN45YywNkr/eR
 ufa/TgppsMKTE8Idd2w6DdB5TvyR7PHktqxWib3ya2Nt19kXqIwn0AlaTuUd79HL
 XIlVmNt5UuNrUi81DzsRxvRdva9n7C6uFXZQo81WUldFhIOg00X4Ol+r2fIfj7KV
 7hcmiZM0SGLZHVRcpr5j
 =ocBr
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.9' into linux-linaro-lsk

This is the 3.10.9 stable release
2013-08-21 12:53:05 +01:00
Linus Torvalds
8e220cfd1a Fix TLB gather virtual address range invalidation corner cases
commit 2b047252d0 upstream.

Ben Tebulin reported:

 "Since v3.7.2 on two independent machines a very specific Git
  repository fails in 9/10 cases on git-fsck due to an SHA1/memory
  failures.  This only occurs on a very specific repository and can be
  reproduced stably on two independent laptops.  Git mailing list ran
  out of ideas and for me this looks like some very exotic kernel issue"

and bisected the failure to the backport of commit 53a59fc67f ("mm:
limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT").

That commit itself is not actually buggy, but what it does is to make it
much more likely to hit the partial TLB invalidation case, since it
introduces a new case in tlb_next_batch() that previously only ever
happened when running out of memory.

The real bug is that the TLB gather virtual memory range setup is subtly
buggered.  It was introduced in commit 597e1c3580 ("mm/mmu_gather:
enable tlb flush range in generic mmu_gather"), and the range handling
was already fixed at least once in commit e6c495a96c ("mm: fix the TLB
range flushed when __tlb_remove_page() runs out of slots"), but that fix
was not complete.

The problem with the TLB gather virtual address range is that it isn't
set up by the initial tlb_gather_mmu() initialization (which didn't get
the TLB range information), but it is set up ad-hoc later by the
functions that actually flush the TLB.  And so any such case that forgot
to update the TLB range entries would potentially miss TLB invalidates.

Rather than try to figure out exactly which particular ad-hoc range
setup was missing (I personally suspect it's the hugetlb case in
zap_huge_pmd(), which didn't have the same logic as zap_pte_range()
did), this patch just gets rid of the problem at the source: make the
TLB range information available to tlb_gather_mmu(), and initialize it
when initializing all the other tlb gather fields.

This makes the patch larger, but conceptually much simpler.  And the end
result is much more understandable; even if you want to play games with
partial ranges when invalidating the TLB contents in chunks, now the
range information is always there, and anybody who doesn't want to
bother with it won't introduce subtle bugs.

Ben verified that this fixes his problem.

Reported-bisected-and-tested-by: Ben Tebulin <tebulin@googlemail.com>
Build-testing-by: Stephen Rothwell <sfr@canb.auug.org.au>
Build-testing-by: Richard Weinberger <richard.weinberger@gmail.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:43:05 -07:00
Jianpeng Ma
a6ad83fce0 elevator: Fix a race in elevator switching
commit d50235b7bc upstream.

There's a race between elevator switching and normal io operation.
    Because the allocation of struct elevator_queue and struct elevator_data
    don't in a atomic operation.So there are have chance to use NULL
    ->elevator_data.
    For example:
        Thread A:                               Thread B
        blk_queu_bio                            elevator_switch
        spin_lock_irq(q->queue_block)           elevator_alloc
        elv_merge                               elevator_init_fn

    Because call elevator_alloc, it can't hold queue_lock and the
    ->elevator_data is NULL.So at the same time, threadA call elv_merge and
    nedd some info of elevator_data.So the crash happened.

    Move the elevator_alloc into func elevator_init_fn, it make the
    operations in a atomic operation.

    Using the follow method can easy reproduce this bug
    1:dd if=/dev/sdb of=/dev/null
    2:while true;do echo noop > scheduler;echo deadline > scheduler;done

    The test method also use this method.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:43:03 -07:00
Radu Caragea
f6c19e2f7d x86 get_unmapped_area(): use proper mmap base for bottom-up direction
commit df54d6fa54 upstream.

When the stack is set to unlimited, the bottomup direction is used for
mmap-ings but the mmap_base is not used and thus effectively renders
ASLR for mmapings along with PIE useless.

Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Sendroiu <molecula2788@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:43:02 -07:00
Michal Simek
4f01c72ef3 microblaze: fix clone syscall
commit dfa9771a7c upstream.

Fix inadvertent breakage in the clone syscall ABI for Microblaze that
was introduced in commit f3268edbe6 ("microblaze: switch to generic
fork/vfork/clone").

The Microblaze syscall ABI for clone takes the parent tid address in the
4th argument; the third argument slot is used for the stack size.  The
incorrectly-used CLONE_BACKWARDS type assigned parent tid to the 3rd
slot.

This commit restores the original ABI so that existing userspace libc
code will work correctly.

All kernel versions from v3.8-rc1 were affected.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:43:02 -07:00
Mark Brown
0a2d5c259e Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Conflicts (the ARM security fixes vs the read only kernel changes from
Google):
	arch/arm/mm/mmu.c
2013-08-15 20:29:53 +01:00
Mark Brown
c1a0dd11e1 This is the 3.10.7 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.20 (GNU/Linux)
 
 iQIcBAABAgAGBQJSDG5ZAAoJEDjbvchgkmk+et8P/3DVUBCFI96xQEw/d5W/8eCn
 VVrPpLP9EfswDcJ4DoWs+tlM6mTyeQ3Lpzsre3dW+mB6eLTmklgXtCWwYK2v03I2
 shHJLcwTVTusuJfymAVkq/2UxMgCATcMlwa19a5YaQ9sk3qrSrKUIZZy+XIOTJiY
 b/fU0b7WkD3uwgR04Ac91/8FoSHhOKzrj/qhDy1dg/RwO3JG3+oRz6Jn7IZBMs19
 4rbf8+CLGvT3GXiF1cwelxNSPyDVkw4T0Hh5AtuZWeGxBzYpAWhw30IiF7/nqA29
 7Q2ELSuxnYXVka9+JAdu6I5m5rYNtvr4AyCCQYRNztI4ku/zuwpTGmSJLavMZT/i
 uEamN+1E2QxPAaO5b1rYyM7NIpYycjRvwVNrIfvPkp4QRbCkix13xh4t2LhjnXrK
 GDn7nOVRKJq369QW4LfRpbyR9dortq3+szIm68GJvnbxt6br0zELE7FMic0u3nj8
 /8zCUHnik0AWtj4l42wifTnPwDEMlIgMsprKOpB2z4DulQlSfgF4R55K1/gCggF3
 EGSjs7x5QT4uxmyKkk0kfUrt/1RcLMK4vMIfeH4pRI0HninnkM/AToY8YstmH2mT
 PBpeA6eJ0dUv5j82PN5Wls426j2JlSqwdo9+Whr7yQbOtuDk1XAk78KMYnr4vo3v
 n7aJxJfFre0+O1AG8rcB
 =Yvid
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.7' into linux-linaro-lsk

This is the 3.10.7 stable release
2013-08-15 12:09:32 +01:00
Trond Myklebust
4662ffcbe3 SUNRPC: If the rpcbind channel is disconnected, fail the call to unregister
commit 786615bc1c upstream.

If rpcbind causes our connection to the AF_LOCAL socket to close after
we've registered a service, then we want to be careful about reconnecting
since the mount namespace may have changed.

By simply refusing to reconnect the AF_LOCAL socket in the case of
unregister, we avoid the need to somehow save the mount namespace. While
this may lead to some services not unregistering properly, it should
be safe.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Nix <nix@esperi.org.uk>
Cc: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14 22:59:08 -07:00
Andrew Vagin
2d7ddf0a8f tracing: Fix fields of struct trace_iterator that are zeroed by mistake
commit ed5467da0e upstream.

tracing_read_pipe zeros all fields bellow "seq". The declaration contains
a comment about that, but it doesn't help.

The first field is "snapshot", it's true when current open file is
snapshot. Looks obvious, that it should not be zeroed.

The second field is "started". It was converted from cpumask_t to
cpumask_var_t (v2.6.28-4983-g4462344), in other words it was
converted from cpumask to pointer on cpumask.

Currently the reference on "started" memory is lost after the first read
from tracing_read_pipe and a proper object will never be freed.

The "started" is never dereferenced for trace_pipe, because trace_pipe
can't have the TRACE_FILE_ANNOTATE options.

Link: http://lkml.kernel.org/r/1375463803-3085183-1-git-send-email-avagin@openvz.org

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14 22:59:07 -07:00