Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298232
b: refs/heads/master
c: bde4d8b
h: refs/heads/master
v: v3
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed Mar 31, 2012
1 parent 33b807a commit c89222a
Show file tree
Hide file tree
Showing 38 changed files with 169 additions and 884 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: 923f79743c76583ed4684e2c80c8da51a7268af3
refs/heads/master: bde4d8b205bc3ccdf7f5a841bfbfa9896b44b1ce
10 changes: 0 additions & 10 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,3 @@ When: 3.5
Why: The old kmap_atomic() with two arguments is deprecated, we only
keep it for backward compatibility for few cycles and then drop it.
Who: Cong Wang <amwang@redhat.com>

----------------------------

What: get_robust_list syscall
When: 2013
Why: There appear to be no production users of the get_robust_list syscall,
and it runs the risk of leaking address locations, allowing the bypass
of ASLR. It was only ever intended for debugging, so it should be
removed.
Who: Kees Cook <keescook@chromium.org>
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ MRPROPER_FILES += .config .config.old .version .old_version \
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples)
clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation)

PHONY += $(clean-dirs) clean archclean
$(clean-dirs):
Expand Down
23 changes: 14 additions & 9 deletions trunk/arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# Copyright (C) 1995-2002 Russell King
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

ifneq ($(MACHINE),)
include $(srctree)/$(MACHINE)/Makefile.boot
endif
Expand Down Expand Up @@ -67,19 +69,22 @@ $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))

clean-files := *.dtb

ifneq ($(LOADADDR),)
UIMAGE_LOADADDR=$(LOADADDR)
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
-C none -a $(LOADADDR) -e $(STARTADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@

ifeq ($(CONFIG_ZBOOT_ROM),y)
$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
ifeq ($(CONFIG_ZBOOT_ROM),y)
UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
UIMAGE_LOADADDR=$(ZRELADDR)
endif
$(obj)/uImage: LOADADDR=$(ZRELADDR)
endif

$(obj)/uImage: STARTADDR=$(LOADADDR)

check_for_multiple_loadaddr = \
if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \
echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \
if [ $(words $(LOADADDR)) -gt 1 ]; then \
echo 'multiple load addresses: $(LOADADDR)'; \
echo 'This is incompatible with uImages'; \
echo 'Specify LOADADDR on the commandline to build an uImage'; \
false; \
Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/avr32/boot/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# for more details.
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

extra-y := vmlinux.bin vmlinux.gz

OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note.gnu.build-id
Expand All @@ -15,9 +17,10 @@ $(obj)/vmlinux.bin: vmlinux FORCE
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)

UIMAGE_LOADADDR = $(CONFIG_LOAD_ADDRESS)
UIMAGE_ENTRYADDR = $(CONFIG_ENTRY_ADDRESS)
UIMAGE_COMPRESSION = gzip
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel \
-C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@

targets += uImage uImage.srec
$(obj)/uImage: $(obj)/vmlinux.gz
Expand Down
19 changes: 11 additions & 8 deletions trunk/arch/blackfin/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
# for more details.
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

targets := vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma vmImage.lzo vmImage.xip
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.xip

ifeq ($(CONFIG_RAMKERNEL),y)
UIMAGE_LOADADDR = $(CONFIG_BOOT_LOAD)
else # CONFIG_ROMKERNEL must be set
UIMAGE_LOADADDR = $(CONFIG_ROM_BASE)
endif
UIMAGE_ENTRYADDR = $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}')
UIMAGE_NAME = '$(CPU_REV)-$(KERNELRELEASE)'
UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -x
UIMAGE_OPTS-y :=
UIMAGE_OPTS-$(CONFIG_RAMKERNEL) += -a $(CONFIG_BOOT_LOAD)
UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -a $(CONFIG_ROM_BASE) -x

quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
-C $(2) -n '$(CPU_REV)-$(KERNELRELEASE)' \
-e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
$(UIMAGE_OPTS-y) -d $< $@

$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
Expand Down
10 changes: 7 additions & 3 deletions trunk/arch/microblaze/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# arch/microblaze/boot/Makefile
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

obj-y += linked_dtb.o

targets := linux.bin linux.bin.gz simpleImage.%
Expand Down Expand Up @@ -33,9 +35,11 @@ quiet_cmd_strip = STRIP $@
cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
-K _fdt_start vmlinux -o $@

UIMAGE_IN = $@
UIMAGE_OUT = $@.ub
UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)
quiet_cmd_uimage = UIMAGE $@.ub
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \
-C none -n 'Linux-$(KERNELRELEASE)' \
-a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \
-d $@ $@.ub

$(obj)/simpleImage.%: vmlinux FORCE
$(call if_changed,cp,.unstrip)
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/sh/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Copyright (C) 1999 Stuart Menefy
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

#
# Assign safe dummy values if these variables are not defined,
# in order to suppress error message.
Expand Down Expand Up @@ -59,8 +61,10 @@ KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
$(KERNEL_MEMORY) + \
$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')

UIMAGE_LOADADDR = $(KERNEL_LOAD)
UIMAGE_ENTRYADDR = $(KERNEL_ENTRY)
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
-C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@

$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/sparc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout
MKIMAGE := $(srctree)/scripts/mkuboot.sh

hostprogs-y := piggyback btfixupprep
targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
Expand Down Expand Up @@ -91,9 +92,11 @@ $(obj)/image.bin: $(obj)/image FORCE
$(obj)/image.gz: $(obj)/image.bin
$(call if_changed,gzip)

UIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR)
UIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR)
UIMAGE_COMPRESSION = gzip
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sparc -O linux -T kernel \
-C gzip -a $(CONFIG_UBOOT_LOAD_ADDR) \
-e $(CONFIG_UBOOT_ENTRY_ADDR) -n 'Linux-$(KERNELRELEASE)' \
-d $< $@

quiet_cmd_uimage.o = UIMAGE.O $@
cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBOOT_FLASH_ADDR) \
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ extern unsigned long profile_pc(struct pt_regs *);
#ifndef __ASSEMBLY__

#ifdef __KERNEL__
#include <asm/switch_to.h>

static inline bool pt_regs_is_syscall(struct pt_regs *regs)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc/kernel/sun4d_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/sbi.h>
#include <asm/mmu.h>
#include <asm/tlbflush.h>
#include <asm/switch_to.h>
#include <asm/cacheflush.h>

#include "kernel.h"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc/kernel/sun4m_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/cpu.h>

#include <asm/cacheflush.h>
#include <asm/switch_to.h>
#include <asm/tlbflush.h>

#include "irq.h"
Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/unicore32/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# Copyright (C) 2001~2010 GUAN Xue-tao
#

MKIMAGE := $(srctree)/scripts/mkuboot.sh

targets := Image zImage uImage

$(obj)/Image: vmlinux FORCE
Expand All @@ -24,8 +26,14 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
@echo ' Kernel: $@ is ready'

UIMAGE_ARCH = unicore
UIMAGE_LOADADDR = 0x0
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A unicore -O linux -T kernel \
-C none -a $(LOADADDR) -e $(STARTADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@

$(obj)/uImage: LOADADDR=0x0

$(obj)/uImage: STARTADDR=$(LOADADDR)

$(obj)/uImage: $(obj)/zImage FORCE
$(call if_changed,uimage)
Expand Down
38 changes: 23 additions & 15 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#include <linux/magic.h>
#include <linux/pid.h>
#include <linux/nsproxy.h>
#include <linux/ptrace.h>

#include <asm/futex.h>

Expand Down Expand Up @@ -2444,31 +2443,40 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
{
struct robust_list_head __user *head;
unsigned long ret;
struct task_struct *p;
const struct cred *cred = current_cred(), *pcred;

if (!futex_cmpxchg_enabled)
return -ENOSYS;

WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");

rcu_read_lock();

ret = -ESRCH;
if (!pid)
p = current;
head = current->robust_list;
else {
struct task_struct *p;

ret = -ESRCH;
rcu_read_lock();
p = find_task_by_vpid(pid);
if (!p)
goto err_unlock;
ret = -EPERM;
pcred = __task_cred(p);
/* If victim is in different user_ns, then uids are not
comparable, so we must have CAP_SYS_PTRACE */
if (cred->user->user_ns != pcred->user->user_ns) {
if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
goto err_unlock;
goto ok;
}
/* If victim is in same user_ns, then uids are comparable */
if (cred->euid != pcred->euid &&
cred->euid != pcred->uid &&
!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
goto err_unlock;
ok:
head = p->robust_list;
rcu_read_unlock();
}

ret = -EPERM;
if (!ptrace_may_access(p, PTRACE_MODE_READ))
goto err_unlock;

head = p->robust_list;
rcu_read_unlock();

if (put_user(sizeof(*head), len_ptr))
return -EFAULT;
return put_user(head, head_ptr);
Expand Down
38 changes: 23 additions & 15 deletions trunk/kernel/futex_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <linux/compat.h>
#include <linux/nsproxy.h>
#include <linux/futex.h>
#include <linux/ptrace.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -137,31 +136,40 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
{
struct compat_robust_list_head __user *head;
unsigned long ret;
struct task_struct *p;
const struct cred *cred = current_cred(), *pcred;

if (!futex_cmpxchg_enabled)
return -ENOSYS;

WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");

rcu_read_lock();

ret = -ESRCH;
if (!pid)
p = current;
head = current->compat_robust_list;
else {
struct task_struct *p;

ret = -ESRCH;
rcu_read_lock();
p = find_task_by_vpid(pid);
if (!p)
goto err_unlock;
ret = -EPERM;
pcred = __task_cred(p);
/* If victim is in different user_ns, then uids are not
comparable, so we must have CAP_SYS_PTRACE */
if (cred->user->user_ns != pcred->user->user_ns) {
if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
goto err_unlock;
goto ok;
}
/* If victim is in same user_ns, then uids are comparable */
if (cred->euid != pcred->euid &&
cred->euid != pcred->uid &&
!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
goto err_unlock;
ok:
head = p->compat_robust_list;
rcu_read_unlock();
}

ret = -EPERM;
if (!ptrace_may_access(p, PTRACE_MODE_READ))
goto err_unlock;

head = p->compat_robust_list;
rcu_read_unlock();

if (put_user(sizeof(*head), len_ptr))
return -EFAULT;
return put_user(ptr_to_compat(head), head_ptr);
Expand Down
16 changes: 6 additions & 10 deletions trunk/kernel/irq/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action)
static void irq_wake_thread(struct irq_desc *desc, struct irqaction *action)
{
/*
* In case the thread crashed and was killed we just pretend that
* we handled the interrupt. The hardirq handler has disabled the
* device interrupt, so no irq storm is lurking.
*/
if (action->thread->flags & PF_EXITING)
return;

/*
* Wake up the handler thread for this action. If the
* Wake up the handler thread for this action. In case the
* thread crashed and was killed we just pretend that we
* handled the interrupt. The hardirq handler has disabled the
* device interrupt, so no irq storm is lurking. If the
* RUNTHREAD bit is already set, nothing to do.
*/
if (test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags))
if ((action->thread->flags & PF_EXITING) ||
test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags))
return;

/*
Expand Down
Loading

0 comments on commit c89222a

Please sign in to comment.