Commit Graph

300425 Commits (075f30901e32feefd3641e6c5537611fd7e27b59)

Author SHA1 Message Date
Eric W. Biederman 38bf195398 connector/userns: replace netlink uses of cap_raised() with capable()
In 2009 Philip Reiser notied that a few users of netlink connector
interface needed a capability check and added the idiom
cap_raised(nsp->eff_cap, CAP_SYS_ADMIN) to a few of them, on the premise
that netlink was asynchronous.

In 2011 Patrick McHardy noticed we were being silly because netlink is
synchronous and removed eff_cap from the netlink_skb_params and changed
the idiom to cap_raised(current_cap(), CAP_SYS_ADMIN).

Looking at those spots with a fresh eye we should be calling
capable(CAP_SYS_ADMIN).  The only reason I can see for not calling capable
is that it once appeared we were not in the same task as the caller which
would have made calling capable() impossible.

In the initial user_namespace the only difference between between
cap_raised(current_cap(), CAP_SYS_ADMIN) and capable(CAP_SYS_ADMIN) are a
few sanity checks and the fact that capable(CAP_SYS_ADMIN) sets
PF_SUPERPRIV if we use the capability.

Since we are going to be using root privilege setting PF_SUPERPRIV seems
the right thing to do.

The motivation for this that patch is that in a child user namespace
cap_raised(current_cap(),...) tests your capabilities with respect to that
child user namespace not capabilities in the initial user namespace and
thus will allow processes that should be unprivielged to use the kernel
services that are only protected with cap_raised(current_cap(),..).

To fix possible user_namespace issues and to just clean up the code
replace cap_raised(current_cap(), CAP_SYS_ADMIN) with
capable(CAP_SYS_ADMIN).

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Philipp Reisner <philipp.reisner@linbit.com>
Acked-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Acked-by: Andrew G. Morgan <morgan@kernel.org>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Cc: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 23:21:39 -04:00
Nicolas Dichtel e0268868ba sctp: check cached dst before using it
dst_check() will take care of SA (and obsolete field), hence
IPsec rekeying scenario is taken into account.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vlad Yaseivch <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 23:15:47 -04:00
Eric Dumazet c57b546840 pktgen: fix crash at module unload
commit 7d3d43dab4 (net: In unregister_netdevice_notifier unregister
the netdevices.) makes pktgen crashing at module unload.

[  296.820578] BUG: spinlock bad magic on CPU#6, rmmod/3267
[  296.820719]  lock: ffff880310c38000, .magic: ffff8803, .owner: <none>/-1, .owner_cpu: -1
[  296.820943] Pid: 3267, comm: rmmod Not tainted 3.4.0-rc5+ #254
[  296.821079] Call Trace:
[  296.821211]  [<ffffffff8168a715>] spin_dump+0x8a/0x8f
[  296.821345]  [<ffffffff8168a73b>] spin_bug+0x21/0x26
[  296.821507]  [<ffffffff812b4741>] do_raw_spin_lock+0x131/0x140
[  296.821648]  [<ffffffff8169188e>] _raw_spin_lock+0x1e/0x20
[  296.821786]  [<ffffffffa00cc0fd>] __pktgen_NN_threads+0x4d/0x140 [pktgen]
[  296.821928]  [<ffffffffa00ccf8d>] pktgen_device_event+0x10d/0x1e0 [pktgen]
[  296.822073]  [<ffffffff8154ed4f>] unregister_netdevice_notifier+0x7f/0x100
[  296.822216]  [<ffffffffa00d2a0b>] pg_cleanup+0x48/0x73 [pktgen]
[  296.822357]  [<ffffffff8109528e>] sys_delete_module+0x17e/0x2a0
[  296.822502]  [<ffffffff81699652>] system_call_fastpath+0x16/0x1b

Hold the pktgen_thread_lock while splicing pktgen_threads, and test
pktgen_exiting in pktgen_device_event() to make unload faster.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 23:10:24 -04:00
David S. Miller 59b9997bab Revert "net: maintain namespace isolation between vlan and real device"
This reverts commit 8a83a00b07.

It causes regressions for S390 devices, because it does an
unconditional DST drop on SKBs for vlans and the QETH device
needs the neighbour entry hung off the DST for certain things
on transmit.

Arnd can't remember exactly why he even needed this change.

Conflicts:

	drivers/net/macvlan.c
	net/8021q/vlan_dev.c
	net/core/dev.c

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 23:03:34 -04:00
Thadeu Lima de Souza Cascardo 380ec964bc ehea: fix losing of NEQ events when one event occurred early
The NEQ interrupt is only triggered when there was no previous pending
interrupt. If we request irq handling after an interrupt has occurred,
we will never get an interrupt until we call H_RESET_EVENTS.

Events seem to be cleared when we first register the NEQ. So, when we
requested irq handling right after registering it, a possible race with
an interrupt was much less likely. Now, there is a chance we may lose
this race and never get any events.

The fix here is to poll and acknowledge any events that might have
happened right after registering the irq handler.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 22:45:54 -04:00
Benjamin Poirier cfb8c3aa59 igb: fix rtnl race in PM resume path
Since the caller (PM resume code) is not the one holding rtnl, when taking the
'else' branch rtnl may be released at any moment, thereby defeating the whole
purpose of this code block.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 22:44:46 -04:00
David S. Miller dccd9ecc37 ipv4: Do not use dead fib_info entries.
Due to RCU lookups and RCU based release, fib_info objects can
be found during lookup which have fi->fib_dead set.

We must ignore these entries, otherwise we risk dereferencing
the parts of the entry which are being torn down.

Reported-by: Yevgen Pronenko <yevgen.pronenko@sonymobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 22:16:32 -04:00
Linus Torvalds d60b9c16d7 Merge branch 'parisc' (PA-RISC compile fixes)
Merge PA-RISC compile fixes from Rolf Eike Beer:
 "Since commit d66acc39c7 ("bitops: Optimise get_order()") getorder.h
  includes log2.h which leads to an include loop on PA-RISC, bringing a
  bunch of other breakage to light.  This patchset fixes the compilation
  of the current state of 3.4 on HPPA.

  Unchanged against the first version, just added an Ack by Grant."

* emailed from Rolf Eike Beer <eike-kernel@sf-tec.de>: (5 patches)
  parisc: move definition of PAGE0 to asm/page.h
  parisc: add missing include of asm/page.h to asm/pgtable.h
  parisc: drop include of asm/pdc.h from asm/hardware.h
  parisc: add missing forward declarations in asm/hardware.h
  parisc: add missing includes in asm/spinlock.h
2012-05-10 15:18:41 -07:00
Linus Torvalds 7c283324da Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc fixes from Andrew Morton.

* emailed from Andrew Morton <akpm@linux-foundation.org>: (8 patches)
  MAINTAINERS: add maintainer for LED subsystem
  mm: nobootmem: fix sign extend problem in __free_pages_memory()
  drivers/leds: correct __devexit annotations
  memcg: free spare array to avoid memory leak
  namespaces, pid_ns: fix leakage on fork() failure
  hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow()
  mm: fix division by 0 in percpu_pagelist_fraction()
  proc/pid/pagemap: correctly report non-present ptes and holes between vmas
2012-05-10 15:17:24 -07:00
Rolf Eike Beer 4a8a0788a3 parisc: move definition of PAGE0 to asm/page.h
This was defined in asm/pdc.h which needs to include asm/page.h for
__PAGE_OFFSET. This leads to an include loop so that page.h eventually will
include pdc.h again. While this is no problem because of header guards, it is
a problem because some symbols may be undefined. Such an error is this:

In file included from include/linux/bitops.h:35:0,
                 from include/asm-generic/getorder.h:7,
                 from arch/parisc/include/asm/page.h:162,
                 from arch/parisc/include/asm/pdc.h:346,
                 from arch/parisc/include/asm/processor.h:16,
                 from arch/parisc/include/asm/spinlock.h:6,
                 from arch/parisc/include/asm/atomic.h:20,
                 from include/linux/atomic.h:4,
                 from include/linux/sysfs.h:20,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/eisa.h:5,
                 from arch/parisc/kernel/pci.c:11:
arch/parisc/include/asm/bitops.h: In function ‘set_bit’:
arch/parisc/include/asm/bitops.h:82:2: error: implicit declaration of function ‘_atomic_spin_lock_irqsave’ [-Werror=implicit-function-declaration]
arch/parisc/include/asm/bitops.h:84:2: error: implicit declaration of function ‘_atomic_spin_unlock_irqrestore’ [-Werror=implicit-function-declaration]

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:12:08 -07:00
Rolf Eike Beer 9b05b1ec40 parisc: add missing include of asm/page.h to asm/pgtable.h
Fixes these errors:

In file included from arch/parisc/include/asm/io.h:5:0,
                 from include/linux/io.h:22,
                 from include/linux/pci.h:54,
                 from arch/parisc/kernel/setup.c:35:
arch/parisc/include/asm/pgtable.h:92:6: warning: "PAGE_SHIFT" is not defined [-Wundef]
arch/parisc/include/asm/pgtable.h:92:6: warning: "PAGE_SHIFT" is not defined [-Wundef]
arch/parisc/include/asm/pgtable.h:92:6: warning: "BITS_PER_PTE_ENTRY" is not defined [-Wundef]

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:12:08 -07:00
Rolf Eike Beer 6eb608f554 parisc: drop include of asm/pdc.h from asm/hardware.h
It seems none of the symbols defined by pdc.h is needed, but it introduces an
include loop causing compile errors:

In file included from arch/parisc/include/asm/spinlock.h:4:0,
                 from arch/parisc/include/asm/atomic.h:20,
                 from include/linux/atomic.h:4,
                 from arch/parisc/include/asm/bitops.h:56,
                 from include/linux/bitops.h:35,
                 from include/asm-generic/getorder.h:7,
                 from arch/parisc/include/asm/page.h:162,
                 from arch/parisc/include/asm/pdc.h:346,
                 from arch/parisc/include/asm/hardware.h:5,
                 from arch/parisc/kernel/hardware.c:30:
arch/parisc/include/asm/processor.h:74:16: error: field ‘cpu_type’ has incomplete type
arch/parisc/include/asm/processor.h:77:20: error: field ‘model’ has incomplete type
arch/parisc/include/asm/processor.h: In function ‘parisc_requires_coherency’:
arch/parisc/include/asm/processor.h:349:36: error: ‘mako’ undeclared (first use in this function)
arch/parisc/include/asm/processor.h:349:36: note: each undeclared identifier is reported only once for each function it appears in
arch/parisc/include/asm/processor.h:350:30: error: ‘mako2’ undeclared (first use in this function)

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Grant Grundler <grantgrundler@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:12:08 -07:00
Rolf Eike Beer 25fe853d2c parisc: add missing forward declarations in asm/hardware.h
Fixes this warnings:

In file included from arch/parisc/include/asm/processor.h:15:0,
                 from arch/parisc/include/asm/spinlock.h:4,
                 from arch/parisc/include/asm/atomic.h:20,
                 from include/linux/atomic.h:4,
                 from arch/parisc/include/asm/bitops.h:11,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:19,
                 from include/linux/sched.h:55,
                 from arch/parisc/kernel/asm-offsets.c:31:
arch/parisc/include/asm/hardware.h:106:10: warning: ‘struct hardware_path’ declared inside parameter list [enabled by default]
arch/parisc/include/asm/hardware.h:106:10: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
arch/parisc/include/asm/hardware.h:116:59: warning: ‘struct hardware_path’ declared inside parameter list [enabled by default]
arch/parisc/include/asm/hardware.h:118:47: warning: ‘struct hardware_path’ declared inside parameter list [enabled by default]
arch/parisc/include/asm/hardware.h:119:57: warning: ‘struct hardware_path’ declared inside parameter list [enabled by default]

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:12:08 -07:00
Rolf Eike Beer 1cab4201f0 parisc: add missing includes in asm/spinlock.h
This leads to this errors:

In file included from arch/parisc/include/asm/atomic.h:20:0,
                 from include/linux/atomic.h:4,
                 from arch/parisc/include/asm/bitops.h:56,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:19,
                 from include/linux/sched.h:55,
                 from arch/parisc/kernel/asm-offsets.c:31:
arch/parisc/include/asm/spinlock.h: In function ‘arch_spin_is_locked’:
arch/parisc/include/asm/spinlock.h:9:2: error: implicit declaration of function ‘__ldcw_align’ [-Werror=implicit-function-declaration]
arch/parisc/include/asm/spinlock.h:9:29: warning: initialization makes pointer from integer without a cast [enabled by default]
arch/parisc/include/asm/spinlock.h: In function ‘arch_spin_lock_flags’:
arch/parisc/include/asm/spinlock.h:22:2: error: implicit declaration of function ‘mb’ [-Werror=implicit-function-declaration]
arch/parisc/include/asm/spinlock.h:23:4: warning: assignment makes pointer from integer without a cast [enabled by default]
arch/parisc/include/asm/spinlock.h:24:2: error: implicit declaration of function ‘__ldcw’ [-Werror=implicit-function-declaration]

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:12:08 -07:00
Linus Torvalds 9e5869f8d7 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull a sparc fix from David Miller.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().
2012-05-10 15:07:20 -07:00
Bryan Wu 17ff3c1fa4 MAINTAINERS: add maintainer for LED subsystem
Add Bryan Wu as the primary maintainer for drivers/leds

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Russ Anderson 6bc2e853c6 mm: nobootmem: fix sign extend problem in __free_pages_memory()
Systems with 8 TBytes of memory or greater can hit a problem where only
the the first 8 TB of memory shows up.  This is due to "int i" being
smaller than "unsigned long start_aligned", causing the high bits to be
dropped.

The fix is to change `i' to unsigned long to match start_aligned
and end_aligned.

Thanks to Jack Steiner for assistance tracking this down.

Signed-off-by: Russ Anderson <rja@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Arnd Bergmann b8cd742acf drivers/leds: correct __devexit annotations
__devexit functions are discarded without CONFIG_HOTPLUG, so they need
to be referenced carefully.  A __devexit function may also not be called
from a __devinit function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Sha Zhengju 8c7577637c memcg: free spare array to avoid memory leak
When the last event is unregistered, there is no need to keep the spare
array anymore.  So free it to avoid memory leak.

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Mike Galbraith 5e2bf01422 namespaces, pid_ns: fix leakage on fork() failure
Fork() failure post namespace creation for a child cloned with
CLONE_NEWPID leaks pid_namespace/mnt_cache due to proc being mounted
during creation, but not unmounted during cleanup.  Call
pid_ns_release_proc() during cleanup.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Louis Rilling <louis.rilling@kerlabs.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Chris Metcalf 4998a6c0ed hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow()
Commit 66aebce747 ("hugetlb: fix race condition in hugetlb_fault()")
added code to avoid a race condition by elevating the page refcount in
hugetlb_fault() while calling hugetlb_cow().

However, one code path in hugetlb_cow() includes an assertion that the
page count is 1, whereas it may now also have the value 2 in this path.

The consensus is that this BUG_ON has served its purpose, so rather than
extending it to cover both cases, we just remove it.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Hillf Danton <dhillf@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: <stable@vger.kernel.org>	[3.0.29+, 3.2.16+, 3.3.3+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Sasha Levin 93278814d3 mm: fix division by 0 in percpu_pagelist_fraction()
percpu_pagelist_fraction_sysctl_handler() has only considered -EINVAL as
a possible error from proc_dointvec_minmax().

If any other error is returned, it would proceed to divide by zero since
percpu_pagelist_fraction wasn't getting initialized at any point.  For
example, writing 0 bytes into the proc file would trigger the issue.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Konstantin Khlebnikov 16fbdce62d proc/pid/pagemap: correctly report non-present ptes and holes between vmas
Reset the current pagemap-entry if the current pte isn't present, or if
current vma is over.  Otherwise pagemap reports last entry again and
again.

Non-present pte reporting was broken in commit 092b50bacd ("pagemap:
introduce data structure for pagemap entry")

Reporting for holes was broken in commit 5aaabe831e ("pagemap: avoid
splitting thp when reading /proc/pid/pagemap")

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reported-by: Pavel Emelyanov <xemul@parallels.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 15:06:44 -07:00
Linus Torvalds f3b26922ec Merge branch 'for-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu fixes from Tejun Heo:
 "This pull request contains two patches.  One is kmemleak annotation
  fix which isn't critical.  The other is kinda serious.

  Depending on NUMA topology, percpu allocator may end up assigning
  overlapping regions for the static percpu areas for different CPUs.
  While critical, the bug has been there for a very long time and only
  few configurations seem to be affected (NUMA configurations w/ no
  memory nodes for example) - so, while it's critical, it isn't exactly
  urgent."

* 'for-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  kmemleak: Fix the kmemleak tracking of the percpu areas with !SMP
  percpu: pcpu_embed_first_chunk() should free unused parts after all allocs are complete
2012-05-10 14:59:50 -07:00
Linus Torvalds fda27bed90 Merge git://git.samba.org/sfrench/cifs-2.6
Pull cifs fix from Steve French.

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix revalidation test in cifs_llseek()
2012-05-10 14:59:02 -07:00
Steven Rostedt 9b63776fa3 tracing: Do not enable function event with enable
With the adding of function tracing event to perf, it caused a
side effect that produces the following warning when enabling all
events in ftrace:

 # echo 1 > /sys/kernel/debug/tracing/events/enable

[console]
event trace: Could not enable event function

This is because when enabling all events via the debugfs system
it ignores events that do not have a ->reg() function assigned.
This was to skip over the ftrace internal events (as they are
not TRACE_EVENTs). But as the ftrace function event now has
a ->reg() function attached to it for use with perf, it is no
longer ignored.

Worse yet, this ->reg() function is being called when it should
not be. It returns an error and causes the above warning to
be printed.

By adding a new event_call flag (TRACE_EVENT_FL_IGNORE_ENABLE)
and have all ftrace internel event structures have it set,
setting the events/enable will no longe try to incorrectly enable
the function event and does not warn.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-10 15:55:43 -04:00
David S. Miller a5a737e090 sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().
%g2 is meant to hold the CPUID number throughout this routine, since
at the very beginning, and at the very end, we use %g2 to calculate
indexes into per-cpu arrays.

However we erroneously clobber it in order to hold the %cwp register
value mid-stream.

Fix this code to use %g3 for the %cwp read and related calulcations
instead.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10 11:00:46 -07:00
Linus Torvalds bc46f9375a NFS client bugfix for Linux 3.4
Fix for the NFSv4 security negotiation:
 - Ensure that the security negotiation tries all registered security flavours
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPq/REAAoJEGcL54qWCgDypFMP/jPWKCsMn2IlzQhlBXOR6bny
 WB4JhV3ieFvVYBiBMCIdqbWITrQ/6vo/vhMLcG2UztvPG+9Oc70z1Hy/zoCy8Ctn
 O4clRbLQtyvHoQQiWY9aHmqB0GUlxqcwpwDJAg2arUjD4pqJRsHVCw+mtLk3W+zO
 39/qIo6//sgHeJCMJ48EyLYUcwJgru9qtfbj4kOqB/0zBYdznv+lWTaXm5yWx9e2
 olZBAdABE0Oa219PdN7toUdE/CCPrayCXtKY7WEk7MvFC7qjvniaDXqWK4xtHnxy
 17caFLRmZNlmBSf6hiZyumPtIlOyaE5O63zzYripSmMWjBZ2YKZwXOdL8PoN8Tue
 3EQyR5lAxGejYX5Ja1r743EE41pPAGa5ZnJPZdv9SAJvMq2rbgQIQteCj6VJnEzv
 k/IvbHoQK+hVQHXnlXYcquhWnFMBVTWJJKcw8Z5OFF8lRtCC8Azs7mqIaHbZXqSA
 ow/up+y77vYWhD7p8VAovZ1YmT2cPBZ4wjA1XnUz4Xa+rAr8JFpzLA0hu8qYwytg
 Se3f1JfSaSTg/V1b2t7jP5p+8b72AFrjrQ0uFAdEKCJkQ90H+SCrOunlaek/x83S
 VSBAhe9MopGvs/SXltDUGUv38yzE5wuJZnnPcH5MDSAwBknH4noOYtIJpkiihkpM
 MOKDs0ASYU2Hnt+HYPmH
 =xNqW
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-3.4-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull a NFS client bugfix from Trond Myklebust:
 "Fix for the NFSv4 security negotiation: ensure that the security
  negotiation tries all registered security flavours"

* tag 'nfs-for-3.4-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  auth_gss: the list of pseudoflavors not being parsed correctly
2012-05-10 10:05:19 -07:00
Linus Torvalds ed3ac021e5 sound fixes for 3.4-rc7
Slightly more than expected as rc7, but all are reasonablly small fixes.
 A few additions of HD-audio fixup entries, a couple of other regression
 fixes including a revert, and a few other trivial oneliners.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPq2sLAAoJEGwxgFQ9KSmk4ZMP/jC9XLQpn3Y95+/id/D+54R5
 dU4aIQYNo1vheODv9hToN6Zvyd+FrouU7mikKwFnyJ1iuPfsxKrsaY+ifbfqXuQo
 L0CuWDnwSDutDf5D3s8G+jg0VQHoYu+Dv7MgLqKs/DGYe3iNZKD34QtgOq0BVio0
 9PP6bQCVB48TeTte3b0KD4O8rWBfSreDJj+UEewFy0V81f8P/e/ILJnkPW144FXy
 1DaR70wE/1wvhW4GWvc+WGM+iH5mUWLaE49K7wdXqcTgR7XRejG4BjWAJBKEoHVc
 o3AmFMTfidMzHokXdU6YgV16I8IXRmlEWFnlEGA5dxVsh0JP0t2d3mIQpcVJMm3E
 Gpz5OMSjRvuOcW3wkNWYYgcm+npHtiRcXYKr+azFymsPoTSA0xlDoi7HQsVbMzG+
 Jz5AwtsyZcp2BIolLvAJTXmBiHuRHNjHW2huqV+G2OI37A5YZWRIfD2vEF07MxXH
 FMRCUEHOMVbRuvZtUnSGbcpdVuSMS2hjwsOdBcO03oPVrc/gp224oQvG2iNxsCHu
 iH0s114j1mIYxVZX4dx+sjMyD9h3lVSghNQcz9Z7jShWdJBiQuiIneTd3y0FVbh1
 l0Nq9A/oPbIYK9kbSb9z4J13WmXeS7rFYdFSPNJJ7XAKwIsZdqEMbxZM3fLHoi7b
 dF95KKVJ7VwCeLjrDVZ4
 =7Zz7
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Slightly more than expected as rc7, but all are reasonablly small
  fixes.  A few additions of HD-audio fixup entries, a couple of other
  regression fixes including a revert, and a few other trivial
  oneliners."

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: sh: fix migor.c compilation
  ALSA: HDA: Lessen CPU usage when waiting for chip to respond
  Revert "ALSA: hda - Set codec to D3 forcibly even if not used"
  ALSA: hda/realtek - Call alc_auto_parse_customize_define() always after fixup
  ALSA: hdsp - Provide ioctl_compat
  ALSA: hda/realtek - Add missing CD-input pin for MSI-7350 mobo
  ALSA: hda/realtek - Add a fixup for Acer Aspire 5739G
  ALSA: echoaudio: Remove incorrect part of assertion
2012-05-10 09:26:58 -07:00
Jan Kiszka b7dafa0ef3 compat: Fix RT signal mask corruption via sigprocmask
compat_sys_sigprocmask reads a smaller signal mask from userspace than
sigprogmask accepts for setting.  So the high word of blocked.sig[0]
will be cleared, releasing any potentially blocked RT signal.

This was discovered via userspace code that relies on get/setcontext.
glibc's i386 versions of those functions use sigprogmask instead of
rt_sigprogmask to save/restore signal mask and caused RT signal
unblocking this way.

As suggested by Linus, this replaces the sys_sigprocmask based compat
version with one that open-codes the required logic, including the merge
of the existing blocked set with the new one provided on SIG_SETMASK.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10 08:58:33 -07:00
Tarun Kanti DebBarma 6edd94db25 gpio/omap: fix incorrect initialization of omap_gpio_mod_init
Initialization of irqenable, irqstatus registers is the common
operation done in this function for all OMAP platforms, viz. OMAP1,
OMAP2+. The latter _gpio_rmw()'s which supposedly got introduced
wrongly to take care of OMAP2+ platforms were overwriting initially
programmed OMAP1 value breaking functionality on OMAP1.
Somehow incorrect assumption was made that each _gpio_rmw()'s were
mutually exclusive. On close observation it is found that the first
_gpio_rmw() which is supposedly done to take care of OMAP1 platform
is generic enough and takes care of OMAP2+ platform as well.
Therefore remove the latter _gpio_rmw() to irqenable as they are
redundant now.

Writing to ctrl and debounce_en registers for OMAP2+ platforms are
modified to match the original(pre-cleanup) code where the registers
are initialized with 0. In the cleanup series since we are using
_gpio_rmw(reg, 0, 1), instead of __raw_writel(), we are just reading
and writing the same values to ctrl and debounce_en. This is not an
issue for debounce_en register because it has 0x0 as the default value.
But in the case of ctrl register the default value is 0x2 (GATINGRATIO
 = 0x1) so that we end up writing 0x2 instead of intended 0 value.
Therefore changing back to __raw_writel() as this is sufficient for
this case besides simpler to understand.

Also, change irqstatus initalization logic that avoids comparison
with bool, besides making it fit in a single line.

Cc: stable@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Reported-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-05-10 07:16:15 -07:00
Paolo Bonzini e4594bb505 [SCSI] virtio_scsi: fix TMF use-after-free
Fix a use-after-free in the TMF path, where cmd may have been already
freed by virtscsi_complete_free when wait_for_completion restarts
executing virtscsi_tmf.  Technically a race, but in practice the command
will always be freed long before the completion waiter is awoken.

The fix is to make callers specifying a completion responsible for
freeing the command in all cases.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:27:06 +01:00
James Bottomley 3c8d9a957d [SCSI] fix oops in all legacy host adapters caused by 6f381fa
Commit 6f381fa344
Author: Lin Ming <ming.m.lin@intel.com>

[SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue
 
Caused a regression where we oops in every legacy mode SCSI host driver
because they supply a NULL pointer to scsi_add_host().  Fix this by checking
for the NULL in scsi_add_host_with_dma() and changing the DMA device to being
the platform_bus in that case (which replicates the original behaviour).

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:24:13 +01:00
Chad Dupuis 6abd7f132a [SCSI] qla2xxx: Update version number to 8.04.00.03-k.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:19:10 +01:00
Saurav Kashyap aaf4d3e2c6 [SCSI] qla2xxx: Properly check for current state after the fabric-login request.
[jejb: checkpatch fixes]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:18:04 +01:00
Giridhar Malavali 4aee57667e [SCSI] qla2xxx: Proper completion to scsi-ml for scsi status task_set_full and busy.
In case of firmmware detected under-run condition and scsi status of
task_set_full or busy_condition, return that to the mid layer for proper error
handling instead of DID_ERROR (which causes error handler activation and a
full retry).

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:15:19 +01:00
Giridhar Malavali a49393f2ae [SCSI] qla2xxx: Block flash access from application when device is initialized for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:10:58 +01:00
Vikas Chaudhary f4e1648a4f [SCSI] qla2xxx: Fix reset time out as qla2xxx not ack to reset request.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10 08:07:49 +01:00
David S. Miller 0e0c55165b Merge branch 'sfc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc 2012-05-09 22:49:57 -04:00
Dan Carpenter 48a5730e5b cifs: fix revalidation test in cifs_llseek()
This test is always true so it means we revalidate the length every
time, which generates more network traffic.  When it is SEEK_SET or
SEEK_CUR, then we don't need to revalidate.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-05-09 15:16:22 -05:00
Linus Torvalds 7ee94d97aa ARM: SoC fixes for 3.4-rc
Things have slowed down a lot for us, but we have five more fixes for
 omap and kirkwood below. Three are for boards setup issues, two are
 SoC-level fixes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqpiAAAoJEIwa5zzehBx36WcP/A3yfgwccYQPAGiazDWMoxj+
 bLdr49L4tgFf8dwRno+IeAKjhhBDYUJgNoz46Tnqfh1L7ImIvGUlPDtqfQGb5+HK
 HZ+mz46ZUoJPdvBS8CY7Xf5lP/5iiMI+wBeE33bu+EyKhgbD8wYmQDCsJJhjjRLW
 TqR/a74Mz/yX9sCL5pZ/ktKhxV/FvBMT3pqpU8Eb50hDtStTouf25EmyLv0iVmJx
 45pwG3+nx6R+/Lu2rwCroKUTl/cNR95L9+EGMzb99aZXSsGS5zmiAEQ2TNcp0lxb
 JMR3bB9zTDWmY1VZ83os2NI1GDOj1Zdvqns/iiBRKLUBvFN447tMdRvZMomvM3VQ
 whiKd5R0aFa42KROZq7V+t540FeLqgDvHY4zeOPDRGrh1Y9ElgCJnciX4Hxm779n
 KH9VlnHrUW3tNHqlLKXTJ1tuvNSbNUE2FtG/m+oJLyUyH4CJzNi1R1rofZEEHEH/
 8zeJzw6amwpSWyLEi1HjyhFOJ8WqOnY17LMWilQeeYbqHGwXGKTOmm9P8PKPk4cx
 dFlwCeJgd7VL+L5rn8LVOjvov7j1iakKZhtSjLMjF4k088MejDVOfTj21Qs5MiHI
 nl03BOvtmwEGXUbYHKromzeHMvoXXWuQyK13cWmgBXAiAGgX76mNU9GukwXU3rqm
 TGrRTsiuGzYQn9w3EVFL
 =GX6x
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM: SoC fixes from Olof Johansson:
 "Things have slowed down a lot for us, but we have five more fixes for
  omap and kirkwood below.  Three are for boards setup issues, two are
  SoC-level fixes."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: OMAP: igep0020: fix smsc911x dummy regulator id
  ARM: orion5x: Fix GPIO enable bits for MPP9
  ARM: kirkwood: add missing kexec.h include
  ARM: OMAP: Revert "ARM: OMAP: ctrl: Fix CONTROL_DSIPHY register fields"
  ARM: OMAP1: Amstrad Delta: Fix wrong IRQ base in FIQ handler
2012-05-09 11:27:00 -07:00
Linus Torvalds 22b6dd78ae regmap: Last minute bug fix for 3.4
This is a last minute bug fix that was only just noticed since the code
 path that's being exercised here is one that is fairly rarely used.  The
 changelog for the change itself is extremely clear and the code itself
 is obvious to inspection so should be pretty safe.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqoQhAAoJEBus8iNuMP3dj1kP/0Z1yIk1ME0KzSy42/qbGKsp
 +2mrAASkh7DbbWU2hSmwTpEgAAiY2ws0A/Uyj/Al4f/gJW6bZvlxK4mbf1i+P1LG
 ab3ohhUOqexHVaIKMTnYKhnHWuzU25mnf2vW8IOr6jccu6h7X4orDmw1uEPVgsbs
 P7fThQa0BPRkiLIUWGmg0oMY6IXJlzsStDK2Npw47EypY4FZCZucJgXkmYZLt0Nk
 mhLPsznD5GqHNSmCqrUI3j/s3R0sd/Xc63pvznBU9D8RAbSRgi2vGL8UenEtIQgt
 bVXOKe5H8ZzXYNYpzpGeJm3dTE2pZWmT1hfRSf0kBOkLhEpt/Oy9WBj1kfoTg9n9
 fNH6OJYn12uG0qQomiAT96Qm3qrslF5y9S64ZyHT6BAkJT87wnEqTmaQkoAevDEr
 hldzT+dTPAk2Pspge8m910+kQA72YyE1z6/PikvkEepYDFrqffZcBFWqjW8aQjGj
 /5r7F5fLC7zJku0FjYUMRYDgYc9z0lk6tDt8QL7E7j+55ntrhYR8IuTQA7g2asal
 yeQSTqa/NkJcch+aULgyOU0W9U1z2i04mdGI74iJnf3DSGGmvJ95IYLJA4tfnIOw
 63xo2BhmHVGyRqTN5l7o5Zlgf5FdcUt+5EBLudSqqZynB/tMZNgb0PEzfIRFBuRq
 GSIm5dwIqKgtymCEOUmp
 =xcal
 -----END PGP SIGNATURE-----

Merge tag 'regmap-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull last minute regman bug fix from Mark Brown:
 "This is a last minute bug fix that was only just noticed since the
  code path that's being exercised here is one that is fairly rarely
  used.  The changelog for the change itself is extremely clear and the
  code itself is obvious to inspection so should be pretty safe."

* tag 'regmap-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: fix possible memory corruption in regmap_bulk_read()
2012-05-09 11:25:45 -07:00
Linus Torvalds 63f4711aec Merge git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM fixes from Avi Kivity:
 "Two asynchronous page fault fixes (one guest, one host), a powerpc
  page refcount fix, and an ia64 build fix."

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: ia64: fix build due to typo
  KVM: PPC: Book3S HV: Fix refcounting of hugepages
  KVM: Do not take reference to mm during async #PF
  KVM: ensure async PF event wakes up vcpu from halt
2012-05-09 11:14:13 -07:00
Linus Torvalds 6a5beacca8 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Benjamin Herrenschmidt:
 "Here are a couple of last minute fixes for 3.4 for regressions
  introduced by my rewrite of the lazy irq masking code."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/irq: Make alignment & program interrupt behave the same
  powerpc/irq: Fix bug with new lazy IRQ handling code
2012-05-09 11:07:29 -07:00
David Ahern 20d23aaa31 perf stat: handle ENXIO error for perf_event_open
perf stat on PPC currently fails to run:

$ perf stat -- sleep 1
  Error: open_counter returned with 6 (No such device or address). /bin/dmesg may provide additional information.

  Fatal: Not all events could be opened.

The problem is that until 2.6.37 (behavior changed with commit b0a873e)
perf on PPC returns ENXIO when hw_perf_event_init() fails. With this
patch we get the expected behavior:

$ perf stat -v -- sleep 1
cycles event is not supported by the kernel.
stalled-cycles-frontend event is not supported by the kernel.
stalled-cycles-backend event is not supported by the kernel.
instructions event is not supported by the kernel.
branches event is not supported by the kernel.
branch-misses event is not supported by the kernel.

...

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1336490956-57145-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-09 14:14:41 -03:00
Catalin Marinas 100d13c3b5 kmemleak: Fix the kmemleak tracking of the percpu areas with !SMP
Kmemleak tracks the percpu allocations via a specific API and the
originally allocated areas must be removed from kmemleak (via
kmemleak_free). The code was already doing this for SMP systems.

Reported-by: Sami Liedes <sami.liedes@iki.fi>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2012-05-09 10:13:29 -07:00
Tejun Heo 42b6428145 percpu: pcpu_embed_first_chunk() should free unused parts after all allocs are complete
pcpu_embed_first_chunk() allocates memory for each node, copies percpu
data and frees unused portions of it before proceeding to the next
group.  This assumes that allocations for different nodes doesn't
overlap; however, depending on memory topology, the bootmem allocator
may end up allocating memory from a different node than the requested
one which may overlap with the portion freed from one of the previous
percpu areas.  This leads to percpu groups for different nodes
overlapping which is a serious bug.

This patch separates out copy & partial free from the allocation loop
such that all allocations are complete before partial frees happen.

This also fixes overlapping frees which could happen on allocation
failure path - out_free_areas path frees whole groups but the groups
could have portions freed at that point.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
Reported-by: "Pavel V. Panteleev" <pp_84@mail.ru>
Tested-by: "Pavel V. Panteleev" <pp_84@mail.ru>
LKML-Reference: <E1SNhwY-0007ui-V7.pp_84-mail-ru@f220.mail.ru>
2012-05-09 10:08:16 -07:00
Olof Johansson e396dbd4ed Fix two board spefific regressions and one regression caused by bad documentation
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqowwAAoJEBvUPslcq6VzDPQP/1LBOfJb6OMdK+lfDA49tMtU
 q/Qzq5GvgKA7+Opb3n5TVpnXh1cT7tSrvDtYI/ol8KaCVkLLoxdIO1dJekPyX81H
 +W4JoUYOLDAKfJ7FP44K7MJu/TsXsQ22Hyv6hYKw9lfm9rzIQwp/ofD08g9HDubc
 j6BbrIH/mBEIheJPor1Iz1j+A50EImKpkixrfD9ttJfJkwu3FmzDp+KvLNhzDX7H
 VCCYatJIkJPXEqIwaVjOyAqSvU3ZHFLxkFVjzRwkLpd2bNA1KX/FjOzv4lrK4jf3
 A2eEce/YSPrNn8KhM+mB/UKLLJ3ifgUvDS6IsvVkxwsPUyGpEwFL1KBEiAlVfApq
 WWxC/WZcZgHlXs4WRH/FS5ERLuPhaom+YkSs8bZRqAGxtA8RO1E6yNG6fzlp84/B
 LFxKa7TXEMCmSoRye6rZ4gmndCQ+8q0OQv1M89aHvn/iv7arS8XtWLGzp01qAQzQ
 OX8CCRxiRxJd9g3nCLhGq77UTI89ZiP86562Df50Akc2SYPCrw2hPR1rYjzU1TCl
 2nVQsDhSJDcGTuIVClTUmbUMM34RJQxlxAgxBJkDPshNjXiV0qMzYe+U1t4HjArE
 IBfshxY0qL6x8y2cdoeDkSpSyhjbeHZqPHYJ/nGFCkTNCQF1+c6o3NqYmdtd+bsF
 bAF1qF3FGhjXubgzpOzM
 =k8QU
 -----END PGP SIGNATURE-----

Merge tag 'omap-fixes-for-v3.4-rc6-take-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Fix two board spefific regressions and one regression caused by bad documentation

By Archit Taneja (1) and others
via Tony Lindgren
* tag 'omap-fixes-for-v3.4-rc6-take-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: igep0020: fix smsc911x dummy regulator id
  ARM: OMAP: Revert "ARM: OMAP: ctrl: Fix CONTROL_DSIPHY register fields"
  ARM: OMAP1: Amstrad Delta: Fix wrong IRQ base in FIQ handler
2012-05-09 09:03:34 -07:00
Enrico Butera 1a21932edc ARM: OMAP: igep0020: fix smsc911x dummy regulator id
id 0 is already used and causes errors at boot:

WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0x9c/0xac()
sysfs: cannot create duplicate filename '/devices/platform/reg-fixed-voltage.0'

Fix it by using the next available one (id=1).

This was caused by 5b3689f4 (ARM: OMAP2+: smsc911x: Add fixed
board regulators) that did not account for some regulators
already being used.

Signed-off-by: Enrico Butera <ebutera@users.berlios.de>
[tony@atomide.com: updated comments for regression causing commit]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-05-09 08:12:05 -07:00
Laxman Dewangan 6560ffd1cc regmap: fix possible memory corruption in regmap_bulk_read()
The function regmap_bulk_read() calls the regmap_read() for
each register if set of register has volatile and cache is
enabled. In this case, last few register read makes the memory
corruption if the register size is not the size of unsigned int.
The regam_read() takes argument as unsigned int for returning
value and it update the value as
	*val = map->format.parse_val(map->work_buf);
This causes complete 4 bytes (size of unsigned int) to get written.
Now if client pass the memory pointer for value which is equal to the
required size of register count in regmap_bulk_read() then last few
register read actually update the memory beyond passed pointer size.

Avoid this by using local variable for read and then do memcpy()
for actual byte copy to passed pointer based on register size.

I allocated one pointer ptr and take first 16 bytes dump of that
pointer then call regmap_bulk_read() with pointer which is just
on top of this allocated pointer and register count of 128. Here
register size is 1 byte.
The memory trace of last 5 register read are as follows:

[    5.438589] regmap_bulk_read after regamp_read() for register 122
[    5.447421] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.467535] regmap_bulk_read after regamp_read() for register 123
[    5.476374] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.496425] regmap_bulk_read after regamp_read() for register 124
[    5.505260] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.525372] regmap_bulk_read after regamp_read() for register 125
[    5.534205] 0xef993c00 0xef993c00 0x00000000 0x00000001
[    5.554258] regmap_bulk_read after regamp_read() for register 126
[    5.563100] 0xef990000 0xef993c00 0x00000000 0x00000001
[    5.554258] regmap_bulk_read after regamp_read() for register 127
[    5.587108] 0xef000000 0xef993c00 0x00000000 0x00000001

Here it is observed that the memory content at first word started changing
on last 3 regmap_read() and so corruption happened.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09 15:44:11 +01:00