Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1888313rwe; Sat, 15 Apr 2023 07:45:02 -0700 (PDT) X-Google-Smtp-Source: AKy350ZO4nWUuPFRG0IErJjeEh7qLMaFmq+TvV4VWi4JchKlK1G4YzIDDGpbyMfkINAgNXSCXbkK X-Received: by 2002:a05:6a20:5484:b0:ee:786b:d6f8 with SMTP id i4-20020a056a20548400b000ee786bd6f8mr5893601pzk.57.1681569901800; Sat, 15 Apr 2023 07:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681569901; cv=none; d=google.com; s=arc-20160816; b=k/T9pqnEB9Koqjmv/Or0CNFMwORhm8uph4NlhIsqdryXaEpL6iuoc5FD3pmE2twxuq 5oFJl/bb2co33r9j3khLxAs91RdnXhViVLxeKnQjbCdGZrmy3kLwMg6vO3IucrBJmLr/ LqpeFcNhYOrb9NEGjaf3FqSaIzy5kYDPYgY0MPazVMbuZm4Dr9rGQCvQ+qOxoxeFNVe3 Ehj8XuVh7ZRUJA66helsZsBbtFEJvdlifzCYIewVyoLqxK5eEuf1pBC2/6NazJ4J7fC5 LQuR6CjoD4BMNl1N/n8SGPrgof9zI8sYMxcNiRsqMN8HqPXXi4q5CXQA10hetMLjQVl7 FrAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:dkim-signature; bh=6jxReWX1VHFUkBOiJk4+uoe8qhRpAiPsba7SYIK19LQ=; b=q4jaNBtiyfMdtUNkRBJXsUH0eV100DBaX5anbEAL1O+PC9RAgqrYAuauPEPDOGQ0cc Rd91roGvwF84ifqpYDpLxuP/e/JmgXWtAKX4txJ9IgqWZQPZUYXG4gNvlmYIv1qm/od8 2SgBOkpX0xN0PD0A/cx0sBe7SZMmW+pkyPuXTwSyL/dy2IL3lAmUr/0aWjhozSJMTQhZ W1sH2NW2p9Sds13ajdytu+Mp38sHo+7TMHQyiZmlN8CVwPM3LX/7XfiPtlXIGrE1WM5X JU83y/xiNOnpkKQN7DM0anx0Oba/5+GshMFYk0hPYbYr8lar1PNzl5nl6WjMN1A7kA0E +ImA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=nxRTMFNP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=SS5cAPP4; 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=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a63570b000000b00507681e1281si6934016pgb.525.2023.04.15.07.44.47; Sat, 15 Apr 2023 07:45:01 -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=@suse.de header.s=susede2_rsa header.b=nxRTMFNP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=SS5cAPP4; 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=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbjDOOhn (ORCPT + 99 others); Sat, 15 Apr 2023 10:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjDOOhl (ORCPT ); Sat, 15 Apr 2023 10:37:41 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95A322691; Sat, 15 Apr 2023 07:37:40 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E2E6E219E2; Sat, 15 Apr 2023 14:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681569458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6jxReWX1VHFUkBOiJk4+uoe8qhRpAiPsba7SYIK19LQ=; b=nxRTMFNPBoInPilYcj80Fzos/jjaxJ2dJJKGvS7Py2q7ziG6piYdw6GoOhf6FHZVKFyjba vc4hGEbsRfS4yYuWONdyeYu9FNRmMnhBXY2SV/8JVEBfJDt7dyrOD5m11ctj3vok7N75vp au6/38jXhVC6yDumjn2P2GM9EQBx3OA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681569458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6jxReWX1VHFUkBOiJk4+uoe8qhRpAiPsba7SYIK19LQ=; b=SS5cAPP49uYT5UyialRaWG1oWsO2VaTkhi4e9siO0mMVLWo1oUxn6oR3YwXrr1962SPsTI 5eCVHKWR9t8mW5BQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A673213451; Sat, 15 Apr 2023 14:37:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AE0zG7G2OmSbJwAAMHmgww (envelope-from ); Sat, 15 Apr 2023 14:37:37 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: [PATCH] bcache: make kobj_type structures constant From: Coly Li In-Reply-To: <3c7289e1-2f21-4adc-bed9-df44fd8988d3@t-8ch.de> Date: Sat, 15 Apr 2023 22:37:24 +0800 Cc: Kent Overstreet , linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <0E590AA0-6A76-4816-AF2E-5079CD81A26C@suse.de> References: <20230214-kobj_type-bcache-v1-1-cf00ead7bee7@weissschuh.net> <125CA8D6-D3B7-42FB-83BE-DCA688F2ACAF@suse.de> <20230214152119.epkfhkojqjvokqmv@t-8ch.de> <9DE71214-283C-4410-B5A4-22DFDA7021F4@suse.de> <4cc38847-a967-487b-8efe-81b741ab6782@t-8ch.de> <3c7289e1-2f21-4adc-bed9-df44fd8988d3@t-8ch.de> To: =?utf-8?Q?Thomas_Wei=C3=9Fschuh?= X-Mailer: Apple Mail (2.3731.500.231) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 > 2023=E5=B9=B44=E6=9C=8815=E6=97=A5 02:38=EF=BC=8CThomas Wei=C3=9Fschuh = =E5=86=99=E9=81=93=EF=BC=9A >=20 > Hi Coly, >=20 > On 2023-04-05 21:38:01+0800, Coly Li wrote: >>> 2023=E5=B9=B44=E6=9C=885=E6=97=A5 01:38=EF=BC=8CThomas Wei=C3=9Fschuh = =E5=86=99=E9=81=93=EF=BC=9A >>>=20 >>> Hi Coly, >>>=20 >>> On 2023-02-15 00:16:03+0800, Coly Li wrote: >>>>> 2023=E5=B9=B42=E6=9C=8814=E6=97=A5 23:21=EF=BC=8CThomas Wei=C3=9Fsch= uh =E5=86=99=E9=81=93=EF=BC=9A >>>>>=20 >>>>> On Tue, Feb 14, 2023 at 05:51:09PM +0800, Coly Li wrote: >>>>>>=20 >>>>>>=20 >>>>>>> 2023=E5=B9=B42=E6=9C=8814=E6=97=A5 11:13=EF=BC=8CThomas = Wei=C3=9Fschuh =E5=86=99=E9=81=93=EF=BC=9A >>>>>>>=20 >>>>>>> Since commit ee6d3dd4ed48 ("driver core: make kobj_type = constant.") >>>>>>> the driver core allows the usage of const struct kobj_type. >>>>>>>=20 >>>>>>> Take advantage of this to constify the structure definitions to = prevent >>>>>>> modification at runtime. >>>>>>>=20 >>>>>>=20 >>>>>> How the const structure definition can prevent modification at = run time? >>>>>=20 >>>>> It will be put into .rodata instead of .data by the compiler. >>>>> The .rodata section is mapped as read-only via the pagetable. >>>>>=20 >>>>> See Documentation/security/self-protection.rst >>>>> "Function pointers and sensitive variables must not be writable". >>>>=20 >>>> I see. Thanks for the information. >>>>=20 >>>> This patch will be added into my testing queue, and submitted = later. >>>=20 >>> It seems this was not submitted. >>> Or did I miss it? >>=20 >> No I don=E2=80=99t submit it yet. It is not emergent fix, and stay = with other testing patches together. >>=20 >> Do you want it to go now? >=20 > No, it's not urgent. >=20 > I just assumed it should have been in next by now and thought it got > lost along the way. > Let's keep it with the other testing patches. Some patches from Zheming are not simple, and I need to find time to go = through them carefully. If I am not able to handle them in time, I will submit the simple ones = to Jens some time later. Thanks. Coly Li