Commit 66e3531
committed
xen/netfront: react properly to failing gnttab_end_foreign_access_ref()
When calling gnttab_end_foreign_access_ref() the returned value must
be tested and the reaction to that value should be appropriate.
In case of failure in xennet_get_responses() the reaction should not be
to crash the system, but to disable the network device.
The calls in setup_netfront() can be replaced by calls of
gnttab_end_foreign_access(). While at it avoid double free of ring
pages and grant references via xennet_disconnect_backend() in this case.
This is CVE-2022-23042 / part of XSA-396.
Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V2:
- avoid double free
V3:
- remove pointless initializer (Jan Beulich)1 parent 42baefa commit 66e3531
1 file changed
Lines changed: 31 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
992 | 991 | | |
993 | 992 | | |
994 | 993 | | |
| |||
1030 | 1029 | | |
1031 | 1030 | | |
1032 | 1031 | | |
1033 | | - | |
1034 | | - | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1035 | 1039 | | |
1036 | 1040 | | |
1037 | 1041 | | |
| |||
1252 | 1256 | | |
1253 | 1257 | | |
1254 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1255 | 1263 | | |
1256 | 1264 | | |
1257 | 1265 | | |
| |||
1916 | 1924 | | |
1917 | 1925 | | |
1918 | 1926 | | |
1919 | | - | |
| 1927 | + | |
1920 | 1928 | | |
1921 | 1929 | | |
1922 | 1930 | | |
| |||
1936 | 1944 | | |
1937 | 1945 | | |
1938 | 1946 | | |
1939 | | - | |
| 1947 | + | |
1940 | 1948 | | |
1941 | 1949 | | |
1942 | 1950 | | |
1943 | 1951 | | |
1944 | 1952 | | |
1945 | 1953 | | |
1946 | | - | |
| 1954 | + | |
1947 | 1955 | | |
1948 | 1956 | | |
1949 | 1957 | | |
1950 | 1958 | | |
1951 | 1959 | | |
1952 | 1960 | | |
1953 | | - | |
| 1961 | + | |
1954 | 1962 | | |
1955 | 1963 | | |
1956 | 1964 | | |
| |||
1963 | 1971 | | |
1964 | 1972 | | |
1965 | 1973 | | |
1966 | | - | |
| 1974 | + | |
1967 | 1975 | | |
1968 | 1976 | | |
1969 | 1977 | | |
1970 | 1978 | | |
1971 | 1979 | | |
1972 | 1980 | | |
1973 | | - | |
1974 | | - | |
1975 | | - | |
1976 | | - | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
1980 | | - | |
1981 | | - | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
1982 | 1996 | | |
1983 | 1997 | | |
1984 | 1998 | | |
| |||
0 commit comments