xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Ian Jackson <iwj@xenproject.org>, Julien Grall <julien@xen.org>,
	xen-devel@lists.xenproject.org, raphning@amazon.co.uk,
	Julien Grall <jgrall@amazon.com>
Subject: Re: [PATCH for-4.15] tools/xenstored: liveupdate: Increase the maximum number of parameters
Date: Fri, 5 Mar 2021 15:55:49 +0100	[thread overview]
Message-ID: <b9435aa0-e47c-85ad-558e-cfa7adeb2a4a@suse.com> (raw)
In-Reply-To: <24642.17658.843482.352849@mariner.uk.xensource.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2056 bytes --]

On 05.03.21 15:49, Ian Jackson wrote:
> Ian Jackson writes ("Re: [PATCH for-4.15] tools/xenstored: liveupdate: Increase the maximum number of parameters"):
>> Jürgen Groß writes ("Re: [PATCH for-4.15] tools/xenstored: liveupdate: Increase the maximum number of parameters"):
>>> On 05.03.21 15:37, Ian Jackson wrote:
>>>> Jürgen Groß writes ("Re: [PATCH for-4.15] tools/xenstored: liveupdate: Increase the maximum number of parameters"):
>>>>> This is the max number of 0 delimited string parameters. Especially the
>>>>> stubdom case needs a binary blob (with length, of course) as parameter,
>>>>> and the number of 0 bytes in this data is just limited by the allowed
>>>>> payload length.
>>>>>
>>>>> See the comment in line 111 of xenstored_control.c.
>>>>
>>>> AFAICT this "live-update" command is variadic.  So why is this
>>>> parameter set here it all then ?
>>>
>>> In order to avoid allocating an array for 4000 arguments when there
>>> are only 5 which need to be treated as strings.
>>
>> So this parameter is doing two jobs: 1. enabling non-variadic commands
>> to take binary input; 2. preventing variadic commands from allocating
>> unbounded memory.
>>
>> The problem with this is that in case 1 exceeding the value is normal
>> and the final argument is binary data; whereas in case 2 glomming
>> together the arguments together with zeroes is wrong and potentially
>> hazrdous.
>>
>> I suggest we solve problem 2 by imposing a higher fixed (for all
>> commands, variadic or not) limit (20 or something) which causes errors
>> when exceeded, rather than silent argument misinterpretation.
> 
> Also, this use of max_pars to do job 2 seems very inconsistent.  It is
> applied only to "live-update".
> 
> If it is necessary for "live-update", which is it not necessary for
> "check" or whatever ?

live-update is the only command with binary data. The other commands are
checking all parameters to be valid, similar to normal parameter parsing
in a main() function of a user program.


Juergen

[-- Attachment #1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2021-03-05 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 12:10 [PATCH for-4.15] tools/xenstored: liveupdate: Increase the maximum number of parameters Julien Grall
2021-03-05 12:44 ` Jürgen Groß
2021-03-05 13:22 ` Ian Jackson
2021-03-05 14:33   ` Jürgen Groß
2021-03-05 14:37     ` Ian Jackson
2021-03-05 14:41       ` Jürgen Groß
2021-03-05 14:46         ` Ian Jackson
2021-03-05 14:49           ` Ian Jackson
2021-03-05 14:55             ` Jürgen Groß [this message]
2021-03-05 14:56           ` Jürgen Groß
2021-03-06 19:39   ` Julien Grall

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=b9435aa0-e47c-85ad-558e-cfa7adeb2a4a@suse.com \
    --to=jgross@suse.com \
    --cc=iwj@xenproject.org \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --cc=raphning@amazon.co.uk \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).