1. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  2. 29 6月, 2017 1 次提交
  3. 02 3月, 2017 3 次提交
  4. 26 1月, 2017 1 次提交
  5. 25 12月, 2016 1 次提交
  6. 23 11月, 2016 1 次提交
    • E
      ptrace: Don't allow accessing an undumpable mm · 84d77d3f
      Eric W. Biederman 提交于
      It is the reasonable expectation that if an executable file is not
      readable there will be no way for a user without special privileges to
      read the file.  This is enforced in ptrace_attach but if ptrace
      is already attached before exec there is no enforcement for read-only
      executables.
      
      As the only way to read such an mm is through access_process_vm
      spin a variant called ptrace_access_vm that will fail if the
      target process is not being ptraced by the current process, or
      the current process did not have sufficient privileges when ptracing
      began to read the target processes mm.
      
      In the ptrace implementations replace access_process_vm by
      ptrace_access_vm.  There remain several ptrace sites that still use
      access_process_vm as they are reading the target executables
      instructions (for kernel consumption) or register stacks.  As such it
      does not appear necessary to add a permission check to those calls.
      
      This bug has always existed in Linux.
      
      Fixes: v1.0
      Cc: stable@vger.kernel.org
      Reported-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      84d77d3f
  7. 19 10月, 2016 1 次提交
  8. 22 9月, 2016 2 次提交
  9. 21 5月, 2016 1 次提交
    • J
      exit_thread: accept a task parameter to be exited · e6464694
      Jiri Slaby 提交于
      We need to call exit_thread from copy_process in a fail path.  So make it
      accept task_struct as a parameter.
      
      [v2]
      * s390: exit_thread_runtime_instr doesn't make sense to be called for
        non-current tasks.
      * arm: fix the comment in vfp_thread_copy
      * change 'me' to 'tsk' for task_struct
      * now we can change only archs that actually have exit_thread
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chen Liqin <liqin.linux@gmail.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e6464694
  10. 15 12月, 2015 1 次提交
    • G
      cris: Fix section mismatches in architecture startup code · f9f3f864
      Guenter Roeck 提交于
      Section mismatches can now result in build failures.
      As result, cris:allnoconfig fails to build as follows.
      
      WARNING: modpost: Found 7 section mismatch(es).
      To see full details build your kernel with:
      'make CONFIG_DEBUG_SECTION_MISMATCH=y'
      FATAL: modpost: Section mismatches detected.
      Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
      
      Part of the problem is that references from .text to .init.text
      are not permitted, and such references are used in cris startup code.
      Since references from .head.text to .init.text are permitted, move
      cris startup code to a new section .head.text.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      f9f3f864
  11. 03 11月, 2015 4 次提交
  12. 05 9月, 2015 4 次提交
  13. 10 8月, 2015 1 次提交
  14. 16 4月, 2015 2 次提交
  15. 13 4月, 2015 1 次提交
  16. 25 3月, 2015 8 次提交
    • R
      CRISv32: use GENERIC_SCHED_CLOCK · d3dad475
      Rabin Vincent 提交于
      Provide a fast sched clock using the free-running timer and the generic
      sched_clock infrastructure.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      d3dad475
    • R
      CRISv32: use MMIO clocksource · edfb6d5f
      Rabin Vincent 提交于
      Use a generic MMIO clocksource and get rid of some lines of code.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      edfb6d5f
    • R
      CRISv32: use generic clockevents · ed9fd3ff
      Rabin Vincent 提交于
      Implement a oneshot-capable clockevents device so we get support for
      things like hrtimers and NOHZ.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      ed9fd3ff
    • R
      CRIS: remove SMP code · 47a8f6fb
      Rabin Vincent 提交于
      The CRIS SMP code cannot be built since there is no (and appears to
      never have been) a CONFIG_SMP Kconfig option in arch/cris/.  Remove it.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      47a8f6fb
    • R
      CRISv32: handle multiple signals · 9a7449d3
      Rabin Vincent 提交于
      Al Viro noted that CRIS fails to handle multiple signals.
      
      This fixes the problem for CRISv32 by making it use a C work_pending
      handling loop similar to the ARM implementation in 0a267fa6
      ("ARM: 7472/1: pull all work_pending logics into C function").
      
      This also happens to fixes the warnings which currently trigger on
      CRISv32 due to do_signal() being called with interrupts disabled.
      
      Test case (should die of the SIGSEGV which gets raised when setting up
      the stack for SIGALRM, but instead reaches and executes the _exit(1)):
      
        #include <unistd.h>
        #include <signal.h>
        #include <sys/time.h>
        #include <err.h>
      
        static void handler(int sig) { }
      
        int main(int argc, char *argv[])
        {
        	int ret;
        	struct itimerval t1 = { .it_value = {1} };
        	stack_t ss = {
        		.ss_sp = NULL,
        		.ss_size = SIGSTKSZ,
        	};
        	struct sigaction action = {
        		.sa_handler = handler,
        		.sa_flags = SA_ONSTACK,
        	};
      
        	ret = sigaltstack(&ss, NULL);
        	if (ret < 0)
        		err(1, "sigaltstack");
      
        	sigaction(SIGALRM, &action, NULL);
         	setitimer(ITIMER_REAL, &t1, NULL);
      
        	pause();
      
        	_exit(1);
      
        	return 0;
        }
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Link: http://lkml.kernel.org/r/20121208074429.GC4939@ZenIV.linux.org.ukSigned-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      9a7449d3
    • R
      CRISv32: prevent bogus restarts on sigreturn · 0f72e5c0
      Rabin Vincent 提交于
      Al Viro noted that CRIS is vulnerable to bogus restarts on sigreturn.
      
      The fixes CRISv32 by using regs->exs as an additional indicator to
      whether we should attempt to restart the syscall or not.  EXS is only
      used in the sigtrap handling, and in that path we already have r9 (the
      other indicator, which indicates if we're in a syscall or not) cleared.
      
      Test case, a port of Al's ARM version from 653d48b2 ("arm: fix
      really nasty sigreturn bug"):
      
        #include <unistd.h>
        #include <signal.h>
        #include <stdlib.h>
        #include <sys/time.h>
        #include <errno.h>
      
        void f(int n)
        {
        	register int r10 asm ("r10") = n;
      
                __asm__ __volatile__(
        		"ba	1f	\n"
        		"nop		\n"
        		"break	8	\n"
        		"1: ba	.	\n"
        		"nop		\n"
        		:
        		: "r" (r10)
        		: "memory");
        }
      
        void handler1(int sig) { }
        void handler2(int sig) { raise(1); }
        void handler3(int sig) { exit(0); }
      
        int main(int argc, char *argv[])
        {
                struct sigaction s = {.sa_handler = handler2};
                struct itimerval t1 = { .it_value = {1} };
                struct itimerval t2 = { .it_value = {2} };
      
                signal(1, handler1);
      
                sigemptyset(&s.sa_mask);
                sigaddset(&s.sa_mask, 1);
                sigaction(SIGALRM, &s, NULL);
      
                signal(SIGVTALRM, handler3);
      
                setitimer(ITIMER_REAL, &t1, NULL);
                setitimer(ITIMER_VIRTUAL, &t2, NULL);
      
                f(-513); /* -ERESTARTNOINTR */
      
                return 0;
        }
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Link: http://lkml.kernel.org/r/20121208074429.GC4939@ZenIV.linux.org.ukSigned-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      0f72e5c0
    • R
      CRISv32: don't attempt syscall restart on irq exit · db4a35c6
      Rabin Vincent 提交于
      r9 is used to determine whether syscall restarting must be performed or
      not.  Unfortunately, r9 is never set to zero in the non-syscall path,
      and r9 is on top of that a callee-saved register which can be set to
      non-zero by the C functions that are called during IRQ handling.
      
      This means that if r10 (used for the syscall return value) is one of the
      -ERESTART* values when a hardware interrupt occurs which leads to a
      signal being delivered to the process, the kernel will "restart" a
      syscall which never occurred.  This will lead to the PC being moved back
      by 2 on return to user space.
      
      Fix the problem by setting r9 to zero in the interrupt path.
      
      Test case (should loop forever but ends up executing the break 8 trap
      instruction):
      
        #include <signal.h>
        #include <stdlib.h>
        #include <sys/time.h>
      
        void f(int n)
        {
        	register int r9 asm ("r9") = 1;
        	register int r10 asm ("r10") = n;
      
                __asm__ __volatile__(
        		"ba	1f	\n"
        		"nop		\n"
        		"break	8	\n"
        		"1: ba	.	\n"
        		"nop		\n"
        		:
        		: "r" (r9), "r" (r10)
        		: "memory");
        }
      
        void handler1(int sig) { }
      
        int main(int argc, char *argv[])
        {
                struct itimerval t1 = { .it_value = {1} };
      
                signal(SIGALRM, handler1);
                setitimer(ITIMER_REAL, &t1, NULL);
      
                f(-513); /* -ERESTARTNOINTR */
      
                return 0;
        }
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      db4a35c6
    • R
      CRISv32: add irq domains support · 43f7071e
      Rabin Vincent 提交于
      Add support for IRQ domains to the CRISv32 interrupt controller.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      43f7071e
  17. 13 2月, 2015 1 次提交
    • A
      all arches, signal: move restart_block to struct task_struct · f56141e3
      Andy Lutomirski 提交于
      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: NAndy Lutomirski <luto@amacapital.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: David Miller <davem@davemloft.net>
      Acked-by: NRichard Weinberger <richard@nod.at>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Chen Liqin <liqin.linux@gmail.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f56141e3
  18. 29 1月, 2015 1 次提交
  19. 20 12月, 2014 3 次提交
  20. 06 8月, 2014 2 次提交