Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1531576imd; Thu, 1 Nov 2018 17:54:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5camaHuvscm39nEnQ6G6yN7C2AS6/MKAA83HQ+sL7W0wCtKKZ7G3zaJd+XYn399xH7vtRcj X-Received: by 2002:a63:4b60:: with SMTP id k32mr9078587pgl.186.1541120093403; Thu, 01 Nov 2018 17:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541120093; cv=none; d=google.com; s=arc-20160816; b=wjHaPKMB7OpoTXL3dN9KXUIgBMxp2bUHZuy0QuFLx01vKuSvlKBSu+O49jFMq3u743 osNTXsrYseKE6riyH+Xp4XqnOQWRr0dXO9fwxuJFpkpXdrSMfSqpBGTvdWPYJdwLrFWL Q0ULI0dKYsH5hg+MCl11C5szmf7XmNj6MWLU2g9ph2A/kRx0XQ4f8jmFPNkKpCWz3mGv BoZZm89AfNGX0S3OFwaC/lVVE6riYHN3PnXpzigeYQ87qboiCv/tXsE4T+dk/mOiyzTr RqIriOwBmtyhP1i8jGXYZvs2MLIhnTLU9fq5o2CpM03zPYgjRp8RISPSUXuWx0Ax2RYR 1lGw== 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; bh=kSUKFXcN2vAsmIl6ri8Fh8E1uuWTd/BwXBS8GrF0Pvc=; b=P9QNUFfJUO9H2sh1xjyGy1x2nyRsl0gyNqgVf5rU/1vQ2Ivk3Aw7u0EEVOgZgKYH6e 9/T+8yIaJv8ZDi90cPZCSru+sGWL9ePdHyVrgHd4kq7dFhIVsRsaDpm3WOYLe895y1OX bNkOp7m6avdJegeoMsE/drvhaPnmVyJ42BVf8Wa5MeAjjBs075ePRfRhOhwv0lhMeuUm RtPVckQxU4rha3eNzo4Wa+VLNqWX02CEhyH2FR6BIjCPdkD+zokFVuEeil7k6ESd4l5l z/NkWZ7Zq/A0tXY0PtlUBL/ba5tv0c1I2IaKJtYRBufski6IVydyeBCIlRUhcCgezbaB Vhpw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q129-v6si31896792pga.96.2018.11.01.17.54.39; Thu, 01 Nov 2018 17:54:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbeKBJ7L (ORCPT + 99 others); Fri, 2 Nov 2018 05:59:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbeKBJ7K (ORCPT ); Fri, 2 Nov 2018 05:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4CF23082AEE; Fri, 2 Nov 2018 00:53:55 +0000 (UTC) Received: from ming.t460p (ovpn-8-20.pek2.redhat.com [10.72.8.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 021C15D961; Fri, 2 Nov 2018 00:53:49 +0000 (UTC) Date: Fri, 2 Nov 2018 08:53:45 +0800 From: Ming Lei To: kernel test robot Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, LKP Subject: Re: [LKP] a518560778 [ 16.132179] BUG: KASAN: null-ptr-deref in brd_alloc Message-ID: <20181102005344.GD24769@ming.t460p> References: <20181102001957.GE24195@shao2-debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181102001957.GE24195@shao2-debian> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 02 Nov 2018 00:53:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 02, 2018 at 08:19:57AM +0800, kernel test robot wrote: > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is > > https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-linus > > commit a5185607787e030fcb0009194d3b12f8bcca59d6 > Author: Ming Lei > AuthorDate: Wed Oct 31 16:40:50 2018 +0800 > Commit: Jens Axboe > CommitDate: Wed Oct 31 08:43:09 2018 -0600 > > block: brd: associate with queue until adding disk > > brd_free() may be called in failure path on one brd instance without > the disk being added yet, so release handler of gendisk may free the > associated request_queue early and cause the following use-after-free[1]. > > This patch fixes this issue by associating gendisk with request_queue > just before adding disk. > > [1] KASAN: use-after-free Read in del_timer_syncNon-volatile memory driver v1.3 > Linux agpgart interface v0.103 > [drm] Initialized vgem 1.0.0 20120112 for virtual device on minor 0 > usbcore: registered new interface driver udl > ================================================================== > BUG: KASAN: use-after-free in __lock_acquire+0x36d9/0x4c20 > kernel/locking/lockdep.c:3218 > Read of size 8 at addr ffff8801d1b6b540 by task swapper/0/1 > > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0+ #88 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS > Google 01/01/2011 > Call Trace: > __dump_stack lib/dump_stack.c:77 [inline] > dump_stack+0x244/0x39d lib/dump_stack.c:113 > print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 > kasan_report_error mm/kasan/report.c:354 [inline] > kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 > __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 > __lock_acquire+0x36d9/0x4c20 kernel/locking/lockdep.c:3218 > lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844 > del_timer_sync+0xb7/0x270 kernel/time/timer.c:1283 > blk_cleanup_queue+0x413/0x710 block/blk-core.c:809 > brd_free+0x5d/0x71 drivers/block/brd.c:422 > brd_init+0x2eb/0x393 drivers/block/brd.c:518 > do_one_initcall+0x145/0x957 init/main.c:890 > do_initcall_level init/main.c:958 [inline] > do_initcalls init/main.c:966 [inline] > do_basic_setup init/main.c:984 [inline] > kernel_init_freeable+0x5c6/0x6b9 init/main.c:1148 > kernel_init+0x11/0x1ae init/main.c:1068 > ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:350 > > Reported-by: syzbot+3701447012fe951dabb2@syzkaller.appspotmail.com > Signed-off-by: Ming Lei > Signed-off-by: Jens Axboe Sorry, my fault. Jens, I just sent you V2 which fixes this issue, could you drop V1 from your for-linus and apply V2 against it? Thanks, Ming