lkml.org 
[lkml]   [2019]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v3 3/4] uaccess: Check no rescheduling function is called in unsafe region
On Tue, Feb 12, 2019 at 09:15:13AM +0000, Julien Thierry wrote:

> >>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> >>> index a674c7db..b1bb7e9 100644
> >>> --- a/kernel/sched/core.c
> >>> +++ b/kernel/sched/core.c
> >>> @@ -3289,6 +3289,14 @@ static inline void schedule_debug(struct task_struct *prev)
> >>> __schedule_bug(prev);
> >>> preempt_count_set(PREEMPT_DISABLED);
> >>> }
> >>> +
> >>> + if (IS_ENABLED(CONFIG_DEBUG_UACCESS_SLEEP) &&
> >>> + unlikely(unsafe_user_region_active())) {
> >>> + printk(KERN_ERR "BUG: scheduling while user_access enabled: %s/%d/0x%08x\n",
> >>> + prev->comm, prev->pid, preempt_count());
> >>> + dump_stack();
> >>> + }
> >>> +
> >>> rcu_sleep_check();
> >>>
> >>> profile_hit(SCHED_PROFILING, __builtin_return_address(0));

> I guess I'll drop the might_resched() part of this patch if that sounds
> alright.

I'm still confused by the schedule_debug() part. How is that not broken?

\
 
 \ /
  Last update: 2019-02-13 11:36    [W:0.106 / U:10.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site