Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1057070imm; Fri, 29 Jun 2018 10:37:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLBjxe/sOHyp5f/iM7GQ6IinPaaCekrKYnJEumzhb9PsUbsFmbFWM/Uz9FD7OiO9BP8Z4pg X-Received: by 2002:a63:2c94:: with SMTP id s142-v6mr13106082pgs.39.1530293831330; Fri, 29 Jun 2018 10:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530293831; cv=none; d=google.com; s=arc-20160816; b=orb6Loeuwwa6qwF65+GpiCI3wAhN4iRCdiY84M8HNeEwWmSHHhBCNJYP3E3FRLubFp 3lrFBPmAu9JZCHv7AafoDc7GKt/ZPrXaNqoipWhrxI1USS8fugOpFGiOf83ym++9tLRd LIW881BPJpjfU0Q8zaPGTbKnI1dYLx9A3tY5f8GWPteWaKqOo0CRYCdQzY9xbKDUwLx8 /bgJHZC8zv7F9HyHJ9aexDtQ03W5Gh7hZwcBNOgKcUwb6n0StdMIj1THk5z2YxPa/P9/ PqyvDNmcWWwODfp8j46nG06nlifRWVSQtBqS4DYqkxwj2DuqsAmbDn8oumztj0CN4+1v VILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=uXLquTH6VPFikEBQcUIKH2gS1OeMQHyP1aEiY5BxmGU=; b=i7Sh4CTAKC9DSCDG96Nv1ohN7Hry/XuIsWNKq31GeBpK0SaxJtwc7IdnymMwOVtmno XKtOWqWATqutNPHgk1GIUGdBYzTY4XY3tgZcLU+waMzChwNaTqmfAkQnlv6hR7qf6RHb +QMMiKT6kO4XsJy1IOQRo5Z4VPGtnzABwY3RWkyePoKXrtYO0eRbELRvHnxdineLfM/A 0yodnKQW9/4WUfTHg8i0yp/MmYS6ogPcLArKHwu2oQd37QJErR8roCgAUO0H1Ci0COHO e5AEMvllrFwuYBJIH0a1R372re/3arOAppsSwA/Xt4Jdr/xt0NB8FLHhDIzQq0PoD7DI MaHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bYcuY3Dd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si8763494pgb.61.2018.06.29.10.36.57; Fri, 29 Jun 2018 10:37:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bYcuY3Dd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753260AbeF2RDZ (ORCPT + 99 others); Fri, 29 Jun 2018 13:03:25 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:40100 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeF2RDW (ORCPT ); Fri, 29 Jun 2018 13:03:22 -0400 Received: by mail-io0-f194.google.com with SMTP id t135-v6so9062752iof.7; Fri, 29 Jun 2018 10:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uXLquTH6VPFikEBQcUIKH2gS1OeMQHyP1aEiY5BxmGU=; b=bYcuY3Dd+kPqEKk7T2RNnfNX6m5hT9DdOVLHKjKTlEpa2MfFFFbMmsD3rcKDBpOwQi vgkV/sVQ51juYFOB/LMFfMojqJYOBuDJO8UxntSsxKeUs4wbM8itZtJTe1hPEOgRMVtm EOCCMCILYQ7CKjbU7cc+xAPMk4mSk45AQRqZw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uXLquTH6VPFikEBQcUIKH2gS1OeMQHyP1aEiY5BxmGU=; b=pWQbRL8FZ9H9sa5pD+j1dUW/ag34EFv4aW9dszAOKqA/8mvrSJICjzGOg7C9R2Ll4i OCZ0bfNgSjPNPTLRfU0foqztGRRHZVrKWB6mfgwK+bvztrmT1bLwhjgG4bygegbtJq5W tcbzNCEJ+X2mO9Nbz50z3mvo3VffTNSTe5TAcgEEPzJ60A2IWpktiI+TSSdmC8+pLOo5 1/0ka1/tu6xaUuXwIPeSEQn51M+sGMpsgzUHXdlKgc0GkNzJWn6Rn2h2LHgSCwHT+V0z 01HuKFYpIvgc3DQpeiW6TAeR6A7mQ6wWfQcRxhsPOPoLlz4bhXkOt37Gj3gT1Ov4zAWR ArQA== X-Gm-Message-State: APt69E2f9NUTU+O5KZdysWzYPj0eOQyvwBhvLbJenBkKmZejrA70Fiym yb3i9lWDYH+8ftVKHVJOP5vBz6ev7KupH3QBcnU= X-Received: by 2002:a6b:980e:: with SMTP id a14-v6mr8322290ioe.238.1530291802040; Fri, 29 Jun 2018 10:03:22 -0700 (PDT) MIME-Version: 1.0 References: <20180628162359.9054-1-mathieu.desnoyers@efficios.com> <9200ED2A-AE4B-4094-81C9-E92240B4840F@amacapital.net> <1706339668.9644.1530281144560.JavaMail.zimbra@efficios.com> <729451355.9702.1530284622326.JavaMail.zimbra@efficios.com> <247789350.9741.1530288432573.JavaMail.zimbra@efficios.com> In-Reply-To: <247789350.9741.1530288432573.JavaMail.zimbra@efficios.com> From: Linus Torvalds Date: Fri, 29 Jun 2018 10:03:10 -0700 Message-ID: Subject: Re: [RFC PATCH for 4.18 1/2] rseq: validate rseq_cs fields are < TASK_SIZE To: Mathieu Desnoyers Cc: Andy Lutomirski , Andrew Lutomirski , Thomas Gleixner , Linux Kernel Mailing List , Linux API , Peter Zijlstra , Paul McKenney , Boqun Feng , Dave Watson , Paul Turner , Andrew Morton , Russell King - ARM Linux , Ingo Molnar , Peter Anvin , Andi Kleen , Christoph Lameter , Ben Maurer , Steven Rostedt , Josh Triplett , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 9:07 AM Mathieu Desnoyers wrote: > > This code is not invoked from syscalls, but rather on return from > interrupt/trap after a preemption. But when we register the rseq, we could easily check that the top bits of the IP is clear, no? Sure, user space can change it after the fact, but at that point it's literally "user space is being intentionally stupid". The real worry is that 32-bit compat code never initializes those bits at all, no? Linus