From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Michael Chang <mchang@suse.com>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH 1/3] Added net_bootp6 command
Date: Mon, 20 Apr 2015 06:38:06 +0300 [thread overview]
Message-ID: <20150420063806.2d031181@opensuse.site> (raw)
In-Reply-To: <20150420030910.GA18433@linux-dsax.tai.apac.novell.com>
В Mon, 20 Apr 2015 11:09:10 +0800
Michael Chang <mchang@suse.com> пишет:
>
> >
> > > > > +
> > > > > + ip_start = ip_end = NULL;
> > > > > + ip_start = bootfile_url + grub_strlen(pr);
> > > > > +
> > > > > + if (*ip_start != '[')
> > > > > + ip_start = NULL;
> > > > > + else
> > > > > + ip_end = grub_strchr (++ip_start, ']');
> > > > > +
> > > > > + if (!ip_start || !ip_end)
> > > > > + {
> > > > > + grub_error (GRUB_ERR_IO, N_("IPv6-address not in square brackets"));
> > > > > + goto cleanup;
> > > > > + }
> > > > > +
> > > >
> > > > Can bootfile_url contain a name and not IPv6 address? Or is address
> > > > mandatory?
> > >
> > > Yes. The string in URL form is mandatory.
> > >
> >
> > I probably was not clear. Must it always be IPv6 address literal as
> > implied by code or can it be e.g. DNS name?
>
> The DNS name could be legit for URL, but current elilo and edk2
> explicitly checks for the starting and ending delimiter '[..]' for using
> the server address and any name is treated as invalid parameters. The
> implementation just followed them.
>
OK, could you put in comments here which explain it, probably marked as
TODO.
> >
> > Yes, but what I mean - this function is only called when we already
> > checked for message_type == DHCPv6_REPLY. So the only reason it can be
> > different here is physical memory corruption.
>
> It also gets called from grub_efi_net_config_real () which doesn't have
> any check for message type.
>
So you do not trust firmware, do you? :) But OK, let's leave check in
place.
P.S. grub_efi_net_config_real should actually have checked
DhcpAckReceived to start with, but I'm afraid to add it now, at least
until we have real report of invalid packages.
next prev parent reply other threads:[~2015-04-20 3:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 9:05 [RFC] Support DHCPv6 and UEFI IPv6 PXE Michael Chang
2015-04-15 9:05 ` [PATCH 1/3] Added net_bootp6 command Michael Chang
2015-04-16 14:40 ` Andrei Borzenkov
2015-04-17 5:04 ` Michael Chang
2015-04-19 8:15 ` Andrei Borzenkov
2015-04-20 3:09 ` Michael Chang
2015-04-20 3:38 ` Andrei Borzenkov [this message]
2015-04-15 9:05 ` [PATCH 2/3] UEFI IPv6 PXE support Michael Chang
2015-04-15 9:05 ` [PATCH 3/3] Use UEFI MAC device as default configured by net_bootp6 Michael Chang
2015-04-16 19:58 ` Andrei Borzenkov
2015-04-17 6:41 ` Michael Chang
2015-04-17 9:01 ` Andrei Borzenkov
2015-04-17 9:48 ` [RFC] Support DHCPv6 and UEFI IPv6 PXE Andrei Borzenkov
-- strict thread matches above, loose matches on Subject: below --
2015-05-12 8:49 [PATCH v1] " Michael Chang
2015-05-12 8:49 ` [PATCH 1/3] Added net_bootp6 command Michael Chang
2015-05-15 6:26 ` Andrei Borzenkov
2015-05-15 13:57 ` Michael Chang
2015-05-16 5:42 ` Andrei Borzenkov
2015-05-19 8:42 ` Michael Chang
2015-05-30 7:25 ` Andrei Borzenkov
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=20150420063806.2d031181@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.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).