From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: Re: [PATCH 18/28] xenstored: handle unlikely failure better in ask_parents Date: Thu, 26 Sep 2013 11:17:32 +1200 Message-ID: References: <1379475484-25993-1-git-send-email-mattjd@gmail.com> <1379475484-25993-19-git-send-email-mattjd@gmail.com> <1380114381.23688.147.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1380114381.23688.147.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, Sep 26, 2013 at 1:06 AM, Ian Campbell wrote: > On Wed, 2013-09-18 at 15:37 +1200, Matthew Daley wrote: >> Coverity-ID: 1055277 >> Signed-off-by: Matthew Daley >> --- >> tools/xenstore/xenstored_core.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c >> index a2cf2a6..0f8ba64 100644 >> --- a/tools/xenstore/xenstored_core.c >> +++ b/tools/xenstore/xenstored_core.c >> @@ -523,8 +523,10 @@ static enum xs_perm_type ask_parents(struct connection *conn, const char *name) >> } while (!streq(name, "/")); >> >> /* No permission at root? We're in trouble. */ >> - if (!node) >> + if (!node) { >> corrupt(conn, "No permissions file at root"); > > Seems almost abort/assert worthy but maybe there is a possible DoS in > that (I haven't looked/thought/checked). So I'll apply this one. I thought that too, but corrupt() does return after doing actual checks/cleaning on the underlying store (FWIW), so it might be worth letting it flounder a bit longer... > >> + return XS_PERM_NONE; >> + } >> >> return perm_for_conn(conn, node->perms, node->num_perms); >> } > >