From: ChenQi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [daisy][PATCH 1/1] systemd: do not use alloca() function in case of uclibc
Date: Tue, 3 Jun 2014 17:36:37 +0800 [thread overview]
Message-ID: <538D9725.7030300@windriver.com> (raw)
In-Reply-To: <538D9363.2020006@windriver.com>
On 06/03/2014 05:20 PM, ChenQi wrote:
> On 06/03/2014 05:06 PM, Richard Purdie wrote:
>> On Tue, 2014-06-03 at 15:42 +0800, Chen Qi wrote:
>>> The alloca() function allocates space in the stack frame of the caller,
>>> so using alloca(new_size - old_size) would possibly crash the stack,
>>> causing a segment fault error.
>>>
>>> This patch fixes the above problem by avoiding using this function in
>>> journal-file.c.
>>>
>>> [YOCTO #6201]
>>>
>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>> ---
>>> .../0001-journal-file.c-do-not-use-alloca.patch | 54
>>> ++++++++++++++++++++
>>> meta/recipes-core/systemd/systemd_211.bb | 1 +
>>> 2 files changed, 55 insertions(+)
>>> create mode 100644
>>> meta/recipes-core/systemd/systemd/0001-journal-file.c-do-not-use-alloca.patch
>>>
>>> diff --git
>>> a/meta/recipes-core/systemd/systemd/0001-journal-file.c-do-not-use-alloca.patch
>>> b/meta/recipes-core/systemd/systemd/0001-journal-file.c-do-not-use-alloca.patch
>>>
>>> new file mode 100644
>>> index 0000000..a638d58
>>> --- /dev/null
>>> +++
>>> b/meta/recipes-core/systemd/systemd/0001-journal-file.c-do-not-use-alloca.patch
>>> @@ -0,0 +1,54 @@
>>> +Upstream-Status: Inappropriate [oe specific]
>> >From the description, this sounds like an allocation error which can
>> happen *anywhere* and is a problem that should be addressed upstream.
>>
>> This Upstream-Status field is therefore completely bogus. Its not
>> inappropriate or oe specific. If you still believe it is, I'd like to
>> hear more explanation.
>>
>> The abuses of this field are starting to really annoy me since this
>> keeps happening.
>>
>> Cheers,
>>
>> Richard
>>
>>
>>
>>
>>
>
> Hi Richard,
>
> The use of alloca() was introduced by an oe-specific patch from Khem Raj.
>
> The patch is
> meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch.
> The upstream status of the above patch is as following.
> Upstream-Status: Denied [no desire for uclibc support]
>
> That's why I use 'Inappropriate [oe specific]' in the Upstream-Status
> field of my patch.
>
> And I just realized I forgot to also patch the journald-kmsg.c file.
> I'll send out a V2.
>
Sorry for the confusion.
I just checked and journald-kmsg.c doesn't have the same problem, as
it's only allocating a small size of space.
char *buf = alloca(sizeof(uint64_t));
So I think that's it.
I will also send out a patch for master branch.
Best Regards,
Chen Qi
> Best Regards,
> Chen Qi
next prev parent reply other threads:[~2014-06-03 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 7:42 [daisy][PATCH 0/1] systemd: do not use alloca() function in case of uclibc Chen Qi
2014-06-03 7:42 ` [daisy][PATCH 1/1] " Chen Qi
2014-06-03 9:06 ` Richard Purdie
2014-06-03 9:20 ` ChenQi
2014-06-03 9:36 ` ChenQi [this message]
2014-06-03 10:58 ` Richard Purdie
2014-06-03 11:42 ` Holger Freyther
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=538D9725.7030300@windriver.com \
--to=qi.chen@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/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