Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5415602imm; Tue, 31 Jul 2018 10:30:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4wj6j07lEIikuABIM8mj+BOZr2T961YAcKbslcnZZDg5tLRuBzxp4m4lUHDL2DzOQsTLI X-Received: by 2002:a17:902:654b:: with SMTP id d11-v6mr21159013pln.8.1533058230846; Tue, 31 Jul 2018 10:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533058230; cv=none; d=google.com; s=arc-20160816; b=mP02J4WAO8sAiJoK4i1F6kk4RBd2NJ9ZcgWiCFrdrZBtvQp3WHXxceDHIgX0Nd/C6D I7ukeuyZGHJtzMYXMojFg0epwzwcY1C2T15nQswwHfdBfY3Pl9wf9/rLIslz9mdqJtRQ ofHizOcuPXMl/3KcfT7GDTBqjYy514yDXtFHhZ7k8xkWMpH4LGNtK6lwAChb/G2t4m5W cDXnfJ1tn+z/JUSra78azF4VvlisXdgMZyHjXMgP/4GOXdBc5OBOkingA7wXtK9j0kdi jxLYZpmLXgl56f2SFZgoMVEaRKQQLPXP3a/qRFnH/QTbfdPoGkYIDe1B+qIfTjRZPnQs Qs4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:to :dkim-signature:arc-authentication-results; bh=O7j1iORwA8ghLSTnaYmwh4fnKu05CX0KLIK5v76br2c=; b=trCJFp0x0dtsiykGPwe3cGdJhZGPKdNyP76UfDuJNQi61Fje3TjLlLyd9iUKnXGFy2 +pH9L2zQssMvPztzF75o1oQFPo+NhYa4//ZIcNELlF8wI4qY6p/TqEHO0fyPwjmb0FtM CAZuKae5uWp3Muvbp2WIVmLex0eJaXvkTNxWDPIEumg0LKfntJpGGDkQLC+5kGdxD6hu wVhxuXVzHdk3y4jLr9Y6QFl5jinfXKNwn1DvYagUztCZQGR5wJNGgqXgTtY1uE2ytnzV 7EPHK0Ckl0hFc8bg0qkGfo/ykeNbahKzVb6zQBUrI6KYBN4kyAO7SiHtgmQvFLyaqrGj 9TXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=SKixPdrh; 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 f15-v6si13723933pli.194.2018.07.31.10.30.16; Tue, 31 Jul 2018 10:30:30 -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=SKixPdrh; 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 S1732173AbeGaSmv (ORCPT + 99 others); Tue, 31 Jul 2018 14:42:51 -0400 Received: from mail-ve1eur01on0121.outbound.protection.outlook.com ([104.47.1.121]:49184 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732118AbeGaSmu (ORCPT ); Tue, 31 Jul 2018 14:42:50 -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=O7j1iORwA8ghLSTnaYmwh4fnKu05CX0KLIK5v76br2c=; b=SKixPdrhT4/0WSX+Y8zVuzEL8lsBDrA6e8VmgL1gRWlP0wDehi0+Ns99zHeKPRGPvJY9ytPGP+9qnPIMbjbKOSFNrWdOjqJ4Gdh2ZrDyGc48QyTXEyFOTwo13Q/5YmHmq9vXDV315JlEE/KWQyZzapdDNIDKPWxAlxmAIYmXXYA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (185.231.240.5) by DB7PR08MB3258.eurprd08.prod.outlook.com (2603:10a6:5:1f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.17; Tue, 31 Jul 2018 17:01:30 +0000 To: Theodore Ts'o , Jan Kara , linux-ext4@vger.kernel.org, Greg Kroah-Hartman , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, Gerrit Renker , dccp@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Ursula Braun , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Vyukov , Christoph Lameter , Andrew Morton , "linux-mm@kvack.org" , Andrey Konovalov , Linus Torvalds From: Andrey Ryabinin Subject: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) Message-ID: Date: Tue, 31 Jul 2018 20:01:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: DB6PR07CA0012.eurprd07.prod.outlook.com (2603:10a6:6:2d::22) To DB7PR08MB3258.eurprd08.prod.outlook.com (2603:10a6:5:1f::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0ff1fee-750a-434b-6b73-08d5f707448f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB7PR08MB3258; X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3258;3:Aq4rSY5IDLsYzE5tG3hcJ+kZdsNo9p3hrSbLmbaZG62fJ0rrGnRwjzSdRQ00RfgriJWtcHXaWUESgq7M4XWLB8xr24IX+Lps/5paxbySab+nl1ZLSHodyxvl9+SCukvCz1HfwlV4+mRbGOKetgA4dG1WYgrJggZSBCwNcq/zQe4eaF9MpD/qFSQbZ8y5z9NC559F/swidRUdZYbcjEsipxeMkEwEueEAf0Nggs6c/PyiyQSLUWBfZJyY47SDXBXH;25:SASoN1QtCDub9G5jXnhQBntBGdbOms+W+5V9YtxFrO5XH9b5lZlaUreNyFipVTXvLYQ3EndHijqqJ8f3hiISUjqOogUtGIiCwjj2fsENbjKDbLE0+ntG6uYGKzftH1pPo4u22ACT18cO4BiQU2DPzzzGAojG7jxU0ALhryq+bEJ0VAguqWgBVmJ/AYKGNr0yWJIxvVhPx8FTWZrZ/JkNknT9GnGN3iW8B+vWBGa9+qCiTN4IPbwUDJhzCae23EQN/V4D80xgXKhBYxR3Kz0xpzD0JccCcqjeLsgY8wM5MM+pJBMD/A7rCZfaqM91wYJwNQIk/kffsx7kzvdnokBvEQ==;31:Ym259FYej1tWk2hpTANV+br6MWVHUnJyfelHqcELurwaTSJGfXTR+rc2C8PRbr1qG9P4UMDSXSipXFWf6KWuq4ojXvXkwjdgjzQQGwKT6Ajs6nG83GXcXqsWYQuRaEHGlMwI12dVOCmj1BnPqfhXA4l1kt2pkRfTYtkTIqATHpc3EGUX4n8w/DPPlbOZCs4xBhKuG5SQVZxskFg3HljbeAa8Htqq3E8AcDN1nq5NgLA= X-MS-TrafficTypeDiagnostic: DB7PR08MB3258: X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3258;20:Eeas+y8EJmDPZ4+qsZBQYDa/cwOXBipKkcYL/hT3Wfn+XRp/BFrgZKDpxLCOFV8VG09mJeN3f5NjgU5F1HT79EsnjGT+019DAyQV6Ih1/3k+0NIpOtBeW6hhdXZFWgFo3br2HyTG3kPqkeKIpyXSQ3URKcVGtgHIea/hoRQXizgai7A6DlgJuvm3hmnYGXVUMUinv3dMDcqzc0G1/+6Z2DL5d8ODgsCS6MFhyRpTI6AO0nVP8GZ0gUlysRKWjfMui40mVsMwp7q+rXJY6rCZTtJTrVD155W133S8faOJTqle3r8OthTO6zsDcq9oQEiginyvWUJc2KEMsxFRji3GjOxprBmVJ1sYUDUzSyFsbG6sNK663UtBj8lYy/jeXb6d4rmWzMqSJ/8EnRtlqwnjsdtnRVkFB8MkOvhDsiNQVnS0Me5ksp/A5O6E318jo2o+02fxHNQnIqk87WqbLxa541bHkKGN2iRTk7urWpYJGz6uf4lrnhUPqih+vxaRS/e0;4:49gvP4OBMo8M6VEbjufskdpX1YUu0Pu7r06BAYvHsT8yPO0t1enwkImAdXSSAZ1twL4AFi+TQwSnxGohXROFomcIVFIcTAQuRteg8lLkIuugcZCpvcVtNx0zqYzT0+RWWum+zcoWq6Q2CRiaPePswZuyCWKZRM5JXfRwQXaDLsrVRO2C5T8kuOlBCzWoh+me+VyV6q5qv2+PzeuLG39XGCGT/0oaiQSBOjU9e1RQMLRVXcQK45d446/0RoZSo4YwBh6Fm3dDSuqqXJF+oOuiEw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DB7PR08MB3258;BCL:0;PCL:0;RULEID:;SRVR:DB7PR08MB3258; X-Forefront-PRVS: 0750463DC9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(346002)(376002)(366004)(39850400004)(396003)(136003)(199004)(189003)(47776003)(6116002)(8936002)(77096007)(52146003)(16576012)(110136005)(50466002)(7416002)(3846002)(7406005)(26005)(2906002)(36756003)(58126008)(97736004)(2486003)(52116002)(16526019)(316002)(23676004)(68736007)(230700001)(106356001)(105586002)(186003)(6486002)(2501003)(65956001)(66066001)(25786009)(65806001)(956004)(14444005)(31686004)(53936002)(305945005)(64126003)(2616005)(478600001)(81166006)(8676002)(81156014)(476003)(86362001)(486006)(53546011)(386003)(2171002)(7736002)(5660300001)(31696002)(65826007)(507254003)(556444002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DB7PR08MB3258;H:[172.16.25.12];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: =?utf-8?B?MTtEQjdQUjA4TUIzMjU4OzIzOkhwd0g5TVcrR0ZmL0xsMkczVWJUMXJZV1Rx?= =?utf-8?B?NkNhMW9aMlI2MzFvZm0wdmRycWE1Y1lWVFdkWVlDNzlGU0pKUEFmNC93UXZD?= =?utf-8?B?L0NsUEh0UElHWm1mNG9CV2JIVThrOTdQTmFWTXdpVk4rS2RsVXloUUdaYXlr?= =?utf-8?B?VUR0Tk1PN3JuMkVaRlJ1emRmQWYzazRBK1ZuNGVzcTFKeUxTbHFKQ3R6bXND?= =?utf-8?B?OEtJVUFMcGI2UGQ5UDRSVjlQd250eHpSUFh3MWY5QVh6eWQrL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dOcgOAghb9CCF0LdksKM/SiDwAfPEHxcCKq1I9VkelkozGVj6LHevSVxSNhaTwa1hW4c2pkjgohiNJli+DOh35v3dIBsVNaJjwt3IIPN7FUaLGlFhOsauV19/ldaRuJfg2a/4h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3258;20:Pgvv4ooT6FRdIhMbPXepPzZ3ffUjz8xRIwLG34QG8Z9LejjIhOQYRqS4OCW8jjfuum+tIEOsNkkMC0tEWMgkJ5JqM1SiaoJjl5+YRrX2aj1ac/qKqflN4v15j5+m2LBDS2ckA2b483FYnSWScOa2vyT1GQrJz+e8gffF+czsq7g= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 17:01:30.2530 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0ff1fee-750a-434b-6b73-08d5f707448f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3258 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/31/2018 07:04 PM, Andrey Ryabinin wrote: >> 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? > > Yeah, I puzzled by this too. However, I think it's hard but possible to make it work, at least in theory. > There must be an initializer, which consists of two parts: > a) initilize objects fields > b) expose object to the world (add it to list or something like that) > > (a) part must somehow to be ok to race with another cpu which might already use the object. > (b) part must must use e.g. barriers to make sure that racy users will see previously inilized fields. > Racy users must have parring barrier of course. > > But it sound fishy, and very easy to fuck up. I won't be surprised if every single one SLAB_TYPESAFE_BY_RCU user > without ->ctor is bogus. It certainly would be better to convert those to use ->ctor. > > Such caches seems used by networking subsystem in proto_register(): > > prot->slab = kmem_cache_create_usercopy(prot->name, > prot->obj_size, 0, > SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT | > prot->slab_flags, > prot->useroffset, prot->usersize, > NULL); > > And certain protocols specify SLAB_TYPESAFE_BY_RCU in ->slab_flags, such as: > llc_proto, smc_proto, smc_proto6, tcp_prot, tcpv6_prot, dccp_v6_prot, dccp_v4_prot. > > > Also nf_conntrack_cachep, kernfs_node_cache, jbd2_journal_head_cache and i915_request cache. > [+CC maintainer of the relevant code.] Guys, it seems that we have a lot of code using SLAB_TYPESAFE_BY_RCU cache without constructor. I think it's nearly impossible to use that combination without having bugs. It's either you don't really need the SLAB_TYPESAFE_BY_RCU, or you need to have a constructor in kmem_cache. Could you guys, please, verify your code if it's really need SLAB_TYPSAFE or constructor? E.g. the netlink code look extremely suspicious: /* * Do not use kmem_cache_zalloc(), as this cache uses * SLAB_TYPESAFE_BY_RCU. */ ct = kmem_cache_alloc(nf_conntrack_cachep, gfp); if (ct == NULL) goto out; spin_lock_init(&ct->lock); If nf_conntrack_cachep objects really used in rcu typesafe manner, than 'ct' returned by kmem_cache_alloc might still be in use by another cpu. So we just reinitialize spin_lock used by someone else?