Skip to contentSkip to conversation

include:linux: task_struct personality comment

PATCH Superseded Andrei Epure 2 participants 3 messages Apr 9, 2013 – Apr 10, 2013 Scheduler

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include:linux: task_struct personality comment

---
 include/linux/sched.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/sched.h +3 -1
index d35d2b6..8621bb0 100644
@@ -1274,8 +1274,10 @@ struct task_struct {
 	int exit_code, exit_signal;
 	int pdeath_signal;  /*  The signal sent when the parent dies  */
 	unsigned int jobctl;	/* JOBCTL_*, siglock protected */
-	/* ??? */
+
+	/* used with exec_domain for compatibility with other UNIX-like OSs */
 	unsigned int personality;
+
 	unsigned did_exec:1;
 	unsigned in_execve:1;	/* Tell the LSMs that the process is doing an
 				 * execve */
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 10 lines · Andrei Epure
---
 include/linux/sched.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/sched.h +0 -0
index d35d2b6..8621bb0 100644

include/linux/sched.h struct task_struct { · line 1279

Quoted 7 lines
include/linux/sched.h +2 -1
@@ -1274,8 +1274,10 @@ struct task_struct {
 	int exit_code, exit_signal;
 	int pdeath_signal;  /*  The signal sent when the parent dies  */
 	unsigned int jobctl;	/* JOBCTL_*, siglock protected */
-	/* ??? */
+
+	/* used with exec_domain for compatibility with other UNIX-like OSs */
 	unsigned int personality;

I don't mind documenting the p->personality flag, but in practice it's not used for emulation of other OSs really, but for emulating ABI behavior with previous _Linux_ versions, see include/uapi/linux/personality.h:

* Flags for bug emulation.
*
* These occupy the top three bytes.
*/

enum {
        UNAME26 =               0x0020000,
        ADDR_NO_RANDOMIZE =     0x0040000,      /* disable randomization of VA space */
        FDPIC_FUNCPTRS =        0x0080000,      /* userspace function ptrs point to descriptors
                                                 * (signal handling)
                                                 */
        MMAP_PAGE_ZERO =        0x0100000,
        ADDR_COMPAT_LAYOUT =    0x0200000,
        READ_IMPLIES_EXEC =     0x0400000,
        ADDR_LIMIT_32BIT =      0x0800000,
        SHORT_INODE =           0x1000000,
        WHOLE_SECONDS =         0x2000000,
        STICKY_TIMEOUTS =       0x4000000,
        ADDR_LIMIT_3GB =        0x8000000,

So the updated comment should say that.

Thanks,

Ingo

#2 lore raw
Quoted 8 lines · Ingo Molnar

I don't mind documenting the p->personality flag, but in practice it's not used for emulation of other OSs really, but for emulating ABI behavior with previous _Linux_ versions, see include/uapi/linux/personality.h:

So the updated comment should say that.

Ok, thanks, I will send a v2.

Andrei

--
Andrei Epure