Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4940747imm; Fri, 18 May 2018 13:23:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpdrbyTMckn4X/vsiNB2nqXj7mxVrMhJJbss17eK7/YTrUkAfXy4TVLWMa0U2ErrasFykSw X-Received: by 2002:a63:a002:: with SMTP id r2-v6mr8542821pge.240.1526675037876; Fri, 18 May 2018 13:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526675037; cv=none; d=google.com; s=arc-20160816; b=xq+BnoymS3NhSlY6jwY9jQhYLw5UrfGgh4xM4CMcGZyUDZW1eeaa4Wl2XO0QQuMrAA IqmahwqMdle5U2VrtRHf4fcCdo2T/3T6sKjVnr3A+ZGkrXwGMPr3y1ALHKKJ7e+QcwW2 3gKsxWavnjXKCZnVBPesuBKxTaZoJmhk09m6phvay2R6f95IJVRxIb1ykrdr5lr4jhHv Gi1JL7F7yIOTrd+ACjNwFqZcTmn11i8zrgpO+q5EM1oEfKoMWh4jLV8U4VgyUWJISAO9 5BxDRXWL0mBKl0MDG6xUeMSf8VpOjVbtJepfmZlVrq+ax9qrYJRkHVYNCySwkYXIQXHB JYXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticoutput:user-agent :in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Od3YTaSZt/lf6YwxSwh0b6k7Volwkc/n5p/KXtt1pto=; b=rQW3f6I6o2eYHsAQa6f1/Fyo+8xtVDDZ+i90nH3LXlGz0IQG+gqVw48PyJ3Q/w4a2S sRghrQ9GAWzc5cqyBc/DyZzluIWDB6mZR1VY/WFnMNGKvPHtY5oe37WYS4DbdjXYaIj6 W/sPa8BgUe5tK6FqlppYT6C4pdMtQV6YwMhu6qvzkyq8M7TEgBMviEebHT8abZAO+OJG hL5rchFTtRF/VVoIiMvtYaFsq8y0NEAxY7nGjJcP+v9bo5vciBSFRxiS5YO0knwnbdSW 8ww4QD6gM2vfXYv7cZyroH+pzJgl5pYq33XVGjYhWXB+OtBoCpkSZuXmjYZuSuLMG5qV rnxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=PXIc4mIU; 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=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13-v6si6775385pgt.624.2018.05.18.13.23.43; Fri, 18 May 2018 13:23:57 -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; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=PXIc4mIU; 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=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbeERUX3 (ORCPT + 99 others); Fri, 18 May 2018 16:23:29 -0400 Received: from mail-db5eur01hn0207.outbound.protection.outlook.com ([104.47.2.207]:21837 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751446AbeERUXV (ORCPT ); Fri, 18 May 2018 16:23:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Od3YTaSZt/lf6YwxSwh0b6k7Volwkc/n5p/KXtt1pto=; b=PXIc4mIUWcdyRRbLtP/gFrcHL3186lEmUQXqvsVsgTZm87vWt8dgZQcOH/T8tqLbgrG22mHsdfRfYseF1Z1PhuAshdDgyF3zqrKE66yrR8Oqo95DdS5tJ9cF26lJr2waaAhcjjifL/PIUadCOCCoL1+mM+o8WifCdbKp2gLuyBE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by VI1PR0801MB1982.eurprd08.prod.outlook.com (2603:10a6:800:8a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Fri, 18 May 2018 20:23:12 +0000 Date: Fri, 18 May 2018 23:23:08 +0300 From: Roman Kagan To: Matthew Wilcox Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] idr: fix invalid ptr dereference on item delete Message-ID: <20180518202307.GB753@rkaganb.sw.ru> Mail-Followup-To: Roman Kagan , Matthew Wilcox , Andrew Morton , linux-kernel@vger.kernel.org References: <20180518175025.GD6361@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180518175025.GD6361@bombadil.infradead.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR07CA0023.eurprd07.prod.outlook.com (2603:10a6:7:67::33) To VI1PR0801MB1982.eurprd08.prod.outlook.com (2603:10a6:800:8a::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1982; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1982;3:QY0SUMAVjpX4NYvUCse3h2o68maJ6U/k3RS4BOFIH9FtYKRwlYqrTjtGGg+YJDiboZHNgAzo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f2iT5GnxSB4M8RwHqSU0lWfqeWvHfHSStl4gielhg/+7losreOtHqaRK99JDe7BkAM/9DwN/ckjQCVImXa5r1PgEOKJ1dOTFksqFjSNYD62lvSMJIvZMRWwX+tkOjgV2hWdoK7Li3RSq2iyt1YmzJYAtVWvwY59m6VM/rillr35NsqHQO2vqs0Av5uKndGiABXBGvkNxO9ztk8M/yBNmAtTA921H4GkEKisFE3LjlonzMuMN4mpZGoVrKhxAHeHCup7q1bX4PzzsbTZ54VXlYNZARL6oqAEML/LjHZ3GsMZm2aMhCQq;4:dBMG6UPP3Qty4cUTFMOwRHfFHoahDnYJWNEH5it9dA0/GN7Bhvv55e1lCowVqDQ5pnayRbGpKWERPN6vm03QZ9al5BdskOKf+w8RjrD/JR4+tka+IbcPpizpZgb6FJO3sidM2ylrghr4+FP1j0cAW4ZvTTS5z/uzzPgCM9yivmRkc4u0vUhZmuWSqeDlk27cDPyuFR5OPPlg7EU/4t2ryHo/FY1EUezFi95mj0kpCaHUmf16e1tYfIuy91dRrFPsmcCsdrxcWlpv5RN3u+JivcpnfADmqcw67iuoInPdh5hyOjJZLieFhPPLQbhYspNb3xvWlkIm6+qzPOv7llMSoLi69RvWK4K+Qx40FBoX4aE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(28532068793085)(89211679590171); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB1982;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1982; X-Forefront-PRVS: 0676F530A9 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(396003)(346002)(376002)(39850400004)(39380400002)(366004)(199004)(189003)(316002)(106356001)(23726003)(8936002)(186003)(33656002)(6666003)(81166006)(16526019)(8676002)(66066001)(81156014)(58126008)(50466002)(36756003)(97736004)(1076002)(6116002)(105586002)(47776003)(16586007)(45080400002)(53416004)(478600001)(3846002)(6916009)(229853002)(5660300001)(4326008)(9686003)(53936002)(486006)(7696005)(476003)(25786009)(59450400001)(7736002)(386003)(55236004)(11346002)(6246003)(68736007)(52116002)(69596002)(26005)(6506007)(956004)(2906002)(76176011)(446003)(55016002)(86362001)(305945005)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:VI1PR0801MB1982;H:rkaganb.sw.ru;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0801MB1982;23:D4LjWkWCH5he0Y8DEAtKuozfwT3PWocMvBHKVsU?= =?us-ascii?Q?rkfGN2BaRZZx+rC0uDRxGouFl2phCT7T47qG0aSkay9ljjNTzYW41fXX+5G8?= =?us-ascii?Q?hPcDP+C0JmRYMi2pnNSfYph7cd7koUylYz4CVw2hnSDcWn1Ns6lCtWavBq8t?= =?us-ascii?Q?GVklAEx7tr8gNJZGJhfJbDHd5h7HBuEVyh3KKKoY+SypFgTlnR93tuiFx214?= =?us-ascii?Q?c6kyE6cAgpmUG1CN7efof5gaUhJYUl+Cm4d8nvizdMIPHQolQ0sIOFKP3U0C?= =?us-ascii?Q?Rtfr1M6m/8l3uz1cA0a+egeH5Myt2NvdHIg1rA24qcXiOq+6EeldFLZQqfmf?= =?us-ascii?Q?1Bj33A5+gn6KiZH4EzWKIfW/iLlYGlka+GmPUuVf8IMHaMdW6Ff4BaSHad0B?= =?us-ascii?Q?QfS0X/x2RnekswT0bXwMQAdgxEPoxigtz62hYYiV/Bx55ykBqHySCg+xFkKL?= =?us-ascii?Q?IqwFQJljBsdM4mrKG3NVr8Z9ImQqHrGepe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LUkA4fXe4M+kiYzFOdAYDKGEKNA2Vw2BpLBfU5XYoUHklx/rp1KmmPQ754NCWWPPQhZuZn+fIeoe69WL1ljmB4Zg56Ta+XLErquqCI4s3PmOMXsB1YYxWjRlF6RboS2h17uB5tirvpBVT60QzeJVZC3DCeaKklEVW26fvphFuKmgnYUy5/yjygIVX8JE5VHfQtXR3MqeWMmlB035sTZ8EK+w+Fl/45ueblj4cPyE/tfkOwXZlCFFJNHno/oypHVv644i4zGmWPJ2MlDsFHWrEwP+U3XR7k+3mH6bbVYswm73+Vuxx9fae6f75Qjnjmk+QIvlUwbQnslFC+Gk= SpamDiagnosticOutput: 1:22 X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1982;7:4XgrgJ9sqO0fFAEnspM5fY19oJ4p6myWFowrw6fjz8VU4m0xC78RaJ8bDnAS95lkBira/GID62dk1c69Sml0rC7pvEURwdJuos3VoPx4d4dCE4+pzo7taRs8x9DHAP9XPPZzY29UdZ4boBC+/0+zXqJRqEWGi0tBlIM/MeYzEJV2egbuJtv9ih1ebG1g053g1FKSasN3tBb2uWDtaAS4DZzWI4Fc3ZMrBulgK8mx0pZ0YC7FQY5NwXDiFU/nFiDe;20:FExWEcWFwS87SS4w93qwBQhQhmvHdBPDASohLhsmslfSgvm5On4yDH34n1tfUaDfvWhMmCADt/jvzuTo1H7t6mVk2qMMKaOr3ln/C8tK/tnHj+JbZXfLCgmoKRXAY6I7hT1HnrfRj59HgITx0ZUutyKmOnd7Vfp6CybsKNhMxhs= X-MS-Office365-Filtering-Correlation-Id: a9b7ca23-b126-4e60-5e56-08d5bcfd2de9 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2018 20:23:12.2059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9b7ca23-b126-4e60-5e56-08d5bcfd2de9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1982 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 18, 2018 at 10:50:25AM -0700, Matthew Wilcox wrote: > It'd be nice if you cc'd the person who wrote the code you're patching. > You'd get a response a lot quicker than waiting until I happened to > notice the email in a different forum. I sent it to someone called "Matthew Wilcox ". Also I cc'd that guy when I only started to point the finger at IDR as the suspected culprit in that syzcaller report. I thought it was him who wrote the code... > Thanks for finding the situation that leads to the bug. Your fix is > incorrect; it's legitimate to store a NULL value at offset 0, and > your patch makes it impossible to delete. Fortunately, the test-suite > covers that case ;-) How do you build it? I wish I had it when debugging but I got linking errors due to missing spin_lock_init, so I decided it wasn't up-to-date. Thanks, Roman. P.S. I'll forward your message to all the recepients of my patch, to let them know it's wrong and you have a better one.