aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-06-10btrfs: reinitialize scrub workersArne Jansen2-3/+5
Scrub starts the workers each time a scrub starts and stops them after it finished. This patch adds an initialization for the workers before each start, otherwise the workers behave strangely. Signed-off-by: Arne Jansen <sensille@gmx.net>
2011-06-10btrfs: scrub: errors in tree enumerationArne Jansen1-23/+34
due to the semantics of btrfs_search_slot the path can point to an invalid slot when ret > 0. This condition went unnoticed, which in turn could have led to an incomplete scrubbing. Signed-off-by: Arne Jansen <sensille@gmx.net>
2011-06-10Btrfs: don't map extent buffer if path->skip_locking is setJosef Bacik1-3/+7
Arne's scrub stuff exposed a problem with mapping the extent buffer in reada_for_search. He searches the commit root with multiple threads and with skip_locking set, so we can race and overwrite node->map_token since node isn't locked. So fix this so that we only map the extent buffer if we don't already have a map_token and skip_locking isn't set. Without this patch scrub would panic almost immediately, with the patch it doesn't panic anymore. Thanks, Reported-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Josef Bacik <josef@redhat.com>
2011-06-10ASoC: SAMSUNG: Fix the incorrect referencing of I2SCON registerSangbeom Kim1-2/+2
If DMA active status should be checked, I2SCON register should be referenced. In this patch, Fix the incorrect referencing of I2SCON register. Reported-by : Lakkyung Jung <lakkyung.jung@samsung.com> Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2011-06-10genirq: Prevent potential NULL dereference in irq_set_irq_wake()Jesper Juhl1-0/+3
In kernel/irq/manage.c::irq_set_irq_wake() we call irq_get_desc_buslock() which may return NULL, but the code dereferences the result unconditionally. irq_set_irq_wake() has lots of callers - I checked a few and I couldn't find anything that guarantees that they won't call it with some input that will cause irq_get_desc_buslock() to return NULL, so I think it's a good thing to test and -EINVAL was the most sane error code in this situation that I could think of. Not all callers test the return value of irq_set_irq_wake(), but those that do take != 0 to mean error as far as I can see, so they should be fine. I guess those that don't test actually should, but that's a different issue. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1106092300360.17868@swampdragon.chaosbits.net Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-06-09Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-devLinus Torvalds1-4/+8
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata: fix unexpectedly frozen port after ata_eh_reset()
2011-06-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds46-117/+1401
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc32, leon: bugfix in LEON SMP interrupt init sparc32, sun4m: bugfix in SMP IPI traphandler sparc: Remove unnecessary semicolons Add support for allocating irqs for bootbus devices Do not skip interrupt sources in sun4d interrupt handler and acknowledge interrupts correctly Restructure sun4d_build_device_irq so that timer interrupts can be allocated sparc: PCIC_PCI needs SPARC32 dependency sparc: Do not select GENERIC_HARDIRQS_NO_DEPRECATED sparc32,leon: add GRPCI2 PCI Host driver sparc32,leon: added LEON-common low-level PCI routines sparc32: added CONFIG_PCIC_PCI Kconfig setting
2011-06-09Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6Linus Torvalds4-19/+53
* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: perf: Use make kernelversion instead of parsing the Makefile kbuild: Hack for depmod not handling X.Y versions kbuild: Move depmod call to a separate script kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL kbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVEL kbuild: silence Nothing to be done for 'all' message
2011-06-09sparc32, leon: bugfix in LEON SMP interrupt initDaniel Hellstrom1-0/+16
During converting per-cpu ticker to genirq layer some IRQ initialization code was removed by commit 2cf9530420e446bb61f665d02afeb81070106900 ("sparc32,leon: per-cpu ticker use genirq per-cpu handler"). This patch reintroduces the code at the same place it was removed from. IRQ12 - IRQ14 will crash on LEON SMP without this patch because it will run the SUN4M IRQ trap handler. Reported-by: Jan Andersson <jan@gaisler.com> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09sparc32, sun4m: bugfix in SMP IPI traphandlerDaniel Hellstrom1-2/+2
Three new IPIs were introduced by commit ecbc42b70acbc6327adefe9635db93fcf62bf59d ("sparc32, sun4m: Implemented SMP IPIs support for SUN4M machines"), the old handler was already prepared for IPIs but handled only IRQ14 and IRQ13, this patch adds support for the new IPI at IRQ12. The IPI trap handler looks at the mask rather than the pending IRQ/IPI, this bug may have masked the problem above, introduced by the same commit. Signed-off-by: Daniel Hellstrom <daniel@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09ethtool.h: fix typosYegor Yefremov1-3/+3
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09ep93xx_eth: Update MAINTAINERSH Hartley Sweeten1-1/+1
Lennert stated that he has been short on time lately. Since I'm maintaining the ep93xx core stuff, I'm willing to also take over maintaining the Ethernet driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Mika Westerberg <mika.westerberg@iki.fi> Acked-by: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09ipv4: Fix packet size calculation for raw IPsec packets in __ip_append_dataSteffen Klassert1-3/+3
We assume that transhdrlen is positive on the first fragment which is wrong for raw packets. So we don't add exthdrlen to the packet size for raw packets. This leads to a reallocation on IPsec because we have not enough headroom on the skb to place the IPsec headers. This patch fixes this by adding exthdrlen to the packet size whenever the send queue of the socket is empty. This issue was introduced with git commit 1470ddf7 (inet: Remove explicit write references to sk/inet in ip_append_data) Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09perf: Use make kernelversion instead of parsing the MakefileMichal Marek1-6/+1
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09kbuild: Hack for depmod not handling X.Y versionsMichal Marek1-1/+24
depmod from module-init-tools < 3.13 and the busybox depmod check if the kernel release starts with <num>.<num>.<num>. To support these versions, we create a symlink with two numbers prepended. Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09kbuild: Move depmod call to a separate scriptMichal Marek2-11/+26
Do not bloat the Makefile with multiline shell statements. No user-visible change intended. Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVELMichal Marek1-1/+1
expr treats all numbers as decimals, so prepending a zero is safe. Note that the KERNEL_VERSION() macro still takes three arguments, 3.0 has to be written as KERNEL_VERSION(3,0,0). Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09kbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVELMichal Marek1-1/+1
Omit the second dot for releases without SUBLEVEL. If PATCHLEVEL is also empty, only display VERSION. Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09gpio/nomadik: fix sleepmode for elder NomadikLinus Walleij3-11/+33
The mach-nomadik machine did not compile properly due to bad ux500-specific functions being called. Introduce new state variables to fix this up. Reported-by: Axel Lin <axel.lin@gmail.com> Cc: Alessandro Rubini <rubini@unipv.it> Cc: Prafulla Wadaskar <prafulla.wadaskar@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-09Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpcLinus Torvalds9-41/+48
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: Force page alignment for initrd reserved memory dtc/powerpc: remove obsolete .gitignore entries powerpc/85xx: fix race bug of calling request_irq after enable elbc interrupts powerpc/book3e: Fix CPU feature handling on e5500 in 32-bit mode powerpc/fsl_rio: Fix compile error when CONFIG_FSL_RIO not set
2011-06-09Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6Linus Torvalds19-45/+84
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: staging: iio: max517: Fix iio_info changes Staging: mei: fix debug code Staging: cx23885: fix include of altera.h staging: iio: error case memory leak fix staging: ath6kl: Fix a kernel panic during suspend/resume staging: gma500: get control from firmware framebuffer if conflicts staging: gma500: Skip bogus LVDS VBT mode and check for LVDS before adding backlight staging: usbip: bugfix prevent driver unbind staging: iio: industrialio-trigger: set iio_poll_func private_data staging: rts_pstor: use bitwise operator instead of logical one staging: fix ath6kl build when CFG80211 is not enabled staging: brcm80211: fix for 'multiple definition of wl_msg_level' build err staging: fix olpc_dcon build, needs BACKLIGHT_CLASS_DEVICE Staging: remove STAGING_EXCLUDE_BUILD option Staging: altera: move .h file to proper place
2011-06-09Merge branch 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6Linus Torvalds3-3/+15
* 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6: swiotlb: Export swioltb_nr_tbl and utilize it as appropiate.
2011-06-09Merge branch 'stable/broadcom.ibft-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6Linus Torvalds1-0/+2
* 'stable/broadcom.ibft-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6: iscsi_ibft: iscsi_ibft_find unused variable i
2011-06-09Merge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32Linus Torvalds11-60/+79
* 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32: unicore32: using generic-y format for one line asm-generic files unicore32: change PERCPU to PERCPU_SECTION unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig) unicore32: change zImage physical address, though it's PIC codes unicore32: move rtc-puv3.c to drivers/rtc directory
2011-06-09vsprintf: Update %pI6c to not compress a single 0Joe Perches1-1/+3
RFC 5952 (http://tools.ietf.org/html/rfc5952) mandates that 2 or more consecutive 0's are required before using :: compression. Update ip6_compressed_string to match the RFC and update the http reference as well. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-09exec: delay address limit change until point of no returnMathias Krause3-6/+1
Unconditionally changing the address limit to USER_DS and not restoring it to its old value in the error path is wrong because it prevents us using kernel memory on repeated calls to this function. This, in fact, breaks the fallback of hard coded paths to the init program from being ever successful if the first candidate fails to load. With this patch applied switching to USER_DS is delayed until the point of no return is reached which makes it possible to have a multi-arch rootfs with one arch specific init binary for each of the (hard coded) probed paths. Since the address limit is already set to USER_DS when start_thread() will be invoked, this redundancy can be safely removed. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-09Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into for-davemJohn W. Linville17-111/+81
2011-06-09staging: iio: max517: Fix iio_info changesRoland Stigge1-1/+1
struct iio_info introduced a bug where the second channel of a MAX518 can't be used. This commit fixes the typo (using max518 instead of the max517 struct). Signed-off-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09Staging: mei: fix debug codeDan Carpenter1-2/+2
! has higher precedence than !=. H_RDY is 8 and since neither 0 nor 1 are equal to 8 the original condition was always true. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09Btrfs: unlock the trans lock properlyJosef Bacik1-1/+1
In btrfs_wait_for_commit if we came upon a transaction that had committed we just exited, but that's bad since we are holding the trans_lock. So break instead so that the lock is dropped. Thanks, Reported-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <josef@redhat.com>
2011-06-09Btrfs: don't map extent buffer if path->skip_locking is setJosef Bacik1-3/+7
Arne's scrub stuff exposed a problem with mapping the extent buffer in reada_for_search. He searches the commit root with multiple threads and with skip_locking set, so we can race and overwrite node->map_token since node isn't locked. So fix this so that we only map the extent buffer if we don't already have a map_token and skip_locking isn't set. Without this patch scrub would panic almost immediately, with the patch it doesn't panic anymore. Thanks, Reported-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Josef Bacik <josef@redhat.com>
2011-06-09ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM contextLars-Peter Clausen1-9/+8
Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a DAPM context not matching the widgets context. This can lead to a wrong prefix_len calculation, which will result in undefined behaviour. To avoid this always use the DAPM context from the widget itself. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2011-06-09x86: devicetree: Add missing early_init_dt_setup_initrd_arch stubFlorian Fainelli1-0/+11
This patch fixes the following build failure: drivers/built-in.o: In function `early_init_dt_check_for_initrd': /home/florian/dev/kernel/x86/linux-2.6-x86/drivers/of/fdt.c:571: undefined reference to `early_init_dt_setup_initrd_arch' make: *** [.tmp_vmlinux1] Error 1 which happens as soon as we enable initrd support on a x86 devicetree platform such as Intel CE4100. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Maxime Bizon <mbizon@freebox.fr> Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: stable@kernel.org # 2.6.39 Link: http://lkml.kernel.org/r/201106061015.50039.ffainelli@freebox.fr Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-06-09iscsi_ibft: iscsi_ibft_find unused variable iConnor Hansen1-0/+2
int i is only needed if CONFIG_ACPI is set so move it within a new ifdef so kernels without ACPI don't allocate space for nothing. Fixes warning too. Signed-off-by: Connor Hansen <cmdkhh@gmail.com> Signed-off-by: Peter Jones <pjones@redhat.com> [v2: Fixed warning when CONFIG_ACPI was defined] Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
2011-06-09ASoC: fsl: fix initialization of DMA buffersTimur Tabi1-4/+5
The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs for playback and capture, so DMA buffers should be allocated only for the initialized streams. Instead of checking for the number of active channels, which apparently is not reliable, check to see if the actual stream object exists. Also provide a better name for the DMA interrupt. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-09ASoC: WM8804 does not support sample rates below 32kHzMark Brown1-2/+7
Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Cc: stable@kernel.org
2011-06-09kbuild: silence Nothing to be done for 'all' messagePeter Foley1-0/+1
This patch silences a Makefile.asm-generic message by defining a dummy rule for all. make -f /usr/src/git/scripts/Makefile.asm-generic \ obj=arch/x86/include/generated/asm make[1]: Nothing to be done for `all'. Signed-off-by: Peter Foley <pefoley2@verizon.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-06-09unicore32: using generic-y format for one line asm-generic filesGuan Xuetao2-35/+59
The patch adds one-line asm-generic files in arch/unicore32/include/asm/Kbuild Also, remove the old implementation in arch/unicore32/Makefile see commit from Sam Ravnborg <d8ecc5cd8e227bc318513b5306ae88a474b8886d> kbuild: asm-generic support Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
2011-06-09unicore32: change PERCPU to PERCPU_SECTIONGuan Xuetao1-1/+1
The patch changes PERCPU to PERCPU_SECTION see commit from Tejun Heo <0415b00d175e0d8945e6785aad21b5f157976ce0> percpu: Always align percpu output section to PAGE_SIZE Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Tejun Heo <tj@kernel.org>
2011-06-09unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig)Guan Xuetao2-2/+3
Rename debug_defconfig to unicore32_defconfig, which is a minimal config for PKUnity-v3 (130nm) SoC board. Also, add KBUILD_DEFCONFIG to use 'make defconfig'. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
2011-06-09unicore32: change zImage physical address, though it's PIC codesGuan Xuetao1-1/+1
U-boot will load the kernel image to 48M physical memory address. The patch changes it to the correct address, though it's PIC codes. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
2011-06-09unicore32: move rtc-puv3.c to drivers/rtc directoryGuan Xuetao7-21/+15
The patch moves rtc driver for PKUnity-v3 SoC from arch/unicore32/kernel/ to drivers/rtc/, with renaming it to rtc-puv3.c. Also, Kconfig, Makefile, and MAINTAINERS are modified correspondingly. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
2011-06-09netpoll: prevent netpoll setup on slave devicesWANG Cong1-0/+6
In commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093 (netpoll: disable netpoll when enslave a device), we automatically disable netpoll when the underlying device is being enslaved, we also need to prevent people from setuping netpoll on devices that are already enslaved. Signed-off-by: WANG Cong <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09net: pmtu_expires fixesEric Dumazet1-34/+44
commit 2c8cec5c10bc (ipv4: Cache learned PMTU information in inetpeer) added some racy peer->pmtu_expires accesses. As its value can be changed by another cpu/thread, we should be more careful, reading its value once. Add peer_pmtu_expired() and peer_pmtu_cleaned() helpers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/urgentIngo Molnar2-10/+14
2011-06-09gianfar:localized filer tableWu Jiajun-B063783-50/+51
Each eTSEC device should own localized filer table. Signed-off-by: Jiajun Wu <b06378@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-09powerpc: Force page alignment for initrd reserved memoryBenjamin Herrenschmidt4-32/+43
When using 64K pages with a separate cpio rootfs, U-Boot will align the rootfs on a 4K page boundary. When the memory is reserved, and subsequent early memblock_alloc is called, it will allocate memory between the 64K page alignment and reserved memory. When the reserved memory is subsequently freed, it is done so by pages, causing the early memblock_alloc requests to be re-used, which in my case, caused the device-tree to be clobbered. This patch forces the reserved memory for initrd to be kernel page aligned, and will move the device tree if it overlaps with the range extension of initrd. This patch will also consolidate the identical function free_initrd_mem() from mm/init_32.c, init_64.c to mm/mem.c, and adds the same range extension when freeing initrd. free_initrd_mem() is also moved to the __init section. Many thanks to Milton Miller for his input on this patch. [BenH: Fixed build without CONFIG_BLK_DEV_INITRD] Signed-off-by: Dave Carroll <dcarroll@astekcorp.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-06-09Merge remote branch 'kumar/merge' into mergeBenjamin Herrenschmidt3-5/+5
2011-06-09Merge remote branch 'gcl/powerpc/merge' into mergeBenjamin Herrenschmidt2-4/+0
2011-06-09AppArmor: Fix sleep in invalid context from task_setrlimitJohn Johansen1-1/+1
Affected kernels 2.6.36 - 3.0 AppArmor may do a GFP_KERNEL memory allocation with task_lock(tsk->group_leader); held when called from security_task_setrlimit. This will only occur when the task's current policy has been replaced, and the task's creds have not been updated before entering the LSM security_task_setrlimit() hook. BUG: sleeping function called from invalid context at mm/slub.c:847 in_atomic(): 1, irqs_disabled(): 0, pid: 1583, name: cupsd 2 locks held by cupsd/1583: #0: (tasklist_lock){.+.+.+}, at: [<ffffffff8104dafa>] do_prlimit+0x61/0x189 #1: (&(&p->alloc_lock)->rlock){+.+.+.}, at: [<ffffffff8104db2d>] do_prlimit+0x94/0x189 Pid: 1583, comm: cupsd Not tainted 3.0.0-rc2-git1 #7 Call Trace: [<ffffffff8102ebf2>] __might_sleep+0x10d/0x112 [<ffffffff810e6f46>] slab_pre_alloc_hook.isra.49+0x2d/0x33 [<ffffffff810e7bc4>] kmem_cache_alloc+0x22/0x132 [<ffffffff8105b6e6>] prepare_creds+0x35/0xe4 [<ffffffff811c0675>] aa_replace_current_profile+0x35/0xb2 [<ffffffff811c4d2d>] aa_current_profile+0x45/0x4c [<ffffffff811c4d4d>] apparmor_task_setrlimit+0x19/0x3a [<ffffffff811beaa5>] security_task_setrlimit+0x11/0x13 [<ffffffff8104db6b>] do_prlimit+0xd2/0x189 [<ffffffff8104dea9>] sys_setrlimit+0x3b/0x48 [<ffffffff814062bb>] system_call_fastpath+0x16/0x1b Signed-off-by: John Johansen <john.johansen@canonical.com> Reported-by: Miles Lane <miles.lane@gmail.com> Cc: stable@kernel.org Signed-off-by: James Morris <jmorris@namei.org>