aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2009-08-17x86, intel_txt: Handle ACPI_SLEEP without X86_TRAMPOLINEH. Peter Anvin1-0/+4
On 32 bits, we can have CONFIG_ACPI_SLEEP set without implying CONFIG_X86_TRAMPOLINE. In that case, we simply do not need to mark the trampoline as a MAC region. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Shane Wang <shane.wang@intel.com> Cc: Joseph Cihula <joseph.cihula@intel.com>
2009-08-14x86, intel_txt: Fix typos in Kconfig helpArnaldo Carvalho de Melo1-2/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-08-14x86, intel_txt: Factor out the code for S3 setupH. Peter Anvin1-13/+40
S3 sleep requires special setup in tboot. However, the data structures needed to do such setup are only available if CONFIG_ACPI_SLEEP is enabled. Abstract them out as much as possible, so we can have a single tboot_setup_sleep() which either is a proper implementation or a stub which simply calls BUG(). Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Shane Wang <shane.wang@intel.com> Cc: Joseph Cihula <joseph.cihula@intel.com>
2009-08-12x86, intel_txt: tboot.c needs <asm/fixmap.h>H. Peter Anvin1-0/+1
arch/x86/kernel/tboot.c needs <asm/fixmap.h>. In most configurations that ends up getting implicitly included, but not in all, causing build failures in some configurations. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Joseph Cihula <joseph.cihula@intel.com> Cc: Shane Wang <shane.wang@intel.com>
2009-07-21intel_txt: Force IOMMU on for Intel TXT launchJoseph Cihula2-2/+22
The tboot module will DMA protect all of memory in order to ensure the that kernel will be able to initialize without compromise (from DMA). Consequently, the kernel must enable Intel Virtualization Technology for Directed I/O (VT-d or Intel IOMMU) in order to replace this broad protection with the appropriate page-granular protection. Otherwise DMA devices will be unable to read or write from memory and the kernel will eventually panic. Because runtime IOMMU support is configurable by command line options, this patch will force it to be enabled regardless of the options specified, and will log a message if it was required to force it on. dmar.c | 7 +++++++ intel-iommu.c | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-21x86, intel_txt: Intel TXT Sx shutdown supportJoseph Cihula3-1/+11
Support for graceful handling of sleep states (S3/S4/S5) after an Intel(R) TXT launch. Without this patch, attempting to place the system in one of the ACPI sleep states (S3/S4/S5) will cause the TXT hardware to treat this as an attack and will cause a system reset, with memory locked. Not only may the subsequent memory scrub take some time, but the platform will be unable to enter the requested power state. This patch calls back into the tboot so that it may properly and securely clean up system state and clear the secrets-in-memory flag, after which it will place the system into the requested sleep state using ACPI information passed by the kernel. arch/x86/kernel/smpboot.c | 2 ++ drivers/acpi/acpica/hwsleep.c | 3 +++ kernel/cpu.c | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-21x86, intel_txt: Intel TXT reboot/halt shutdown supportJoseph Cihula2-0/+11
Support for graceful handling of kernel reboots after an Intel(R) TXT launch. Without this patch, attempting to reboot or halt the system will cause the TXT hardware to lock memory upon system restart because the secrets-in-memory flag that was set on launch was never cleared. This will in turn cause BIOS to execute a TXT Authenticated Code Module (ACM) that will scrub all of memory and then unlock it. Depending on the amount of memory in the system and its type, this may take some time. This patch creates a 1:1 address mapping to the tboot module and then calls back into tboot so that it may properly and securely clean up system state and clear the secrets-in-memory flag. When it has completed these steps, the tboot module will reboot or halt the system. arch/x86/kernel/reboot.c | 8 ++++++++ init/main.c | 3 +++ 2 files changed, 11 insertions(+) Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-21x86, intel_txt: Intel TXT boot supportJoseph Cihula9-1/+827
This patch adds kernel configuration and boot support for Intel Trusted Execution Technology (Intel TXT). Intel's technology for safer computing, Intel Trusted Execution Technology (Intel TXT), defines platform-level enhancements that provide the building blocks for creating trusted platforms. Intel TXT was formerly known by the code name LaGrande Technology (LT). Intel TXT in Brief: o Provides dynamic root of trust for measurement (DRTM) o Data protection in case of improper shutdown o Measurement and verification of launched environment Intel TXT is part of the vPro(TM) brand and is also available some non-vPro systems. It is currently available on desktop systems based on the Q35, X38, Q45, and Q43 Express chipsets (e.g. Dell Optiplex 755, HP dc7800, etc.) and mobile systems based on the GM45, PM45, and GS45 Express chipsets. For more information, see http://www.intel.com/technology/security/. This site also has a link to the Intel TXT MLE Developers Manual, which has been updated for the new released platforms. A much more complete description of how these patches support TXT, how to configure a system for it, etc. is in the Documentation/intel_txt.txt file in this patch. This patch provides the TXT support routines for complete functionality, documentation for TXT support and for the changes to the boot_params structure, and boot detection of a TXT launch. Attempts to shutdown (reboot, Sx) the system will result in platform resets; subsequent patches will support these shutdown modes properly. Documentation/intel_txt.txt | 210 +++++++++++++++++++++ Documentation/x86/zero-page.txt | 1 arch/x86/include/asm/bootparam.h | 3 arch/x86/include/asm/fixmap.h | 3 arch/x86/include/asm/tboot.h | 197 ++++++++++++++++++++ arch/x86/kernel/Makefile | 1 arch/x86/kernel/setup.c | 4 arch/x86/kernel/tboot.c | 379 +++++++++++++++++++++++++++++++++++++++ security/Kconfig | 30 +++ 9 files changed, 827 insertions(+), 1 deletion(-) Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Gang Wei <gang.wei@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-20mvsdio: fix handling of partial word at the end of PIO transferNicolas Pitre1-2/+2
Standard data flow for MMC/SD/SDIO cards requires that the mvsdio controller be set for big endian operation. This is causing problems with buffers which length is not a multiple of 4 bytes as the last partial word doesn't get shifted all the way and stored properly in memory. Let's compensate for this. Signed-off-by: Nicolas Pitre <nico@marvell.com> CC: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-20blackfin: fix wrong CTS inversionSonic Zhang6-6/+6
The Blackfin serial headers were inverting the CTS value leading to wrong handling of the CTS line which broke CTS/RTS handling completely. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-20tty: fix chars_in_buffersAlan Cox7-10/+10
This function does not have an error return and returning an error is instead interpreted as having a lot of pending bytes. Reported by Jeff Harris who provided a list of some of the remaining offenders. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-20specialix.c: convert nested spin_lock_irqsave to spin_lockJulia Lawall1-12/+12
If spin_lock_irqsave is called twice in a row with the same second argument, the interrupt state at the point of the second call overwrites the value saved by the first call. Indeed, the second call does not need to save the interrupt state, so it is changed to a simple spin_lock. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression lock1,lock2; expression flags; @@ *spin_lock_irqsave(lock1,flags) ... when != flags *spin_lock_irqsave(lock2,flags) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-20vc: create vcs(a) devices for consolesKay Sievers1-0/+4
The buffer for the consoles are unconditionally allocated at con_init() time, which miss the creation of the vcs(a) devices. Since 2.6.30 (commit 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81, 'vcs: hook sysfs devices into object lifetime instead of "binding"' to be exact) these devices are no longer created at open() and removed on close(), but controlled by the lifetime of the buffers. Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Cc: stable@kernel.org Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-20cifs: free nativeFileSystem field before allocating a new oneJeff Layton1-0/+1
...otherwise, we'll leak this memory if we have to reconnect (e.g. after network failure). Signed-off-by: Jeff Layton <jlayton@redhat.com> CC: Stable <stable@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
2009-07-18ARM: Realview & Versatile: Fix i2c_board_info definitionsRussell King2-4/+2
Fix i2c_board_info definitions - we were defining the 'type' field of these structures twice since the first argument of I2C_BOARD_INFO sets this field. Move the second definition into I2C_BOARD_INFO(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Ben Dooks <ben-linux@fluff.org>
2009-07-18vmlinux.lds.h: restructure BSS linker script macrosTim Abbott2-11/+10
The BSS section macros in vmlinux.lds.h currently place the .sbss input section outside the bounds of [__bss_start, __bss_end]. On all architectures except for microblaze that handle both .sbss and __bss_start/__bss_end, this is wrong: the .sbss input section is within the range [__bss_start, __bss_end]. Relatedly, the example code at the top of the file actually has __bss_start/__bss_end defined twice; I believe the right fix here is to define them in the BSS_SECTION macro but not in the BSS macro. Another problem with the current macros is that several architectures have an ALIGN(4) or some other small number just before __bss_stop in their linker scripts. The BSS_SECTION macro currently hardcodes this to 4; while it should really be an argument. It also ignores its sbss_align argument; fix that. mn10300 is the only user at present of any of the macros touched by this patch. It looks like mn10300 actually was incorrectly converted to use the new BSS() macro (the alignment of 4 prior to conversion was a __bss_stop alignment, but the argument to the BSS macro is a start alignment). So fix this as well. I'd like acks from Sam and David on this one. Also CCing Paul, since he has a patch from me which will need to be updated to use BSS_SECTION(0, PAGE_SIZE, 4) once this gets merged. Signed-off-by: Tim Abbott <tabbott@ksplice.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-07-17kconfig: initialize the screen before using curses(3) functionsArnaud Lacombe1-0/+2
This is needed on non ncurses based implementation to get a properly initialized `stdscr' in main(). Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-07-17kconfig: variable argument lists needs `stdarg.h'Arnaud Lacombe1-0/+2
Fix build on non GNU based platforms. Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-07-17kbuild, deb-pkg: fix install scripts for posix shmaximilian attems1-1/+1
bash versus dash and posh disagree on expanding $@ within double quotes: export x="$@" see http://bugs.debian.org/381091 for details just use the arglist with $*. dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install): subprocess pre-installation script returned error exit status 2 export: 6: 2.6.31-rc1-18: bad variable name fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567 seen on Ubuntu as there dash is the default sh, versus bash on Debian. Reported-by: Pauli <suokkos@gmail.com> Cc: Frans Pop <elendil@planet.nl> Signed-off-by: maximilian attems <max@stro.at> Acked-By: Andres Salomon <dilinger@collabora.co.uk>
2009-07-17tty_port: Fix return on interrupted useAlan Cox1-1/+1
Whoops.. fortunately not many people use this yet. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-17Revert "Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm/fpu.h"Aurelien Jarno1-0/+2
asm/fpu.h uses the __IA64_UL macro which is declared in asm/types.h, so this include is really required. Without it, GNU libc fails to build. This reverts commit 2678c07b07ac2076675e5d57653bdf02e9af1950. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Fenghua Yu <fenghua.yu@intel.com>
2009-07-17Add dma_debug_init() for ia64fujita1-0/+8
The commit 9916219579d078c80377dd3988c2cc213536d868 was supposed to add CONFIG_DMA_API_DEBUG support to IA64 however I forgot to add dma_debug_init(). Signed-off-by: fujita <fujita@tulip.osrg.net> Acked-by: Fenghua Yu <fenghua.yu@intel.com>
2009-07-17Fix ia64 compilation IS_ERR and PTE_ERR errors.Fenghua Yu1-0/+1
When building ia64 kernel with CONFIG_XEN_SYS_HYPERVISOR, compiler reports errors: drivers/xen/sys-hypervisor.c: In function ‘uuid_show’: drivers/xen/sys-hypervisor.c:125: error: implicit declaration of function ‘IS_ERR’ drivers/xen/sys-hypervisor.c:126: error: implicit declaration of function ‘PTR_ERR’ This patch fixes the errors. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-07-17[ARM] 5608/1: Updated U300 defconfigLinus Walleij1-10/+8
Removed the LBD support that isn't of any use right now at least, then remove remnants of the TCM config flags that somehow crept in by mistake (not yet merged patch for 2.6.32) and then the usual defconfig noise from updated menus. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-17[ARM] 5606/1: Fix ep93xx watchdog driver headersRyan Mallon1-0/+1
Fix a number of build errors in the ep93xx watchdog driver due to missing io.h Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-17virtio_net: Sync header with qemuAlex Williamson1-4/+10
Qemu added support for a few extra RX modes that Linux doesn't currently make use of. Sync the headers to maintain consistency. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17virtio-pci: correctly unregister root device on errorMark McLoughlin1-1/+1
If pci_register_driver() fails we're incorrectly unregistering the root device with device_unregister() rather than root_device_unregister(). Reported-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17virtio_blk: ioctl return value fixChristoph Hellwig1-1/+1
Block driver ioctl methods must return ENOTTY and not -ENOIOCTLCMD if they expect the block layer to handle generic ioctls. This triggered a BLKROSET failure in xfsqa #200. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17virtio_blk: don't bounce highmem requestsChristoph Hellwig1-0/+3
By default a block driver bounces highmem requests, but virtio-blk is perfectly fine with any request that fit into it's 64 bit addressing scheme, mapped in the kernel virtual space or not. Besides improving performance on highmem systems this also makes the reproducible oops in __bounce_end_io go away (but hiding the real cause). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17lguest: restrict CPUID to avoid perf counter wrmsrRusty Russell1-0/+5
Avoid the following: [ 0.012093] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x2f/0x40() Rather than chase each new cpuid-detected feature, just lie about the highest valid CPUID so this code is never run. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17lguest: remove unnecessary forward struct declarationDavide Libenzi1-2/+0
While fixing lg.h to drop the fwd declaration, I noticed there's another one ;) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-17lguest: fix journeyMatias Zabaljauregui3-3/+3
fix: "make Guest" was complaining about duplicated G:032 Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-07-16tracing/function: Fix the return value of ftrace_trace_onoff_callback()Xiao Guangrong1-1/+1
ftrace_trace_onoff_callback() will return an error even if we do the right operation, for example: # echo _spin_*:traceon:10 > set_ftrace_filter -bash: echo: write error: Invalid argument # cat set_ftrace_filter #### all functions enabled #### _spin_trylock_bh:traceon:count=10 _spin_unlock_irq:traceon:count=10 _spin_unlock_bh:traceon:count=10 _spin_lock_irq:traceon:count=10 _spin_unlock:traceon:count=10 _spin_trylock:traceon:count=10 _spin_unlock_irqrestore:traceon:count=10 _spin_lock_irqsave:traceon:count=10 _spin_lock_bh:traceon:count=10 _spin_lock:traceon:count=10 We want to set _spin_*:traceon:10 to set_ftrace_filter, it complains with "Invalid argument", but the operation is successful. This is because ftrace_process_regex() returns the number of functions that matched the pattern. If the number is not 0, this value is returned by ftrace_regex_write() whereas we want to return the number of bytes virtually written. Also the file offset pointer is not updated in this case. If the number of matched functions is lower than the number of bytes written by the user, this results to a reprocessing of the string given by the user with a lower size, leading to a malformed ftrace regex and then a -EINVAL returned. So, this patch fixes it by returning 0 if no error occured. The fix also applies on 2.6.30 Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Cc: stable@kernel.org Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2009-07-16Blackfin: define HARDIRQ_BITS again for nowMike Frysinger1-0/+3
The default values of HARDIRQ_BITS and PREEMPT_BITS in common code leads to build failure: In file included from include/linux/interrupt.h:12, from include/linux/kernel_stat.h:8, from arch/blackfin/kernel/asm-offsets.c:32: include/linux/hardirq.h:66:2: error: #error PREEMPT_ACTIVE is too low! So until that gets resolved, just declare our own default value again. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16n_tty: Fix echo raceAlan Cox1-3/+0
If a tty in N_TTY mode with echo enabled manages to get itself into a state where - echo characters are pending - FASYNC is enabled - tty_write_wakeup is called from either - a device write path (pty) - an IRQ (serial) then it either deadlocks or explodes taking a mutex in the IRQ path. On the serial side it is almost impossible to reproduce because you have to go from a full serial port to a near empty one with echo characters pending. The pty case happens to have become possible to trigger using emacs and ptys, the pty changes having created a scenario which shows up this bug. The code path is n_tty:process_echoes() (takes mutex) tty_io:tty_put_char() pty:pty_write (or serial paths) tty_wakeup (from pty_write or serial IRQ) n_tty_write_wakeup() process_echoes() *KABOOM* Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16tty: nozomi, fix tty refcounting bugJiri Slaby1-4/+8
Don't forget to drop a tty refererence on fail paths in receive_data(). Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16vt: drop bootmem/slab memory distinctionJohannes Weiner2-10/+3
Bootmem is not used for the vt screen buffer anymore as slab is now available at the time the console is initialized. Get rid of the now superfluous distinction between slab and bootmem, it's always slab. This also fixes a kmalloc leak which Catalin described thusly: Commit a5f4f52e ("vt: use kzalloc() instead of the bootmem allocator") replaced the alloc_bootmem() with kzalloc() but didn't set vc_kmalloced to 1 and the memory block is later leaked. The corresponding kmemleak trace: unreferenced object 0xdf828000 (size 8192): comm "swapper", pid 0, jiffies 4294937296 backtrace: [<c006d473>] __save_stack_trace+0x17/0x1c [<c000d869>] log_early+0x55/0x84 [<c01cfa4b>] kmemleak_alloc+0x33/0x3c [<c006c013>] __kmalloc+0xd7/0xe4 [<c00108c7>] con_init+0xbf/0x1b8 [<c0010149>] console_init+0x11/0x20 [<c0008797>] start_kernel+0x137/0x1e4 Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi> Tested-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16drivers/serial/bfin_sport_uart.c: remove wrong and unneeded memsetAndrew Morton1-1/+0
dcb314@hotmail.com notes that this memset has its args reversed. It's unneeded anyway, so remove it. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13587 Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16serial: don't add msm_serial's probe function to the driver structUwe Kleine-König1-1/+0
msm_serial_driver is registered using platform_driver_probe which takes care for the probe function itself. So don't pass it in the driver struct, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16tty: fix close/hangup raceAlan Cox1-10/+15
We can get a situation where a hangup occurs during or after a close. In that case the ldisc gets disposed of by the close and the hangup then explodes. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16Add '-fno-delete-null-pointer-checks' to gcc CFLAGSEugene Teo1-1/+2
Turning on this flag could prevent the compiler from optimising away some "useless" checks for null pointers. Such bugs can sometimes become exploitable at compile time because of the -O2 optimisation. See http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html An example that clearly shows this 'problem' is commit 6bf67672. static void __devexit agnx_pci_remove(struct pci_dev *pdev) { struct ieee80211_hw *dev = pci_get_drvdata(pdev); - struct agnx_priv *priv = dev->priv; + struct agnx_priv *priv; AGNX_TRACE; if (!dev) return; + priv = dev->priv; By reverting this patch, and compile it with and without -fno-delete-null-pointer-checks flag, we can see that the check for dev is compiled away. call printk # - testq %r12, %r12 # dev - je .L94 #, movq %r12, %rdi # dev, Clearly the 'fix' is to stop using dev before it is tested, but building with -fno-delete-null-pointer-checks flag at least makes it harder to abuse. Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Acked-by: Eric Paris <eparis@redhat.com> Acked-by: Wang Cong <amwang@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16Revert "ppp: Fix throttling bugs"Linus Torvalds2-0/+2
This reverts commit a6540f731d506d9e82444cf0020e716613d4c46c, as requested by Alan: "... as it was wrong, the pty code is now fixed and the fact this isn't reverted is breaking pptp setups." Requested-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16arch/blackfin: Add kmalloc NULL testsJulia Lawall1-0/+8
Check that the result of kmalloc is not NULL before passing it to other functions. In the first two cases, the new code returns -ENOMEM, which seems compatible with what is done for similar functions for other architectures. In the last two cases, the new code fails silently, ie just returns, because the function has void return type. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x == NULL when != x != NULL when != (x || ...) ( kfree(x) | f(...,C,...,x,...) | *f(...,x,...) | *x->f ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: add CPLB entries for Core B on-chip L1 SRAM regionsGraf Yang1-6/+17
The Blackfin SMP port was missing CPLB entries for Core B on-chip L1 SRAM regions. Any code that attempted to use these would wrongly crash due to a CPLB miss. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: work around anomaly 05000189Robin Getz1-1/+2
Similar to anomaly 05000281 but not as bad, we cannot return to the instruction causing a fault otherwise we'll trigger a second false exception. The system can still recover, but it isn't correct. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: drop per-cpu loops_per_jiffy trackingMichael Hennerich3-6/+4
On Blackfin SMP, a per-cpu loops_per_jiffy is pointless since both cores always run at the same CCLK. In addition, the current implementation has flaws since the main consumer for loops_per_jiffy (asm/delay.h) uses the global kernel loops_per_jiffy and not the per_cpu one. So punt all of the per-cpu handling and go back to the global shared one. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: fix bugs in GPIO resume codeMichael Hennerich1-4/+2
Change the bfin_gpio_pm_hibernate_restore() function to: 1) AND restored DATA with DIR (not OR) to get correct final state 2) Restore DATA before setting DIR to avoid glitches Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: bf537-stamp: fix irq decl for AD7142Barry Song1-1/+1
The AD7142 add-on card hooks the IRQ line up to PG5, not PF5. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: fix handling of IPEND in interrupt context saveRobin Getz1-3/+4
The interrupt context save logic incorrectly stored the address of the IPEND register rather than its value due to a missing dereference. While we're here, also enable this code for all kernel debugging scenarios and not just when KGDB is enabled. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: drop duplicate runtime checking of anomaly 05000448Robin Getz1-4/+0
We already catch this anomaly at compile time, and the runtime version is such that it ends up checking on all parts rather than just the ones that might actually have it. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>