Re: [PATCH RFC 00/15] decouple pagefault_disable() from preempt_disable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed,  6 May 2015 19:50:24 +0200 David Hildenbrand <dahi@xxxxxxxxxxxxxxxxxx> wrote:

> As Peter asked me to also do the decoupling in one shot, this is
> the new series.
> 
> I recently discovered that might_fault() doesn't call might_sleep()
> anymore. Therefore bugs like:
> 
>   spin_lock(&lock);
>   rc = copy_to_user(...);
>   spin_unlock(&lock);
> 
> would not be detected with CONFIG_DEBUG_ATOMIC_SLEEP. The code was
> changed to disable false positives for code like:
> 
>   pagefault_disable();
>   rc = copy_to_user(...);
>   pagefault_enable();
> 
> Whereby the caller wants do deal with failures.

hm, that was a significant screwup.  I wonder how many bugs we
subsequently added.

>
> ..
>

> This series therefore does 2 things:
> 
> 
> 1. Decouple pagefault_disable() from preempt_enable()
> 
> ...
> 
> 2. Reenable might_sleep() checks for might_fault()

All seems sensible to me.  pagefault_disabled has to go into the
task_struct (rather than being per-cpu) because
pagefault_disabled_inc() doesn't disable preemption, yes?

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux