Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232026
b: refs/heads/master
c: 8d99641
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jan 21, 2011
1 parent 94e8669 commit c0ac88d
Show file tree
Hide file tree
Showing 331 changed files with 1,033 additions and 798 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 225c8e010f2d17a62aef131e24c6e7c111f36f9b
refs/heads/master: 8d99641f6c1af806cd5d9e6badce91910219a161
73 changes: 65 additions & 8 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#include <limits.h>
#include <stddef.h>
#include <signal.h>
#include <pwd.h>
#include <grp.h>

#include <linux/virtio_config.h>
#include <linux/virtio_net.h>
#include <linux/virtio_blk.h>
Expand Down Expand Up @@ -298,20 +301,27 @@ static void *map_zeroed_pages(unsigned int num)

/*
* We use a private mapping (ie. if we write to the page, it will be
* copied).
* copied). We allocate an extra two pages PROT_NONE to act as guard
* pages against read/write attempts that exceed allocated space.
*/
addr = mmap(NULL, getpagesize() * num,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
addr = mmap(NULL, getpagesize() * (num+2),
PROT_NONE, MAP_PRIVATE, fd, 0);

if (addr == MAP_FAILED)
err(1, "Mmapping %u pages of /dev/zero", num);

if (mprotect(addr + getpagesize(), getpagesize() * num,
PROT_READ|PROT_WRITE) == -1)
err(1, "mprotect rw %u pages failed", num);

/*
* One neat mmap feature is that you can close the fd, and it
* stays mapped.
*/
close(fd);

return addr;
/* Return address after PROT_NONE page */
return addr + getpagesize();
}

/* Get some more pages for a device. */
Expand Down Expand Up @@ -343,7 +353,7 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
* done to it. This allows us to share untouched memory between
* Guests.
*/
if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC,
if (mmap(addr, len, PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)
return;

Expand Down Expand Up @@ -573,10 +583,10 @@ static void *_check_pointer(unsigned long addr, unsigned int size,
unsigned int line)
{
/*
* We have to separately check addr and addr+size, because size could
* be huge and addr + size might wrap around.
* Check if the requested address and size exceeds the allocated memory,
* or addr + size wraps around.
*/
if (addr >= guest_limit || addr + size >= guest_limit)
if ((addr + size) > guest_limit || (addr + size) < addr)
errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);
/*
* We return a pointer for the caller's convenience, now we know it's
Expand Down Expand Up @@ -1872,6 +1882,8 @@ static struct option opts[] = {
{ "block", 1, NULL, 'b' },
{ "rng", 0, NULL, 'r' },
{ "initrd", 1, NULL, 'i' },
{ "username", 1, NULL, 'u' },
{ "chroot", 1, NULL, 'c' },
{ NULL },
};
static void usage(void)
Expand All @@ -1894,6 +1906,12 @@ int main(int argc, char *argv[])
/* If they specify an initrd file to load. */
const char *initrd_name = NULL;

/* Password structure for initgroups/setres[gu]id */
struct passwd *user_details = NULL;

/* Directory to chroot to */
char *chroot_path = NULL;

/* Save the args: we "reboot" by execing ourselves again. */
main_args = argv;

Expand Down Expand Up @@ -1950,6 +1968,14 @@ int main(int argc, char *argv[])
case 'i':
initrd_name = optarg;
break;
case 'u':
user_details = getpwnam(optarg);
if (!user_details)
err(1, "getpwnam failed, incorrect username?");
break;
case 'c':
chroot_path = optarg;
break;
default:
warnx("Unknown argument %s", argv[optind]);
usage();
Expand Down Expand Up @@ -2021,6 +2047,37 @@ int main(int argc, char *argv[])
/* If we exit via err(), this kills all the threads, restores tty. */
atexit(cleanup_devices);

/* If requested, chroot to a directory */
if (chroot_path) {
if (chroot(chroot_path) != 0)
err(1, "chroot(\"%s\") failed", chroot_path);

if (chdir("/") != 0)
err(1, "chdir(\"/\") failed");

verbose("chroot done\n");
}

/* If requested, drop privileges */
if (user_details) {
uid_t u;
gid_t g;

u = user_details->pw_uid;
g = user_details->pw_gid;

if (initgroups(user_details->pw_name, g) != 0)
err(1, "initgroups failed");

if (setresgid(g, g, g) != 0)
err(1, "setresgid failed");

if (setresuid(u, u, u) != 0)
err(1, "setresuid failed");

verbose("Dropping privileges completed\n");
}

/* Finally, run the Guest. This doesn't return. */
run_guest();
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/Documentation/lguest/lguest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ Running Lguest:

for general information on how to get bridging to work.

- Random number generation. Using the --rng option will provide a
/dev/hwrng in the guest that will read from the host's /dev/random.
Use this option in conjunction with rng-tools (see ../hw_random.txt)
to provide entropy to the guest kernel's /dev/random.

There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest

Good luck!
Expand Down
50 changes: 25 additions & 25 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ L: linux-serial@vger.kernel.org
W: http://serial.sourceforge.net
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
F: drivers/serial/8250*
F: drivers/tty/serial/8250*
F: include/linux/serial_8250.h

8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
Expand Down Expand Up @@ -892,8 +892,8 @@ F: arch/arm/mach-msm/
F: drivers/video/msm/
F: drivers/mmc/host/msm_sdcc.c
F: drivers/mmc/host/msm_sdcc.h
F: drivers/serial/msm_serial.h
F: drivers/serial/msm_serial.c
F: drivers/tty/serial/msm_serial.h
F: drivers/tty/serial/msm_serial.c
T: git git://codeaurora.org/quic/kernel/davidb/linux-msm.git
S: Maintained

Expand Down Expand Up @@ -1260,7 +1260,7 @@ F: drivers/mmc/host/atmel-mci-regs.h
ATMEL AT91 / AT32 SERIAL DRIVER
M: Nicolas Ferre <nicolas.ferre@atmel.com>
S: Supported
F: drivers/serial/atmel_serial.c
F: drivers/tty/serial/atmel_serial.c

ATMEL LCDFB DRIVER
M: Nicolas Ferre <nicolas.ferre@atmel.com>
Expand Down Expand Up @@ -1416,7 +1416,7 @@ M: Sonic Zhang <sonic.zhang@analog.com>
L: uclinux-dist-devel@blackfin.uclinux.org
W: http://blackfin.uclinux.org
S: Supported
F: drivers/serial/bfin_5xx.c
F: drivers/tty/serial/bfin_5xx.c

BLACKFIN WATCHDOG DRIVER
M: Mike Frysinger <vapier.adi@gmail.com>
Expand Down Expand Up @@ -1881,7 +1881,7 @@ L: linux-cris-kernel@axis.com
W: http://developer.axis.com
S: Maintained
F: arch/cris/
F: drivers/serial/crisv10.*
F: drivers/tty/serial/crisv10.*

CRYPTO API
M: Herbert Xu <herbert@gondor.apana.org.au>
Expand Down Expand Up @@ -2220,7 +2220,7 @@ F: drivers/net/wan/dscc4.c
DZ DECSTATION DZ11 SERIAL DRIVER
M: "Maciej W. Rozycki" <macro@linux-mips.org>
S: Maintained
F: drivers/serial/dz.*
F: drivers/tty/serial/dz.*

EATA-DMA SCSI DRIVER
M: Michael Neuffer <mike@i-Connect.Net>
Expand Down Expand Up @@ -2647,7 +2647,7 @@ FREESCALE QUICC ENGINE UCC UART DRIVER
M: Timur Tabi <timur@freescale.com>
L: linuxppc-dev@lists.ozlabs.org
S: Supported
F: drivers/serial/ucc_uart.c
F: drivers/tty/serial/ucc_uart.c

FREESCALE SOC SOUND DRIVERS
M: Timur Tabi <timur@freescale.com>
Expand Down Expand Up @@ -3354,7 +3354,7 @@ IOC3 SERIAL DRIVER
M: Pat Gefre <pfg@sgi.com>
L: linux-serial@vger.kernel.org
S: Maintained
F: drivers/serial/ioc3_serial.c
F: drivers/tty/serial/ioc3_serial.c

IP MASQUERADING
M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
Expand Down Expand Up @@ -3531,7 +3531,7 @@ JSM Neo PCI based serial card
M: Breno Leitao <leitao@linux.vnet.ibm.com>
L: linux-serial@vger.kernel.org
S: Maintained
F: drivers/serial/jsm/
F: drivers/tty/serial/jsm/

K10TEMP HARDWARE MONITORING DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
Expand Down Expand Up @@ -3681,7 +3681,7 @@ L: kgdb-bugreport@lists.sourceforge.net
S: Maintained
F: Documentation/DocBook/kgdb.tmpl
F: drivers/misc/kgdbts.c
F: drivers/serial/kgdboc.c
F: drivers/tty/serial/kgdboc.c
F: include/linux/kdb.h
F: include/linux/kgdb.h
F: kernel/debug/
Expand Down Expand Up @@ -5549,7 +5549,7 @@ M: Pat Gefre <pfg@sgi.com>
L: linux-ia64@vger.kernel.org
S: Supported
F: Documentation/ia64/serial.txt
F: drivers/serial/ioc?_serial.c
F: drivers/tty/serial/ioc?_serial.c
F: include/linux/ioc?.h

SGI VISUAL WORKSTATION 320 AND 540
Expand All @@ -5571,7 +5571,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
F: arch/arm/mach-lh7a40x/
F: drivers/serial/serial_lh7a40x.c
F: drivers/tty/serial/serial_lh7a40x.c
F: drivers/usb/gadget/lh7a40*
F: drivers/usb/host/ohci-lh7a40*

Expand Down Expand Up @@ -5791,14 +5791,14 @@ L: sparclinux@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
S: Maintained
F: drivers/serial/suncore.c
F: drivers/serial/suncore.h
F: drivers/serial/sunhv.c
F: drivers/serial/sunsab.c
F: drivers/serial/sunsab.h
F: drivers/serial/sunsu.c
F: drivers/serial/sunzilog.c
F: drivers/serial/sunzilog.h
F: drivers/tty/serial/suncore.c
F: drivers/tty/serial/suncore.h
F: drivers/tty/serial/sunhv.c
F: drivers/tty/serial/sunsab.c
F: drivers/tty/serial/sunsab.h
F: drivers/tty/serial/sunsu.c
F: drivers/tty/serial/sunzilog.c
F: drivers/tty/serial/sunzilog.h

SPEAR PLATFORM SUPPORT
M: Viresh Kumar <viresh.kumar@st.com>
Expand Down Expand Up @@ -6128,8 +6128,8 @@ TTY LAYER
M: Greg Kroah-Hartman <gregkh@suse.de>
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
F: drivers/char/tty_*
F: drivers/serial/serial_core.c
F: drivers/tty/*
F: drivers/tty/serial/serial_core.c
F: include/linux/serial_core.h
F: include/linux/serial.h
F: include/linux/tty.h
Expand Down Expand Up @@ -6874,7 +6874,7 @@ XILINX UARTLITE SERIAL DRIVER
M: Peter Korsgaard <jacmet@sunsite.dk>
L: linux-serial@vger.kernel.org
S: Maintained
F: drivers/serial/uartlite.c
F: drivers/tty/serial/uartlite.c

YAM DRIVER FOR AX.25
M: Jean-Paul Roubelat <jpr@f6fbb.org>
Expand Down Expand Up @@ -6920,7 +6920,7 @@ F: drivers/media/video/zoran/
ZS DECSTATION Z85C30 SERIAL DRIVER
M: "Maciej W. Rozycki" <macro@linux-mips.org>
S: Maintained
F: drivers/serial/zs.*
F: drivers/tty/serial/zs.*

GRE DEMULTIPLEXER DRIVER
M: Dmitry Kozlov <xeb@mail.ru>
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-msm/board-qsd8x50.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const unsigned qsd8x50_surf_smc91x_gpio __initdata = 156;
* at run-time: they vary from board to board, and the true
* configuration won't be known until boot.
*/
static struct resource smc91x_resources[] __initdata = {
static struct resource smc91x_resources[] = {
[0] = {
.flags = IORESOURCE_MEM,
},
Expand All @@ -52,7 +52,7 @@ static struct resource smc91x_resources[] __initdata = {
},
};

static struct platform_device smc91x_device __initdata = {
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/lguest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ config LGUEST_GUEST
bool "Lguest guest support"
select PARAVIRT
depends on X86_32
select VIRTUALIZATION
select VIRTIO
select VIRTIO_RING
select VIRTIO_CONSOLE
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ static void __init lguest_init_IRQ(void)

for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
/* Some systems map "vectors" to interrupts weirdly. Not us! */
__get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
__this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR);
if (i != SYSCALL_VECTOR)
set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ obj-$(CONFIG_XEN) += xen/
# regulators early, since some subsystems rely on them to initialize
obj-$(CONFIG_REGULATOR) += regulator/

# char/ comes before serial/ etc so that the VT console is the boot-time
# tty/ comes before char/ so that the VT console is the boot-time
# default.
obj-y += tty/
obj-y += char/
Expand All @@ -38,7 +38,6 @@ obj-$(CONFIG_CONNECTOR) += connector/
obj-$(CONFIG_FB_I810) += video/i810/
obj-$(CONFIG_FB_INTEL) += video/intelfb/

obj-y += serial/
obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ mfd/ nfc/
obj-$(CONFIG_NUBUS) += nubus/
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/acpica/accommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*****************************************************************************/

/*
* Copyright (C) 2000 - 2010, Intel Corp.
* Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/acpica/acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*****************************************************************************/

/*
* Copyright (C) 2000 - 2010, Intel Corp.
* Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*****************************************************************************/

/*
* Copyright (C) 2000 - 2010, Intel Corp.
* Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit c0ac88d

Please sign in to comment.