Skip to contentSkip to conversation

/dev/[k]mem: make reads and writes interruptible

PATCH Superseded Jason A. Donenfeld 2 participants 3 messages Apr 7, 2022 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /dev/[k]mem: make reads and writes interruptible

In 8619e5bdeee8 ("/dev/mem: Bail out upon SIGKILL."), /dev/[k]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().

---
 drivers/char/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/mem.c +1 -1
index cc296f0823bd..84ca98ed1dad 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.35.1
#1 lore raw
Quoted 10 lines · Jason A. Donenfeld

In 8619e5bdeee8 ("/dev/mem: Bail out upon SIGKILL."), /dev/[k]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().

/dev/kmem is no more. So this should only apply to /dev/mem nowadays.

Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw

PATCH v2 1/1 /dev/mem: make reads and writes interruptible

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().

---
Changes v1->v2:
- The commit message mentions only /dev/mem now, not /dev/kmem which was removed.

 drivers/char/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/mem.c +1 -1
index cc296f0823bd..84ca98ed1dad 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.35.1