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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 9 Sep 2011 11:04:19 +0200
From:	Matthieu CASTET <matthieu.castet@...rot.com>
To:	Arnaud Lacombe <lacombar@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-kbuild@...r.kernel.org" <linux-kbuild@...r.kernel.org>
Subject: Re: randconfig broken on choice

Hi Arnaud,

Arnaud Lacombe a écrit :
> Hi,
> 
> On Tue, Sep 6, 2011 at 11:32 AM, Arnaud Lacombe <lacombar@...il.com> wrote:
>> Hi,
>>
>> On Tue, Sep 6, 2011 at 11:13 AM, Matthieu CASTET
>> <matthieu.castet@...rot.com> wrote:
>>> Hi,
>>>
>>> Arnaud Lacombe a écrit :
>>>> Hi,
>>>>
>> ok, I reproduced it with:
>>
>> while true; do
>>    make randconfig
>>    CONFIG_SLAB=; CONFIG_SLOB=; CONFIG_SLUB=
>>    source .config
>>    if [ "${CONFIG_SLAB}${CONFIG_SLOB}${CONFIG_SLUB}" != "y" ]; then
>>        break
>>    fi
>>    sleep 1
>> done
>>
>> I wonder what set the flags originally...
>>
> This is interesting; I'm always getting the following:
> 
> CONFIG_SLUB=y
> CONFIG_SLOB=y
> 
> never CONFIG_SLAB and another one. Actually, the default of the choice
> ends up being selected along with the random one. Is this what you
> mean by "we don't take "sym->def[S_DEF_USER].tri" but the "default
> sym->cur.tri"" ?
Yes, what I mean is that we don't take the value set by randomize_choice_values,
 but some default values.
I wonder why the other one is random (I don't search who set cur value).

You can see the problem with the attached patch

and do make randconfig | grep -e "SL[UAO]B,"


 However, I do not see this behavior with the
> following reduced testcase:
> 
> 
Yes that's weird.

> Btw, you say that "we don't clean SYMBOL_VALID for choice entry", but
> AFAIU the code, we explicitly set the not-randomly-chosen choice value
> to 'no', so it's value should be valid.
> 
I don't understand what you mean.

What I saw is that randomize_choice_values modify sym->def[S_DEF_USER],
but because it is already marked valid, we never use sym->def[S_DEF_USER] in the
code writing the .config.


Matthieu


diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index b633bdb..eecb7af 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -147,6 +147,9 @@ struct property *sym_get_env_prop(struct symbol *sym);

 static inline tristate sym_get_tristate_value(struct symbol *sym)
 {
+	printf("name %s, cur=%d(%s) user=%d(%s)\n", sym->name,
+			sym->curr.tri, sym->flags & SYMBOL_VALID?"valid":"invalid",
+			sym->def[S_DEF_USER].tri, sym->flags & SYMBOL_DEF_USER?"valid":"invalid");
 	return sym->curr.tri;
 }

--
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