Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2918244rwb; Sat, 29 Jul 2023 18:06:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEC3l8ChrTSyLvAzUz+f5bLh5K7Go/B2rSgmA0GeLmHLXRXhOuJ2E1k8hdkugD13PBqcg0v X-Received: by 2002:a17:906:30c3:b0:97b:956f:e6b5 with SMTP id b3-20020a17090630c300b0097b956fe6b5mr3727346ejb.23.1690679194264; Sat, 29 Jul 2023 18:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690679194; cv=none; d=google.com; s=arc-20160816; b=BHbyS2a3KqMBu5dv5WueSWIoC3luWyi/sfoRlb/mU2jf4Oiewu0pPyrMKxhZUiIwPR FJTDGfXmHusUb55FeXMC1iZ7jxi1ftXNFDfR5NMFwj7JpYRNzpoepETASxglertzkva8 PmOXZwKZFR421yGax0SDPB4i1j56UAOwrGFdUqy75bMiSlDS08a7wcT3y7X3jbRcaBI9 7wz9+V/A0JlZb5vHpRXAW5zhRMFo+xKJnA5VE4pxaZxzwt5lN9OiBzMFtT/jNp2ccajo uiwM6apdqXV/MUHds+qafs2uAzrtjr8oqlcS/HBkb2p14lTvTTs6Lp2+ZjsC6Y4v3ULG 2bOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature; bh=0v0jLwnwzDh79wxSK826et8eo4TKKEDlYscJEeAlfEU=; fh=a9bQE2jAGH+JKEIDaSAWHdn/4VyN0IIYNLrx2qNoc3E=; b=xs8KyNGOr6l+hSeOt4eFbj10/abMnnA/nrq1dAk+fCfSJRvBnwSldKCOvh3Ah2Bxbu qC2kGwC+SMt7glHl7y31ye6yQAAo424ydBhlubNj3IUYwI0354wsHHwytF3HehT0x+JG /IXyWqIF17Q16+uA64L64T/IAuqh+qN/VBp69zkkEwo9Vb6GYrTOYIHwKSn0u/lTZ/Lu RBu5/cTaJyJhdvCjC1yvTFxZM97p3Fqwb32Lchi+Ist8QgNdqCqiXV+XonxwJM7oXsSg kCSZ95AIHx7aF+gOwQZPc8jMrE6WsPBSQapcPSNGVCV4IOSK+23If7mLmQruxCsksO/y LowA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=l+Nw2eJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja1-20020a170907988100b00992b4abde3csi5372866ejc.916.2023.07.29.18.06.10; Sat, 29 Jul 2023 18:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=l+Nw2eJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbjG2Xlm (ORCPT + 99 others); Sat, 29 Jul 2023 19:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjG2Xlk (ORCPT ); Sat, 29 Jul 2023 19:41:40 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D8CF2D61; Sat, 29 Jul 2023 16:41:39 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-99bc0a20b54so516132866b.1; Sat, 29 Jul 2023 16:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690674097; x=1691278897; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:from:to:cc:subject:date:message-id:reply-to; bh=0v0jLwnwzDh79wxSK826et8eo4TKKEDlYscJEeAlfEU=; b=l+Nw2eJGJRlse4weN+Zg5DIXZNLaRZs5vFgzEiDdgg1NVBpJBPAP8OzwvRbggZoW9D 6MK/na7e5zNYF59WMdm41sY/wunXt8GSdQzyG//9j/nGqMdIe9f3ieqSRGHjnObEbs3p RvwylckQKxUUNifHqKyQZvNuhVEtoDASqluSKX/cSHmrTTsrrqUSAS+QsBzgne4N29HE ggliqqsd1AaVRC7CNdnz+d3ySVpggDjQR+1n+RuZS7WOQ5UkVLyh8aI3d9NI6ptsFAw3 ysggpwzxvF5BItqzHreMz7JvHvLs2wh3MYR4bGsyVSI0DdLdwZQn2QZ6vIZrMDD83545 0Mpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690674097; x=1691278897; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0v0jLwnwzDh79wxSK826et8eo4TKKEDlYscJEeAlfEU=; b=R/vxykTEHd6aRjAbHtuL+7vhLKM7doqvDEnZlJd5nv7ymCG3I4jHM5023EGsJs5vZk cCmqj24ai1mxkefCyISRc/B7aZ9Cg0p4hbg3Dyy1mi5dCqLTcrIlfAzQ1U60GB/5AleZ PGu+2ELTlaiZoLaik7VKvPKRFcKWyVxCPIpmSuRJkJHBJtqSyj8dbLrBcVzSzcQ1m/+5 LoaOvo4YN7N0CmD7vxojI3VZandgPC1wNopKZgy4vaIwRwuzWY4BUX3EGK8bugNjoLsy e7T1HwVWa1VlwJGsDiD/sQ55rfInwzOaTmdqAKrr2aD7lXvheO+RXbRcj88EILM3Qfzv mKxQ== X-Gm-Message-State: ABy/qLYhoyJbxeuL/cQniPfdV2ucrvkX27vQvD7rlRXCZREJK6biAM3p xzXXVus6qZca6T5+QZBMKI8= X-Received: by 2002:a17:907:75f0:b0:99b:ca5d:1466 with SMTP id jz16-20020a17090775f000b0099bca5d1466mr3445829ejc.66.1690674097502; Sat, 29 Jul 2023 16:41:37 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id b3-20020a170906490300b0099307a5c564sm3874472ejq.55.2023.07.29.16.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 16:41:37 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id BD1B127C0054; Sat, 29 Jul 2023 19:41:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 29 Jul 2023 19:41:33 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrieelgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjgesthekredttddtjeenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeevgffhueevkedutefgveduuedujeefledthffgheegkeekiefgudekhffg geelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Jul 2023 19:41:31 -0400 (EDT) Date: Sat, 29 Jul 2023 16:40:53 -0700 From: Boqun Feng To: Miguel Ojeda Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Martin Rodriguez Reboredo , Alice Ryhl , Dariusz Sosnowski , Geoffrey Thomas , Fox Chen , John Baublitz , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Kees Cook , Andreas Hindborg , stable@vger.kernel.org Subject: Re: [PATCH] rust: allocator: Prevents mis-aligned allocation Message-ID: References: <20230613164258.3831917-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 29, 2023 at 04:01:03PM +0200, Miguel Ojeda wrote: > On Tue, Jun 13, 2023 at 6:44 PM Boqun Feng wrote: > > > > Cc: stable@vger.kernel.org # v6.1+ > > Applied to `rust-next`, thanks! > > However, should this go to stable? The actual functions being called > are the `__rust_*` ones (until they get removed in 1.71), no? Thus Interesting, I wasn't aware of the `__rust_*` "hack" here, so you are right, this doesn't fix the issue in stable kernels. > this is not actually fixing the actual functions being called, right? > > If that is correct, then the fix should change the functions below, > perhaps adding `krealloc_with_flags()` from the other patch (it does > not need to be a method, by the way), and calling it with a `Layout` > like the generated ones do. Then I can rebase `rust-next` on top of Sounds good, however I think it'll be better if I resend this one, and the other one originally from Bjorn based on the introduction of function `krealloc_with_flags` (I will name it as `krealloc_aligned`, since it's a function that returns a aligned object with krealloc). Thoughts? Regards, Boqun > the fix that adds the `krealloc_with_flags()`. > > Cheers, > Miguel