From patchwork Wed Sep 4 01:16:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Li X-Patchwork-Id: 13789535 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50B186AA7 for ; Wed, 4 Sep 2024 01:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725412094; cv=none; b=uMuC65mrXtP0wXhSinJr2NpEWoMSR5Xv9WHXcvzMNOkNolwzLjy+HBaWKH1s/vXJLZioG4KPsTA9BZ5HLBIYCti/los134fYUxdLn/TsnuJ6fR3D6EdtYPrqQKapb5FEwDimpDbAvJaJnwsg6IEfFCmU0McQRBkYhJqN2QrT10M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725412094; c=relaxed/simple; bh=h2siSvw5jOYLfZPp8y/y0Kbmv1tbRr8nVni4/N6MSjA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CzW7L6/BB/cIGVbz/MeQnEPn3ij7tL7ploPe02eptlqvIKBW4V6Lm1d9/1WP2NS6lDBaFDRKmk7wFPCR+aJAege5RJDiCr09xThHrp1rPICOCFNxbmEJpiQv+jsGDoUBMc8OWIjKPY8mjz3TQsZu2WL7lNxX3O3tJ6Ebk00azjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Wz45k6l79z1HJ8Z; Wed, 4 Sep 2024 09:04:42 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id 0178C1A0190; Wed, 4 Sep 2024 09:08:10 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 4 Sep 2024 09:08:09 +0800 From: Hongbo Li To: , CC: , Subject: [PATCH -next] parisc: pdc_stable: Constify struct kobj_type Date: Wed, 4 Sep 2024 09:16:42 +0800 Message-ID: <20240904011642.2010258-1-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-parisc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500022.china.huawei.com (7.185.36.66) This 'struct kobj_type' is not modified. It is only used in kobject_init_and_add() which takes a 'const struct kobj_type *ktype' parameter. Constifying this structure and moving it to a read-only section, and can increase over all security. Signed-off-by: Hongbo Li --- drivers/parisc/pdc_stable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index 633266447e2f..16f4496bca95 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c @@ -483,7 +483,7 @@ static struct attribute *paths_subsys_attrs[] = { ATTRIBUTE_GROUPS(paths_subsys); /* Specific kobject type for our PDC paths */ -static struct kobj_type ktype_pdcspath = { +static const struct kobj_type ktype_pdcspath = { .sysfs_ops = &pdcspath_attr_ops, .default_groups = paths_subsys_groups, };