If kip->nused is not zero, collect_one_slot() return false, otherwise do
a lot of linked list operations, reverse the processing order to make the
code if nesting more concise. __disable_kprobe() is the same as well.
Signed-off-by: Jinjie Ruan
---
kernel/kprobes.c |
The CONFIG_KPROBES_ON_FTRACE #if/#else/#endif section is small and doesn't
nest additional #ifdefs so the comment is useless and should be removed,
but the __ARCH_WANT_KPROBES_INSN_SLOT and CONFIG_OPTPROBES() nest is long,
it is better to add comment for reading.
Signed-off-by: Jinjie
Add the __counted_by compiler attribute to the flexible array member
stripes to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Signed-off-by: Jinjie Ruan
---
kernel/kprobes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kprobes.c
Annotate structs with __counted_by() for kprobe and do some cleanup.
Jinjie Ruan (3):
kprobes: Annotate structs with __counted_by()
kprobes: Cleanup the config comment
kprobes: Cleanup collect_one_slot() and __disable_kprobe()
kernel/kprobes.c | 87
On 2024/7/20 0:01, Kees Cook wrote:
> On Fri, Jul 19, 2024 at 11:14:27AM +0800, Jinjie Ruan wrote:
>> Add support of kernel stack offset randomization while handling syscall,
>> the offset is defaultly limited by KSTACK_OFFSET_MAX().
>>
>> In order to avoid tri
do_syscall() at function level.
With this patch, the REPORT_STACK test show that:
`loongarch64 bits of stack entropy: 7`
Signed-off-by: Jinjie Ruan
Suggested-by: Huacai Chen
---
v2:
- get_random_u16() -> drdtime().
- Add Suggested-by.
---
arch/loongarch/Kconfig | 1 +
a
ight.
"DRDTIME" can access independent stable counter of the processor core
according to "Loongson Processor 3C5000L Register Instruction Manual",
which is similar to "RDTSC" in x86.
I'll update it in next version.
>
> Huacai
>
> On Thu, Jul 18, 2
do_syscall() at function level.
With this patch, the REPORT_STACK test show that:
`loongarch64 bits of stack entropy: 7`
Signed-off-by: Jinjie Ruan
---
arch/loongarch/Kconfig | 1 +
arch/loongarch/kernel/syscall.c | 16 +++-
2 files changed, 16 insertions(+), 1