9181f7c690 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid
adding weak function")
2. commit 7af82ff90a2b ("powerpc/ftrace: Ignore weak functions")
3. commit f6834c8c59a8 ("powerpc/ftrace: Fix dropping weak symbols with
older toolchains")
Signed-off-by: Zheng Yejian
this issue, check that an given address is within the size of
the function found.
Signed-off-by: Zheng Yejian
---
include/linux/module.h | 7 +++
kernel/module/kallsyms.c | 19 +--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/include/linux/module.h b/include
quot;)
Signed-off-by: Zheng Yejian
---
kernel/trace/ftrace.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 0e8628e4d296..c46c35ac9b42 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -657
is generally 10+ times.
As an optimization, introduce linked list 'sym_list' to associate and
count all symbols, then store them into 'table' at one time.
Signed-off-by: Zheng Yejian
---
scripts/kallsyms.c | 33 -
1 file changed, 20 insertions(+), 13 deletions(-)
diff
T
solution, also two related definition for powerpc.
[1]
https://lore.kernel.org/all/20240607150228.gr8...@noisy.programming.kicks-ass.net/
[2]
https://lore.kernel.org/all/20240611092157.gu40...@noisy.programming.kicks-ass.net/
Zheng Yejian (6):
kallsyms: Optimize multiple times of realloc() to o
Fixes: aebfd12521d9 ("x86/ibt,ftrace: Search for __fentry__ location")
Signed-off-by: Zheng Yejian
---
include/linux/kallsyms.h | 13 +
include/linux/module.h | 7 +++
kernel/module/kallsyms.c | 23 +--
kernel/trace/ftrace.c| 15 ++-
d-by: Peter Zijlstra
Signed-off-by: Zheng Yejian
---
scripts/kallsyms.c | 101 +++-
scripts/link-vmlinux.sh | 4 +-
scripts/mksysmap| 2 +-
3 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.
On 2024/6/11 17:21, Peter Zijlstra wrote:
On Tue, Jun 11, 2024 at 09:56:51AM +0800, Zheng Yejian wrote:
On 2024/6/7 23:02, Peter Zijlstra wrote:
Oh gawd, sodding weak functions again.
I would suggest changing scipts/kallsyms.c to emit readily identifiable
symbol names for all the weak junk
On 2024/6/7 23:02, Peter Zijlstra wrote:
On Fri, Jun 07, 2024 at 07:52:11PM +0800, Zheng Yejian wrote:
ftrace_location() was changed to not only return the __fentry__ location
when called for the __fentry__ location, but also when called for the
sym+0 location after commit aebfd12521d9 (&quo
ry record in __mount_loc table will
slow down system boot and module load.
Solution 1 and 2 need every arch to handle the complex fentry location
case, I use solution 3 as RFC.
Fixes: aebfd12521d9 ("x86/ibt,ftrace: Search for __fentry__ location")
Signed-off-by: Zheng Yejian
---
includ
()/ftrace_free_mem().
Fixes: ae6aa16fdc16 ("kprobes: introduce ftrace based optimization")
Suggested-by: Steven Rostedt
Signed-off-by: Zheng Yejian
---
kernel/trace/ftrace.c | 39 +++
1 file changed, 23 insertions(+), 16 deletions(-)
v4:
- Simp
On 2024/5/3 05:07, Steven Rostedt wrote:
On Wed, 17 Apr 2024 11:28:30 +0800
Zheng Yejian wrote:
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index da1710499698..e05d3e3dc06a 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1581,7 +1581,7 @@ static struct
()/ftrace_free_mem().
Fixes: ae6aa16fdc16 ("kprobes: introduce ftrace based optimization")
Suggested-by: Steven Rostedt
Signed-off-by: Zheng Yejian
---
kernel/trace/ftrace.c | 46 ---
1 file changed, 30 insertions(+), 16 deletions(-)
v3:
, and call
synchronize_rcu() before freeing any ftrace pages.
Fixes: ae6aa16fdc16 ("kprobes: introduce ftrace based optimization")
Signed-off-by: Zheng Yejian
---
kernel/trace/ftrace.c | 43 +++
1 file changed, 27 insertions(+), 16 deletions(-)
v2:
On 2024/4/10 23:28, Steven Rostedt wrote:
On Mon, 1 Apr 2024 20:55:43 +0800
Zheng Yejian wrote:
KASAN reports a bug:
BUG: KASAN: use-after-free in ftrace_location+0x90/0x120
Read of size 8 at addr 888141d40010 by task insmod/424
CPU: 8 PID: 424 Comm: insmod Tainted: GW
text_address()`
and `__module_text_address()`, but use only `__module_text_address()`
once and do `try_module_get(module)` which is only available with
MODULE_STATE_LIVE.
Signed-off-by: Zheng Yejian
---
kernel/kprobes.c | 18 --
1 file changed, 12 insertions(+), 6 deletions(-)
v
On 2024/4/9 21:49, Masami Hiramatsu (Google) wrote:
On Tue, 9 Apr 2024 14:20:45 +0800
Zheng Yejian wrote:
On 2024/4/8 20:41, Masami Hiramatsu (Google) wrote:
Hi Zheng,
On Mon, 8 Apr 2024 16:34:03 +0800
Zheng Yejian wrote:
There is once warn in __arm_kprobe_ftrace() on:
ret
On 2024/4/8 20:41, Masami Hiramatsu (Google) wrote:
Hi Zheng,
On Mon, 8 Apr 2024 16:34:03 +0800
Zheng Yejian wrote:
There is once warn in __arm_kprobe_ftrace() on:
ret = ftrace_set_filter_ip(ops, (unsigned long)p->addr, 0, 0);
if (WARN_ONCE(..., "Failed to arm kprobe-ftrac
ret = -EINVAL;
goto out;
}
Signed-off-by: Zheng Yejian
---
kernel/kprobes.c | 18 --
1 file changed, 12 insertions(+), 6 deletions(-)
v2:
- Update commit messages and comments as suggested by Masami.
Link:
https://lore.kernel.org/all/20240408115038.b0c857
On 2024/4/8 10:50, Masami Hiramatsu (Google) wrote:
On Sun, 7 Apr 2024 11:59:04 +0800
Zheng Yejian wrote:
There is once warn in __arm_kprobe_ftrace() on:
ret = ftrace_set_filter_ip(ops, (unsigned long)p->addr, 0, 0);
if (WARN_ONCE(..., "Failed to arm kprobe-ftrace at %pS (err
hen
//the return value would still be 0 !!!
*probed_mod = __module_text_address((unsigned long) p->addr);
...
}
So adjust the module text check to fix it.
Signed-off-by: Zheng Yejian
---
kernel/kprobes.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
dif
records in
ftrace_location(), so is ftrace_location_range().
Fixes: ae6aa16fdc16 ("kprobes: introduce ftrace based optimization")
Signed-off-by: Zheng Yejian
---
kernel/trace/ftrace.c | 28 ++--
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/ke
el0_svc+0x34/0x68
el0t_64_sync_handler+0xb8/0xc0
el0t_64_sync+0x168/0x170
Suggested-by: Steven Rostedt
Signed-off-by: Zheng Yejian
---
kernel/trace/trace.c | 6 ++
kernel/trace/trace.h | 1 +
kernel/trace/trace_events_hist.c | 12
3 files changed, 15
el0_svc+0x34/0x68
el0t_64_sync_handler+0xb8/0xc0
el0t_64_sync+0x168/0x170
Suggested-by: Steven Rostedt
Signed-off-by: Zheng Yejian
---
kernel/trace/trace_events_hist.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
Steve, thanks for your review!
v2:
- Introduce
el0t_64_sync+0x168/0x170
Signed-off-by: Zheng Yejian
---
kernel/trace/trace_events_hist.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 1abc07fba1b9..00447ea7dabd 100644
--- a/kernel/trace
mments of ring_buffer_bytes_cpu() in this patch.
Fixes: c64e148a3be3 ("trace: Add ring buffer stats to measure rate of events")
Signed-off-by: Zheng Yejian
---
kernel/trace/ring_buffer.c | 28 +++-
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/kernel/tra
Without the newline character, the log may not be printed immediately
after the error occurs.
Fixes: ca376a937486 ("livepatch: Prevent module-specific KLP rela sections from
referencing vmlinux symbols")
Signed-off-by: Zheng Yejian
---
kernel/livepatch/core.c | 2 +-
1 file
Changelog for 'v2':
Complete commit messages with needed git commit ids as Greg and Lee suggested.
Lee sent a patchset to update Futex for v4.9, see
https://www.spinics.net/lists/stable/msg443081.html,
Then Xiaoming sent a follow-up patch for it, see
4409 ("futex: Provide distinct return value when owner is exiting")
... and is the correct fix for this issue.
Fixes: 9c3f39860367 ("futex: Cure exit race")
Cc: sta...@vger.kernel.org # v4.9.258
Signed-off-by: Xiaoming Ni
Reviewed-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Si
ned-off-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Zheng Yejian
---
kernel/futex.c | 71 +-
1 file changed, 65 insertions(+), 6 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index b410752f5ad1..116766ef7de6 100644
--- a/ke
evious futex back-port attempt]
Signed-off-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Zheng Yejian
---
kernel/futex.c | 138 +++--
1 file changed, 112 insertions(+), 26 deletions(-)
diff --git a/kernel/futex.c b/kernel/f
ee: Required to satisfy functional dependency from futex back-port.
Re-add the missing handle_exit_race() parts from:
3d4775df0a89 ("futex: Replace PF_EXITPIDONE with a state")]
Signed-off-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Zheng
m
Link: http://lkml.kernel.org/r/20170322104151.751993...@infradead.org
Signed-off-by: Thomas Gleixner
[Lee: Back-ported in support of a previous futex back-port attempt]
Signed-off-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Zheng Yejian
---
kernel/f
Lee sent a patchset to update Futex for 4.9, see
https://www.spinics.net/lists/stable/msg443081.html,
Then Xiaoming sent a follow-up patch for it, see
https://lore.kernel.org/lkml/20210225093120.GD641347@dell/.
These patchsets may also resolve following issues in 4.4.260 which have been
y: Xiaoming Ni
Reviewed-by: Lee Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Zheng Yejian
---
kernel/futex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index 116766ef7de6..98c65b3c3a00 100644
--- a/kernel/futex.c
+++ b
This patch may fix the following bug:
Link:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/?h=linux-4.9.y=5b1d078507bd33ebf6c2083fa363cf5832809c19
> static int __fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
> struct
Cc: Thomas Gleixner
Fixes: c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex")
Link:
http://lkml.kernel.org/r/20180122103947.gd2...@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar
Signed-off-by: Zheng Yejian
---
kernel/futex.c | 6 +++---
1 file changed, 3 insert
Cc: Thomas Gleixner
Fixes: c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex")
Link:
http://lkml.kernel.org/r/20180122103947.gd2...@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar
Signed-off-by: Zheng Yejian
---
kernel/futex.c | 7 +++
1 file changed, 3 insert
This patch may fix the following bug:
Link:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/futex.c?h=linux-4.9.y=282aeb477a10d09cc5c4d73c54bb996964723f96
> static int __fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
>
39 matches
Mail list logo