forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5413eef
committed
Repair failure to check that a table is still compatible with a previously
made query plan. Use of ALTER COLUMN TYPE creates a hazard for cachedquery plans: they could contain Vars that claim a column has a differenttype than it now has. Fix this by checking during plan startup that Varsat relation scan level match the current relation tuple descriptor. Sinceat that point we already have at least AccessShareLock, we can be sure thecolumn type will not change underneath us later in the query. However,since a backend's locks do not conflict against itself, there is still ahole for an attacker to exploit: he could try to execute ALTER COLUMN TYPEwhile a query is in progress in the current backend. Seal that hole byrejecting ALTER TABLE whenever the target relation is already open inthe current backend.This is a significant security hole: not only can one trivially crash thebackend, but with appropriate misuse of pass-by-reference datatypes it ispossible to read out arbitrary locations in the server process's memory,which could allow retrieving database content the user should not be ableto see. Our thanks to Jeff Trout for the initial report.Security:CVE-2007-05561 parentf8eb75b commit5413eef
File tree
13 files changed
+311
-90
lines changed- src
- backend
- commands
- executor
- include/executor
13 files changed
+311
-90
lines changedLines changed: 50 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1964 | 1964 |
| |
1965 | 1965 |
| |
1966 | 1966 |
| |
1967 |
| - | |
1968 |
| - | |
1969 |
| - | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
1970 | 1990 |
| |
1971 | 1991 |
| |
1972 | 1992 |
| |
1973 | 1993 |
| |
1974 | 1994 |
| |
1975 | 1995 |
| |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
1976 | 2001 |
| |
1977 | 2002 |
| |
1978 | 2003 |
| |
1979 | 2004 |
| |
1980 |
| - | |
1981 |
| - | |
1982 |
| - | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
1983 | 2008 |
| |
1984 | 2009 |
| |
1985 | 2010 |
| |
| |||
2929 | 2954 |
| |
2930 | 2955 |
| |
2931 | 2956 |
| |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
2932 | 2963 |
| |
2933 | 2964 |
| |
2934 | 2965 |
| |
| |||
2960 | 2991 |
| |
2961 | 2992 |
| |
2962 | 2993 |
| |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
2963 | 3000 |
| |
2964 | 3001 |
| |
2965 | 3002 |
| |
| |||
3765 | 3802 |
| |
3766 | 3803 |
| |
3767 | 3804 |
| |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
3768 | 3811 |
| |
3769 | 3812 |
| |
3770 | 3813 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| |||
804 | 804 |
| |
805 | 805 |
| |
806 | 806 |
| |
807 |
| - | |
| 807 | + | |
| 808 | + | |
808 | 809 |
| |
809 | 810 |
| |
810 | 811 |
| |
|
0 commit comments
Comments
(0)