Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sbin/cgdconfig




> On May 16, 2022, at 5:10 AM, Taylor R Campbell <riastradh%NetBSD.org@localhost> wrote:
> 
>> Date: Mon, 16 May 2022 04:49:22 +0000
>> From: nia <nia%NetBSD.org@localhost>
>> 
>> On Sun, May 15, 2022 at 03:53:27PM -0400, Christos Zoulas wrote:
>>> Log Message:
>>> Build argon2 inline so that crunched programs work. I also disabled threads
>>> for now; we can put them back if needed.
>> 
>> Please re-enable threads. They influence the output hash
>> so by disabling threads you stop people from being able
>> to decrypt their disks.
> 
> Surely `disabling threads' just means cgdconfig can't take advantage
> of parallelism to compute the same function in less time, not that
> cgdconfig computes a different function or fails to compute the same
> function, no?
> 
> I agree threads should be re-enabled, but maybe it would be reasonable
> to find a way to conditionalize this on crunchgen/rescue/whatever if
> that gets in the way.
> 
> Christos, can you write down the problems that led to making this
> commit?  The commit message doesn't explain any of what went wrong so
> I don't even know what to look for when putting threads back.

It is simple. You just take out the cpp define to disable and add thread.c to the
list of files to be built and -lpthread. The reason I changed the build in cgdconfig
from reaching out to libargon2 and using the pre-built library to explicitly building
the necessary objects locally was that I did not want to teach rescue about libargon2.
I just disabled threads in the process because it was the same way done in libcrypt.
I didn't expect that this would produce different results. Rescue was not threaded before
but now I had to add -lpthread for it to link. The whole thing is very weird. It all started
with me protecting all the extra symbols that libargon2 exposed to libcrypt. This in
turn made cgdconfig not link in rescue because it was missing argon2_hash which
before it was resolving from libcrypt. Which means that the cgdconfig in rescue was
built without threads before... What a mess.

christos

Attachment: signature.asc
Description: Message signed with OpenPGP



Home | Main Index | Thread Index | Old Index