Repository navigation
Commit d205f26
Refuse RLS graph loads during parallel operations
The traversal graph loads RLS-protected labels through an SPI query, so
the policies are evaluated in whichever process loads the graph.
vertex_stats() and age_graph_stats() are parallel safe, so under a
parallel plan a worker loaded the graph. A worker does not have all of
the caller's session state; inet_client_addr(), for one, is NULL there.
A policy that hid edges from a client connection therefore admitted
them in the worker, and the statistics counted edges the caller could
not see.
Raise an error (SQLSTATE 25000) instead of loading an RLS-protected
label in parallel mode. Roles the policies do not apply to, labels
without RLS, serial plans and age.enforce_rls_in_traversal = off are
unaffected. The function declarations stay parallel safe, so other
queries keep their parallel plans.
The new rls_vle part forces a parallel plan and checks that the
restricted role is refused while the owner and a serial plan still get
statistics.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5de33f6 commit d205f26
3 files changed
Lines changed: 92 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1384 | 1384 | | |
1385 | 1385 | | |
1386 | 1386 | | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1387 | 1428 | | |
1388 | 1429 | | |
1389 | 1430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
876 | 906 | | |
877 | 907 | | |
878 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| |||
1370 | 1371 | | |
1371 | 1372 | | |
1372 | 1373 | | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
1373 | 1392 | | |
1374 | 1393 | | |
1375 | 1394 | | |
| |||
1434 | 1453 | | |
1435 | 1454 | | |
1436 | 1455 | | |
| 1456 | + | |
1437 | 1457 | | |
1438 | 1458 | | |
1439 | 1459 | | |
| |||
1594 | 1614 | | |
1595 | 1615 | | |
1596 | 1616 | | |
| 1617 | + | |
1597 | 1618 | | |
1598 | 1619 | | |
1599 | 1620 | | |
| |||
0 commit comments