Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?
Date: 2019-09-05 10:17:36
Message-ID: CAFiTN-tk7apiURLCJiJtimoHvY5ScwnvnDDYTkZaDQw8qUs+ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 5, 2019 at 3:26 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>
> On Thu, Sep 5, 2019 at 6:33 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > /*
> > + * For inheritance child relations, we also need to remember
> > + * the root parent.
> > + */
> > + if (parent->rtekind == RTE_RELATION)
> > + rel->inh_root_relid = parent->inh_root_relid > 0 ?
> > + parent->inh_root_relid :
> > + parent->relid;
> > + else
> > + /* Child relation of flattened UNION ALL subquery. */
> > + rel->inh_root_relid = relid;
> >
> > With the current changes, parent->inh_root_relid will always be > 0 so
> > (parent->inh_root_relid > 0) condition doesn't make sence. Right?
>
> Oops, you're right. It should be:
>
> if (parent->rtekind == RTE_RELATION)
> rel->inh_root_relid = parent->inh_root_relid;
> else
> rel->inh_root_relid = relid;
>
Right!

> Updated patch attached.
>

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-09-05 12:16:11 Re: BUG #15977: Inconsistent behavior in chained transactions
Previous Message Amit Langote 2019-09-05 09:56:29 Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?