[lkml]   [2019]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] /dev/mem: Bail out upon SIGKILL when reading memory.
On Sat, Aug 24, 2019 at 10:50 PM Tetsuo Handa
<> wrote:
> @@ -142,7 +144,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
> sz = size_inside_page(p, count);
> cond_resched();
> err = -EINTR;
> - if (fatal_signal_pending(current))
> + if (signal_pending(current))
> goto failed;
> err = -EPERM;

So from a "likelihood of breaking" standpoint, I'd really like to make
sure that the "signal_pending()" checks come at the *end* of the loop.

That way, if somebody is doing a 4-byte read from MMIO, he'll never see -EINTR.

I'm specifically thinking of tools like user-space 'lspci' etc, which
I wouldn't be surprised could happen.

Also, just in case things break, I do agree with Ingo that this should
be split up into several patches.


 \ /
  Last update: 2019-08-25 18:55    [W:0.170 / U:3.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site