Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754381AbdLTEgj (ORCPT ); Tue, 19 Dec 2017 23:36:39 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:45920 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754325AbdLTEgg (ORCPT ); Tue, 19 Dec 2017 23:36:36 -0500 X-Google-Smtp-Source: ACJfBosU7NS/z1wuRIOq3lGrl7FkY0QAmfwnTfVRWeL6bJAmoOtNNkGtNPkA/EVDombBxU8m9ccO2P7Pf4jDHKXttdA= MIME-Version: 1.0 In-Reply-To: References: <001a113e9ca8a3affd05609d7ccf@google.com> <6a50d160-56d0-29f9-cfed-6c9202140b43@I-love.SAKURA.ne.jp> <20171219083746.GR19604@eros> <20171219132246.GD13680@bombadil.infradead.org> <20171219214849.GU21978@ZenIV.linux.org.uk> <20171220035043.GA14980@bombadil.infradead.org> From: Linus Torvalds Date: Tue, 19 Dec 2017 20:36:34 -0800 X-Google-Sender-Auth: sRP4VzktkXG8DM9v2VFeIozHUZk Message-ID: Subject: Re: BUG: bad usercopy in memdup_user To: Matthew Wilcox Cc: Al Viro , "Tobin C. Harding" , Dmitry Vyukov , Kees Cook , Tetsuo Handa , Linux-MM , syzbot , David Windsor , keun-o.park@darkmatter.ae, Laura Abbott , LKML , Mark Rutland , Ingo Molnar , syzkaller-bugs@googlegroups.com, Will Deacon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 34 On Tue, Dec 19, 2017 at 8:05 PM, Linus Torvalds wrote: > > And yes, we had a few cases where the hashing actually did hide the > values, and I've been applying patches to turn those from %p to %px. So far at least: 10a7e9d84915 Do not hash userspace addresses in fault handlers 85c3e4a5a185 mm/slab.c: do not hash pointers when debugging slab d81041820873 powerpc/xmon: Don't print hashed pointers in xmon 328b4ed93b69 x86: don't hash faulting address in oops printout b7ad7ef742a9 remove task and stack pointer printout from oops dump 6424f6bb4327 kasan: use %px to print addresses instead of %p although that next-to-last case is a "remove %p" case rather than "convert to %px". And we'll probably hit a few more, I'm not at all claiming that we're somehow "done". There's bound to be other cases people haven't noticed yet (or haven't patched yet, like the usercopy case that Kees is signed up to fix up). But considering that we had something like 12k of those %p users, I think a handful now (and maybe a few tens eventually) is worth the pain and confusion. I just want to make sure that the ones we _do_ convert we actually spend the mental effort really looking at, and really asking "does it make sense to convert this?" Not just knee-jerking "oh, it's hashed, let's just unhash it". Linus