Thread (7 messages) flat view 7 messages, 3 authors, 2025-02-22

Re: [PATCH -next v2] uprobes: fix two zero old_folio bugs in __replace_page()

From: Tong Tiangen <hidden>
Date: 2025-02-22 02:37:16
Also in: bpf, linux-mm, linux-perf-users, lkml


在 2025/2/21 23:28, Oleg Nesterov 写道:
On 02/21, Tong Tiangen wrote:
quoted
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -506,6 +506,11 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
  	if (ret <= 0)
  		goto put_old;

+	if (is_zero_page(old_page)) {
+		ret = -EINVAL;
+		goto put_old;
+	}
I agree with David, the subject looks a bit misleading.

And. I won't insist, this is cosmetic, but if you send V2 please consider
moving the "verify_opcode()" check down, after the is_zero_page/PageCompound
checks.

Oleg.
OK, check the validity of the old page first and modify the subject in
v3 .

Thanks.

.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help