Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b581af51 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86/i386: Put aligned stack-canary in percpu shared_aligned section
  x86/i386: Make sure stack-protector segment base is cache aligned
  x86: Detect stack protector for i386 builds on x86_64
  x86: allow "=rm" in native_save_fl()
  x86: properly annotate alternatives.c
  x86: Introduce GDT_ENTRY_INIT(), initialize bad_bios_desc statically
  x86, 32-bit: Use generic sys_pipe()
  x86: Introduce GDT_ENTRY_INIT(), fix APM
  x86: Introduce GDT_ENTRY_INIT()
  x86: Introduce set_desc_base() and set_desc_limit()
  x86: Remove unused patch_espfix_desc()
  x86: Use get_desc_base()
parents ffaf854b 53f82452
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ endif


ifdef CONFIG_CC_STACKPROTECTOR
ifdef CONFIG_CC_STACKPROTECTOR
	cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
	cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
        ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC)),y)
        ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y)
                stackp-y := -fstack-protector
                stackp-y := -fstack-protector
                stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += -fstack-protector-all
                stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += -fstack-protector-all
                KBUILD_CFLAGS += $(stackp-y)
                KBUILD_CFLAGS += $(stackp-y)
+1 −1
Original line number Original line Diff line number Diff line
@@ -537,7 +537,7 @@ ia32_sys_call_table:
	.quad sys_mkdir
	.quad sys_mkdir
	.quad sys_rmdir		/* 40 */
	.quad sys_rmdir		/* 40 */
	.quad sys_dup
	.quad sys_dup
	.quad sys32_pipe
	.quad sys_pipe
	.quad compat_sys_times
	.quad compat_sys_times
	.quad quiet_ni_syscall			/* old prof syscall holder */
	.quad quiet_ni_syscall			/* old prof syscall holder */
	.quad sys_brk		/* 45 */
	.quad sys_brk		/* 45 */
+0 −14
Original line number Original line Diff line number Diff line
@@ -189,20 +189,6 @@ asmlinkage long sys32_mprotect(unsigned long start, size_t len,
	return sys_mprotect(start, len, prot);
	return sys_mprotect(start, len, prot);
}
}


asmlinkage long sys32_pipe(int __user *fd)
{
	int retval;
	int fds[2];

	retval = do_pipe_flags(fds, 0);
	if (retval)
		goto out;
	if (copy_to_user(fd, fds, sizeof(fds)))
		retval = -EFAULT;
out:
	return retval;
}

asmlinkage long sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
asmlinkage long sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
				   struct sigaction32 __user *oact,
				   struct sigaction32 __user *oact,
				   unsigned int sigsetsize)
				   unsigned int sigsetsize)
+0 −7
Original line number Original line Diff line number Diff line
@@ -73,8 +73,6 @@ static inline void alternatives_smp_module_del(struct module *mod) {}
static inline void alternatives_smp_switch(int smp) {}
static inline void alternatives_smp_switch(int smp) {}
#endif	/* CONFIG_SMP */
#endif	/* CONFIG_SMP */


const unsigned char *const *find_nop_table(void);

/* alternative assembly primitive: */
/* alternative assembly primitive: */
#define ALTERNATIVE(oldinstr, newinstr, feature)			\
#define ALTERNATIVE(oldinstr, newinstr, feature)			\
									\
									\
@@ -144,8 +142,6 @@ static inline void apply_paravirt(struct paravirt_patch_site *start,
#define __parainstructions_end	NULL
#define __parainstructions_end	NULL
#endif
#endif


extern void add_nops(void *insns, unsigned int len);

/*
/*
 * Clear and restore the kernel write-protection flag on the local CPU.
 * Clear and restore the kernel write-protection flag on the local CPU.
 * Allows the kernel to edit read-only pages.
 * Allows the kernel to edit read-only pages.
@@ -161,10 +157,7 @@ extern void add_nops(void *insns, unsigned int len);
 * Intel's errata.
 * Intel's errata.
 * On the local CPU you need to be protected again NMI or MCE handlers seeing an
 * On the local CPU you need to be protected again NMI or MCE handlers seeing an
 * inconsistent instruction while you patch.
 * inconsistent instruction while you patch.
 * The _early version expects the memory to already be RW.
 */
 */

extern void *text_poke(void *addr, const void *opcode, size_t len);
extern void *text_poke(void *addr, const void *opcode, size_t len);
extern void *text_poke_early(void *addr, const void *opcode, size_t len);


#endif /* _ASM_X86_ALTERNATIVE_H */
#endif /* _ASM_X86_ALTERNATIVE_H */
+13 −0
Original line number Original line Diff line number Diff line
@@ -291,11 +291,24 @@ static inline unsigned long get_desc_base(const struct desc_struct *desc)
	return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
	return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
}
}


static inline void set_desc_base(struct desc_struct *desc, unsigned long base)
{
	desc->base0 = base & 0xffff;
	desc->base1 = (base >> 16) & 0xff;
	desc->base2 = (base >> 24) & 0xff;
}

static inline unsigned long get_desc_limit(const struct desc_struct *desc)
static inline unsigned long get_desc_limit(const struct desc_struct *desc)
{
{
	return desc->limit0 | (desc->limit << 16);
	return desc->limit0 | (desc->limit << 16);
}
}


static inline void set_desc_limit(struct desc_struct *desc, unsigned long limit)
{
	desc->limit0 = limit & 0xffff;
	desc->limit = (limit >> 16) & 0xf;
}

static inline void _set_gate(int gate, unsigned type, void *addr,
static inline void _set_gate(int gate, unsigned type, void *addr,
			     unsigned dpl, unsigned ist, unsigned seg)
			     unsigned dpl, unsigned ist, unsigned seg)
{
{
Loading