Re: [PATCH] tty: fix leakage of -ERESTARTSYS to userland

From: Satoru Takeuchi
Date: Wed May 30 2007 - 21:55:35 EST


At Wed, 30 May 2007 18:08:55 -0700 (PDT),
Roland McGrath wrote:
>
> Aside from typos, I think it should be more clearly and strongly worded.
>
> "These should never be seen by user programs. To return one of these
> codes, signal_pending() MUST be set. Note that ptrace can observe these at
> syscall exit tracing, but they will never be left for the debugged user
> process to see."

Thanks, is that better?

Satoru

---
Add comment for errnos related to restart syscall to avoid the leakage of
them to user programs.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@xxxxxxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Roland McGrath <roland@xxxxxxxxxx>

Index: linux-2.6.22-rc3/include/linux/errno.h
===================================================================
--- linux-2.6.22-rc3.orig/include/linux/errno.h 2007-04-26 12:08:32.000000000 +0900
+++ linux-2.6.22-rc3/include/linux/errno.h 2007-05-31 10:47:40.000000000 +0900
@@ -5,7 +5,12 @@

#ifdef __KERNEL__

-/* Should never be seen by user programs */
+/*
+ * These should never be seen by user programs. To return one of ERESTART*
+ * codes, signal_pending() MUST be set. Note that ptrace can observe these
+ * at syscall exit tracing, but they will never be left for the debugged user
+ * process to see.
+ */
#define ERESTARTSYS 512
#define ERESTARTNOINTR 513
#define ERESTARTNOHAND 514 /* restart if no handler.. */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/