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

Commit ad51271a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton:

- various misc things

- kexec updates

- sysctl core updates

- scripts/gdb udpates

- checkpoint-restart updates

- ipc updates

- kernel/watchdog updates

- Kees's "rough equivalent to the glibc _FORTIFY_SOURCE=1 feature"

- "stackprotector: ascii armor the stack canary"

- more MM bits

- checkpatch updates

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (96 commits)
  writeback: rework wb_[dec|inc]_stat family of functions
  ARM: samsung: usb-ohci: move inline before return type
  video: fbdev: omap: move inline before return type
  video: fbdev: intelfb: move inline before return type
  USB: serial: safe_serial: move __inline__ before return type
  drivers: tty: serial: move inline before return type
  drivers: s390: move static and inline before return type
  x86/efi: move asmlinkage before return type
  sh: move inline before return type
  MIPS: SMP: move asmlinkage before return type
  m68k: coldfire: move inline before return type
  ia64: sn: pci: move inline before type
  ia64: move inline before return type
  FRV: tlbflush: move asmlinkage before return type
  CRIS: gpio: move inline before return type
  ARM: HP Jornada 7XX: move inline before return type
  ARM: KVM: move asmlinkage before type
  checkpatch: improve the STORAGE_CLASS test
  mm, migration: do not trigger OOM killer when migrating memory
  drm/i915: use __GFP_RETRY_MAYFAIL
  ...
parents 6735a197 3e8f399d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ requirements you pass the flag GFP_DMA to kmalloc.

Unfortunately the memory available for ISA DMA is scarce so unless you
allocate the memory during boot-up it's a good idea to also pass
__GFP_REPEAT and __GFP_NOWARN to make the allocator try a bit harder.
__GFP_RETRY_MAYFAIL and __GFP_NOWARN to make the allocator try a bit harder.

(This scarcity also means that you should allocate the buffer as
early as possible and not release it until the driver is unloaded.)
+78 −0
Original line number Diff line number Diff line
@@ -134,6 +134,22 @@ use the boot option:
	fail_futex=
	mmc_core.fail_request=<interval>,<probability>,<space>,<times>

o proc entries

- /proc/self/task/<current-tid>/fail-nth:

	Write to this file of integer N makes N-th call in the current task fail
	(N is 0-based). Read from this file returns a single char 'Y' or 'N'
	that says if the fault setup with a previous write to this file was
	injected or not, and disables the fault if it wasn't yet injected.
	Note that this file enables all types of faults (slab, futex, etc).
	This setting takes precedence over all other generic debugfs settings
	like probability, interval, times, etc. But per-capability settings
	(e.g. fail_futex/ignore-private) take precedence over it.

	This feature is intended for systematic testing of faults in a single
	system call. See an example below.

How to add new fault injection capability
-----------------------------------------

@@ -278,3 +294,65 @@ allocation failure.
	# env FAILCMD_TYPE=fail_page_alloc \
		./tools/testing/fault-injection/failcmd.sh --times=100 \
                -- make -C tools/testing/selftests/ run_tests

Systematic faults using fail-nth
---------------------------------

The following code systematically faults 0-th, 1-st, 2-nd and so on
capabilities in the socketpair() system call.

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

int main()
{
	int i, err, res, fail_nth, fds[2];
	char buf[128];

	system("echo N > /sys/kernel/debug/failslab/ignore-gfp-wait");
	sprintf(buf, "/proc/self/task/%ld/fail-nth", syscall(SYS_gettid));
	fail_nth = open(buf, O_RDWR);
	for (i = 0;; i++) {
		sprintf(buf, "%d", i);
		write(fail_nth, buf, strlen(buf));
		res = socketpair(AF_LOCAL, SOCK_STREAM, 0, fds);
		err = errno;
		read(fail_nth, buf, 1);
		if (res == 0) {
			close(fds[0]);
			close(fds[1]);
		}
		printf("%d-th fault %c: res=%d/%d\n", i, buf[0], res, err);
		if (buf[0] != 'Y')
			break;
	}
	return 0;
}

An example output:

0-th fault Y: res=-1/23
1-th fault Y: res=-1/23
2-th fault Y: res=-1/23
3-th fault Y: res=-1/12
4-th fault Y: res=-1/12
5-th fault Y: res=-1/23
6-th fault Y: res=-1/23
7-th fault Y: res=-1/23
8-th fault Y: res=-1/12
9-th fault Y: res=-1/12
10-th fault Y: res=-1/12
11-th fault Y: res=-1/12
12-th fault Y: res=-1/12
13-th fault Y: res=-1/12
14-th fault Y: res=-1/12
15-th fault Y: res=-1/12
16-th fault N: res=0/12
+5 −1
Original line number Diff line number Diff line
@@ -1786,12 +1786,16 @@ pair provide additional information particular to the objects they represent.
	pos:	0
	flags:	02
	mnt_id:	9
	tfd:        5 events:       1d data: ffffffffffffffff
	tfd:        5 events:       1d data: ffffffffffffffff pos:0 ino:61af sdev:7

	where 'tfd' is a target file descriptor number in decimal form,
	'events' is events mask being watched and the 'data' is data
	associated with a target [see epoll(7) for more details].

	The 'pos' is current offset of the target file in decimal form
	[see lseek(2)], 'ino' and 'sdev' are inode and device numbers
	where target file resides, all in hex format.

	Fsnotify files
	~~~~~~~~~~~~~~
	For inotify files the format is the following
+9 −3
Original line number Diff line number Diff line
@@ -112,8 +112,8 @@ There are two possible methods of using Kdump.
2) Or use the system kernel binary itself as dump-capture kernel and there is
   no need to build a separate dump-capture kernel. This is possible
   only with the architectures which support a relocatable kernel. As
   of today, i386, x86_64, ppc64, ia64 and arm architectures support relocatable
   kernel.
   of today, i386, x86_64, ppc64, ia64, arm and arm64 architectures support
   relocatable kernel.

Building a relocatable kernel is advantageous from the point of view that
one does not have to build a second kernel for capturing the dump. But
@@ -339,7 +339,7 @@ For arm:
For arm64:
	- Use vmlinux or Image

If you are using a uncompressed vmlinux image then use following command
If you are using an uncompressed vmlinux image then use following command
to load dump-capture kernel.

   kexec -p <dump-capture-kernel-vmlinux-image> \
@@ -361,6 +361,12 @@ to load dump-capture kernel.
   --dtb=<dtb-for-dump-capture-kernel> \
   --append="root=<root-dev> <arch-specific-options>"

If you are using an uncompressed Image, then use following command
to load dump-capture kernel.

   kexec -p <dump-capture-kernel-Image> \
   --initrd=<initrd-for-dump-capture-kernel> \
   --append="root=<root-dev> <arch-specific-options>"

Please note, that --args-linux does not need to be specified for ia64.
It is planned to make this a no-op on that architecture, but for now
+28 −3
Original line number Diff line number Diff line
@@ -198,9 +198,6 @@ config HAVE_KPROBES_ON_FTRACE
config HAVE_NMI
	bool

config HAVE_NMI_WATCHDOG
	depends on HAVE_NMI
	bool
#
# An arch should select this if it provides all these things:
#
@@ -226,6 +223,12 @@ config GENERIC_SMP_IDLE_THREAD
config GENERIC_IDLE_POLL_SETUP
       bool

config ARCH_HAS_FORTIFY_SOURCE
	bool
	help
	  An architecture should select this when it can successfully
	  build and run with CONFIG_FORTIFY_SOURCE.

# Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
config ARCH_HAS_SET_MEMORY
	bool
@@ -288,6 +291,28 @@ config HAVE_PERF_EVENTS_NMI
	  subsystem.  Also has support for calculating CPU cycle events
	  to determine how many clock cycles in a given period.

config HAVE_HARDLOCKUP_DETECTOR_PERF
	bool
	depends on HAVE_PERF_EVENTS_NMI
	help
	  The arch chooses to use the generic perf-NMI-based hardlockup
	  detector. Must define HAVE_PERF_EVENTS_NMI.

config HAVE_NMI_WATCHDOG
	depends on HAVE_NMI
	bool
	help
	  The arch provides a low level NMI watchdog. It provides
	  asm/nmi.h, and defines its own arch_touch_nmi_watchdog().

config HAVE_HARDLOCKUP_DETECTOR_ARCH
	bool
	select HAVE_NMI_WATCHDOG
	help
	  The arch chooses to provide its own hardlockup detector, which is
	  a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
	  interfaces and parameters provided by hardlockup detector subsystem.

config HAVE_PERF_REGS
	bool
	help
Loading