Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@busybox.net, Pierre-Jean Texier <texier.pj2@gmail.com>,
	Peter Seiderer <ps.report@gmx.net>
Subject: Re: [Buildroot] [PATCH v2] package/haveged: bump version to 1.9.14
Date: Sun, 25 Jul 2021 23:41:07 +0200	[thread overview]
Message-ID: <20210725234107.48122620@windsurf> (raw)
In-Reply-To: <20210331200710.GH24043@scaer>

Hello,

On Wed, 31 Mar 2021 22:07:10 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Are you sure this is correct? Later on in that file, 'path' is forcibly
> assigned as thus:
> 
>     200       path[0] = '/';
> 
> And then, 'path' is used to start the daemon:
> 
>     527    else run_daemon(handle, path, argv);
> 
> So, if the original argv[0] does not start with a '/' (e.g. because it
> is called from the PATH), then 'path' will contain a mangled program
> name:
> 
>     argv[0] = "haveged"
>     path = strdup(argv[0]) = "haveged"
> 
> and thus with line 200:
>     path = "/aveged"
> 
> Did I miss something?

I agree with you that this is weird. *But* if you look at
https://github.com/jirka-h/haveged/commit/26d35af198da01220ba4f7a1b987f17012476c00#diff-043ded6506fb937c60ed15d0e9cfe02d6de6c72bcbd0bb14b7ad5e64ee7a6713L19
which is the commit that introduced this, they really just added the
<sys/auxv.h> usage as an additional thing if the path doesn't start
with /. So what Peter's patch does it make that new "feature" compile
time conditional, while it didn't exist at all before.

So with Peter's patch, on uClibc, you're just back to exactly how
haveged was behaving in its 1.9.13 version.

But I agree overall that all this string manipulation dance looks very
fragile :-/

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  parent reply	other threads:[~2021-07-25 21:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 18:50 [Buildroot] [PATCH v2] package/haveged: bump version to 1.9.14 Peter Seiderer
2021-03-31 20:07 ` Yann E. MORIN
2021-03-31 21:52   ` Peter Seiderer
2021-04-02 20:01     ` Yann E. MORIN
2021-04-04 12:43       ` Yann E. MORIN
2021-07-25 21:41   ` Thomas Petazzoni [this message]
2021-07-25 21:38 ` Thomas Petazzoni
2021-07-27 21:03   ` Peter Seiderer
2021-07-27 21:38     ` Norbert Lange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210725234107.48122620@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    --cc=ps.report@gmx.net \
    --cc=texier.pj2@gmail.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox