diff options
Diffstat (limited to 'arch/sh/kernel')
| -rw-r--r-- | arch/sh/kernel/cpu/sh5/entry.S | 82 | ||||
| -rw-r--r-- | arch/sh/kernel/process.c | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/process_64.c | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/sh_ksyms_64.c | 2 |
4 files changed, 2 insertions, 84 deletions
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index ff1f0e6e9bec..b7cf6a547f11 100644 --- a/arch/sh/kernel/cpu/sh5/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
| @@ -1569,86 +1569,6 @@ ___clear_user_exit: | |||
| 1569 | #endif /* CONFIG_MMU */ | 1569 | #endif /* CONFIG_MMU */ |
| 1570 | 1570 | ||
| 1571 | /* | 1571 | /* |
| 1572 | * int __strncpy_from_user(unsigned long __dest, unsigned long __src, | ||
| 1573 | * int __count) | ||
| 1574 | * | ||
| 1575 | * Inputs: | ||
| 1576 | * (r2) target address | ||
| 1577 | * (r3) source address | ||
| 1578 | * (r4) maximum size in bytes | ||
| 1579 | * | ||
| 1580 | * Ouputs: | ||
| 1581 | * (*r2) copied data | ||
| 1582 | * (r2) -EFAULT (in case of faulting) | ||
| 1583 | * copied data (otherwise) | ||
| 1584 | */ | ||
| 1585 | .global __strncpy_from_user | ||
| 1586 | __strncpy_from_user: | ||
| 1587 | pta ___strncpy_from_user1, tr0 | ||
| 1588 | pta ___strncpy_from_user_done, tr1 | ||
| 1589 | or r4, ZERO, r5 /* r5 = original count */ | ||
| 1590 | beq/u r4, r63, tr1 /* early exit if r4==0 */ | ||
| 1591 | movi -(EFAULT), r6 /* r6 = reply, no real fixup */ | ||
| 1592 | or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */ | ||
| 1593 | |||
| 1594 | ___strncpy_from_user1: | ||
| 1595 | ld.b r3, 0, r7 /* Fault address: only in reading */ | ||
| 1596 | st.b r2, 0, r7 | ||
| 1597 | addi r2, 1, r2 | ||
| 1598 | addi r3, 1, r3 | ||
| 1599 | beq/u ZERO, r7, tr1 | ||
| 1600 | addi r4, -1, r4 /* return real number of copied bytes */ | ||
| 1601 | bne/l ZERO, r4, tr0 | ||
| 1602 | |||
| 1603 | ___strncpy_from_user_done: | ||
| 1604 | sub r5, r4, r6 /* If done, return copied */ | ||
| 1605 | |||
| 1606 | ___strncpy_from_user_exit: | ||
| 1607 | or r6, ZERO, r2 | ||
| 1608 | ptabs LINK, tr0 | ||
| 1609 | blink tr0, ZERO | ||
| 1610 | |||
| 1611 | /* | ||
| 1612 | * extern long __strnlen_user(const char *__s, long __n) | ||
| 1613 | * | ||
| 1614 | * Inputs: | ||
| 1615 | * (r2) source address | ||
| 1616 | * (r3) source size in bytes | ||
| 1617 | * | ||
| 1618 | * Ouputs: | ||
| 1619 | * (r2) -EFAULT (in case of faulting) | ||
| 1620 | * string length (otherwise) | ||
| 1621 | */ | ||
| 1622 | .global __strnlen_user | ||
| 1623 | __strnlen_user: | ||
| 1624 | pta ___strnlen_user_set_reply, tr0 | ||
| 1625 | pta ___strnlen_user1, tr1 | ||
| 1626 | or ZERO, ZERO, r5 /* r5 = counter */ | ||
| 1627 | movi -(EFAULT), r6 /* r6 = reply, no real fixup */ | ||
| 1628 | or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */ | ||
| 1629 | beq r3, ZERO, tr0 | ||
| 1630 | |||
| 1631 | ___strnlen_user1: | ||
| 1632 | ldx.b r2, r5, r7 /* Fault address: only in reading */ | ||
| 1633 | addi r3, -1, r3 /* No real fixup */ | ||
| 1634 | addi r5, 1, r5 | ||
| 1635 | beq r3, ZERO, tr0 | ||
| 1636 | bne r7, ZERO, tr1 | ||
| 1637 | ! The line below used to be active. This meant led to a junk byte lying between each pair | ||
| 1638 | ! of entries in the argv & envp structures in memory. Whilst the program saw the right data | ||
| 1639 | ! via the argv and envp arguments to main, it meant the 'flat' representation visible through | ||
| 1640 | ! /proc/$pid/cmdline was corrupt, causing trouble with ps, for example. | ||
| 1641 | ! addi r5, 1, r5 /* Include '\0' */ | ||
| 1642 | |||
| 1643 | ___strnlen_user_set_reply: | ||
| 1644 | or r5, ZERO, r6 /* If done, return counter */ | ||
| 1645 | |||
| 1646 | ___strnlen_user_exit: | ||
| 1647 | or r6, ZERO, r2 | ||
| 1648 | ptabs LINK, tr0 | ||
| 1649 | blink tr0, ZERO | ||
| 1650 | |||
| 1651 | /* | ||
| 1652 | * extern long __get_user_asm_?(void *val, long addr) | 1572 | * extern long __get_user_asm_?(void *val, long addr) |
| 1653 | * | 1573 | * |
| 1654 | * Inputs: | 1574 | * Inputs: |
| @@ -1982,8 +1902,6 @@ asm_uaccess_start: | |||
| 1982 | .long ___copy_user2, ___copy_user_exit | 1902 | .long ___copy_user2, ___copy_user_exit |
| 1983 | .long ___clear_user1, ___clear_user_exit | 1903 | .long ___clear_user1, ___clear_user_exit |
| 1984 | #endif | 1904 | #endif |
| 1985 | .long ___strncpy_from_user1, ___strncpy_from_user_exit | ||
| 1986 | .long ___strnlen_user1, ___strnlen_user_exit | ||
| 1987 | .long ___get_user_asm_b1, ___get_user_asm_b_exit | 1905 | .long ___get_user_asm_b1, ___get_user_asm_b_exit |
| 1988 | .long ___get_user_asm_w1, ___get_user_asm_w_exit | 1906 | .long ___get_user_asm_w1, ___get_user_asm_w_exit |
| 1989 | .long ___get_user_asm_l1, ___get_user_asm_l_exit | 1907 | .long ___get_user_asm_l1, ___get_user_asm_l_exit |
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 9b7a459a4613..055d91b70305 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
| 5 | #include <linux/export.h> | 5 | #include <linux/export.h> |
| 6 | #include <linux/stackprotector.h> | 6 | #include <linux/stackprotector.h> |
| 7 | #include <asm/fpu.h> | ||
| 7 | 8 | ||
| 8 | struct kmem_cache *task_xstate_cachep = NULL; | 9 | struct kmem_cache *task_xstate_cachep = NULL; |
| 9 | unsigned int xstate_size; | 10 | unsigned int xstate_size; |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index 4264583eabac..602545b12a86 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <asm/switch_to.h> | 33 | #include <asm/switch_to.h> |
| 34 | 34 | ||
| 35 | struct task_struct *last_task_used_math = NULL; | 35 | struct task_struct *last_task_used_math = NULL; |
| 36 | struct pt_regs fake_swapper_regs = { 0, }; | ||
| 36 | 37 | ||
| 37 | void show_regs(struct pt_regs *regs) | 38 | void show_regs(struct pt_regs *regs) |
| 38 | { | 39 | { |
diff --git a/arch/sh/kernel/sh_ksyms_64.c b/arch/sh/kernel/sh_ksyms_64.c index 45afa5c51f67..26a0774f5272 100644 --- a/arch/sh/kernel/sh_ksyms_64.c +++ b/arch/sh/kernel/sh_ksyms_64.c | |||
| @@ -32,8 +32,6 @@ EXPORT_SYMBOL(__get_user_asm_b); | |||
| 32 | EXPORT_SYMBOL(__get_user_asm_w); | 32 | EXPORT_SYMBOL(__get_user_asm_w); |
| 33 | EXPORT_SYMBOL(__get_user_asm_l); | 33 | EXPORT_SYMBOL(__get_user_asm_l); |
| 34 | EXPORT_SYMBOL(__get_user_asm_q); | 34 | EXPORT_SYMBOL(__get_user_asm_q); |
| 35 | EXPORT_SYMBOL(__strnlen_user); | ||
| 36 | EXPORT_SYMBOL(__strncpy_from_user); | ||
| 37 | EXPORT_SYMBOL(__clear_user); | 35 | EXPORT_SYMBOL(__clear_user); |
| 38 | EXPORT_SYMBOL(copy_page); | 36 | EXPORT_SYMBOL(copy_page); |
| 39 | EXPORT_SYMBOL(__copy_user); | 37 | EXPORT_SYMBOL(__copy_user); |
