Received: by 10.223.176.5 with SMTP id f5csp3279063wra; Thu, 1 Feb 2018 13:54:15 -0800 (PST) X-Google-Smtp-Source: AH8x226WwBC3Lx8ABtJX72AdbVpSPZP3ctuK70q6eHKOxVMi3F6h9/OY6K0tlUd+4yx7wTbUL/MF X-Received: by 10.99.56.85 with SMTP id h21mr29385501pgn.402.1517522055690; Thu, 01 Feb 2018 13:54:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517522055; cv=none; d=google.com; s=arc-20160816; b=g44fpyo65LRBfx08/xGKb3Qa/ea7YnsB6uTPpCh+8g3WYFTlr0jfuDvZUytjoQizE2 iVKRzKip81xZwLBwrmQkmdszSNBMnCyfBz+0EjYBr1oVCFQmuE8qykD1zKVF3dKuCP3G iLBgXurVpesgAzmcQ+M5cxs/MiHz7jlb4bl2QqKMv7Fe5fpl/l6TTjShWUpDNolH0ZpC KF45lUXTJIdKS13AxmZrki5y5KrgX2aDwAYCpFwbILU6Jm/dYPtKRMOAEbBtY2f2HRs1 AXSavDlzV38Nw4vmh/fM5V6dYQgCnpH8vaEpOto3Nn5wS4aQ28b6PyULRJoJimjBkNXw Pbaw== 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=oHTYH8kZusMAJpX994wJ2kNvPJ5BNpEHLKecdhhnNJw=; b=Kj4fj2kiih+jmWmvq3EvItMWijE78Hr4RDtPu/YHItBj3wA9glz+UNt+RQR6k7q87V 3c80uzvLvSdMNLEB6UruoXLbUKg7F5tN+pFi8c/dQVPZ1UUE16onVje4CF2Va8mtiOkh YkFqyN9aHr8LD6UJgwkHnDCXSJ1JfSNKY+atElcgENQd2y7Puipu1YqMIshVw1xU2Qo8 t/iBYnfoXB/E4slF9KytwYYNi45lWWNB8Kw+f0JTuK/F52z2xo2hPV14emXWfnnYaBUV RmteZKoG1Goh2SYHTanjoDXlDShtOisl2RjpRB5wzly0ssniZfTxbDWsuyOiVLmNY1xz jRhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JpQSmFN/; 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=NONE 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 d16-v6si434868pll.210.2018.02.01.13.54.00; Thu, 01 Feb 2018 13:54:15 -0800 (PST) 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=JpQSmFN/; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbeBAVxA (ORCPT + 99 others); Thu, 1 Feb 2018 16:53:00 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:51976 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbeBAVwx (ORCPT ); Thu, 1 Feb 2018 16:52:53 -0500 Received: by mail-it0-f65.google.com with SMTP id p139so6103562itb.1; Thu, 01 Feb 2018 13:52:52 -0800 (PST) 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=oHTYH8kZusMAJpX994wJ2kNvPJ5BNpEHLKecdhhnNJw=; b=JpQSmFN/DSKZ66nImV26YyPdL918yGD8PymzYFw73pqQ22wXpvKnNmZbPGtO/R1Wr7 4VFCquZO7uyIrX01BpETSiMw9PIYK7T96JkTS8x0EWMAsZFNnoO/lZYeD3ltdeVsa8ub e5Y6QWGkNRHRfJMA2esAu2nOC/wS0GoeNL+/K5PrjTPlmgWQdghstdpNtuL2Q/Vlr50T vnRp0r6ktx2YJhzOoVjgCxatmHfaMPOOojpM3wpPQUsQP7jm8/QUmIaxhU0cOO+CXFa9 +yL/d+9WS4pFGnSvtO5PeawJSoHflIFozL1h8acJyEZT5a7/h/K04TpYhrKrkelZHh8b m7GA== 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=oHTYH8kZusMAJpX994wJ2kNvPJ5BNpEHLKecdhhnNJw=; b=IdJYGysa8EvslWc9pgA3e7hj+SNHt+9jGChQVOlafhvEOVJXkJzXT/BN+Xyg/v90tl VIOvYbKfDAHi025W8S3XwPxAM7Gh1CQkG1cMhoDjVMGfCy/K2czm6h70VLounncGH4x/ 6yCWT/8lHLybT6hL+TfisQwRPpe2VvNAFso5/7bxpi2Ivdjd+Nb6DnvN1ZFjbWP6Auav aAPf2FsDb15SaK4vtxYRq90D7RWZo5X/31h0qrcntZKOhq1BOAIyhBTJUid0IEvpHrNM SpEp9gma6fg+8FpLzyb1+G0vd9p3AO5Qtqehyi/Xoc8nbwlLBJ2BBRHcqLKlxi9wV5pk MCGg== X-Gm-Message-State: AKwxyteiLBEYoa75SVwy9mNJQoFpDQmtkgnnFvkKUjbNE1q5QfzWV8as dJBs/j/zKADp3jCdca2LTOI= X-Received: by 10.36.87.83 with SMTP id u80mr6205041ita.140.1517521972360; Thu, 01 Feb 2018 13:52:52 -0800 (PST) Received: from gmail.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id d3sm77782ite.36.2018.02.01.13.52.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2018 13:52:51 -0800 (PST) Date: Thu, 1 Feb 2018 13:52:49 -0800 From: Eric Biggers To: Jon Maloy Cc: Cong Wang , syzbot , David Miller , LKML , Linux Kernel Network Developers , "syzkaller-bugs@googlegroups.com" , "tipc-discussion@lists.sourceforge.net" , Ying Xue Subject: Re: KASAN: use-after-free Read in tipc_group_size Message-ID: <20180201215249.6axvmcejdew4no55@gmail.com> References: <001a1144982043d4af05624506fc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 08, 2018 at 08:11:35PM +0000, Jon Maloy wrote: > > > > -----Original Message----- > > From: Cong Wang [mailto:xiyou.wangcong@gmail.com] > > Sent: Monday, January 08, 2018 13:44 > > To: syzbot > > Cc: David Miller ; Jon Maloy > > ; LKML ; Linux > > Kernel Network Developers ; syzkaller- > > bugs@googlegroups.com; tipc-discussion@lists.sourceforge.net; Ying Xue > > > > Subject: Re: KASAN: use-after-free Read in tipc_group_size > > > > On Mon, Jan 8, 2018 at 6:58 AM, syzbot > > wrote: > > > Hello, > > > > > > syzkaller hit the following crash on > > > b2cd1df66037e7c4697c7e40496bf7e4a5e16a2d > > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/maste > > > r > > > compiler: gcc (GCC) 7.1.1 20170620 > > > .config is attached > > > Raw console output is attached. > > > C reproducer is attached > > > syzkaller reproducer is attached. See https://goo.gl/kgGztJ for > > > information about syzkaller reproducers > > > > > > > > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > > > Reported-by: syzbot+aae58876fb5a1fad0a4b@syzkaller.appspotmail.com > > > It will help syzbot understand when the bug is fixed. See footer for > > > details. > > > If you forward the report, please keep this part and the footer. > > > > > > > > ========================================================== > > ======== > > > BUG: KASAN: use-after-free in tipc_group_size+0x40/0x50 > > > net/tipc/group.c:158 Read of size 2 at addr ffff8801c08ba280 by task > > > syzkaller447710/3513 > > > > > > CPU: 0 PID: 3513 Comm: syzkaller447710 Not tainted 4.15.0-rc7+ #252 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, > > > BIOS Google 01/01/2011 Call Trace: > > > __dump_stack lib/dump_stack.c:17 [inline] > > > dump_stack+0x194/0x257 lib/dump_stack.c:53 > > > print_address_description+0x73/0x250 mm/kasan/report.c:252 > > > kasan_report_error mm/kasan/report.c:351 [inline] > > > kasan_report+0x25b/0x340 mm/kasan/report.c:409 > > > __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:428 > > > tipc_group_size+0x40/0x50 net/tipc/group.c:158 > > > tipc_poll+0x374/0x4f0 net/tipc/socket.c:739 > > > > Seems we have to lock the sock for tipc_group_size() in tipc_poll(). > > Not quite. I think it is that we initialize 'grp' on the stack before we call sock_poll_wait() and access it after it returns. > This is anyway fixed in patch #9 of the series I just sent to net-next, where the poll() handling for group members is redesigned. > > ///jon > Last occurred on Jan 16. Seems to have been fixed by commit 60c2530696320: #syz fix: tipc: fix race between poll() and setsockopt() - Eric