Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp362744imm; Fri, 31 Aug 2018 02:27:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbIL8W4PxLkXr77bIc/2m0v074hmozbAJTPnr61jiCqjwpwna5QdEFxgXoiEkUpDTYAL8eV X-Received: by 2002:a17:902:4124:: with SMTP id e33-v6mr14596453pld.48.1535707621831; Fri, 31 Aug 2018 02:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535707621; cv=none; d=google.com; s=arc-20160816; b=xo0TXQhPmoNEMgHDFKwWZdF/20PnI3hnYo/2TTU9bHIqI+1MeTlN6mlYAQcmXFZrE4 qBP/Ckn7i0qwWRUHBMzsu4n34oOf+41hfXOxRIlZ60bE3IujZ/OAs/M3WSelptbAKIeK xVCAnRqZOtOzpTnap/PmaX7xuSJ+y1UWODIQCR9io1lqqzWvEnVS66GHS5rzcB0Jaahm RcloOd3VcMwjFlq5VIiuBgV+eYW9+J39usFulzAevsxB7OCc3IujCQxg3Ckx1ZBc/oE4 +Q+56JDDz5Jjv/AVN/D46u73UD+BZCKF1rBJhxUB7HARaq7oP5rvCPPsUpT5eb3zdvgB oycA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=f39v9NvL0dna5Wxvti4XgLL2bwfWPTeGuj+93NLRq2g=; b=VmICrXSRgNel9CdhYC7yuGBc1bkm7K9qka60eHBZL/49kPGuONUkm/6pHAvFVu44uC Hcx20rkMCr3ezES4ACmQtrHiDLeEnCpeIV3BUS12MPlI0AzogS3Z9wahcSl3FRwl0Wbb HYWh0op5K8t32ZWdH4FAWDFJNISgP+48f4F+aOrmkGCMETYqWCwTtQAct8FXiO1Olf9u LrHbe8s+12hw88AaTvQ6YKw52S+6UnHwMBlmu7o62m2tmmITkQwrx81aWUnY4ZgP5QAK Da1gy8Ie/OuAZXQTSZmeyZR+zVHkJ9jYMPf4jJaGfZVnwRv90Fel97V3efkDgF455RYk vo3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TJuevRr0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si7768293pli.355.2018.08.31.02.26.47; Fri, 31 Aug 2018 02:27:01 -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=@gmail.com header.s=20161025 header.b=TJuevRr0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbeHaMdg (ORCPT + 99 others); Fri, 31 Aug 2018 08:33:36 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:50983 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeHaMdg (ORCPT ); Fri, 31 Aug 2018 08:33:36 -0400 Received: by mail-wm0-f68.google.com with SMTP id s12-v6so4380706wmc.0 for ; Fri, 31 Aug 2018 01:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=f39v9NvL0dna5Wxvti4XgLL2bwfWPTeGuj+93NLRq2g=; b=TJuevRr0s0G8sPZ8pqCfwr69T9ty8m1sPHVhP2cYVzxR7f/pPNpsj1u+IvNyOM9Y38 B4SSfgktnyF9D98re/rekALXnPbZe8ryN7JudthO5qarpbDsMIUwdbxrjVIcpmUJP2S3 UQbfKSICZ/T0nQOkTKKa+FdzXGLIYb+Tj1VshHvF8GlLd3BWLcj1axSqa0q1J+J5ALoZ AAJlkoaWP3obRN4xFEs1ryiuwpkjdjROymsBg055ELV/Ga29V+1vSjQlY4aTqYFlX+4x VKZlVDvrWKU5maqJ0eGaGRmRzl/0QktykF7zg7UVd7PM4v2N/buZnskxSjmQgiQdZ6Y/ xnRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=f39v9NvL0dna5Wxvti4XgLL2bwfWPTeGuj+93NLRq2g=; b=DF5jwOeeb20Q6K3orOevg1vmVaeIb31ORBmtFxoru4JZOHCJcNxvNMONJAKL4URFqy o5otu3oa94aQrzHQ6jOmzOpaGcRrlcIuPG6wTVeNJH3wHzU74tYYox3VbFcGGiaarAW1 Z7fNoUxJasTX5Xsb8u34N7PLyyKc4CWfiBSNUIWktF46NYR/LtIT6x1VlEaFrYM9/wWK mcuMKSPovuP4O9GVB+lbgPWAl404QAXDyiwrn1k6mgGRppXnMVHYx/fD8NTS25LEHZJ3 ihSmkErrZa5zEukPatOlmIlXLAFPoUclpIoF/Hlqtna0P/7Rgv6QS5a/NJ0XjKyhgaBt +Ccw== X-Gm-Message-State: APzg51CMHmV5PRjDscVW7hMbKeOV3OuVKV+ViN8kXTsfXrwan0MFvHJS KiI9+r33Tz1LL36SOX06dCxog5GO X-Received: by 2002:a1c:1188:: with SMTP id 130-v6mr3997573wmr.138.1535704035743; Fri, 31 Aug 2018 01:27:15 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4006:df00:41c4:f3ec:dcc3:6a2f]) by smtp.gmail.com with ESMTPSA id k35-v6sm14523080wrc.14.2018.08.31.01.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 01:27:15 -0700 (PDT) Date: Fri, 31 Aug 2018 10:27:14 +0200 From: Luc Van Oostenryck To: Jann Horn Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Kees Cook , Borislav Petkov Subject: Re: [PATCH] x86/dumpstack: fix address space casting in show_opcodes() Message-ID: <20180831082712.cbfvv655amizvkfq@ltop.local> References: <20180830194736.210039-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180830194736.210039-1-jannh@google.com> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 30, 2018 at 09:47:36PM +0200, Jann Horn wrote: > I sloppily passed a kernel-typed pointer to __range_not_ok(), and sparse > doesn't like that. > Make `prologue` a __user pointer (to protect against accidental > dereferences) and force-cast it to a kernel pointer when calling > probe_kernel_read(), which will then immediately force-cast it back to a > user pointer. It's a bit sad to have to do this. __range_not_ok() explicitly requires a __user pointer (I don't know if there is a good reason for it) but the real job is done by __chk_range_not_ok(). Can't you use this later instead? -- Luc Van Oostenryck