/dev/mem: make reads and writes interruptible
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 7 Apr 2022 12:26:38 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Apr 2022 15:31:01 +0000 (17:31 +0200)
In 8619e5bdeee8 ("/dev/mem: Bail out upon SIGKILL."), /dev/mem became
killable, and that commit noted:

  Theoretically, reading/writing /dev/mem and /dev/kmem can become
  "interruptible". But this patch chose "killable". Future patch will
  make them "interruptible" so that we can revert to "killable" if
  some program regressed.

So now we take the next step in making it "interruptible", by changing
fatal_signal_pending() into signal_pending().

Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://lore.kernel.org/r/20220407122638.490660-1-Jason@zx2c4.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mem.c

index cc296f0823bd0bcee8a9d4e2cfa10a6c385eb9b0..84ca98ed1dada445f9fd8a9b4c1ee42a67cdf9c4 100644 (file)
@@ -101,7 +101,7 @@ static inline bool should_stop_iteration(void)
 {
        if (need_resched())
                cond_resched();
-       return fatal_signal_pending(current);
+       return signal_pending(current);
 }
 
 /*