[sugar] [RFC] teach sugar to update oom_adj

Marco Pesenti Gritti mpg
Wed Feb 21 04:35:42 EST 2007


On Wed, 2007-02-21 at 14:58 +0530, Joshua N Pritikin wrote:
> On Tue, Feb 20, 2007 at 05:15:19PM +0100, Marco Pesenti Gritti wrote:
> > On Tue, 2007-02-20 at 21:28 +0530, Joshua N Pritikin wrote:
> > > On Mon, Feb 19, 2007 at 01:51:07PM +0100, Marco Pesenti Gritti wrote:
> > > > Is /proc/pid/oom_adj supposed to be user writable?
> > > 
> > > It needs capable(CAP_SYS_RESOURCE). Is OLPC going to employ SELinux or 
> > > somesuch for Bitfrost? If not then some kind of mini-server running as 
> > > root will be needed to traverse the security barrier.
> > 
> > We already have that (hardwaremanager on dev.laptop.org).
> 
> Can any process connect to hardwaremanager? If so, then oom_adj needs 
> to be somewhere else. A malicious process could set oom_adj such that 
> the next process to die is sugar. Only sugar should have access to set 
> oom_adj.
> 

Currently any process can connect, but only sugar really needs to. I
don't see problem with limiting access.

> > Though I think functionality which is generic and fit in HAL should just
> > go there (less code for us to maintain). I have no idea if oom_adj fits
> > in HAL.
> 
> Doesn't HAL just issue events and load kernel modules? I don't think 
> oom_adj belongs in HAL.

Well they added an interface to get the battery level for example.
That's why I'm confused about what belongs to HAL and what doesn't.

Marco



More information about the Sugar-devel mailing list