Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5326607imm; Tue, 31 Jul 2018 09:05:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPvIeqEcaHjHrH7N6lg3Rn+kkaTn+CWBv7SNvajQgHMClUcMjV4qchoFqYr3RLCqekDpU0 X-Received: by 2002:a65:6258:: with SMTP id q24-v6mr21016423pgv.131.1533053145757; Tue, 31 Jul 2018 09:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533053145; cv=none; d=google.com; s=arc-20160816; b=HIkgKk8G7P2wn5fef9iQWrbfkml5kC4qHTx86K7kzOuROS7wZxMiQgB1RGW4JW0Izu 8uWQ23oZTaW1897LKnvVUsRS0b250J2P9SVN6qRmLe9Ea7eC6eHwNw1dBLZHljpF++bm i/3GV+ydUpTV0G6G9aOMfhKRcNbYLkegWOXfB9o8gBa+2TGJf1/FJGgReNnDmRsvcgOr ihfxzMGC7sWIekwrBv6CZpbaelvzVaqFzvsQGm5Q0CwvtIkhlN+RTJocz1aG27r7loyu YGMMmdWXX5U7CM0CYL/myg17gcmSqALTyqm5TEGU6ftjknFcFALmkVYYJMWO0IYV2o8Q aC3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=MCCwJ+aQ3QluAcbv7Vnv7dpmLID9SHTC3R7LCcSvpZw=; b=GWZS/uJk7MAKm8rSPiz7lsyF5UotJPPiscp3GrTN77sC8qyepq5C8rdDqYegcSegYG nqMUiCTZz5eKuIvK/pHLneZeyBWQ+dD8vrDQzDP5mlIAhyzaRSmWddabfkn0SdosQfA6 7AvUo1SHSzXM7rlNrgZKInJ3NlrBZWMeWR3WfzrkUEk/XzdnAwx+DOlLjjR8Up0PwZbI KEVHTLIt28NZQT09Df78/N4y5e9miNKxWhAAZ75xap++cQEyyFl+vq7/E+EEIKqwvvK+ tU3LeCIZOKG2Lj5G74VYh+Cx/rVjbB30yDUnL5tBNi17VNOE6uhl49EGf86Uyus8y0/q 2f4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=e4eqVFHp; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb1-v6si13764657plb.128.2018.07.31.09.05.31; Tue, 31 Jul 2018 09:05:45 -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=@google.com header.s=20161025 header.b=e4eqVFHp; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732478AbeGaRoi (ORCPT + 99 others); Tue, 31 Jul 2018 13:44:38 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:37453 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbeGaRoh (ORCPT ); Tue, 31 Jul 2018 13:44:37 -0400 Received: by mail-pl0-f65.google.com with SMTP id d5-v6so1823937pll.4 for ; Tue, 31 Jul 2018 09:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MCCwJ+aQ3QluAcbv7Vnv7dpmLID9SHTC3R7LCcSvpZw=; b=e4eqVFHpMWLgqb8r300mBWpvUhRfuPDu5cOG5bwFJNipHub1t1qRWQ8JNVjMh5ac4j Ow/DQPSJyXC6M4IspXZlc0TFfveJE/is0rpnh45tkp+X5EzVny4DkUPK1JLIhuzXpglV KruSmDEJsqezuHZAC0thQpHP68yX+sxfYDKgt89jw7KyuShaY1Mysv+7hU8A0PrQI6D4 PaS7w/xzCk+5S6qU6UWL76hH4RIxxc2lnuFW+jQ3ftUN9dwngrrUos0U/JGa/vD+JZLH q2yo5N+OsgzSvgFWmpRnuhraEWBbt/aQ+aV8GDGorUf2n8SazudfWlnLRhXQtnt8l/xb zWjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MCCwJ+aQ3QluAcbv7Vnv7dpmLID9SHTC3R7LCcSvpZw=; b=sb0OBLNGmXSf+nI4LD0GO467+2pmeWeZRlvkZ+gg6a0RoT/DKqFaPMUzZNlaqPXBo0 TEA0K9HmG4BRK5Xc4M0JFdIXoRJ9ABxF1lPG/Ueba+60u7FxNxug2s/dU2Qj0QIwPwOg CsWRXi/HDdLFhmTNBATOTQxw+zIiX94AHPXe5fGJHKancy3jEikVN/sUK9+sfZLqYhvF vFfZoMPuNHgeMflf3weEixBuwiQQVahwRvmAHaiZkfgsLUNv3PqJgepNX9KeIj8VmEag 3rEcf+2whI9PDoBqyO4KxT2vDDDi59OiZ5n5yV2GlaD3bSMPTORtKj9WYk/oJAfIYlUu DEJw== X-Gm-Message-State: AOUpUlHy1vI5zG99euNMlKDNooXFnQPVpFyR8WrEUNRTRNs38zyYdNNH xoIcdItpv7b31TaWkB+IIuHLQMGRzz5v/sYEUSSYAA== X-Received: by 2002:a17:902:740b:: with SMTP id g11-v6mr21160189pll.85.1533053017437; Tue, 31 Jul 2018 09:03:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:ac14:0:0:0:0 with HTTP; Tue, 31 Jul 2018 09:03:16 -0700 (PDT) In-Reply-To: <01000164f0fd5abc-df9ea911-9701-498c-adce-9f833e6df3ed-000000@email.amazonses.com> References: <09cb5553-d84a-0e62-5174-315c14b88833@arm.com> <8240d4f9-c8df-cfe9-119d-6e933f8b13df@virtuozzo.com> <01000164f0fd5abc-df9ea911-9701-498c-adce-9f833e6df3ed-000000@email.amazonses.com> From: Dmitry Vyukov Date: Tue, 31 Jul 2018 18:03:16 +0200 Message-ID: Subject: Re: [PATCH v4 13/17] khwasan: add hooks implementation To: Christopher Lameter Cc: Andrey Ryabinin , Andrey Konovalov , vincenzo.frascino@arm.com, Alexander Potapenko , Catalin Marinas , Will Deacon , Andrew Morton , Mark Rutland , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , kasan-dev , linux-doc@vger.kernel.org, LKML , Linux ARM , linux-sparse@vger.kernel.org, Linux Memory Management List , Linux Kbuild mailing list , Chintan Pandya , Jacob Bramley , Jann Horn , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Mark Brand , Ramana Radhakrishnan , Evgeniy Stepanov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 5:38 PM, Christopher Lameter wrote: > On Tue, 31 Jul 2018, Dmitry Vyukov wrote: > >> > Actually you should do this for SLAB_TYPESAFE_BY_RCU slabs. Usually they are with ->ctors but there >> > are few without constructors. >> > We can't reinitialize or even retag them. The latter will definitely cause false-positive use-after-free reports. >> >> Somewhat offtopic, but I can't understand how SLAB_TYPESAFE_BY_RCU >> slabs can be useful without ctors or at least memset(0). Objects in >> such slabs need to be type-stable, but I can't understand how it's >> possible to establish type stability without a ctor... Are these bugs? >> Or I am missing something subtle? What would be a canonical usage of >> SLAB_TYPESAFE_BY_RCU slab without a ctor? > > True that sounds fishy. Would someone post a list of SLAB_TYPESAFE_BY_RCU > slabs without ctors? https://elixir.bootlin.com/linux/latest/source/fs/jbd2/journal.c#L2395 https://elixir.bootlin.com/linux/latest/source/fs/kernfs/mount.c#L415 https://elixir.bootlin.com/linux/latest/source/net/netfilter/nf_conntrack_core.c#L2065 https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/i915/i915_gem.c#L5501 https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/i915/selftests/mock_gem_device.c#L212 https://elixir.bootlin.com/linux/latest/source/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c#L1131 Also these in proto structs: https://elixir.bootlin.com/linux/latest/source/net/dccp/ipv4.c#L959 https://elixir.bootlin.com/linux/latest/source/net/dccp/ipv6.c#L1048 https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_ipv4.c#L2461 https://elixir.bootlin.com/linux/latest/source/net/ipv6/tcp_ipv6.c#L1980 https://elixir.bootlin.com/linux/latest/source/net/llc/af_llc.c#L145 https://elixir.bootlin.com/linux/latest/source/net/smc/af_smc.c#L105 They later created in net/core/sock.c without ctor.