20 Jul, 2015

1 commit

  • Migrate avr32 driver to the new 'set-state' interface provided by
    clockevents core, the earlier 'set-mode' interface is marked obsolete
    now.

    This also enables us to implement callbacks for new states of clockevent
    devices, for example: ONESHOT_STOPPED.

    We want to call cpu_idle_poll_ctrl() in shutdown only if we were in
    oneshot or resume state earlier. Create another variable to save this
    information and check that in shutdown callback.

    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Signed-off-by: Viresh Kumar
    Acked-by: Hans-Christian Egtvedt

    Viresh Kumar
     

13 Apr, 2015

1 commit


13 Feb, 2015

1 commit

  • If an attacker can cause a controlled kernel stack overflow, overwriting
    the restart block is a very juicy exploit target. This is because the
    restart_block is held in the same memory allocation as the kernel stack.

    Moving the restart block to struct task_struct prevents this exploit by
    making the restart_block harder to locate.

    Note that there are other fields in thread_info that are also easy
    targets, at least on some architectures.

    It's also a decent simplification, since the restart code is more or less
    identical on all architectures.

    [james.hogan@imgtec.com: metag: align thread_info::supervisor_stack]
    Signed-off-by: Andy Lutomirski
    Cc: Thomas Gleixner
    Cc: Al Viro
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Kees Cook
    Cc: David Miller
    Acked-by: Richard Weinberger
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Steven Miao
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: David Howells
    Cc: Richard Kuo
    Cc: "Luck, Tony"
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Jonas Bonn
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Acked-by: Michael Ellerman (powerpc)
    Tested-by: Michael Ellerman (powerpc)
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Chen Liqin
    Cc: Lennox Wu
    Cc: Chris Metcalf
    Cc: Guan Xuetao
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: Oleg Nesterov
    Cc: Guenter Roeck
    Signed-off-by: James Hogan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Lutomirski
     

09 Feb, 2015

1 commit

  • This patch adds a bunch of missing syscalls to AVR32:
    __NR_pread64
    __NR_pwrite64
    __NR_timerfd_create
    __NR_fallocate
    __NR_timerfd_settime
    __NR_timerfd_gettime
    __NR_signalfd4
    __NR_eventfd2
    __NR_epoll_create1
    __NR_dup3
    __NR_pipe2
    __NR_inotify_init1
    __NR_preadv
    __NR_pwritev
    __NR_rt_tgsigqueueinfo
    __NR_perf_event_open
    __NR_recvmmsg
    __NR_fanotify_init
    __NR_fanotify_mark
    __NR_prlimit64
    __NR_name_to_handle_at
    __NR_open_by_handle_at
    __NR_clock_adjtime
    __NR_syncfs
    __NR_sendmmsg
    __NR_process_vm_readv
    __NR_process_vm_writev
    __NR_kcmp
    __NR_finit_module
    __NR_sched_setattr
    __NR_sched_getattr
    __NR_renameat2
    __NR_seccomp
    __NR_getrandom
    __NR_memfd_create
    __NR_bpf
    __NR_execveat

    On AVR32, all parameters beyond the 5th are passed on the stack. System
    calls don't use the stack -- they borrow a callee-saved register
    instead. This means that syscalls that take 6 parameters must be called
    through a stub that pushes the last parameter on the stack.

    This relates to syscall fallocate, fanotify_mark, process_vm_readv, and
    process_vm_writev.

    Signed-off-by: Hans-Christian Egtvedt

    Hans-Christian Egtvedt
     

20 Jan, 2015

1 commit

  • Archs have been abusing module_free() to clean up their arch-specific
    allocations. Since module_free() is also (ab)used by BPF and trace code,
    let's keep it to simple allocations, and provide a hook called before
    that.

    This means that avr32, ia64, parisc and s390 no longer need to implement
    their own module_free() at all. avr32 doesn't need module_finalize()
    either.

    Signed-off-by: Rusty Russell
    Cc: Chris Metcalf
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-s390@vger.kernel.org

    Rusty Russell
     

27 Aug, 2014

1 commit


06 Aug, 2014

2 commits


01 Apr, 2014

1 commit


10 Dec, 2013

1 commit


20 Nov, 2013

2 commits

  • This patch fixes following error (for big kernels):

    ---88---

    It comes up when the kernel increases and 'panic()' is too far away to fit in
    the +/- 2MiB range. Which in turn issues from the 21-bit displacement in
    'br{cond4}' mnemonic which is one of the two ways to do jumps (rjmp has just
    10-bit displacement and therefore a way smaller range). This fact was stated
    before in 8d29b7b9f81d6b83d869ff054e6c189d6da73f1f.
    One solution to solve this is to add a local storage for the symbol address
    and just load the $pc with that value.

    Signed-off-by: Andreas Bießmann
    Acked-by: Hans-Christian Egtvedt
    Cc: Haavard Skinnemoen
    Cc: stable@vger.kernel.org

    Andreas Bießmann
     
  • Before the CRT was (fully) set up in kernel_entry (bss cleared before in
    _start, but also not before jump to panic() in no_tag_table case).

    This patch fixes this up to have a fully working CRT when branching to panic()
    in no_tag_table.

    Signed-off-by: Andreas Bießmann
    Acked-by: Hans-Christian Egtvedt
    Cc: Haavard Skinnemoen
    Cc: stable@vger.kernel.org

    Andreas Bießmann
     

30 Sep, 2013

2 commits

  • The patch fixes the following compiler warning:
    CC arch/avr32/kernel/process.o
    arch/avr32/kernel/process.c: In function 'copy_thread':
    arch/avr32/kernel/process.c:292: warning: assignment makes integer \
    from pointer without a cast

    Signed-off-by: Gabor Juhos
    Acked-by: Hans-Christian Egtvedt

    Gabor Juhos
     
  • Since commit 01426478df3a8791ff5c8b6b82d409e699cfaf38
    (avr32: Use generic idle loop) the kernel throws the
    following warning on avr32:

    WARNING: at 900322e4 [verbose debug info unavailable]
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0-rc2 #117
    task: 901c3ecc ti: 901c0000 task.ti: 901c0000
    PC is at cpu_idle_poll_ctrl+0x1c/0x38
    LR is at comparator_mode+0x3e/0x40
    pc : [] lr : [] Not tainted
    sp : 901c1f74 r12: 00000000 r11: 901c74a0
    r10: 901d2510 r9 : 00000001 r8 : 901db4de
    r7 : 901c74a0 r6 : 00000001 r5 : 00410020 r4 : 901db574
    r3 : 00410024 r2 : 90206fe0 r1 : 00000000 r0 : 007f0000
    Flags: qvnzc
    Mode bits: hjmde....G
    CPU Mode: Supervisor
    Call trace:
    [] clockevents_set_mode+0x16/0x2e
    [] clockevents_shutdown+0xa/0x1e
    [] clockevents_exchange_device+0x58/0x70
    [] tick_check_new_device+0x38/0x54
    [] clockevents_register_device+0x32/0x90
    [] time_init+0xa8/0x108
    [] start_kernel+0x128/0x23c

    When the 'avr32_comparator' clockevent device is registered,
    the clockevent core sets the mode of that clockevent device
    to CLOCK_EVT_MODE_SHUTDOWN. Due to this, the 'comparator_mode'
    function calls the 'cpu_idle_poll_ctrl' to disables idle poll.
    This results in the aforementioned warning because the polling
    is not enabled yet.

    Change the code to only disable idle poll if it is enabled by
    the same function to avoid the warning.

    Cc: stable@vger.kernel.org
    Signed-off-by: Gabor Juhos
    Acked-by: Hans-Christian Egtvedt

    Gabor Juhos
     

04 Jul, 2013

1 commit

  • Normalize global variables exported by vmlinux.lds to conform usage
    guidelines from include/asm-generic/sections.h.

    Use _text to mark the start of the kernel image including the head text,
    and _stext to mark the start of the .text section.

    Signed-off-by: Jiang Liu
    Acked-by: Hans-Christian Egtvedt
    Cc: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     

19 Jun, 2013

1 commit

  • Most of the stuff from kernel/sched.c was moved to kernel/sched/core.c long time
    back and the comments/Documentation never got updated.

    I figured it out when I was going through sched-domains.txt and so thought of
    fixing it globally.

    I haven't crossed check if the stuff that is referenced in sched/core.c by all
    these files is still present and hasn't changed as that wasn't the motive behind
    this patch.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/cdff76a265326ab8d71922a1db5be599f20aad45.1370329560.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar
     

14 May, 2013

1 commit


01 May, 2013

2 commits

  • show_regs() is inherently arch-dependent but it does make sense to print
    generic debug information and some archs already do albeit in slightly
    different forms. This patch introduces a generic function to print debug
    information from show_regs() so that different archs print out the same
    information and it's much easier to modify what's printed.

    show_regs_print_info() prints out the same debug info as dump_stack()
    does plus task and thread_info pointers.

    * Archs which didn't print debug info now do.

    alpha, arc, blackfin, c6x, cris, frv, h8300, hexagon, ia64, m32r,
    metag, microblaze, mn10300, openrisc, parisc, score, sh64, sparc,
    um, xtensa

    * Already prints debug info. Replaced with show_regs_print_info().
    The printed information is superset of what used to be there.

    arm, arm64, avr32, mips, powerpc, sh32, tile, unicore32, x86

    * s390 is special in that it used to print arch-specific information
    along with generic debug info. Heiko and Martin think that the
    arch-specific extra isn't worth keeping s390 specfic implementation.
    Converted to use the generic version.

    Note that now all archs print the debug info before actual register
    dumps.

    An example BUG() dump follows.

    kernel BUG at /work/os/work/kernel/workqueue.c:4841!
    invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #7
    Hardware name: empty empty/S3992, BIOS 080011 10/26/2007
    task: ffff88007c85e040 ti: ffff88007c860000 task.ti: ffff88007c860000
    RIP: 0010:[] [] init_workqueues+0x4/0x6
    RSP: 0000:ffff88007c861ec8 EFLAGS: 00010246
    RAX: ffff88007c861fd8 RBX: ffffffff824466a8 RCX: 0000000000000001
    RDX: 0000000000000046 RSI: 0000000000000001 RDI: ffffffff8234a07a
    RBP: ffff88007c861ec8 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8234a07a
    R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    FS: 0000000000000000(0000) GS:ffff88007dc00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: ffff88015f7ff000 CR3: 00000000021f1000 CR4: 00000000000007f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Stack:
    ffff88007c861ef8 ffffffff81000312 ffffffff824466a8 ffff88007c85e650
    0000000000000003 0000000000000000 ffff88007c861f38 ffffffff82335e5d
    ffff88007c862080 ffffffff8223d8c0 ffff88007c862080 ffffffff81c47760
    Call Trace:
    [] do_one_initcall+0x122/0x170
    [] kernel_init_freeable+0x9b/0x1c8
    [] ? rest_init+0x140/0x140
    [] kernel_init+0xe/0xf0
    [] ret_from_fork+0x7c/0xb0
    [] ? rest_init+0x140/0x140
    ...

    v2: Typo fix in x86-32.

    v3: CPU number dropped from show_regs_print_info() as
    dump_stack_print_info() has been updated to print it. s390
    specific implementation dropped as requested by s390 maintainers.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Acked-by: Jesper Nilsson
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Bjorn Helgaas
    Cc: Fengguang Wu
    Cc: Mike Frysinger
    Cc: Vineet Gupta
    Cc: Sam Ravnborg
    Acked-by: Chris Metcalf [tile bits]
    Acked-by: Richard Kuo [hexagon bits]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Both dump_stack() and show_stack() are currently implemented by each
    architecture. show_stack(NULL, NULL) dumps the backtrace for the
    current task as does dump_stack(). On some archs, dump_stack() prints
    extra information - pid, utsname and so on - in addition to the
    backtrace while the two are identical on other archs.

    The usages in arch-independent code of the two functions indicate
    show_stack(NULL, NULL) should print out bare backtrace while
    dump_stack() is used for debugging purposes when something went wrong,
    so it does make sense to print additional information on the task which
    triggered dump_stack().

    There's no reason to require archs to implement two separate but mostly
    identical functions. It leads to unnecessary subtle information.

    This patch expands the dummy fallback dump_stack() implementation in
    lib/dump_stack.c such that it prints out debug information (taken from
    x86) and invokes show_stack(NULL, NULL) and drops arch-specific
    dump_stack() implementations in all archs except blackfin. Blackfin's
    dump_stack() does something wonky that I don't understand.

    Debug information can be printed separately by calling
    dump_stack_print_info() so that arch-specific dump_stack()
    implementation can still emit the same debug information. This is used
    in blackfin.

    This patch brings the following behavior changes.

    * On some archs, an extra level in backtrace for show_stack() could be
    printed. This is because the top frame was determined in
    dump_stack() on those archs while generic dump_stack() can't do that
    reliably. It can be compensated by inlining dump_stack() but not
    sure whether that'd be necessary.

    * Most archs didn't use to print debug info on dump_stack(). They do
    now.

    An example WARN dump follows.

    WARNING: at kernel/workqueue.c:4841 init_workqueues+0x35/0x505()
    Hardware name: empty
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #9
    0000000000000009 ffff88007c861e08 ffffffff81c614dc ffff88007c861e48
    ffffffff8108f50f ffffffff82228240 0000000000000040 ffffffff8234a03c
    0000000000000000 0000000000000000 0000000000000000 ffff88007c861e58
    Call Trace:
    [] dump_stack+0x19/0x1b
    [] warn_slowpath_common+0x7f/0xc0
    [] warn_slowpath_null+0x1a/0x20
    [] init_workqueues+0x35/0x505
    ...

    v2: CPU number added to the generic debug info as requested by s390
    folks and dropped the s390 specific dump_stack(). This loses %ksp
    from the debug message which the maintainers think isn't important
    enough to keep the s390-specific dump_stack() implementation.

    dump_stack_print_info() is moved to kernel/printk.c from
    lib/dump_stack.c. Because linkage is per objecct file,
    dump_stack_print_info() living in the same lib file as generic
    dump_stack() means that archs which implement custom dump_stack()
    - at this point, only blackfin - can't use dump_stack_print_info()
    as that will bring in the generic version of dump_stack() too. v1
    The v1 patch broke build on blackfin due to this issue. The build
    breakage was reported by Fengguang Wu.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Acked-by: Vineet Gupta
    Acked-by: Jesper Nilsson
    Acked-by: Vineet Gupta
    Acked-by: Martin Schwidefsky [s390 bits]
    Cc: Heiko Carstens
    Cc: Mike Frysinger
    Cc: Fengguang Wu
    Cc: Bjorn Helgaas
    Cc: Sam Ravnborg
    Acked-by: Richard Kuo [hexagon bits]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

08 Apr, 2013

1 commit

  • Also replace the idle poll enforcement by the generic functionality.

    Signed-off-by: Thomas Gleixner
    Cc: Linus Torvalds
    Cc: Rusty Russell
    Cc: Paul McKenney
    Cc: Peter Zijlstra
    Reviewed-by: Cc: Srivatsa S. Bhat
    Cc: Magnus Damm
    Cc: Hans-Christian Egtvedt
    Link: http://lkml.kernel.org/r/20130321215233.950290809@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

26 Feb, 2013

1 commit

  • Pull module update from Rusty Russell:
    "The sweeping change is to make add_taint() explicitly indicate whether
    to disable lockdep, but it's a mechanical change."

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    MODSIGN: Add option to not sign modules during modules_install
    MODSIGN: Add -s option to sign-file
    MODSIGN: Specify the hash algorithm on sign-file command line
    MODSIGN: Simplify Makefile with a Kconfig helper
    module: clean up load_module a little more.
    modpost: Ignore ARC specific non-alloc sections
    module: constify within_module_*
    taint: add explicit flag to show whether lock dep is still OK.
    module: printk message when module signature fail taints kernel.

    Linus Torvalds
     

04 Feb, 2013

1 commit


21 Jan, 2013

1 commit


29 Nov, 2012

2 commits


15 Oct, 2012

2 commits


13 Oct, 2012

1 commit

  • getname() is intended to copy pathname strings from userspace into a
    kernel buffer. The result is just a string in kernel space. It would
    however be quite helpful to be able to attach some ancillary info to
    the string.

    For instance, we could attach some audit-related info to reduce the
    amount of audit-related processing needed. When auditing is enabled,
    we could also call getname() on the string more than once and not
    need to recopy it from userspace.

    This patchset converts the getname()/putname() interfaces to return
    a struct instead of a string. For now, the struct just tracks the
    string in kernel space and the original userland pointer for it.

    Later, we'll add other information to the struct as it becomes
    convenient.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton
     

01 Oct, 2012

1 commit


05 Jun, 2012

1 commit


02 Jun, 2012

6 commits


24 May, 2012

2 commits


22 May, 2012

2 commits