From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50012C54EAA for ; Thu, 26 Jan 2023 19:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VyvsvGIRK83FTSYi6hAoTvaagn3vbzELPOjWaXq037c=; b=zFh6bJLL45anjr XUk6jQh55+efEKecYSp73tYIlNIwAesXo0CCsmBMuMZcfUR0QjVpRDCtJMb+mZ8+x8qXzHzdW+Xj7 f6kluBwioMqlZXzexG2jNa0TkG0p1q+keNC1VVvBc/w5mIH1W68vIpqfD/KqL1felIahVr0RYEGqx qu2njj4/EIUFySf9CxNa2Gtxd6ANaVhhcrlDAVydfIydS7ITthorDdtRCUZAhkKHpXnlGl6W2OzDQ 7SrUHmS6jwgq0fFDUlYS/D9nIkR1o+seQ0MIf9IKVYOXXLu0/XkxNJj/sEvpmutMXTy0yl+75BaSH DQK5q5oT56NywIxRtGjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pL87d-00CL20-74; Thu, 26 Jan 2023 19:41:21 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pL87R-00CKwf-Dn for linux-arm-kernel@lists.infradead.org; Thu, 26 Jan 2023 19:41:13 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E9B71B81EE0; Thu, 26 Jan 2023 19:41:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A54AEC4339C; Thu, 26 Jan 2023 19:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674762066; bh=3YjWfRUjo1ft3vovfj8Qj3jVfoFZUWVVSPF5um0H8zE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VoyKzLiNEea4r35ZvjOAjIE9GUFTldWwpSUnLI7E55mloCSr7TsbGm6/pJQ0+n37j Ey3424GqS0m6y6wvsA6a01ivb6oq/gKzpvviM0ASv/lK4h9ClorDIMEtm81rSQ90B8 d49B4DHagpUBxkO0N84eFsxptnABs+HFtUKDIKeW65vgXmcMMLIxbih7TzgBji6j/z DomLaK/PhQavIqoKjaeL9JpDz8oBnF7vdRjLWkhR2ejUFY7MRSF7wS3ks/FcapV5KH yn+Dtbj/M2HckZSj5kuumdgcprFLcGYxS1dXf5R2gASVuKyjuHPu7+HIKUYMthXIja CVEbdGOSsbMhw== Date: Thu, 26 Jan 2023 21:40:41 +0200 From: Mike Rapoport To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v4 1/7] kernel/fork: convert vma assignment to a memcpy Message-ID: References: <20230126193752.297968-1-surenb@google.com> <20230126193752.297968-2-surenb@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230126193752.297968-2-surenb@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230126_114109_671217_57DDF83A X-CRM114-Status: GOOD ( 18.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 26, 2023 at 11:37:46AM -0800, Suren Baghdasaryan wrote: > Convert vma assignment in vm_area_dup() to a memcpy() to prevent compiler > errors when we add a const modifier to vma->vm_flags. > > Signed-off-by: Suren Baghdasaryan > Acked-by: Mel Gorman Acked-by: Mike Rapoport (IBM) > --- > kernel/fork.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/fork.c b/kernel/fork.c > index 441dcec60aae..9260f975b8f4 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -472,7 +472,7 @@ struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig) > * orig->shared.rb may be modified concurrently, but the clone > * will be reinitialized. > */ > - *new = data_race(*orig); > + data_race(memcpy(new, orig, sizeof(*new))); > INIT_LIST_HEAD(&new->anon_vma_chain); > dup_anon_vma_name(orig, new); > } > -- > 2.39.1 > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel