Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp654328imm; Fri, 31 Aug 2018 09:39:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaiAC8QjnInet+coUaBLhb+cDPglWcsIFVWdSYfR/LDe3oIvVUrnzFNKhDK1xq4GTyc8Kty X-Received: by 2002:a62:50c3:: with SMTP id g64-v6mr16643549pfj.244.1535733564320; Fri, 31 Aug 2018 09:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535733564; cv=none; d=google.com; s=arc-20160816; b=a0Z9txXhk3djH/kiRPd0KKCpQYv1FNfwzrn/iy33k79NaDaJy+F2QfX9quX9YAzsDM drZA6ejmqTJ/g+KO7NXR0LGTcEt1VEi/UqaHeIux+oiCbG6SCWLo9lbEA4Wlx/az6TTe 8MUSrCZrgTt9hj4ImX1AicxfZe4BWHNvEOK3CxKcJ8angQX2AB+cVAUfCxwsimZ2LF5S 9a/hC5pEDHZNjejgQ3S1MxSsCeZHJvsgLm2kR56Dr/+oDHvF6IYkE3/JEygkN0vNAVu+ C2tbolBgQs5oN6o7EYxqKRE3TF5IWuODvxMYTUWvlbmTJQaqBSV6kt8HiLNb5OWt4ewI t44A== 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=QsUWn1tdpegM0IUsMBl6l5qr5WlKXJe7TqKmA3ZUpEQ=; b=N0Zh8HFdlz630CyIhWpLhEEH4xFa6rkmKV44D/RM5gnuIObYc+RRysVmVzECwDUw6G asbutMrKqRzPVRYsYWSTR8Z+KzPB1hzn72IbN73glbUAOeruobHcIliGIov6MayvuX69 fJf5hu0BohQW1xJ6qQTI7+Ox5cAWMjBxBbKfBy21NeE4w9lfJca+RgYvU4H4E9zXJqoH HMRwvzXgEQ9Nhahu3ADcIgEI0nyGgBWtuj+CqX/W9Q3my6n2znsCBc1eeNT93sYGEEy5 tuy1AB8B0U9yJrbrNH3m/qFAXYSbEL4OkEUgiH1ww/cUZo/ZkOSmOwkhcHqaxy11VLEz 2mpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WPKslM1a; 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 f27-v6si4380851pga.334.2018.08.31.09.39.09; Fri, 31 Aug 2018 09:39:24 -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=WPKslM1a; 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 S1728714AbeHaSpw (ORCPT + 99 others); Fri, 31 Aug 2018 14:45:52 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46818 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728627AbeHaSpw (ORCPT ); Fri, 31 Aug 2018 14:45:52 -0400 Received: by mail-wr1-f66.google.com with SMTP id a108-v6so11405601wrc.13 for ; Fri, 31 Aug 2018 07:38:04 -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=QsUWn1tdpegM0IUsMBl6l5qr5WlKXJe7TqKmA3ZUpEQ=; b=WPKslM1av1BrKv1PaB4J1pE3JVa9Wee4MrA/1sagBHb5AlBKIff4AehasmmXUx7z/o VY1ZGXvuF2nB232oJdHCcOmRSF65r4Fbop0q6iEEtWL3sRnO1t4jItA7bbZbne80UbkL XxdFOnxZnBpk0XXAMhXxICnU1e5wSQJyJ7+taQwKbCiNvuUgeeR+PkqsJ/PxvLUaXmGl JnZptNw0IVrZheNVprEjwSF+IRuVi33WRy88i4kycTgXLeqXs7Am+c/AdLBZ1XBhtAwD VgQ47vnyQnsMC/EW651ilFqwbuE2rRLxH605i9U1BreDw1gp3DkNHQPLJqU9qw+Swd9S iBkw== 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=QsUWn1tdpegM0IUsMBl6l5qr5WlKXJe7TqKmA3ZUpEQ=; b=l1Z7oOomtYU791wgdrrAipKsHlVAMixD4/4rBKJX3Gcl4fCI7j5w4WA/nzU1huZ5yP EF0OnPCU8M5UiPQH8YuZkv+o2hssX/njzQyk30TgJRsPbqh9msQm2zMgbuS8tIvbzldw UK3RcknLXzydBO+RwyahWcNQlcFENBIIv1vdviX1p6UwrwLS0UcPklCe04fkFctdWf9C GEzt5E/v9KpQ7IxEUrbHFvyp18HfUzdo2nw2ov4EihFdqHBkIhy1RvbpJRUkSt4MC9Fo MDwb1dxaJHnKb3hJuy9/3jrNjYKbOGbPkDORI8cgpB/BLm4Tcu6kTY5ygZgiGn4xqzzD JcYw== X-Gm-Message-State: APzg51AvHbsMduJwpMmXVB7zyoxNumpbIvgbIiD1NT9UcJNYms7egrm4 peC5RGtWiGKoSN7NZUHuFtA= X-Received: by 2002:a5d:6451:: with SMTP id d17-v6mr10307712wrw.64.1535726284051; Fri, 31 Aug 2018 07:38:04 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4006:df00:6d3b:d608:c6b2:3704]) by smtp.gmail.com with ESMTPSA id j6-v6sm9221232wrq.25.2018.08.31.07.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 07:38:03 -0700 (PDT) Date: Fri, 31 Aug 2018 16:38:02 +0200 From: Luc Van Oostenryck To: Jann Horn Cc: Thomas Gleixner , kernel list , Kees Cook , bp@suse.de Subject: Re: [PATCH] x86/dumpstack: fix address space casting in show_opcodes() Message-ID: <20180831143801.dn5dgpob7xb2kqaq@ltop.local> References: <20180830194736.210039-1-jannh@google.com> <20180831082712.cbfvv655amizvkfq@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 03:26:24PM +0200, Jann Horn wrote: > > By the way, here are all 60 probe_kernel_read() callers: ... > 41 of these (or something like that, I counted by hand) have some sort > of cast in the call expression. > probe_kernel_read() is kinda special in that expected types for the > second argument are both kernel pointers and unsigned longs. It might > make sense to have a wrapper macro around probe_kernel_read() that > accepts anything as long as it's as wide as a pointer... Well, if __user pointers should not be accepted, then it's much better, typewisely, to leave it as const void * (and cast the ulong args to some plain generic pointer, like void* or u8*). -- Luc Van Oostenryck