From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyrel Datwyler Subject: Re: [PATCH 6/9] PCI: hotplug: Constify hotplug_slot_ops Date: Mon, 20 Aug 2018 17:38:06 -0700 Message-ID: <92f4ee2a-39b8-daa6-ea36-4214e4a438bd@linux.vnet.ibm.com> References: <40b17d029c4fbf099535f989b1d6dd013f708a73.1534686485.git.lukas@wunner.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40b17d029c4fbf099535f989b1d6dd013f708a73.1534686485.git.lukas@wunner.de> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 , Gerald Schaefer , Corentin Chary , Sebastian Ott , Darren Hart , linuxppc-dev@lists.ozlabs.org, Andy Shevchenko , Len Brown List-Id: linux-acpi@vger.kernel.org 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