From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.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 41vWxR2qSKzF0hg for ; Tue, 21 Aug 2018 10:38:19 +1000 (AEST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7L0Xlt5055851 for ; Mon, 20 Aug 2018 20:38:17 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m066g3w6x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 Aug 2018 20:38:17 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Aug 2018 20:38:15 -0400 Subject: Re: [PATCH 6/9] PCI: hotplug: Constify hotplug_slot_ops To: Lukas Wunner , Bjorn Helgaas , linux-pci@vger.kernel.org, Sinan Kaya , Mika Westerberg Cc: Scott Murray , linux-s390@vger.kernel.org, Greg Kroah-Hartman , acpi4asus-user@lists.sourceforge.net, "Rafael J. Wysocki" , Gavin Shan , platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, Paul Mackerras , Sebastian Ott , Corentin Chary , Darren Hart , linuxppc-dev@lists.ozlabs.org, Andy Shevchenko , Gerald Schaefer , Len Brown References: <40b17d029c4fbf099535f989b1d6dd013f708a73.1534686485.git.lukas@wunner.de> From: Tyrel Datwyler Date: Mon, 20 Aug 2018 17:38:06 -0700 MIME-Version: 1.0 In-Reply-To: <40b17d029c4fbf099535f989b1d6dd013f708a73.1534686485.git.lukas@wunner.de> Content-Type: text/plain; charset=utf-8 Message-Id: <92f4ee2a-39b8-daa6-ea36-4214e4a438bd@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 08/19/2018 07:29 AM, Lukas Wunner wrote: > Hotplug drivers cannot declare their hotplug_slot_ops const, making them > attractive targets for attackers, because upon registration of a hotplug > slot, __pci_hp_initialize() writes to the "owner" and "mod_name" members > in that struct. > > Fix by moving these members to struct hotplug_slot and constify every > driver's hotplug_slot_ops except for pciehp. > > pciehp constructs its hotplug_slot_ops at runtime based on the PCIe > port's capabilities, hence cannot declare them const. It can be > converted to __write_rarely once that's mainlined: > http://www.openwall.com/lists/kernel-hardening/2016/11/16/3 > > Signed-off-by: Lukas Wunner > Cc: Rafael J. Wysocki > Cc: Len Brown > Cc: Scott Murray > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Gavin Shan > Cc: Sebastian Ott > Cc: Gerald Schaefer > Cc: Corentin Chary > Cc: Darren Hart > Cc: Andy Shevchenko > --- With regards to drivers/pci/hotplug/rpa* Acked-by: Tyrel Datwyler