Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6331679rwl; Tue, 4 Apr 2023 10:57:44 -0700 (PDT) X-Google-Smtp-Source: AKy350ZHxhSxqPXEj/hnA7dEnItjVLtRwyz1VReVaRRj8M0tGOHoLidzmNX0T4poGE0srWNNjfy4 X-Received: by 2002:a05:6a20:b329:b0:da:39a5:6e66 with SMTP id ef41-20020a056a20b32900b000da39a56e66mr2955859pzb.18.1680631064480; Tue, 04 Apr 2023 10:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680631064; cv=none; d=google.com; s=arc-20160816; b=jw/bSOqiTQh6PFPWds7tbqLLc00CmpqrkW6oIeJ2beaw5BOjaJixYWpeK9UJ4ZWQTd 9F6XsInxBtbi7oHkORzzrdp1CkTRUZn8rneSffiqbkSpcdQgm6zgJv7qDfSZHDgJTckb HzK2HgDcM0Sv7Ham6rLVYcPQ5AABcDsW9mN/z6ojvM4rNtBOVf8AWyC3JBokD7TTqN3D fg4xPd9Yci7uptpgCSOjnhvDQjQn9PSylxN0FYtKe3cIYJICI2oAVNazZBFtL4k9cEsu R6jUuVMC8aIKcdt5pT9Z5PSI1QvRoec2qg69eB55EvZZZJspYnwSVjFp9QbgGbYxgH87 AxNg== 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:dkim-signature:date; bh=dLCJ4QDPGQOdXRjeLEsSdzn4iRIChACqcsqMFzOH5j4=; b=pDn56AKTyl/2Y1Rx0z4OrhFqTPiWgMjA6czMwEWb+JKqmnJImn4maFSwuN4543QaZM tsOAhErobIlycAb5xY8/fSF1k2FCHDQ3bSWPjtwo28Foss8nCkvAB4U/dPPiuhL+htbQ uT1iwcui9QVHKab4o9jSCL/evOTz1oTEbNDgso8p/1LcmetoE0aTIn0WK8TAIiBZ4TF0 azNkQ6NvrZNtMfx4vP1j2cM5s4OJmWVgO9i8675m74as01zaOOrKQ+Gom0iWTRB995WR LYn5E/mhBebbvT4qKfttnAd/RvMhFlHyitO48FJSXcpfAWdrSP1eWbC8OEw/HctYNXD9 YLYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=HjHU2oi9; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g28-20020aa796bc000000b0062a3e63c747si10389495pfk.197.2023.04.04.10.57.33; Tue, 04 Apr 2023 10:57:44 -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=@weissschuh.net header.s=mail header.b=HjHU2oi9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236161AbjDDRjY (ORCPT + 99 others); Tue, 4 Apr 2023 13:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236215AbjDDRjK (ORCPT ); Tue, 4 Apr 2023 13:39:10 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7E74687; Tue, 4 Apr 2023 10:38:54 -0700 (PDT) Date: Tue, 4 Apr 2023 17:38:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1680629925; bh=g7Xmkp6P6k5IHx2pSo9vtJJIrKkpePh1vaRO81qxXK8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HjHU2oi9UEjeSvu/5PuuJD1W3DUp4v/PEWC34D+UU6LF55GkHfHL+m5fqlD32c6u9 4OS3kuA5Nr2BFYJVvv5rlomUE2eMK1ntwo1ksokGwYQFSk9odTONsfNGkPSrGWIQf+ 3zNYoNcawaoRytF5T4QqNyKdyiyT2hITkh5AV3Tw= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Coly Li Cc: Kent Overstreet , linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bcache: make kobj_type structures constant Message-ID: <4cc38847-a967-487b-8efe-81b741ab6782@t-8ch.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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9DE71214-283C-4410-B5A4-22DFDA7021F4@suse.de> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hi Coly, On 2023-02-15 00:16:03+0800, Coly Li wrote: > > 2023年2月14日 23:21,Thomas Weißschuh 写道: > > > > On Tue, Feb 14, 2023 at 05:51:09PM +0800, Coly Li wrote: > >> > >> > >>> 2023年2月14日 11:13,Thomas Weißschuh 写道: > >>> > >>> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > >>> the driver core allows the usage of const struct kobj_type. > >>> > >>> Take advantage of this to constify the structure definitions to prevent > >>> modification at runtime. > >>> > >> > >> How the const structure definition can prevent modification at run time? > > > > It will be put into .rodata instead of .data by the compiler. > > The .rodata section is mapped as read-only via the pagetable. > > > > See Documentation/security/self-protection.rst > > "Function pointers and sensitive variables must not be writable". > > I see. Thanks for the information. > > This patch will be added into my testing queue, and submitted later. It seems this was not submitted. Or did I miss it? Thanks, Thomas