From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967285AbdLSNWy (ORCPT ); Tue, 19 Dec 2017 08:22:54 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:46069 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965422AbdLSNWx (ORCPT ); Tue, 19 Dec 2017 08:22:53 -0500 Date: Tue, 19 Dec 2017 05:22:46 -0800 From: Matthew Wilcox To: "Tobin C. Harding" Cc: 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 Subject: Re: BUG: bad usercopy in memdup_user Message-ID: <20171219132246.GD13680@bombadil.infradead.org> References: <001a113e9ca8a3affd05609d7ccf@google.com> <6a50d160-56d0-29f9-cfed-6c9202140b43@I-love.SAKURA.ne.jp> <20171219083746.GR19604@eros> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171219083746.GR19604@eros> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 19, 2017 at 07:37:46PM +1100, Tobin C. Harding wrote: > On Tue, Dec 19, 2017 at 09:12:58AM +0100, Dmitry Vyukov wrote: > > On Tue, Dec 19, 2017 at 1:57 AM, Kees Cook wrote: > > > On Mon, Dec 18, 2017 at 6:22 AM, Tetsuo Handa > > >> This BUG is reporting > > >> > > >> [ 26.089789] usercopy: kernel memory overwrite attempt detected to 0000000022a5b430 (kmalloc-1024) (1024 bytes) > > >> > > >> line. But isn't 0000000022a5b430 strange for kmalloc(1024, GFP_KERNEL)ed kernel address? > > > > > > The address is hashed (see the %p threads for 4.15). > > > > > > +Tobin, is there a way to disable hashing entirely? The only > > designation of syzbot is providing crash reports to kernel developers > > with as much info as possible. It's fine for it to leak whatever. > > We have new specifier %px to print addresses in hex if leaking info is > not a worry. Could we have a way to know that the printed address is hashed and not just a pointer getting completely scrogged? Perhaps prefix it with ... a hash! So this line would look like: [ 26.089789] usercopy: kernel memory overwrite attempt detected to #0000000022a5b430 (kmalloc-1024) (1024 bytes) Or does that miss the point of hashing the address, so the attacker thinks its a real address? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 333FC6B029F for ; Tue, 19 Dec 2017 08:22:51 -0500 (EST) Received: by mail-pl0-f69.google.com with SMTP id 31so7429047plk.20 for ; Tue, 19 Dec 2017 05:22:51 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id ay8si11037895plb.198.2017.12.19.05.22.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 05:22:50 -0800 (PST) Date: Tue, 19 Dec 2017 05:22:46 -0800 From: Matthew Wilcox Subject: Re: BUG: bad usercopy in memdup_user Message-ID: <20171219132246.GD13680@bombadil.infradead.org> References: <001a113e9ca8a3affd05609d7ccf@google.com> <6a50d160-56d0-29f9-cfed-6c9202140b43@I-love.SAKURA.ne.jp> <20171219083746.GR19604@eros> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171219083746.GR19604@eros> Sender: owner-linux-mm@kvack.org List-ID: To: "Tobin C. Harding" Cc: 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 On Tue, Dec 19, 2017 at 07:37:46PM +1100, Tobin C. Harding wrote: > On Tue, Dec 19, 2017 at 09:12:58AM +0100, Dmitry Vyukov wrote: > > On Tue, Dec 19, 2017 at 1:57 AM, Kees Cook wrote: > > > On Mon, Dec 18, 2017 at 6:22 AM, Tetsuo Handa > > >> This BUG is reporting > > >> > > >> [ 26.089789] usercopy: kernel memory overwrite attempt detected to 0000000022a5b430 (kmalloc-1024) (1024 bytes) > > >> > > >> line. But isn't 0000000022a5b430 strange for kmalloc(1024, GFP_KERNEL)ed kernel address? > > > > > > The address is hashed (see the %p threads for 4.15). > > > > > > +Tobin, is there a way to disable hashing entirely? The only > > designation of syzbot is providing crash reports to kernel developers > > with as much info as possible. It's fine for it to leak whatever. > > We have new specifier %px to print addresses in hex if leaking info is > not a worry. Could we have a way to know that the printed address is hashed and not just a pointer getting completely scrogged? Perhaps prefix it with ... a hash! So this line would look like: [ 26.089789] usercopy: kernel memory overwrite attempt detected to #0000000022a5b430 (kmalloc-1024) (1024 bytes) Or does that miss the point of hashing the address, so the attacker thinks its a real address? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org