Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1045622imm; Sat, 7 Jul 2018 15:14:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfc9EXyB360WRivr+tNGQwZnUbPUNU1VTCFd+wcNO8lu8w1pMIMe89BpAk27gVP5mwMn71o X-Received: by 2002:a65:62cd:: with SMTP id m13-v6mr13804967pgv.280.1531001681636; Sat, 07 Jul 2018 15:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531001681; cv=none; d=google.com; s=arc-20160816; b=xp0zwH8+ttP+NhwMGyIT8k7GbYHByUH918OK802v5pw0wvu7LmGcdgsr+mpB8bU0Z0 D8nL+pyCSzrurvQ3i/1hiP58V2RqLS1X67mifUy758sKIBSh8clUaHKISQ2fm/kcLQBL ZswT6l5yTeL9hD4zUvlsdB15qaBqwhdhTaXgqCYWjsiklhg73kJnq0atPKeVp9xn4v8b LSwgjNlNnheOjDy+12yHjBN9DwJiitti4v7KTpLSoMGsMO3EO9SIFlhKXzxVVDbwsUfs VIKxymdsSq4iifDulpJBZvB/KpHAXUxcU+MDzSkKmPx8gHnrnyGAxbW1yNUHlXKmEkZQ 7q8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from:arc-authentication-results; bh=h6HKyyqC+si4TnOWNAdK2oiqrQoKJ1xYs2gGwSYvrHQ=; b=0lbus3piowK5DKftQEAzjeQaKm2jrOVQeLFzK9vdUhxaWp1DTbuSmne+/AQI0eMnVU FVDToQefE6Xzm+q3KRyYWmYbNpEJCYvxYCk5Gn0PeBTOlVnEfzJM+f5OscdQkXUSN7mh irBLm4Jhdpwo4aG+t8848qavw2NYtcwGGNQ9vMjSEatGRNfFgsMBFvAu7QS97+zNhCLI ZGxnktWxW1vDZnj02Rv+IbDtCOfAQnR8O997XM8SMBmsQrE+SGwOzWo/civAC1piurYC C0MuXw9bVTTYyFpUneVQjbRTJSa5tJibL8Y9uSULl8tuxY0w1a9m0xDIV//3X8U9ar8h o62Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si11005108pla.422.2018.07.07.15.13.55; Sat, 07 Jul 2018 15:14:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732AbeGGWMH (ORCPT + 99 others); Sat, 7 Jul 2018 18:12:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:37468 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753758AbeGGWMG (ORCPT ); Sat, 7 Jul 2018 18:12:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B6598AD72; Sat, 7 Jul 2018 22:12:04 +0000 (UTC) From: NeilBrown To: Paolo Abeni , Thomas Graf , Herbert Xu , David Miller Date: Sun, 08 Jul 2018 08:11:54 +1000 Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [4/4] rhashtable: improve rhashtable_walk stability when stop/start used. In-Reply-To: <86f305ff238d7cdac7ab20b0d6395cc6571cf4e0.camel@redhat.com> References: <152452255351.1456.12384285355497513812.stgit@noble> <86f305ff238d7cdac7ab20b0d6395cc6571cf4e0.camel@redhat.com> Message-ID: <87tvpawv9x.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, Jul 05 2018, Paolo Abeni wrote: > > While testing new code that uses the rhashtable walker, I'm obeserving > an use after free, that is apparently caused by the above: > > [ 146.834815] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > [ 146.842933] BUG: KASAN: use-after-free in inet_frag_worker+0x9f/0x210 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Hi, did you get a chance to run ./scripts/faddr2line on this address and find out where it is crashing? I had a look in the code you posted and couldn't see anything obvious. > [ 146.850120] Read of size 4 at addr ffff881b6b9342d8 by task kworker/13= :1/177 > [ 146.857984]=20 > [ 146.859645] CPU: 13 PID: 177 Comm: kworker/13:1 Not tainted 4.18.0-rc3= .mirror_unclone_6_frag_dbg+ #1974 > [ 146.870128] Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.1.7= 06/16/2016 > [ 146.878478] Workqueue: events inet_frag_worker > [ 146.883433] Call Trace: > [ 146.886162] dump_stack+0x90/0xe3 > [ 146.889861] print_address_description+0x6a/0x2a0 > [ 146.895109] kasan_report+0x176/0x2d0 > [ 146.899193] ? inet_frag_worker+0x9f/0x210 > [ 146.903762] inet_frag_worker+0x9f/0x210 > [ 146.908142] process_one_work+0x24f/0x6e0 > [ 146.912614] ? process_one_work+0x1a6/0x6e0 > [ 146.917285] worker_thread+0x4e/0x3d0 > [ 146.921373] kthread+0x106/0x140 > [ 146.924970] ? process_one_work+0x6e0/0x6e0 > [ 146.929637] ? kthread_bind+0x10/0x10 > [ 146.933723] ret_from_fork+0x3a/0x50 > [ 146.937717]=20 > [ 146.939377] Allocated by task 177: > [ 146.943170] kasan_kmalloc+0x86/0xb0 > [ 146.947158] __kmalloc_node+0x181/0x430 > [ 146.951438] kvmalloc_node+0x4f/0x70 > [ 146.955427] alloc_bucket_spinlocks+0x34/0xa0 This seems to suggest that it is one of the bucket spinlocks that is being incorrectly referenced, but they aren't referenced in the failing code at all. I cannot imagine how to interpret that. Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAltBOqoACgkQOeye3VZi gbnezQ/9Elqp2PTjdsdE3icERUum7nxUYZV8cCuXoWdUgRA17oqfNmxiPsyxojIh uVN7LKqkeFH8FJU2OpivQrtRyzQAU7p80CSqds5DPIn62r/b5k/QkMNf+WowluSY MR9PAeqQZfXTd/TDNDkT7sBtNYC2qStj+VHEm2Suap5tcY878wtbKp+HB07HJr1q xLOCudq/T0ZK9Vum/eZDccEpqxsxEzFOSY6o9SqIl7rC1qXzX9+02R1sZKwolp0Z WLRM/tO+NCwh98jA75GjN0LXJg368KDgbNu3IP83/dxNOyuSxOputt+yNZbYV9X5 Noqy2Mgd4Xt4IsEBB3gGgXu8RhqiJ27vccgCKAD8negvEGbu502/r3vqCDaJjrMH 0N/eFvh5VvOPnvOhYbChHAs6tAPL0nqK6HkbOc1slOmuHQDQhfxEtS7SWK7Jfimr rZKMwzk/WpPVITDgaOITcZ2mvqm+69bciRnJNQHR33HPREYwSQpY3TlaZz/vKfE3 FHeBb0DOPMkC2SiH0WAKjwOkbt2f1mlkm7dEby12HxyoM25RNNMPzcKC9h+3CUG7 8D/26SJZqoODAplthCsoHB4eL8ctg0XEGsdmkY5SqV5xm6ipf2oVa+WUT71VjSJM GGQVdfj0Lb2pSKcBYOTJAM0Ucg4bbfDyuH5K/5oh3i3JOe+FNV8= =o7LG -----END PGP SIGNATURE----- --=-=-=--