From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758477AbdJMMuY (ORCPT ); Fri, 13 Oct 2017 08:50:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43846 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758325AbdJMMuW (ORCPT ); Fri, 13 Oct 2017 08:50:22 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 39B95A964E Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Subject: Re: [RFC PATCH v9 for 4.15 01/14] Restartable sequences system call To: Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Peter Zijlstra , Paul Turner , Andrew Hunter , Andy Lutomirski , Dave Watson , Josh Triplett , Will Deacon Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Andi Kleen , Chris Lameter , Ingo Molnar , "H. Peter Anvin" , Ben Maurer , Steven Rostedt , Linus Torvalds , Andrew Morton , Russell King , Catalin Marinas , Michael Kerrisk , Alexander Viro , linux-api@vger.kernel.org References: <20171012230326.19984-1-mathieu.desnoyers@efficios.com> <20171012230326.19984-2-mathieu.desnoyers@efficios.com> From: Florian Weimer Message-ID: <19edaac0-98d7-e7a0-aceb-b861a2befce4@redhat.com> Date: Fri, 13 Oct 2017 14:50:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171012230326.19984-2-mathieu.desnoyers@efficios.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 13 Oct 2017 12:50:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/2017 01:03 AM, Mathieu Desnoyers wrote: > Expose a new system call allowing each thread to register one userspace > memory area to be used as an ABI between kernel and user-space for two > purposes: user-space restartable sequences and quick access to read the > current CPU number value from user-space. > > * Restartable sequences (per-cpu atomics) > > Restartables sequences allow user-space to perform update operations on > per-cpu data without requiring heavy-weight atomic operations. > > The restartable critical sections (percpu atomics) work has been started > by Paul Turner and Andrew Hunter. It lets the kernel handle restart of > critical sections. [1] [2] The re-implementation proposed here brings a > few simplifications to the ABI which facilitates porting to other > architectures and speeds up the user-space fast path. A locking-based > fall-back, purely implemented in user-space, is proposed here to deal > with debugger single-stepping. This fallback interacts with rseq_start() > and rseq_finish(), which force retries in response to concurrent > lock-based activity. This functionality essentially relies on writable function pointers (or pointers to data containing function pointers), right? Is there a way to make this a less attractive target for exploit writers? Thanks, Florian