lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.00.1311211059260.9932@twin.jikos.cz>
Date:	Thu, 21 Nov 2013 11:02:14 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	Andy Lutomirski <luto@...capital.net>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] Add a text_poke syscall

On Tue, 19 Nov 2013, Andi Kleen wrote:

> > > +	err = get_user_pages_fast((unsigned long)addr, npages, 1, pages);
> > > +	if (err < 0)
> > > +		return err;
> > > +	err = 0;
> > > +	mutex_lock(&text_mutex);
> > > +	bp_target_mm = current->mm;
> > > +	bp_int3_addr = (u8 *)addr + 1;
> > 
> > Do you need an smp_wmb here?  (Maybe there's a strong enough barrier in
> > __text_poke_bp.)
> 
> __text_poke_bp already has enough barriers (although I don't
> think they are really needed in any case)

As an author of those barriers I have to ask -- why do you think so? The 
first one is there to avoid int3 handler seeing !patching_in_progress 
while it has actually been entered due to text_poke_bp() kicking in.

The second one is there for exactly the inverse reason.

Both are pairing to smp_rmb() in poke_int3_handler().

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ