| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | # |
| 4 | # An x86 alternative with an empty replacement still gets a relocation for its |
| 5 | # replacement offset, but the label it points at is the end of the previous |
| 6 | # replacement -- which is also the start of the next one. The value is |
| 7 | # meaningless, and get_alt_entry() already ignores it. |
| 8 | # |
| 9 | # Cloning it drags in an unrelated neighboring replacement and everything that |
| 10 | # replacement references. In the reported case an empty alternative in |
| 11 | # meminfo_proc_show() pulled in one from proc_kcore_init(), emitting a klp |
| 12 | # relocation against init text which is long freed by the time the patch is |
| 13 | # applied. |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | # target's own replacement comes along ... |
| 26 | |
| 27 | # ... neighbor's does not, nor what it references. |
| 28 | |
| 29 | |
| 30 | |
| 31 |