[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131129183558.GA9803@redhat.com>
Date: Fri, 29 Nov 2013 19:35:58 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
x86@...nel.org, Andi Kleen <ak@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] Add a text_poke syscall v2
On 11/25, Andi Kleen wrote:
>
> + err = get_user_pages_fast((unsigned long)addr, npages, 1, pages);
> + if (err < 0)
> + return err;
> + if (err != npages) {
> + err = -EFAULT;
> + goto out;
> + }
> + err = 0;
> + mutex_lock(&text_mutex);
> + bp_target_mm = current->mm;
> + bp_int3_addr = (u8 *)addr + 1;
> + __text_poke_bp(pages,
> + (unsigned long)addr & ~PAGE_MASK,
> + insn, len, handler);
We are going to change this user page, it seems that we need
set_page_dirty() ?
Andi, et al. I am going to discuss the things I do not really
understand, probably this can't make any sense, but...
I am wondering if sys_text_poke() can do something like
down_write(mmap_sem);
get_user_pages(write, page, vma);
ptep = page_check_address(...);
pte = ptep_clear_flush(ptep);
copy-opcode-to-page;
pte = pte_mkdirty(pte);
set_pte_at(ptep, pte);
pte_unmap_unlock(...);
up_write(mmap_sem);
?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists