From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: 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: 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