qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Farhan Ali <alifm@linux.ibm.com>,
	qemu-s390x@nongnu.org,
	Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	qemu-devel@nongnu.org, Collin Walling <walling@linux.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] pc-bios/s390-ccw/net: Add support for pxelinux-style config files
Date: Tue, 5 Jun 2018 13:41:04 +0200	[thread overview]
Message-ID: <a890c257-63f9-ca49-cc6f-fbd5e2bddf5b@redhat.com> (raw)
In-Reply-To: <2489ce83-a622-2f63-e9d1-50b3298596cb@linux.ibm.com>

On 01.06.2018 22:19, Farhan Ali wrote:
> 
> 
> On 05/31/2018 11:21 PM, Thomas Huth wrote:
>>> Just a question do we want to clear cfgbuf here, before calling
>>> pxelinux_load_parse_cfg?
>> That's theoretically not necessary. The buffer either gets populated
>> with data, or the function errors out. The code also makes sure that
>> there is a final NUL-character in the buffer:
>>
>> https://github.com/aik/SLOF/blob/64c526a/lib/libnet/pxelinux.c#L169
>>
>> ... but I think I've got to double check that there is also a
>> NUL-character immediately at the end of the downloaded data ... so
>> there's indeed a change required, but likely rather in the SLOF code
>> than here.
> 
> Can't we do that in net_try_direct_tftp_load, or it is better to put
> that in SLOF code?

I've now submitted a patch to SLOF to fix two issues with regards to the
NUL-termination handling there:

https://lists.ozlabs.org/pipermail/slof/2018-June/002201.html

Now it's the duty of the caller to take care of proper NUL-termination.
There is already this line in net_try_direct_tftp_load():

  cfgbuf[rc] = 0;    /* Make sure that it is NUL-terminated */

... so I think we should be fine there.

 Thomas

  reply	other threads:[~2018-06-05 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30  9:16 [Qemu-devel] [PATCH 0/3] pc-bios/s390-ccw: Allow network booting via pxelinux.cfg Thomas Huth
2018-05-30  9:16 ` [Qemu-devel] [PATCH 1/3] pc-bios/s390-ccw/net: Update code for the latest changes in SLOF Thomas Huth
2018-05-30  9:16 ` [Qemu-devel] [PATCH 2/3] pc-bios/s390-ccw/net: Add support for pxelinux-style config files Thomas Huth
2018-05-30 11:07   ` Viktor VM Mihajlovski
2018-06-01  5:44     ` Thomas Huth
2018-05-31 21:25   ` Farhan Ali
2018-06-01  3:21     ` Thomas Huth
2018-06-01 20:19       ` Farhan Ali
2018-06-05 11:41         ` Thomas Huth [this message]
2018-05-30  9:16 ` [Qemu-devel] [PATCH 3/3] pc-bios/s390-ccw/net: Try to load pxelinux.cfg file accoring to the UUID Thomas Huth
2018-06-01 20:16   ` Farhan Ali
2018-06-04  9:36   ` Cornelia Huck
2018-06-05 12:04     ` Thomas Huth
2018-06-05 12:23       ` Cornelia Huck

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=a890c257-63f9-ca49-cc6f-fbd5e2bddf5b@redhat.com \
    --to=thuth@redhat.com \
    --cc=alifm@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=walling@linux.ibm.com \
    /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).