Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp978200imm; Tue, 5 Jun 2018 07:23:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI0qUVJrYsB5On+iM0+c1pFS9/jFROl7OuBjGKI6kSjCg+IPnKCRIXHWJOvo4kv+LqUpnub X-Received: by 2002:a63:583:: with SMTP id 125-v6mr20722530pgf.385.1528208629478; Tue, 05 Jun 2018 07:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528208629; cv=none; d=google.com; s=arc-20160816; b=bQO8E8zmX/P09dw92/mXmFqpGumi+MmCcZ3yvkbnffdrHvVfOT7VBYx5oD9Fp68Z/q dp8SsDbZhoumhylvkpBhmYnjy7i8GaQpGYxQshTlxF4h4xa7AliW6OiT2ogs8rFClZ8F OdBKwK2Jtm7tYcBrm4K32TE7raiJ2pxZQtX8ZguaeAzsgp8DzgLwXaucSstrZp7pgH+A VnAHCu+szFL7+xPOFJK2WFdfzmyhZadA0uKcesiEdaYeLrNmxq8oz+EHCQGD5xjGB5DP Xjpe/AEzlKgM0bDbU9sw5xZO71dcRDuOViQycYEFY8t+VGtGmF/eGOKyeLMC0zYKL6i9 jHvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=j1aGD9mFSbjb0Ts/jdLdfDc+Bp9c/uOPp+1qoJ+YnV0=; b=0sImE6VMETgXnIcnIdV+GyF1F1H9bWUBei/0IDOA8j7P0v0nuT0V7j48z/4GT7KXAx 5XrJLUnRXtxEerWL/inEfSI2DBUP6qUmvG6rQcoeJKZbnQSx8PCrTxKNkM0KXcRqy38j 6RUJwyzlvB5nIAisAVYdFNU+qQbr+j+FeNvAln5tadOUEje2Nls9twoWfNxafn0yAQHU JGQP/kmxZISJUcmcQ8W7PrvXjlggnZZQKwDD4iE88AE4A+6NKxe/kGUjrbFbh0eBXBas KVVGDkkcDx2LAlC+HLdabK/XxuMevYrZadF8UDbrZQCRt8NYgDiRkwmo5vwaJZwc1HuZ Ubtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=iKcZn3g0; 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 q19-v6si13378951pgq.71.2018.06.05.07.23.35; Tue, 05 Jun 2018 07:23:49 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=iKcZn3g0; 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 S1752520AbeFEOW1 (ORCPT + 99 others); Tue, 5 Jun 2018 10:22:27 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:40167 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486AbeFEOW0 (ORCPT ); Tue, 5 Jun 2018 10:22:26 -0400 Received: by mail-it0-f67.google.com with SMTP id j186-v6so3558802ita.5 for ; Tue, 05 Jun 2018 07:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j1aGD9mFSbjb0Ts/jdLdfDc+Bp9c/uOPp+1qoJ+YnV0=; b=iKcZn3g0HJaInSflncSotGk87msnwd+WbC8C576ysD7G6wgkqOo6zh6UGC/voiGcRI 8zOHeLP2SMXtN+coNgBfPMJ/ONVYnW0VYLoCh9FGR+7tV8YF7R2vCW8WO57tEiFcA+wh Amt1CnfD3AIu/VlkFJH8h/MGuq2sdJ4wR6bR3hKNv50hv/nSGXoDn4+JQsr/ZVj0kKms P+kIG2NXBMVJ7nfTSfShaxFOiRrcPzn+59DAFY/bFpgbSirXOaG0zrhTlSpaH+H/bpkD 4VHg5DjmOCmKIqQk7l3mGXxO4CRdRlUJoVJTt6cOsV9rHPFJfn0DEO1NpHhvf1PMKZ0s Peww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j1aGD9mFSbjb0Ts/jdLdfDc+Bp9c/uOPp+1qoJ+YnV0=; b=iPCB2p6MCgoWThbj8bctGwl61pEDZBY2hD7a+Nr8wEMqSx3RmlxnX0poipq+vCFNHs U0x4HX5yA8yv1P72uEcMeKUR30TNR6ttzp8/fk5zqWeiFfgYmVyWRqcJEu9xjQTm1xsx wngqMcOoP6wC0USvMIjrCretfPfk9BC+99DupoHIEFEpduT43P1ELnorWNoku03SIh5e 4DXWd72oSKKgMSj5up1nqWpT7qcWclpiYgXP6aijm6s9u6Dbyg0Ul1/AhY0nWdLFFf3z V+1J5Ly7xgftmHFytmfYw7N/w9A4FCp5Ii8KQ7CQzACpNQQY1EO717p2F1Zp8HUzWyum D6gg== X-Gm-Message-State: APt69E0Mvb9uUShXs/QHM53b+qoTz58fxgkBW0+NP+69zjK+EVc+xHz1 OlFn1X3gPJpuTf9inPrIbngbpLJMoS0= X-Received: by 2002:a24:e506:: with SMTP id g6-v6mr1743120iti.117.1528208545132; Tue, 05 Jun 2018 07:22:25 -0700 (PDT) Received: from [192.168.1.167] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id e18-v6sm714935itf.29.2018.06.05.07.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 07:22:22 -0700 (PDT) Subject: Re: [PATCH] dm: Use kzalloc for all structs with embedded biosets/mempools To: Kent Overstreet , torvalds@linux-foundation.org Cc: snitzer@redhat.com, linux-kernel@vger.kernel.org References: <20180605092633.29583-1-kent.overstreet@gmail.com> From: Jens Axboe Message-ID: Date: Tue, 5 Jun 2018 08:22:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180605092633.29583-1-kent.overstreet@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/5/18 3:26 AM, Kent Overstreet wrote: > mempool_init()/bioset_init() require that the mempools/biosets be zeroed > first; they probably should not _require_ this, but not allocating those > structs with kzalloc is a fairly nonsensical thing to do (calling > mempool_exit()/bioset_exit() on an uninitialized mempool/bioset is legal > and safe, but only works if said memory was zeroed.) > > Signed-off-by: Kent Overstreet > --- > > Linus, > > I fucked up majorly on the bioset/mempool conversion - I forgot to check that > everything biosets/mempools were being embedded in was actually being zeroed on > allocation. Device mapper currently explodes, you'll probably want to apply this > patch post haste. > > I have now done that auditing, for every single conversion - this patch fixes > everything I found. There do not seem to be any incorrect ones outside of device > mapper... > > We'll probably want a second patch that either a) changes > bioset_init()/mempool_init() to zero the passed in bioset/mempool first, or b) > my preference, WARN() or BUG() if they're passed memory that isn't zeroed. Odd, haven't seen a crash, but probably requires kasan or poisoning to trigger anything? Mike's tree also had the changes, since they were based on the block tree. I can queue this up and ship it later today. Mike, you want to review this one? -- Jens Axboe