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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 C7CD0C54EAA for ; Thu, 26 Jan 2023 19:46:18 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4P2rmn06rtz3fWc for ; Fri, 27 Jan 2023 06:46:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=VoyKzLiN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4601:e00::1; helo=ams.source.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=VoyKzLiN; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4P2rfw2H6Mz3fKR for ; Fri, 27 Jan 2023 06:41:12 +1100 (AEDT) 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 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230126193752.297968-2-surenb@google.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michel@lespinasse.org, joelaf@google.com, songliubraving@fb.com, mhocko@suse.com, leewalsh@google.com, david@redhat.com, peterz@infradead.org, bigeasy@linutronix.de, peterx@redhat.com, dhowells@redhat.com, linux-mm@kvack.org, edumazet@google.com, jglisse@google.com, punit.agrawal@bytedance.com, will@kernel.org, arjunroy@google.com, dave@stgolabs.net, minchan@google.com, x86@kernel.org, hughd@google.com, willy@infradead.org, gurua@google.com, mingo@redhat.com, linux-arm-kernel@lists.infradead.org, rientjes@google.com, axelrasmussen@google.com, kernel-team@android.com, soheil@google.com, paulmck@kernel.org, jannh@google.com, liam.howlett@oracle.com, shakeelb@google.com, luto@kernel.org, gthelen@google.com, ldufour@linux.ibm.com, vbabka@suse.cz, posk@google.com, lstoakes@gmail.com, peterjung1337@gmail.com, linuxppc-dev@lists.ozlabs.org, kent.overstreet@linux.dev, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, akpm@linux-foundation.org, tatashin@google.com, mgorman@techsingularity .net Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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. 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 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A35DC54EAA for ; Thu, 26 Jan 2023 19:41:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A929E6B0072; Thu, 26 Jan 2023 14:41:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A1BF76B0073; Thu, 26 Jan 2023 14:41:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E3718E0001; Thu, 26 Jan 2023 14:41:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7D4796B0072 for ; Thu, 26 Jan 2023 14:41:11 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4384B80D0A for ; Thu, 26 Jan 2023 19:41:11 +0000 (UTC) X-FDA: 80397968742.24.35EF765 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 856B3C0012 for ; Thu, 26 Jan 2023 19:41:09 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VoyKzLiN; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674762069; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RHKve6d6Gns3PPJdGndNAP7YghDPbfnluAeey6XifCg=; b=MN+qD8QhT/NXS/KZGYa6OYDmE9/YwUYa3cQbtJ0o+yEBacojf1RFgTkyv57H0Wk1hE+dK6 Yw15tfWIAosscwSPdd/mfGOLGOgwssCiONHx3HKGWZ6trs69/3mAjf9KCRmACrCGiPkTlm 7iPhv0yQwO00URRP3DNPeZUbn41NpCE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VoyKzLiN; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674762069; a=rsa-sha256; cv=none; b=tcECT4tC4UUWgMHdFhzHmF4IEKyTRpetas/lGHcp1WAO1hvYQagr2/RLmki9NDZ/j5jAZs eoK4gWXQ6Av7Ic3NG0HynUVpvVMHJHuvLTs/OGlpZg9lhtgmGIMFUIZximLfiW4jt8RDh5 BnXYZ8ETzWjQB5/C3NAhGXjZffRAZs8= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230126193752.297968-2-surenb@google.com> X-Stat-Signature: 1h93wahz5ayfwayxh7e8srguuq944nw4 X-Rspam-User: X-Rspamd-Queue-Id: 856B3C0012 X-Rspamd-Server: rspam06 X-HE-Tag: 1674762069-517644 X-HE-Meta: U2FsdGVkX18DXFOIGRISaiZOhbYgSnBjjXsvfeJqR+4SGwVXs9clquDkdKAkLGtY/9b5Rikw/4Z77kVzlA/m+PH5yK4GdlaXfOmU478vWiCn3mfoj5gPpHGMCPbkd5/lgyxVZpSkALKXMRn/WTMz5nBv1hmV5iNog7bHjBe1hSoFBOYm4MF0/DN/51UASSftrDBfl28pR/aM0rYxC32nAs4gDsTSej4SMyCQ/zK0Uh32lVHDzzXMwX8WSaq28+LFtDJwN5p+M9I61aX+DThzEDWsahHCwQ6zi5IX6epB9p/XB8bn3QnmzbdmmmpLxnX3M2nH+uaezmkJ/qWXAAZI291nrjcgr+sl33y6RPjyEhYshlvfn/ThmQv9C6jaBUDV5xJA+rYBRMk3bY3lqryLxv7csEmR3em+ROudfnxQgpCCMXWs+AalHaPfvJyR5p7T6lY9Od+xNdeYTMkdE7WsXo3G+2znodgPihZygUEifKb074Ge5yXv61dFMRotLaADziu9jMmx79r/dsV8XGZNqgUPWZFxvzGQCmmLyg0UQK4S2XGHxEpntQ3GybKuRABx8aeJP0ayCbKOHKsmHyiJRtGN7HQC8g/MbF7VtdqcstdKh2CCnPLX5uDosnQcP9gQGJXMJorIE/emPsPsDHzQGC5vqlCdf+KU4fqxIKbYQnWtfInCRQ3TfvYzp/4hfq7JY8qoIw/hKjzs+qd09kIOMNw09JNpyS+RSLCyNWpprpBITQowTsLBsbutjI0gBV43+ymIYfisWXwquV25y9O0MXVjHG4ZC8jWUNgriSLK1AWKlqyF29CUAO1l4/utxi7ZVZFG6NZdDxSgghxvv63IGK1mUxR/cccg+fh3n8iYeUUXPMTszphfP3xT19AB5zKRPeajIRqQ704yllh0dRUMIb1TTgz0/lJZtJli5c9I5sWdupRLQV+735OLfw6CN9U+wLQ9IqLsDTsJatfZKU/ kVIUJPMz jjC2r7fQZtpR9TrjPXiVqJVcuH1zEHcB8846dBsGA2ELTbHteADrwE9ScJffvRTaofPf4+yNRn8Wbzp1oNHL8diDJtA5V3fR05nitpbeFuD9/CzVWu4phrCNaBWrWil5kHh/KaDz+GuIYKOeVLugUDTP+yPkxbaTWsufIFD/P24LYIlTa7uA8PiX7jfJ7iJPuwqPrPKf1VLbRMa7epYDs0of8m58RlkmNxQMoy9ygM7Bz50npsYmBoUn9bBoh7MQCMxK9vfvXVp+Z+6iyIq+i/wKmpI+p6Z8IpBpITwfoCix/9ua+f0MZTLOi0BGzADQ2Ok7hxAf3UsMbFwsiZE0ME/x+7vuWpk16VZfN0krjt90z06z9pTleJ4JzSJanfcfzYMMvdhxFbZPwYHWS97u3x24Zpahu5w5RQA9/ahnLxn8vjPFKTUFQjxjb1KBXs/K14qMp X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.