Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp636279imm; Mon, 2 Jul 2018 19:20:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcU7k8XdclJct0vhjxFNTQMxjL7DoaoZW+D6yVGYHl7ZiKwY0w4HVRZFjacmmrjUhsvlETn X-Received: by 2002:a62:3783:: with SMTP id e125-v6mr27554289pfa.232.1530584433880; Mon, 02 Jul 2018 19:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530584433; cv=none; d=google.com; s=arc-20160816; b=zn/9DBWgHm7s48xhq8k88ojxjXZRTmAuPqPabpVb0DFT87H460wiCOICIJDG8beTn0 YTKdi/yNDXsWNggQ80nOnTEIhM32ywFcShEfGjeMUxxEU8eABy3zVuNyZ8FTKO/VVMVr u6JmvvTZDB/9/cORM0/8wX8TvrNK++oLgS8jlzznSkhc+c/15zAQYYB/9gitHfMYFjHd n4VqeW+lvIE6qtxcKcXl+TtALrIS8W50tm2qMS9zrLK0m1WPnV6OH2N9koSc+HLZ3U9i bLe51tPaDCHBgDI2S2qTWPvN8qD7dCUxq9rj4S4UqfLEA4SclDaNsPUYhJW5TJVeAclo SCBQ== 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=x4xZeRzIUXCIwk41rsBxf/Mu+TyZxUIn9ioB+2frsw0=; b=KQBmv3CrrsRN8p1KSeZATUGFBmKaPIiboay7bZdNHiPQ8NfbxGo+b/KPYJKtisnzLe /dQMzLeiONit49HGyl57DAlWaKRprwrp3GQepKYd856NFgDMdhQK5P3XlX6iwe/acsXw +Ibr3GSbhqHkGV43xelSLbcARyiWsNFjmpoWP5qzW5SLg3Hp8HmrlTxlfR3XyHO2gdb/ syFwEnmkKrpTur+Rgt9fzcDZKPrhcUQ1qlzA2PAYToJuqakOQYcNWqCW/gq5QwpvaDa7 5YHF+iG9SnNVCEOR2H2EfhjtcZJuRMcbqWg5GpyleDBthkR5jn9Un9Z2FMaGFSPEhpC5 +BTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=PuM4TgB9; 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 y63-v6si2094pgb.5.2018.07.02.19.20.19; Mon, 02 Jul 2018 19:20:33 -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=PuM4TgB9; 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 S1753861AbeGCCSv (ORCPT + 99 others); Mon, 2 Jul 2018 22:18:51 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:56077 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753495AbeGCCSu (ORCPT ); Mon, 2 Jul 2018 22:18:50 -0400 Received: by mail-it0-f66.google.com with SMTP id 16-v6so991263itl.5; Mon, 02 Jul 2018 19:18:49 -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=x4xZeRzIUXCIwk41rsBxf/Mu+TyZxUIn9ioB+2frsw0=; b=PuM4TgB9iW0nY/nzEbEwKXFUZuwJ7FQSwADPmiOxCc2mny0pWGM6WD3dM37AP37v+l ugqou2IErccn3doHouGRUoswLn46h/ef/4dBokbmeRG4uH7pW01ieMel5FQcpKPoVpb/ hrMpf6DEy0PEumA39VeLz1WP65W/MAn85it7A= 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=x4xZeRzIUXCIwk41rsBxf/Mu+TyZxUIn9ioB+2frsw0=; b=XUzTU3REpGHcqMEKBjK+w6Z/1kq8gLjnhBpynlG2rimUK/3vAdl2tIxu7t/zOtDoIG zyJuPU7QiDhbGMg/wm7aBoHLRlj5Z7RZL9ilQhYCPV+Mk00QF8MZNS26Y3PtlBhxZSIM X5pCYpn0ZB01uW/Gs28LXCk5ZryMJJD5+XooAH5l2m0C9ABdNGZqbwjT4dnVue+D0Dll SpfqdhEiNAPammfII2nQ/eoEZ0iwm93YLJ0fM87sCPxCI76VlUhLqw2eSTRWZAgJ+8W/ ZfBqZ+vidk02ul3/bp4dADZ5ccYtQzpLz6uzlJSRG0wp3zoVfy50cVeVgiLRT/mpNrK/ ltmQ== X-Gm-Message-State: APt69E2HZC4qbLtcIMDzHKlQF0j/S4WGsm6xA+Go9+up6bZl5VQzRDPg wvWYDBGerpNitrYOdmwVpM8S21NawnNhQMgfOiE= X-Received: by 2002:a02:1bdc:: with SMTP id 89-v6mr22347283jas.72.1530584329442; Mon, 02 Jul 2018 19:18:49 -0700 (PDT) MIME-Version: 1.0 References: <20180702223143.4663-1-mathieu.desnoyers@efficios.com> <415287289.10831.1530572418907.JavaMail.zimbra@efficios.com> <825871008.10839.1530573419561.JavaMail.zimbra@efficios.com> <1959930320.10843.1530573742647.JavaMail.zimbra@efficios.com> <8B2E4CEB-3080-4602-8B62-774E400892EB@amacapital.net> <459661281.10865.1530580742205.JavaMail.zimbra@efficios.com> <858886246.10882.1530583291379.JavaMail.zimbra@efficios.com> In-Reply-To: <858886246.10882.1530583291379.JavaMail.zimbra@efficios.com> From: Linus Torvalds Date: Mon, 2 Jul 2018 19:18:38 -0700 Message-ID: Subject: Re: [RFC PATCH for 4.18] rseq: use __u64 for rseq_cs fields, validate user inputs To: Mathieu Desnoyers Cc: Andy 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 Mon, Jul 2, 2018 at 7:01 PM Mathieu Desnoyers wrote: > > One thing to consider is how we will implement the load of that pointer > on the kernel side. Use "get_user()". It works for 64-bit objects too, and it will be atomic in the 32-bit sub-parts on a 32-bit architecture. Again: there is no point in trying to be atomic in the full 64 bits (when you're running on 32-bit). The upper bits don't have to "match" the lower bits. They just have to be zero. So doing it as two loads is fine - the same way it's perfectly fine to do it as two stores (since the store to the upper bits will always be zero). Linus