| От | Stephen Frost |
|---|---|
| Тема | Re: copy.c handling for RLS is insecure |
| Дата | |
| Msg-id | 20150709212141.GA12131@tamriel.snowman.net обсуждение исходный текст |
| Ответ на | Re: copy.c handling for RLS is insecure (Andres Freund <andres@anarazel.de>) |
| Ответы |
Re: copy.c handling for RLS is insecure
|
| Список | pgsql-hackers |
Noah, Andres,
* Andres Freund (andres@anarazel.de) wrote:
> On 2015-07-09 01:28:28 -0400, Noah Misch wrote:
> > > - Keep the OID check, shouldn't hurt to have it
> >
> > What benefit is left?
>
> A bit of defense in depth. We execute user defined code in COPY
> (e.g. BEFORE triggers). That user defined code could very well replace
> the relation. Now I think right now that'd happen late enough, so the
> second lookup already happened. But a bit more robust defense against
> that sounds good to me.
Attached patch keeps the relation locked, fully qualifies it when
building up the query, and uses list_member_oid() to check that the
relation's OID ends up in the resulting relationOids list (to address
Noah's point that the planner doesn't guarantee the ordering; I doubt
that list will ever be more than a few entries long).
Also removes the misguided Assert().
Barring objections, I'll commit this (and backpatch to 9.5) tomorrow.
Thanks!
Stephen
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера