[systemd-devel] [PATCH] RFC: stack_size_guess() and LINE_MAX limitation for MESSAGE

Harald Hoyer harald at redhat.com
Wed Apr 17 23:43:18 PDT 2013


Am 17.04.2013 19:48, schrieb Lennart Poettering:
> On Mon, 15.04.13 16:12, harald at redhat.com (harald at redhat.com) wrote:
> 
>> From: Harald Hoyer <harald at redhat.com>
>>
>> Introduce stack_size_guess() and alloca_maybe_safe() and get rid of
>> the LINE_MAX limitation for MESSAGE in sd_journal_printv*()
> 
> tbh I don't really see the benefit of this. This is about logging, you
> really want to avoid too much magic in there with differing results
> depending "how deep in you are". We should stay predictable here, and
> that also means that we fail predictably and that we generate the very
> same messages regardless in which context you call us...
> 
> I mean, the original comment in that source file suggested to do a VLA
> loop there, but that'd only be an optimization, we'd still have to
> enforce a fixed limit on the resulting string, to avoid DoS
> attacks... Now, turning this into something entirely dynamic sounds
> dangerous too me at little benefit...
> 
> Also, the those functions are slow enough, not sure how I feel about
> adding yet another syscall into each invocation...
> 
> What's the precise issue you are trying to fix here? Are there reports
> of the limit actually being a real-life issue?

No reports, just got interested how to solve the SIGSEGV problem, when we run
out of stack memory. Feel free to ignore this patch, if you don't like it :)



More information about the systemd-devel mailing list