Commit 76f2653
mm: page_alloc: check the order of compound page even when the order is zero
For compound pages, the head sets the PG_head flag and the tail sets the
compound_head to indicate the head page. If a user allocates a compound
page and frees it with a different order, the compound page information
will not be properly initialized. To detect this problem,
compound_order(page) and the order argument are compared, but this is not
checked when the order argument is zero. That error should be checked
regardless of the order.
Link: https://lkml.kernel.org/r/20231023083217.1866451-1-hyesoo.yu@samsung.com
Signed-off-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent be16dd7 commit 76f2653
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| 1082 | + | |
1082 | 1083 | | |
1083 | 1084 | | |
1084 | 1085 | | |
| |||
1097 | 1098 | | |
1098 | 1099 | | |
1099 | 1100 | | |
| 1101 | + | |
| 1102 | + | |
1100 | 1103 | | |
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
1104 | 1107 | | |
1105 | | - | |
1106 | 1108 | | |
1107 | 1109 | | |
1108 | | - | |
1109 | | - | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| |||
0 commit comments