Re: Broken lock management in policy.c.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Broken lock management in policy.c.
Дата
Msg-id CAM3SWZTZc2ipHAqEAnH3MJyWmd6aVTkB9i7EFCATYa=cRX4=LQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Broken lock management in policy.c.  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Broken lock management in policy.c.  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Sun, Jan 3, 2016 at 6:09 PM, Peter Geoghegan <pg@heroku.com> wrote:
>> I think we should get rid of it altogether (since I also agree with the
>> upthread comment that it's in the wrong place) and instead put an example
>> into section 5.7 saying directly that sub-selects, or in general
>> references to rows other than the one under test, are risky in RLS
>> policies.  We could also show the FOR UPDATE workaround there.
>
> I agree that there should be a worked out example.

I should remind you that SELECT FOR UPDATE requires conventional
UPDATE privilege (at least on columns appearing in the SELECT list).
So, among SELECT commands, SELECT FOR UPDATE is special in that it
requires UPDATE privilege. This is not true of equivalent RLS
policies, though.

So, as part of documenting the SELECT FOR UPDATE workaround, you're
going to have to advise admins that they need to have (lesser
privileged) user accounts with conventional UPDATE privilege on a
(USING qual referenced) table that they're most certainly not supposed
to be able to UPDATE at all (since they can totally undermine RLS with
such an UPDATE). RLS can make it impossible to actually proceed with
such an UPDATE, which makes the SELECT FOR UPDATE workaround possible,
but it's all pretty messy.

-- 
Peter Geoghegan



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 9.5 BLOCKER: regrole and regnamespace and quotes
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Broken lock management in policy.c.