Merge tag 'v3.10.103' into update
This is the 3.10.103 stable release
This commit is contained in:
+9
-4
@@ -2475,13 +2475,18 @@ static inline void kmemleak_load_module(const struct module *mod,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MODULE_SIG
|
||||
static int module_sig_check(struct load_info *info)
|
||||
static int module_sig_check(struct load_info *info, int flags)
|
||||
{
|
||||
int err = -ENOKEY;
|
||||
const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
|
||||
const void *mod = info->hdr;
|
||||
|
||||
if (info->len > markerlen &&
|
||||
/*
|
||||
* Require flags == 0, as a module with version information
|
||||
* removed is no longer the module that was signed
|
||||
*/
|
||||
if (flags == 0 &&
|
||||
info->len > markerlen &&
|
||||
memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
|
||||
/* We truncate the module to discard the signature */
|
||||
info->len -= markerlen;
|
||||
@@ -2503,7 +2508,7 @@ static int module_sig_check(struct load_info *info)
|
||||
return err;
|
||||
}
|
||||
#else /* !CONFIG_MODULE_SIG */
|
||||
static int module_sig_check(struct load_info *info)
|
||||
static int module_sig_check(struct load_info *info, int flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -3228,7 +3233,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
|
||||
struct module *mod;
|
||||
long err;
|
||||
|
||||
err = module_sig_check(info);
|
||||
err = module_sig_check(info, flags);
|
||||
if (err)
|
||||
goto free_copy;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <linux/sysrq.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/nmi.h>
|
||||
#include <linux/console.h>
|
||||
|
||||
#define PANIC_TIMER_STEP 100
|
||||
#define PANIC_BLINK_SPD 18
|
||||
@@ -134,6 +135,8 @@ void panic(const char *fmt, ...)
|
||||
|
||||
bust_spinlocks(0);
|
||||
|
||||
console_flush_on_panic();
|
||||
|
||||
if (!panic_blink)
|
||||
panic_blink = no_blink;
|
||||
|
||||
|
||||
+35
-1
@@ -2131,7 +2131,7 @@ void console_unlock(void)
|
||||
static u64 seen_seq;
|
||||
unsigned long flags;
|
||||
bool wake_klogd = false;
|
||||
bool retry;
|
||||
bool do_cond_resched, retry;
|
||||
#ifdef LOG_TOO_MUCH_WARNING
|
||||
unsigned long total_log_size = 0;
|
||||
unsigned long long t1 = 0, t2 = 0;
|
||||
@@ -2139,11 +2139,23 @@ void console_unlock(void)
|
||||
int org_loglevel = console_loglevel;
|
||||
#endif
|
||||
|
||||
|
||||
if (console_suspended) {
|
||||
up(&console_sem);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Console drivers are called under logbuf_lock, so
|
||||
* @console_may_schedule should be cleared before; however, we may
|
||||
* end up dumping a lot of lines, for example, if called from
|
||||
* console registration path, and should invoke cond_resched()
|
||||
* between lines if allowable. Not doing so can cause a very long
|
||||
* scheduling stall on a slow console leading to RCU stall and
|
||||
* softlockup warnings which exacerbate the issue with more
|
||||
* messages practically incapacitating the system.
|
||||
*/
|
||||
do_cond_resched = console_may_schedule;
|
||||
console_may_schedule = 0;
|
||||
|
||||
/* flush buffered message fragment immediately to console */
|
||||
@@ -2239,6 +2251,9 @@ skip:
|
||||
call_console_drivers(level, text, len);
|
||||
#endif
|
||||
local_irq_restore(flags);
|
||||
|
||||
if (do_cond_resched)
|
||||
cond_resched();
|
||||
}
|
||||
console_locked = 0;
|
||||
mutex_release(&console_lock_dep_map, 1, _RET_IP_);
|
||||
@@ -2307,6 +2322,25 @@ void console_unblank(void)
|
||||
console_unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
* console_flush_on_panic - flush console content on panic
|
||||
*
|
||||
* Immediately output all pending messages no matter what.
|
||||
*/
|
||||
void console_flush_on_panic(void)
|
||||
{
|
||||
/*
|
||||
* If someone else is holding the console lock, trylock will fail
|
||||
* and may_schedule may be set. Ignore and proceed to unlock so
|
||||
* that messages are flushed out. As this can be called from any
|
||||
* context and we don't want to get preempted while flushing,
|
||||
* ensure may_schedule is cleared.
|
||||
*/
|
||||
console_trylock();
|
||||
console_may_schedule = 0;
|
||||
console_unlock();
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the console tty driver structure and its associated index
|
||||
*/
|
||||
|
||||
+5
-9
@@ -3013,11 +3013,9 @@ static int do_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t *info)
|
||||
* Nor can they impersonate a kill()/tgkill(), which adds source info.
|
||||
*/
|
||||
if ((info->si_code >= 0 || info->si_code == SI_TKILL) &&
|
||||
(task_pid_vnr(current) != pid)) {
|
||||
/* We used to allow any < 0 si_code */
|
||||
WARN_ON_ONCE(info->si_code < 0);
|
||||
(task_pid_vnr(current) != pid))
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
info->si_signo = sig;
|
||||
|
||||
/* POSIX.1b doesn't mention process groups. */
|
||||
@@ -3062,12 +3060,10 @@ static int do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t *info)
|
||||
/* Not even root can pretend to send signals from the kernel.
|
||||
* Nor can they impersonate a kill()/tgkill(), which adds source info.
|
||||
*/
|
||||
if (((info->si_code >= 0 || info->si_code == SI_TKILL)) &&
|
||||
(task_pid_vnr(current) != pid)) {
|
||||
/* We used to allow any < 0 si_code */
|
||||
WARN_ON_ONCE(info->si_code < 0);
|
||||
if ((info->si_code >= 0 || info->si_code == SI_TKILL) &&
|
||||
(task_pid_vnr(current) != pid))
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
info->si_signo = sig;
|
||||
|
||||
return do_send_specific(tgid, pid, sig, info);
|
||||
|
||||
@@ -1649,6 +1649,20 @@ static struct ctl_table fs_table[] = {
|
||||
.proc_handler = &pipe_proc_fn,
|
||||
.extra1 = &pipe_min_size,
|
||||
},
|
||||
{
|
||||
.procname = "pipe-user-pages-hard",
|
||||
.data = &pipe_user_pages_hard,
|
||||
.maxlen = sizeof(pipe_user_pages_hard),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_doulongvec_minmax,
|
||||
},
|
||||
{
|
||||
.procname = "pipe-user-pages-soft",
|
||||
.data = &pipe_user_pages_soft,
|
||||
.maxlen = sizeof(pipe_user_pages_soft),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_doulongvec_minmax,
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -38,6 +38,10 @@ struct trace_bprintk_fmt {
|
||||
static inline struct trace_bprintk_fmt *lookup_format(const char *fmt)
|
||||
{
|
||||
struct trace_bprintk_fmt *pos;
|
||||
|
||||
if (!fmt)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
list_for_each_entry(pos, &trace_bprintk_fmt_list, list) {
|
||||
if (!strcmp(pos->fmt, fmt))
|
||||
return pos;
|
||||
@@ -59,7 +63,8 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
|
||||
for (iter = start; iter < end; iter++) {
|
||||
struct trace_bprintk_fmt *tb_fmt = lookup_format(*iter);
|
||||
if (tb_fmt) {
|
||||
*iter = tb_fmt->fmt;
|
||||
if (!IS_ERR(tb_fmt))
|
||||
*iter = tb_fmt->fmt;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user