Commit Graph

16171 Commits

Author SHA1 Message Date
Tom Marshall 672c40a112 kernel: Only expose su when daemon is running
It has been claimed that the PG implementation of 'su' has security
vulnerabilities even when disabled.  Unfortunately, the people that
find these vulnerabilities often like to keep them private so they
can profit from exploits while leaving users exposed to malicious
hackers.

In order to reduce the attack surface for vulnerabilites, it is
therefore necessary to make 'su' completely inaccessible when it
is not in use (except by the root and system users).

Change-Id: I79716c72f74d0b7af34ec3a8054896c6559a181d
2018-05-03 18:44:36 +02:00
Stricted 9afc0d8b26 fix compilation after merge 2018-03-21 23:40:56 +01:00
Stricted bdecc6d184 Merge tag 'v3.10.108' into update
This is the 3.10.108 stable release
2018-03-21 23:07:40 +01:00
Stricted 073b9047a0 Merge tag 'v3.10.107' into update
This is the 3.10.107 stable release
2018-03-21 23:07:35 +01:00
Stricted 47e5ca72da Merge tag 'v3.10.106' into update
This is the 3.10.106 stable release
2018-03-21 23:06:23 +01:00
Stricted ad957d335c Merge tag 'v3.10.105' into update
This is the 3.10.105 stable release
2018-03-21 23:00:38 +01:00
Stricted b9e7bc93d6 Merge tag 'v3.10.103' into update
This is the 3.10.103 stable release
2018-03-21 22:58:21 +01:00
Stricted a8732f92e3 Merge tag 'v3.10.102' into update
This is the 3.10.102 stable release
2018-03-21 22:54:09 +01:00
Stricted 9aae3dad3d Merge tag 'v3.10.101' into update
This is the 3.10.101 stable release
2018-03-21 22:52:41 +01:00
Stricted d09f889ac9 Merge tag 'v3.10.99' into update
This is the 3.10.99 stable release
2018-03-21 22:51:42 +01:00
Stricted 647f2da1e2 Merge tag 'v3.10.98' into update
This is the 3.10.98 stable release
2018-03-21 22:51:37 +01:00
Stricted dd388bd4cd Merge tag 'v3.10.97' into update
This is the 3.10.97 stable release
2018-03-21 22:51:04 +01:00
Stricted 3884fb9807 Merge tag 'v3.10.93' into update
This is the 3.10.93 stable release
2018-03-21 22:49:39 +01:00
Stricted 4511a4e21f Merge tag 'v3.10.92' into update
This is the 3.10.92 stable release
2018-03-21 22:49:35 +01:00
Stricted d50b84c473 Merge tag 'v3.10.91' into update
This is the 3.10.91 stable release
2018-03-21 22:48:36 +01:00
Stricted 8441062777 Merge tag 'v3.10.90' into update
This is the 3.10.90 stable release
2018-03-21 22:47:31 +01:00
Stricted 97a3fbdc30 Merge tag 'v3.10.88' into update
This is the 3.10.88 stable release
2018-03-21 22:47:25 +01:00
Stricted 3460ea59c6 Merge tag 'v3.10.87' into update
This is the 3.10.87 stable release
2018-03-21 22:47:22 +01:00
Stricted 45f8c76c71 Merge tag 'v3.10.86' into update
This is the 3.10.86 stable release
2018-03-21 22:47:17 +01:00
Stricted 38b8911896 Merge tag 'v3.10.85' into update
This is the 3.10.85 stable release
2018-03-21 22:46:39 +01:00
Stricted 81575b8770 Merge tag 'v3.10.83' into update
This is the 3.10.83 stable release
2018-03-21 22:46:32 +01:00
Stricted 241abbf30d Merge tag 'v3.10.82' into update
This is the 3.10.82 stable release
2018-03-21 22:45:38 +01:00
Stricted eabf5dacf4 Merge tag 'v3.10.81' into update
This is the 3.10.81 stable release
2018-03-21 22:45:35 +01:00
Stricted 705e3c2e81 Merge tag 'v3.10.79' into update
This is the 3.10.79 stable release
2018-03-21 22:44:42 +01:00
Stricted 9b13083065 Merge tag 'v3.10.77' into update
This is the 3.10.77 stable release
2018-03-21 22:44:34 +01:00
Stricted 85511b9d61 Merge tag 'v3.10.76' into update
This is the 3.10.76 stable release
2018-03-21 22:42:30 +01:00
Stricted 446a42c9b2 Merge tag 'v3.10.75' into update
This is the 3.10.75 stable release
2018-03-21 22:41:10 +01:00
Stricted 4a7de1f3d4 Merge tag 'v3.10.74' into update
This is the 3.10.74 stable release
2018-03-21 22:41:07 +01:00
Stricted eff333fa3b Merge tag 'v3.10.73' into update
This is the 3.10.73 stable release
2018-03-21 22:41:03 +01:00
Stricted aba762bde4 Merge tag 'v3.10.72' into update
This is the 3.10.72 stable release
2018-03-21 22:40:54 +01:00
Stricted 5d8d08710c Merge tag 'v3.10.71' into update
This is the 3.10.71 stable release
2018-03-21 22:40:50 +01:00
Stricted 4a2455f795 Merge tag 'v3.10.69' into update
This is the 3.10.69 stable release
2018-03-21 22:39:46 +01:00
Stricted 875966bda8 Merge tag 'v3.10.68' into update
This is the 3.10.68 stable release
2018-03-21 22:38:24 +01:00
Stricted b2d402e5a4 Merge tag 'v3.10.67' into update
This is the 3.10.67 stable release
2018-03-21 22:36:30 +01:00
Stricted 90cb50b720 Merge tag 'v3.10.65' into update
This is the 3.10.65 stable release
2018-03-21 22:36:23 +01:00
Stricted d242a5721c Merge tag 'v3.10.64' into update
This is the 3.10.64 stable release
2018-03-21 22:33:51 +01:00
Stricted 620f7405fd Merge tag 'v3.10.62' into update
This is the 3.10.62 stable release
2018-03-21 22:31:45 +01:00
Stricted 7887027a47 Merge tag 'v3.10.61' into update
This is the 3.10.61 stable release
2018-03-21 22:31:40 +01:00
Stricted 6f56b75961 Merge tag 'v3.10.60' into update
This is the 3.10.60 stable release
2018-03-21 22:31:34 +01:00
Stricted f5aa73ff5c Merge tag 'v3.10.57' into update
This is the 3.10.57 stable release
2018-03-21 22:28:46 +01:00
Stricted f29ec40f35 Merge tag 'v3.10.56' into update
This is the 3.10.56 stable release
2018-03-21 22:24:54 +01:00
Stricted b435043299 Merge tag 'v3.10.55' into update
This is the 3.10.55 stable release
2018-03-21 22:13:57 +01:00
Stricted 4b9e97964e import PULS_20180308 2018-03-13 20:30:12 +01:00
Stricted 6fa3eb70c0 import PULS_20160108 2018-03-13 20:29:02 +01:00
Bo Yan 7210062e8f tracing: Erase irqsoff trace with empty write
commit 8dd33bcb7050dd6f8c1432732f930932c9d3a33e upstream.

One convenient way to erase trace is "echo > trace". However, this
is currently broken if the current tracer is irqsoff tracer. This
is because irqsoff tracer use max_buffer as the default trace
buffer.

Set the max_buffer as the one to be cleared when it's the trace
buffer currently in use.

Link: http://lkml.kernel.org/r/1505754215-29411-1-git-send-email-byan@nvidia.com

Cc: <mingo@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 4acd4d00f ("tracing: give easy way to clear trace buffer")
Signed-off-by: Bo Yan <byan@nvidia.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-02 10:46:01 +01:00
Baohong Liu ec8c69ea45 tracing: Apply trace_clock changes to instance max buffer
commit 170b3b1050e28d1ba0700e262f0899ffa4fccc52 upstream.

Currently trace_clock timestamps are applied to both regular and max
buffers only for global trace. For instance trace, trace_clock
timestamps are applied only to regular buffer. But, regular and max
buffers can be swapped, for example, following a snapshot. So, for
instance trace, bad timestamps can be seen following a snapshot.
Let's apply trace_clock timestamps to instance max buffer as well.

Link: http://lkml.kernel.org/r/ebdb168d0be042dcdf51f81e696b17fabe3609c1.1504642143.git.tom.zanussi@linux.intel.com

Cc: stable@vger.kernel.org
Fixes: 277ba0446 ("tracing: Add interface to allow multiple trace buffers")
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-02 10:46:01 +01:00
Tejun Heo 162f50e691 workqueue: implicit ordered attribute should be overridable
commit 0a94efb5acbb6980d7c9ab604372d93cd507e4d8 upstream.

5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be
ordered") automatically enabled ordered attribute for unbound
workqueues w/ max_active == 1.  Because ordered workqueues reject
max_active and some attribute changes, this implicit ordered mode
broke cases where the user creates an unbound workqueue w/ max_active
== 1 and later explicitly changes the related attributes.

This patch distinguishes explicit and implicit ordered setting and
overrides from attribute changes if implict.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered")
Cc: Holger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-02 10:45:58 +01:00
Marcin Nowakowski 7af6952b18 kernel/extable.c: mark core_kernel_text notrace
commit c0d80ddab89916273cb97114889d3f337bc370ae upstream.

core_kernel_text is used by MIPS in its function graph trace processing,
so having this method traced leads to an infinite set of recursive calls
such as:

  Call Trace:
     ftrace_return_to_handler+0x50/0x128
     core_kernel_text+0x10/0x1b8
     prepare_ftrace_return+0x6c/0x114
     ftrace_graph_caller+0x20/0x44
     return_to_handler+0x10/0x30
     return_to_handler+0x0/0x30
     return_to_handler+0x0/0x30
     ftrace_ops_no_ops+0x114/0x1bc
     core_kernel_text+0x10/0x1b8
     core_kernel_text+0x10/0x1b8
     core_kernel_text+0x10/0x1b8
     ftrace_ops_no_ops+0x114/0x1bc
     core_kernel_text+0x10/0x1b8
     prepare_ftrace_return+0x6c/0x114
     ftrace_graph_caller+0x20/0x44
     (...)

Mark the function notrace to avoid it being traced.

Link: http://lkml.kernel.org/r/1498028607-6765-1-git-send-email-marcin.nowakowski@imgtec.com
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Meyer <thomas@m3y3r.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-02 07:16:20 +01:00
Tejun Heo ae49cb71c5 workqueue: restore WQ_UNBOUND/max_active==1 to be ordered
commit 5c0338c68706be53b3dc472e4308961c36e4ece1 upstream.

The combination of WQ_UNBOUND and max_active == 1 used to imply
ordered execution.  After NUMA affinity 4c16bd327c ("workqueue:
implement NUMA affinity for unbound workqueues"), this is no longer
true due to per-node worker pools.

While the right way to create an ordered workqueue is
alloc_ordered_workqueue(), the documentation has been misleading for a
long time and people do use WQ_UNBOUND and max_active == 1 for ordered
workqueues which can lead to subtle bugs which are very difficult to
trigger.

It's unlikely that we'd see noticeable performance impact by enforcing
ordering on WQ_UNBOUND / max_active == 1 workqueues.  Let's
automatically set __WQ_ORDERED for those workqueues.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Christoph Hellwig <hch@infradead.org>
Reported-by: Alexei Potashnik <alexei@purestorage.com>
Fixes: 4c16bd327c ("workqueue: implement NUMA affinity for unbound workqueues")
Cc: stable@vger.kernel.org # v3.10+
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-01 22:12:44 +01:00
Sergey Senozhatsky d46354fc25 printk: use rcuidle console tracepoint
commit fc98c3c8c9dcafd67adcce69e6ce3191d5306c9c upstream.

Use rcuidle console tracepoint because, apparently, it may be issued
from an idle CPU:

  hw-breakpoint: Failed to enable monitor mode on CPU 0.
  hw-breakpoint: CPU 0 failed to disable vector catch

  ===============================
  [ ERR: suspicious RCU usage.  ]
  4.10.0-rc8-next-20170215+ #119 Not tainted
  -------------------------------
  ./include/trace/events/printk.h:32 suspicious rcu_dereference_check() usage!

  other info that might help us debug this:

  RCU used illegally from idle CPU!
  rcu_scheduler_active = 2, debug_locks = 0
  RCU used illegally from extended quiescent state!
  2 locks held by swapper/0/0:
   #0:  (cpu_pm_notifier_lock){......}, at: [<c0237e2c>] cpu_pm_exit+0x10/0x54
   #1:  (console_lock){+.+.+.}, at: [<c01ab350>] vprintk_emit+0x264/0x474

  stack backtrace:
  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc8-next-20170215+ #119
  Hardware name: Generic OMAP4 (Flattened Device Tree)
    console_unlock
    vprintk_emit
    vprintk_default
    printk
    reset_ctrl_regs
    dbg_cpu_pm_notify
    notifier_call_chain
    cpu_pm_exit
    omap_enter_idle_coupled
    cpuidle_enter_state
    cpuidle_enter_state_coupled
    do_idle
    cpu_startup_entry
    start_kernel

This RCU warning, however, is suppressed by lockdep_off() in printk().
lockdep_off() increments the ->lockdep_recursion counter and thus
disables RCU_LOCKDEP_WARN() and debug_lockdep_rcu_enabled(), which want
lockdep to be enabled "current->lockdep_recursion == 0".

Link: http://lkml.kernel.org/r/20170217015932.11898-1-sergey.senozhatsky@gmail.com
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Russell King <rmk@armlinux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wt: changes are in kernel/printk.c in 3.10]
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-06-20 14:04:54 +02:00