lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 08 Jul 2008 09:23:29 -0400
From:	Lee Schermerhorn <lee.schermerhorn@...com>
To:	John Blackwood <john.blackwood@...r.com>
Cc:	linux-kernel@...r.kernel.org, Joe Korty <joe.korty@...r.com>
Subject: Re: [bug ?] do_get_mempolicy()

On Thu, 2008-07-03 at 16:44 -0400, John Blackwood wrote:
> Hi Lee,

John:  I'm just getting back from a long weekend and I'm wading through
a big e-mail back log.  I'll take a look at this when I get to the end
of my inbox.  I/m probably responsible for that line.  I recall thinking
that get_mempolicy() should return the policy that one would pass back
in to achieve the same effect.  But, I blew it.

> 
> I'm having unexpected results with get_mempolicy(2) in 2.6.26, and
> I am hoping that you can either agree with me, or maybe comment on my
> misconceptions.
> 
> When I have a task with no special task mempolicy (the default mempolicy),
> when I call get_mempolicy(2), it returns a policy value of 2 (MPOL_BIND)
> with a NULL nodemask.
> 
> I believe that this is because of the code in do_get_mempolicy() that does:
> 
>   *policy |= pol->flags;
> 
> in the else case when flags do not contain MPOL_F_NODE.

I think that need to mask off the internal flags, and shift the
remaining ones up to the correct location.  I'll send a patch, if no one
beats me to it.

> 
> I guess I don't understand why we are ORing in the pol->flags into the
> *policy value.  For example, when this is for the default_policy, the
> MPOL_F_LOCAL flag (which has a value of 2) gets stuffed into the *policy
> location, and a get_mempolicy(2) caller sees this as the MPOL_BIND
> mempolicy.
> 
> Maybe the "*policy |= pol->flags;" line should be removed ?
> 
> That is, maybe it was valid at some point, but subsequent changes
> make this line of code no longer valid ?
> 
> Sorry if I'm out-to-lunch here...

No, doesn't appear that way..

> 
> Thanks very much for you time and considerations on this issue.
> 

thanks for reporting it. 

Lee

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ