Commit a0a44d9
committed
mm, slab: don't wrap internal functions with alloc_hooks()
The functions __kmalloc_noprof(), kmalloc_large_noprof(),
kmalloc_trace_noprof() and their _node variants are all internal to the
implementations of kmalloc_noprof() and kmalloc_node_noprof() and are
only declared in the "public" slab.h and exported so that those
implementations can be static inline and distinguish the build-time
constant size variants. The only other users for some of the internal
functions are slub_kunit and fortify_kunit tests which make very
short-lived allocations.
Therefore we can stop wrapping them with the alloc_hooks() macro.
Instead add a __ prefix to all of them and a comment documenting these
as internal. Also rename __kmalloc_trace() to __kmalloc_cache() which is
more descriptive - it is a variant of __kmalloc() where the exact
kmalloc cache has been already determined.
The usage in fortify_kunit can be removed completely, as the internal
functions should be tested already through kmalloc() tests in the
test variant that passes non-constant allocation size.
Reported-by: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Kees Cook <keescook@chromium.org>
Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 1613e60 commit a0a44d9
4 files changed
Lines changed: 38 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | 531 | | |
535 | 532 | | |
536 | 533 | | |
| |||
568 | 565 | | |
569 | 566 | | |
570 | 567 | | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | 568 | | |
576 | 569 | | |
577 | 570 | | |
578 | 571 | | |
579 | | - | |
580 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
581 | 583 | | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
| 584 | + | |
| 585 | + | |
586 | 586 | | |
587 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
588 | 590 | | |
589 | | - | |
590 | | - | |
591 | | - | |
| 591 | + | |
| 592 | + | |
592 | 593 | | |
593 | | - | |
594 | | - | |
595 | | - | |
| 594 | + | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
| 674 | + | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 236 | | |
242 | 237 | | |
243 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4053 | 4053 | | |
4054 | 4054 | | |
4055 | 4055 | | |
4056 | | - | |
| 4056 | + | |
4057 | 4057 | | |
4058 | 4058 | | |
4059 | 4059 | | |
| |||
4078 | 4078 | | |
4079 | 4079 | | |
4080 | 4080 | | |
4081 | | - | |
| 4081 | + | |
4082 | 4082 | | |
4083 | | - | |
| 4083 | + | |
4084 | 4084 | | |
4085 | 4085 | | |
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
4089 | | - | |
| 4089 | + | |
4090 | 4090 | | |
4091 | | - | |
| 4091 | + | |
4092 | 4092 | | |
4093 | | - | |
| 4093 | + | |
4094 | 4094 | | |
4095 | 4095 | | |
4096 | 4096 | | |
4097 | 4097 | | |
4098 | 4098 | | |
4099 | | - | |
| 4099 | + | |
4100 | 4100 | | |
4101 | 4101 | | |
4102 | 4102 | | |
| |||
4106 | 4106 | | |
4107 | 4107 | | |
4108 | 4108 | | |
4109 | | - | |
| 4109 | + | |
4110 | 4110 | | |
4111 | 4111 | | |
4112 | 4112 | | |
| |||
4142 | 4142 | | |
4143 | 4143 | | |
4144 | 4144 | | |
4145 | | - | |
| 4145 | + | |
4146 | 4146 | | |
4147 | 4147 | | |
4148 | 4148 | | |
| |||
4152 | 4152 | | |
4153 | 4153 | | |
4154 | 4154 | | |
4155 | | - | |
| 4155 | + | |
4156 | 4156 | | |
4157 | | - | |
4158 | | - | |
| 4157 | + | |
| 4158 | + | |
4159 | 4159 | | |
4160 | 4160 | | |
4161 | 4161 | | |
| |||
4164 | 4164 | | |
4165 | 4165 | | |
4166 | 4166 | | |
4167 | | - | |
| 4167 | + | |
4168 | 4168 | | |
4169 | 4169 | | |
4170 | 4170 | | |
| |||
0 commit comments