lkml.org 
[lkml]   [2014]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.
On Wed, Feb 19, 2014 at 02:00:21PM -0800, Andrew Morton wrote:

> > I toyed with the idea of changing task_struct.make_it_fail to unsigned too,
> > but only realized I missed that after I'd sent out the diff.
>
> If we're touching the task_struct we could make it a bool.
>
> Or just a single bit(field). task_struct already has a bunch of
> bitfields in it (strangely, they aren't contiguous).

afaics, asides from brk_randomized, they're contiguous, and gcc dtrt..

unsigned int in_execve:1; /* 768:31 4 */
unsigned int in_iowait:1; /* 768:30 4 */
unsigned int no_new_privs:1; /* 768:29 4 */
unsigned int sched_reset_on_fork:1; /* 768:28 4 */
unsigned int sched_contributes_to_load:1; /* 768:27 4 */

So we could move the COMPAT_BRK ifdef and save 4 bytes for all the people still using libc5.
(Or those who are for some reason averse to heap randomization).

It's not really worth doing unless you're moving a bunch of other stuff around
in task_struct though, because as it is now, that struct has a bunch of alignment padding
& holes, so you're not going to save anything.

The other tricky part with reorganizing that struct is that so much of it is configurable.

Dave



\
 
 \ /
  Last update: 2014-02-20 00:21    [W:0.039 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site