Commit 0b391a5
mm: vmalloc: support more granular vrealloc() sizing
commit a0309fa upstream.
Introduce struct vm_struct::requested_size so that the requested
(re)allocation size is retained separately from the allocated area size.
This means that KASAN will correctly poison the correct spans of requested
bytes. This also means we can support growing the usable portion of an
allocation that can already be supported by the existing area's existing
allocation.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 3ddc2fe ("mm: vmalloc: implement vrealloc()")
Signed-off-by: Kees Cook <[email protected]>
Reported-by: Erhard Furtner <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Reviewed-by: Danilo Krummrich <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 2b35c1a commit 0b391a5
2 files changed
+25
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1940 | 1940 | | |
1941 | 1941 | | |
1942 | 1942 | | |
1943 | | - | |
| 1943 | + | |
1944 | 1944 | | |
1945 | 1945 | | |
1946 | 1946 | | |
| |||
3133 | 3133 | | |
3134 | 3134 | | |
3135 | 3135 | | |
| 3136 | + | |
3136 | 3137 | | |
3137 | 3138 | | |
3138 | 3139 | | |
| |||
4067 | 4068 | | |
4068 | 4069 | | |
4069 | 4070 | | |
| 4071 | + | |
| 4072 | + | |
4070 | 4073 | | |
4071 | 4074 | | |
4072 | 4075 | | |
| |||
4076 | 4079 | | |
4077 | 4080 | | |
4078 | 4081 | | |
4079 | | - | |
4080 | | - | |
4081 | 4082 | | |
4082 | 4083 | | |
4083 | 4084 | | |
4084 | 4085 | | |
4085 | 4086 | | |
4086 | 4087 | | |
4087 | | - | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
4088 | 4093 | | |
4089 | 4094 | | |
4090 | 4095 | | |
4091 | 4096 | | |
4092 | 4097 | | |
4093 | 4098 | | |
4094 | 4099 | | |
4095 | | - | |
4096 | | - | |
| 4100 | + | |
| 4101 | + | |
4097 | 4102 | | |
| 4103 | + | |
4098 | 4104 | | |
4099 | | - | |
4100 | 4105 | | |
4101 | 4106 | | |
4102 | 4107 | | |
| 4108 | + | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
4103 | 4120 | | |
4104 | 4121 | | |
4105 | 4122 | | |
| |||
0 commit comments