Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp37184imm; Thu, 28 Jun 2018 14:24:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKonsn8lRLAogw+1ET/A11hZPXRUY3m5j1dU0mJEYNmfvHlg5zgiKmsTjZhpAaexDLzlDts X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr11882042plc.301.1530221055262; Thu, 28 Jun 2018 14:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530221055; cv=none; d=google.com; s=arc-20160816; b=x5Xcd16+KhJpligZ2OpIs1hRtyfBqYerxymGq3FDEPJ2Rk3VuNCFxP/OdgfpMKIck5 p3R/vWuZ8UJ03Z/shcxN3xAjjksoyIuNeJmAhAaQKWRhp0aeC3NZsjCmT34Kz7aPEinC CHxFc4/AnKnnhdrNY0hnAk3fq0B5l12bWO2zTYXUeJGa6pbRjCiiwonWmq/a18/18qE1 6Y708MLmhGaOAD7sNGh8P248diaZILe2Cui38tFnJj4PNG9w7Y9ZEzo4i8Nz7iYMIFtl pZeLRVlhRg05Dc1L6QsDUu11B1YrPnm6eug/0fj9NNGZDQWGrcjwDx6BsZlkxV606L+e uoJw== 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=3KqTMhO9wk67UjDyc7BMCZLUZ/ESiYpnMwRgq8QjpC4=; b=gvj9JZu48lp2/HwwGmBnSSrO/y/2HHI5qdk7hrZGbdIWbNx5qwNA0m3oAC/HykD5vN BVq8vZJQkZi5R1e7ToPtfJxiwmbgnJvzsUomT9dKoOBZd8Ak+a7o0UibE+WSCksGKuyE pm0PaGG2IL47cgocBqH26MkLm7YjoSrcQ9iMOpFvIIUT9Z8HM8IKa2Wcscs0WJcjflyZ aKBmwBz1TF5d4AR8PCpvF6ma5KIdpLLbRhsE+MP2uoUHcaQJIWgXm+0ceTD5nldyf3jj aXLDeqfHxc6rrjhbymGBKDuVf4sIw2Wf6ef7zj7IwqrGKXvimjFa1Yu7/2SR0MpvlkxN JGIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=bjM0dScq; 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 m187-v6si6832002pgm.418.2018.06.28.14.23.41; Thu, 28 Jun 2018 14:24:15 -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=bjM0dScq; 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 S964939AbeF1VWl (ORCPT + 99 others); Thu, 28 Jun 2018 17:22:41 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:41675 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbeF1VWj (ORCPT ); Thu, 28 Jun 2018 17:22:39 -0400 Received: by mail-io0-f196.google.com with SMTP id k16-v6so6576694ioa.8; Thu, 28 Jun 2018 14:22:39 -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=3KqTMhO9wk67UjDyc7BMCZLUZ/ESiYpnMwRgq8QjpC4=; b=bjM0dScqjgyQzjsCnyR3RBAY6SactJHLi+WxXFAoYRIPgepdFfGY2eOHqyxcNUdrlV /+en2oZKLtK+3E3BQ3gOGys1mZnpeGe+7f9lko8SJcr9+Qs/xbQrwGV4nCIwaOk6oyOh VQoHoCy7oWsbReJMhX3w39KQTlzpH6IEjqdLM= 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=3KqTMhO9wk67UjDyc7BMCZLUZ/ESiYpnMwRgq8QjpC4=; b=KNJ9cNEXY4Lwe1MCL9C+4FHrLnnqPZ3WXDLAHoE8Bl3Aq0Vy06dntn5aynsmaapcvJ C018UjLK1UaECtZoAQGlwBg98E+CwdTsXdroFmXzZvpHZQMAbdDQcYo1ebAIwpf70H0X IkhoBrVQ+bDdHyO4u6W9ox2XCfbAY+5da3kChAU+HLZ91WpznYuyJff9Vtkj85FsvZrK CQ+L/6T0cA3t2r3Rbp7+L9Xq88uYaFrgvXDLc08ZPDO1l4pn5LcvW+r81FrEzV+tTFSv Tyl5/uplFxCxQB0mH1XvZNBVdqW36MtbnXG8iOVZrt9xHMqRcSre6PDJkchcK0f3t/62 a3aQ== X-Gm-Message-State: APt69E3mLyEFDjhwWmupiECMQK0pLE33y4/iYWtKEl9tHY3lLH/yiR54 RqGiuzUejShMkxiWpFci3mF3qYEYKimzEgRDU7Q= X-Received: by 2002:a6b:1502:: with SMTP id 2-v6mr10650264iov.203.1530220958881; Thu, 28 Jun 2018 14:22:38 -0700 (PDT) MIME-Version: 1.0 References: <20180628162359.9054-1-mathieu.desnoyers@efficios.com> In-Reply-To: From: Linus Torvalds Date: Thu, 28 Jun 2018 14:22:27 -0700 Message-ID: Subject: Re: [RFC PATCH for 4.18 1/2] rseq: validate rseq_cs fields are < TASK_SIZE To: Andrew Lutomirski Cc: Mathieu Desnoyers , 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 , joelaf@google.com 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 Thu, Jun 28, 2018 at 1:23 PM Andy Lutomirski wrote: > > This is okay with me for a fix outside the merge window. Can you do a > followup for the next merge window that fixes it better, though? In > particular, TASK_SIZE is generally garbage. I think a better fix > would be something like adding a new arch-overridable helper like: > > static inline unsigned long current_max_user_addr(void) { return TASK_SIZE; } We already have that. It's called "user_addr_max()". It's the limit we use for user accesses. That said, I don't see why we should even check the IP. It's not like that's done by signal handling either. Linus