xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH 3 of 3 RESEND] libxl: Warn that /usr/bin/pygrub is deprecated
Date: Thu, 10 May 2012 13:10:07 +0100	[thread overview]
Message-ID: <20120510121007.GD73773@ocelot.phlegethon.org> (raw)
In-Reply-To: <4FABAACC.9000301@eu.citrix.com>

At 12:47 +0100 on 10 May (1336654044), George Dunlap wrote:
> On 10/05/12 12:44, Tim Deegan wrote:
> >If the user controlled both the length and contents of
> >info->u.pv.bootloader, it could cause this to overrun that buffer and
> >cause a SEGV.  So, sadly, strcmp goes on the 'just never use it' list
> >for many people.
> 
> Hmm, yes, I suppose it's *technically* possible that even when comparing 
> to a static string, if info->u.pv.bootloader contains a short, 
> non-null-terminated string, and were close to the edge of a page, it 
> could cause a SEGV.  But using strncmp wouldn't solve that, would it?

Yes - you give it the length of the info->u.pv.bootloader buffer and it
guards against from exactly this problem.  That's assuming you allocated
it yourself and filled it with user-supplied bytes.  If the user
supplied the buffer, of course, you're forced to trust them and
strncmp() doesn't buy you anything.

Tim.

  reply	other threads:[~2012-05-10 12:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 10:51 [PATCH 0 of 3 RESEND] tools: Move bootloaders to libexec directory George Dunlap
2012-05-09 10:51 ` [PATCH 1 of 3 RESEND] libxl: Look for bootloader in libexec path George Dunlap
2012-05-09 13:39   ` Ian Campbell
2012-05-09 14:01     ` George Dunlap
2012-05-09 10:51 ` [PATCH 2 of 3 RESEND] tools: Install pv bootloaders in libexec rather than /usr/bin George Dunlap
2012-05-09 13:41   ` Ian Campbell
2012-05-09 10:51 ` [PATCH 3 of 3 RESEND] libxl: Warn that /usr/bin/pygrub is deprecated George Dunlap
2012-05-09 13:43   ` Ian Campbell
2012-05-09 14:48     ` George Dunlap
2012-05-10 11:36       ` Ian Jackson
2012-05-10 11:37         ` George Dunlap
2012-05-10 11:44         ` Tim Deegan
2012-05-10 11:47           ` George Dunlap
2012-05-10 12:10             ` Tim Deegan [this message]
2012-05-10 13:15           ` Ian Jackson
2012-05-10 13:20             ` Tim Deegan

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=20120510121007.GD73773@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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).