diff options
author | Alexandre Oliva <lxoliva@fsfla.org> | 2012-11-27 11:57:41 +0000 |
---|---|---|
committer | Alexandre Oliva <lxoliva@fsfla.org> | 2012-11-27 11:57:41 +0000 |
commit | 1690f37fac4161cf9ad6966071ea5c5d7cf33da1 (patch) | |
tree | 1c365aefa18a66b765c1e444b409ff87f53ebe15 /freed-ora/current/master | |
parent | 1455c121c3e0421dbaa611e53574bb1ce5506115 (diff) | |
download | linux-libre-raptor-1690f37fac4161cf9ad6966071ea5c5d7cf33da1.tar.gz linux-libre-raptor-1690f37fac4161cf9ad6966071ea5c5d7cf33da1.zip |
3.7.0-0.rc6.git4.1.fc19.gnu
Diffstat (limited to 'freed-ora/current/master')
69 files changed, 11299 insertions, 12396 deletions
diff --git a/freed-ora/current/master/ACPI-AC-check-the-return-value-of-power_supply_register.patch b/freed-ora/current/master/ACPI-AC-check-the-return-value-of-power_supply_register.patch deleted file mode 100644 index c9eb1a17d..000000000 --- a/freed-ora/current/master/ACPI-AC-check-the-return-value-of-power_supply_register.patch +++ /dev/null @@ -1,37 +0,0 @@ -In the ac.c, lack check return value of power_supply_register(). -This may casue that acpi driver's add() ops was called successful -while the device may be failed to be initalized. For example, some -ugly bios may describe two ACADs in the same dsdt. They use the same -name which will cause the second ACAD device can no be registered. -And then power_supply_register() failed. But acpi driver's add() ops -is called sucessfully. The acpi device also will receive acpi notification -and cause oops. - https://bugzilla.redhat.com/show_bug.cgi?id=772730 - -Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> ---- - drivers/acpi/ac.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c -index 6512b20..d1fcbc0 100644 ---- a/drivers/acpi/ac.c -+++ b/drivers/acpi/ac.c -@@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_device *device) - ac->charger.properties = ac_props; - ac->charger.num_properties = ARRAY_SIZE(ac_props); - ac->charger.get_property = get_ac_property; -- power_supply_register(&ac->device->dev, &ac->charger); -+ result = power_supply_register(&ac->device->dev, &ac->charger); -+ if (result) -+ goto end; - - printk(KERN_INFO PREFIX "%s [%s] (%s)\n", - acpi_device_name(device), acpi_device_bid(device), --- -1.7.6.rc2.8.g28eb - --- -To unsubscribe from this list: send the line "unsubscribe linux-acpi" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html
\ No newline at end of file diff --git a/freed-ora/current/master/Bluetooth-Add-support-for-BCM20702A0.patch b/freed-ora/current/master/Bluetooth-Add-support-for-BCM20702A0.patch new file mode 100644 index 000000000..99178d757 --- /dev/null +++ b/freed-ora/current/master/Bluetooth-Add-support-for-BCM20702A0.patch @@ -0,0 +1,43 @@ +From a5f86c3423428c8e28b6501d0e9c3929ca91f07d Mon Sep 17 00:00:00 2001 +From: Jeff Cook <jeff@deserettechnology.com> +Date: Fri, 9 Nov 2012 16:39:48 -0700 +Subject: [PATCH 2/2] Bluetooth: Add support for BCM20702A0 [0b05, 17b5] + +Vendor-specific ID for BCM20702A0. +Support for bluetooth over Asus Wi-Fi GO!, included with Asus P8Z77-V +Deluxe. + +T: Bus=07 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 +D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0b05 ProdID=17b5 Rev=01.12 +S: Manufacturer=Broadcom Corp +S: Product=BCM20702A0 +S: SerialNumber=94DBC98AC113 +C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA +I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none) +I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none) +I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) +I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none) + +Cc: stable@vger.kernel.org +Signed-off-by: Jeff Cook <jeff@deserettechnology.com> +Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> +--- + drivers/bluetooth/btusb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index b167944..6dc44ff 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -96,6 +96,7 @@ static struct usb_device_id btusb_table[] = { + { USB_DEVICE(0x0c10, 0x0000) }, + + /* Broadcom BCM20702A0 */ ++ { USB_DEVICE(0x0b05, 0x17b5) }, + { USB_DEVICE(0x04ca, 0x2003) }, + { USB_DEVICE(0x0489, 0xe042) }, + { USB_DEVICE(0x413c, 0x8197) }, +-- +1.8.0 + diff --git a/freed-ora/current/master/Makefile.config b/freed-ora/current/master/Makefile.config index 8c70dae32..21143ebda 100644 --- a/freed-ora/current/master/Makefile.config +++ b/freed-ora/current/master/Makefile.config @@ -9,6 +9,7 @@ CONFIGFILES = \ $(CFG)-i686-PAE.config $(CFG)-i686-PAEdebug.config \ $(CFG)-x86_64.config $(CFG)-x86_64-debug.config \ $(CFG)-s390x.config \ + $(CFG)-armv7.config \ $(CFG)-armv5tel-kirkwood.config \ $(CFG)-armv7l.config $(CFG)-armv7hl.config \ $(CFG)-armv7l-imx.config $(CFG)-armv7hl-imx.config \ @@ -17,9 +18,9 @@ CONFIGFILES = \ $(CFG)-armv7l-highbank.config $(CFG)-armv7hl-highbank.config \ $(CFG)-ppc.config $(CFG)-ppc-smp.config \ $(CFG)-sparc64.config \ - $(CFG)-ppc64.config $(CFG)-ppc64-debug.config + $(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config -PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390x sparc64 +PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390x sparc64 arm TEMPFILES = $(addprefix temp-, $(addsuffix -generic, $(PLATFORMS))) configs: $(CONFIGFILES) @@ -37,6 +38,9 @@ temp-generic: config-generic temp-debug-generic: config-generic cat config-generic config-debug > temp-debug-generic +temp-armv7: config-armv7 temp-generic + perl merge.pl $^ > $@ + temp-arm-generic: config-arm-generic temp-generic perl merge.pl $^ > $@ @@ -88,6 +92,9 @@ temp-powerpc-debug-generic: config-powerpc-generic temp-debug-generic temp-powerpc32-generic: config-powerpc32-generic temp-powerpc-generic perl merge.pl $^ > $@ +temp-powerpc64-generic: config-powerpc64 temp-powerpc-generic + perl merge.pl $^ > $@ + temp-s390-generic: config-s390x temp-generic perl merge.pl $^ > $@ @@ -112,15 +119,21 @@ kernel-$(VERSION)-x86_64-debug.config: /dev/null temp-x86_64-debug-generic kernel-$(VERSION)-sparc64.config: /dev/null temp-sparc64-generic perl merge.pl $^ sparc64 > $@ -kernel-$(VERSION)-ppc64.config: config-powerpc64 temp-powerpc-generic +kernel-$(VERSION)-ppc64.config: /dev/null temp-powerpc64-generic perl merge.pl $^ powerpc > $@ -kernel-$(VERSION)-ppc64-debug.config: config-powerpc64 temp-powerpc-debug-generic +kernel-$(VERSION)-ppc64-debug.config: temp-powerpc64-generic temp-powerpc-debug-generic + perl merge.pl $^ powerpc > $@ + +kernel-$(VERSION)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic perl merge.pl $^ powerpc > $@ kernel-$(VERSION)-s390x.config: config-s390x temp-s390-generic perl merge.pl $^ s390 > $@ +kernel-$(VERSION)-armv7.config: /dev/null temp-armv7 + perl merge.pl $^ armv7 > $@ + kernel-$(VERSION)-armv5tel-kirkwood.config: /dev/null temp-armv5tel-kirkwood perl merge.pl $^ arm > $@ @@ -139,7 +152,7 @@ kernel-$(VERSION)-armv7l-omap.config: /dev/null temp-armv7l-omap kernel-$(VERSION)-armv7l-tegra.config: /dev/null temp-armv7l-tegra perl merge.pl $^ arm > $@ -kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7l-versatile +kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7 perl merge.pl $^ arm > $@ kernel-$(VERSION)-armv7hl-imx.config: /dev/null temp-armv7l-imx diff --git a/freed-ora/current/master/Makefile.release b/freed-ora/current/master/Makefile.release index e3ad8071a..ee811bac2 100644 --- a/freed-ora/current/master/Makefile.release +++ b/freed-ora/current/master/Makefile.release @@ -68,6 +68,7 @@ config-release: @perl -pi -e 's/CONFIG_DETECT_HUNG_TASK=y/# CONFIG_DETECT_HUNG_TASK is not set/' config-nodebug @perl -pi -e 's/CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y/# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_KMEMLEAK=y/# CONFIG_DEBUG_KMEMLEAK is not set/' config-nodebug + @perl -pi -e 's/CONFIG_MAC80211_MESSAGE_TRACING=y/# CONFIG_MAC80211_MESSAGE_TRACING is not set/' config-nodebug @# Undo anything that make extremedebug might have set @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug diff --git a/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch b/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch new file mode 100644 index 000000000..fd92c1664 --- /dev/null +++ b/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch @@ -0,0 +1,80 @@ +From patchwork Sun Jul 22 10:01:43 2012 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: arm-allnoconfig error: '__LINUX_ARM_ARCH__' undeclared +Date: Sun, 22 Jul 2012 10:01:43 -0000 +From: Arnd Bergmann <arnd@arndb.de> +X-Patchwork-Id: 1224201 +Message-Id: <201207221001.43528.arnd@arndb.de> +To: Fengguang Wu <fengguang.wu@intel.com> +Cc: Russell King <linux@arm.linux.org.uk>, + LKML <linux-kernel@vger.kernel.org>, linux-arm-kernel@lists.infradead.org + +On Sunday 22 July 2012, Fengguang Wu wrote: +> Kernel build failed on arm-allnoconfig: +> +> include/linux/math64.h:55:15: error: '__LINUX_ARM_ARCH__' undeclared (first use in this function) +> arch/arm/include/asm/glue-cache.h:129:2: error: #error Unknown cache maintenance model +> arch/arm/include/asm/glue-df.h:99:2: error: #error Unknown data abort handler type +> arch/arm/include/asm/glue-pf.h:54:2: error: #error Unknown prefetch abort handler type +> +> Do you think this allnoconfig test meaningful at all? + +The allno/mod/yesconfig tests on ARM are somewhat limited in their +usefulness at the moment because they always pick the same platform +type (versatile) and don't really cover the cases that most people +are interested in. + +The particular problem with allnoconfig is that the logic to determine +the architecture level depends on at least one platform being selected, +and there are also problems with nommu kernels that tend to not work +if certain other options are not set correctly. + +We can make the nommu case go away if we make hide the option for +non-expert configurations including allnoconfig. I suggested adding +some logic to all the subarch Kconfig files that forces at least +one of the boards to be enabled like the patch below, but a number +of people didn't like it. + +For reference, here is what I would use in order to get 'make +allnoconfig' to work on ARM. My impression is at the moment that +we should make a more serious attempt at fixing all the possible +configurations when we get to 'multiplatform' configurations, +because that will be more interesting than doing it just for +the versatile platform. + +Signed-off-by: Arnd Bergmann <arnd@arndb.de> + + +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index a306d6d..e43e743 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -236,7 +236,7 @@ source "kernel/Kconfig.freezer" + menu "System Type" + + config MMU +- bool "MMU-based Paged Memory Management Support" ++ bool "MMU-based Paged Memory Management Support" if EXPERT + default y + help + Select if you want MMU-based virtualised addressing space +diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig +index c1f38f6..455f20a 100644 +--- a/arch/arm/mach-versatile/Kconfig ++++ b/arch/arm/mach-versatile/Kconfig +@@ -25,4 +25,13 @@ config MACH_VERSATILE_DT + Include support for the ARM(R) Versatile/PB platform, + using the device tree for discovery + ++config MACH_VERSATILE_AUTO ++ def_bool y ++ depends on !ARCH_VERSATILE_PB ++ depends on !MACH_VERSATILE_AB ++ select MACH_VERSATILE_DT ++ help ++ We autoselect MACH_VERSATILE_DT if both PB and AB are ++ disabled, to ensure that at least one platform is enabled. ++ + endmenu diff --git a/freed-ora/current/master/arm-export-read_current_timer.patch b/freed-ora/current/master/arm-export-read_current_timer.patch new file mode 100644 index 000000000..5059d6862 --- /dev/null +++ b/freed-ora/current/master/arm-export-read_current_timer.patch @@ -0,0 +1,10 @@ +--- linux-3.7.0-0.rc2.git1.2.fc19.x86_64/arch/arm/kernel/armksyms.c.orig 2012-10-01 00:47:46.000000000 +0100 ++++ linux-3.7.0-0.rc2.git1.2.fc19.x86_64/arch/arm/kernel/armksyms.c 2012-10-24 09:06:46.570452677 +0100 +@@ -50,6 +50,7 @@ + + /* platform dependent support */ + EXPORT_SYMBOL(arm_delay_ops); ++EXPORT_SYMBOL(read_current_timer); + + /* networking */ + EXPORT_SYMBOL(csum_partial); diff --git a/freed-ora/current/master/arm-omapdrm-fixinc.patch b/freed-ora/current/master/arm-omapdrm-fixinc.patch new file mode 100644 index 000000000..001b4c57f --- /dev/null +++ b/freed-ora/current/master/arm-omapdrm-fixinc.patch @@ -0,0 +1,15 @@ +--- linux-3.7.0-0.rc2.git4.2.fc19.x86_64/drivers/staging/omapdrm/omap_crtc.c.orig 2012-10-30 09:58:47.613641237 +0000 ++++ linux-3.7.0-0.rc2.git4.2.fc19.x86_64/drivers/staging/omapdrm/omap_crtc.c 2012-10-30 10:05:36.996081758 +0000 +@@ -19,9 +19,9 @@ + + #include "omap_drv.h" + +-#include "drm_mode.h" +-#include "drm_crtc.h" +-#include "drm_crtc_helper.h" ++#include <drm/drm_mode.h> ++#include <drm/drm_crtc.h> ++#include <drm/drm_crtc_helper.h> + + #define to_omap_crtc(x) container_of(x, struct omap_crtc, base) + diff --git a/freed-ora/current/master/config-arm-generic b/freed-ora/current/master/config-arm-generic index 94d299b2d..b6be5388a 100644 --- a/freed-ora/current/master/config-arm-generic +++ b/freed-ora/current/master/config-arm-generic @@ -12,29 +12,44 @@ CONFIG_AEABI=y CONFIG_OABI_COMPAT=y CONFIG_VFP=y CONFIG_ARM_UNWIND=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_SMP=y CONFIG_NR_CPUS=4 CONFIG_SMP_ON_UP=y +CONFIG_ARM_ARCH_TIMER=y + +CONFIG_CMDLINE="" + +# CONFIG_ARM_LPAE is not set # CONFIG_FPE_NWFPE is not set CONFIG_FPE_FASTFPE=y +CONFIG_HIGHPTE=y +CONFIG_HW_PERF_EVENTS=y +CONFIG_UACCESS_WITH_MEMCPY=y # Generic ARM Errata CONFIG_ARM_ERRATA_720789=y CONFIG_ARM_ERRATA_751472=y +CONFIG_ARM_ERRATA_742230=y +CONFIG_ARM_ERRATA_742231=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y # Generic ARM config options CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_LOCAL_TIMERS=y +CONFIG_ATAGS=y CONFIG_ATAGS_PROC=y -# DeviceTree -CONFIG_USE_OF=y -# CONFIG_OF_SELFTEST is not set -CONFIG_PROC_DEVICETREE=y -CONFIG_ARM_APPENDED_DTB=y +CONFIG_PL330_DMA=y +CONFIG_AMBA_PL08X=y +CONFIG_PL330_DMA=y +# CONFIG_XIP_KERNEL is not set +# CONFIG_PID_IN_CONTEXTIDR is not set # Generic options we want for ARM that aren't defualt CONFIG_HIGHMEM=y @@ -58,26 +73,26 @@ CONFIG_SUSPEND=y CONFIG_ARM_CPU_SUSPEND=y CONFIG_ARM_CPU_TOPOLOGY=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 +CONFIG_LSM_MMAP_MIN_ADDR=32768 + +# CONFIG_XEN is not set + CONFIG_THERMAL=y +CONFIG_ETHERNET=y + CONFIG_PERF_EVENTS=y CONFIG_PERF_COUNTERS=y CONFIG_CC_STACKPROTECTOR=y -CONFIG_AUTO_ZRELADDR=y - CONFIG_SECCOMP=y CONFIG_STRICT_DEVMEM=y CONFIG_SPARSE_IRQ=y -CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 -CONFIG_LSM_MMAP_MIN_ADDR=32768 - # Generic HW for all ARM platforms -CONFIG_LEDS=y -CONFIG_LEDS_CPU=y CONFIG_LEDS_GPIO=m CONFIG_LBDAF=y @@ -85,10 +100,15 @@ CONFIG_LBDAF=y CONFIG_RFKILL_GPIO=m CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y CONFIG_GPIO_GENERIC_PLATFORM=m +CONFIG_PINCTRL_SINGLE=m + +CONFIG_USB_ULPI=y CONFIG_SND_ARM=y CONFIG_SND_ARMAACI=m CONFIG_SND_SOC=m +CONFIG_SND_DESIGNWARE_I2S=m +CONFIG_SND_SIMPLE_CARD=m # CONFIG_SND_SOC_CACHE_LZO is not set CONFIG_SND_SOC_ALL_CODECS=m @@ -101,7 +121,25 @@ CONFIG_DM9000_DEBUGLEVEL=4 CONFIG_SMC911X=m CONFIG_SMSC911X=m +CONFIG_SERIO_AMBAKMI=m +CONFIG_I2C_NOMADIK=m +CONFIG_ARM_SP805_WATCHDOG=m +CONFIG_FB_ARMCLCD=m +CONFIG_MPCORE_WATCHDOG=m + +CONFIG_MMC_ARMMMCI=m CONFIG_MMC_SDHCI_PLTFM=m +CONFIG_MMC_SDHCI_OF=m +CONFIG_MMC_SPI=m +CONFIG_MMC_DW=m +CONFIG_MMC_DW_PLTFM=m +CONFIG_MMC_DW_PCI=m +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_IDMAC is not set +CONFIG_MMC_SDHCI_PXAV3=m +CONFIG_MMC_SDHCI_PXAV2=m + +# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set # Generic GPIO options CONFIG_GENERIC_GPIO=y @@ -109,6 +147,8 @@ CONFIG_GENERIC_GPIO=y CONFIG_MTD=m CONFIG_MTD_TESTS=m CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_OF_PARTS=y +CONFIG_MTD_PHYSMAP_OF=y # CONFIG_MTD_AFS_PARTS is not set CONFIG_MTD_CHAR=m CONFIG_MTD_BLKDEVS=m @@ -134,6 +174,7 @@ CONFIG_MTD_ALAUDA=m # CONFIG_MTD_ONENAND is not set CONFIG_MTD_JEDECPROBE=m CONFIG_MTD_GEN_PROBE=y +CONFIG_MTD_IMPA7=m CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y # CONFIG_MTD_MAP_BANK_WIDTH_4 is not set @@ -169,6 +210,8 @@ CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_UBI_BEB_RESERVE=1 # CONFIG_MTD_UBI_GLUEBI is not set # CONFIG_MTD_UBI_DEBUG is not set +CONFIG_MG_DISK=m +CONFIG_MG_DISK_RES=0 # CONFIG_SM_FTL is not set @@ -191,10 +234,107 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y # CONFIG_UBIFS_FS_DEBUG is not set +# HW crypto and rng +CONFIG_CRYPTO_SHA1_ARM=m +CONFIG_CRYPTO_AES_ARM=m +CONFIG_HW_RANDOM_ATMEL=m +CONFIG_HW_RANDOM_EXYNOS=m + +# Device tree +CONFIG_OF=y +CONFIG_USE_OF=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_PROC_DEVICETREE=y +# CONFIG_OF_SELFTEST is not set + +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_OF_GPIO=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_I2C_MUX_PINCTRL=m +CONFIG_OF_MDIO=m +CONFIG_MDIO_BUS_MUX_GPIO=m +CONFIG_MDIO_BUS_MUX_MMIOREG=m + +CONFIG_BPF_JIT=y + +CONFIG_RCU_FANOUT_LEAF=16 +CONFIG_EDAC=y +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_LEGACY_SYSFS=y + +CONFIG_RTC_DRV_88PM80X=m +CONFIG_RTC_DRV_PL030=m +CONFIG_RTC_DRV_PL031=m +CONFIG_RTC_DRV_SNVS=m +CONFIG_RFKILL_REGULATOR=m +CONFIG_INPUT_88PM80X_ONKEY=y +CONFIG_INPUT_GP2A=m +CONFIG_INPUT_GPIO_TILT_POLLED=m +CONFIG_INPUT_PWM_BEEPER=m +CONFIG_SERIAL_AMBA_PL010=m +CONFIG_SERIAL_AMBA_PL011=m +CONFIG_GPIO_PL061=y +CONFIG_GPIO_MCP23S08=m +CONFIG_GPIO_ADNP=m +CONFIG_PL310_ERRATA_753970=y + +CONFIG_MFD_88PM800=m +CONFIG_MFD_88PM805=m +CONFIG_MFD_SYSCON=y + +CONFIG_REGULATOR_VIRTUAL_CONSUMER=m +CONFIG_REGULATOR_USERSPACE_CONSUMER=m +CONFIG_REGULATOR_GPIO=m +CONFIG_REGULATOR_AD5398=m +CONFIG_REGULATOR_ISL6271A=m +CONFIG_REGULATOR_MAX1586=m +CONFIG_REGULATOR_MAX8649=m +CONFIG_REGULATOR_MAX8660=m +CONFIG_REGULATOR_MAX8952=m +CONFIG_REGULATOR_LP3971=m +CONFIG_REGULATOR_TPS62360=m +CONFIG_REGULATOR_TPS65023=m +CONFIG_REGULATOR_TPS6507X=m +CONFIG_CHARGER_MANAGER=y +CONFIG_EXTCON_GPIO=m + +# CONFIG_AUTO_ZRELADDR is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set + +# CONFIG_VFIO is not set + +# CONFIG_XIP_KERNEL is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_APM_EMULATION is not set +# CONFIG_DEPRECATED_PARAM_STRUCT is not set + +# CONFIG_SERIAL_8250_EM is not set +# CONFIG_GPIO_EM is not set +# CONFIG_HVC_DCC is not set +# CONFIG_LEDS_RENESAS_TPU is not set + +# Possibly part of Snowball +# CONFIG_MFD_T7L66XB is not set +# CONFIG_MFD_TC6387XB is not set + +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_COMMON_CLK_DEBUG is not set +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_ARM_KPROBES_TEST is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set + +# CONFIG_DEBUG_PINCTRL is not set + # HW Disabled because it causes issues on ARM platforms # disable TPM on arm at least on the trimslices it causes havoc # CONFIG_TCG_TPM is not set + # CONFIG_IMA is not set # ERROR: "__bswapsi2" [drivers/staging/crystalhd/crystalhd.ko] undefined! diff --git a/freed-ora/current/master/config-arm-highbank b/freed-ora/current/master/config-arm-highbank index 40b5e6c04..952a21ac4 100644 --- a/freed-ora/current/master/config-arm-highbank +++ b/freed-ora/current/master/config-arm-highbank @@ -26,13 +26,37 @@ CONFIG_ATA_SFF=y CONFIG_NET_CALXEDA_XGMAC=y +CONFIG_EDAC_HIGHBANK_MC=m +CONFIG_EDAC_HIGHBANK_L2=m + CONFIG_GPIO_PL061=y CONFIG_SERIAL_AMBA_PL010=y CONFIG_SERIAL_AMBA_PL010_CONSOLE=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y CONFIG_RTC_DRV_PL030=y CONFIG_RTC_DRV_PL031=y -# CONFIG_DVB_TDA1004X is not set -# CONFIG_DVB_PLL is not set +CONFIG_SATA_HIGHBANK=m + +CONFIG_OC_ETM=y + +# CONFIG_NET_VENDOR_BROADCOM is not set +# these were all requested to be disabled on highbank kernels by calxeda +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_CAIF is not set +# CONFIG_NFC is not set +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +# CONFIG_ATM_DRIVERS is not set +# CONFIG_WAN is not set +# CONFIG_ISDN is not set +# CONFIG_MEDIA_SUPPORT is not set +# CONFIG_DRM is not set +# CONFIG_SND is not set +# end of list of requested disabled options diff --git a/freed-ora/current/master/config-arm-imx b/freed-ora/current/master/config-arm-imx index 88dd42b5f..bddff88ab 100644 --- a/freed-ora/current/master/config-arm-imx +++ b/freed-ora/current/master/config-arm-imx @@ -1,45 +1,62 @@ CONFIG_ARCH_MXC=y CONFIG_ARCH_MX51=y -CONFIG_MACH_MX51_BABBAGE=y -CONFIG_MACH_MX51_3DS=y -CONFIG_MACH_EUKREA_CPUIMX51=y + CONFIG_VFP=y CONFIG_NEON=y - -CONFIG_MACH_EUKREA_CPUIMX51SD=y -CONFIG_MACH_MX51_EFIKAMX=y -CONFIG_MACH_MX51_EFIKASB=y # CONFIG_SWP_EMULATE is not set # CONFIG_THUMB2_KERNEL is not set CONFIG_CPU_FREQ_IMX=y -CONFIG_W1_MASTER_MXC=m -CONFIG_IMX_DMA=y -CONFIG_IMX_SDMA=y + +CONFIG_SOC_IMX6Q=y + +CONFIG_MACH_ARMADILLO5X0=y +CONFIG_MACH_BUG=y +CONFIG_MACH_EUKREA_CPUIMX35=y +CONFIG_MACH_EUKREA_CPUIMX35SD=y +CONFIG_MACH_EUKREA_CPUIMX51=y +CONFIG_MACH_EUKREA_CPUIMX51SD=y +CONFIG_MACH_IMX31_DT=y +CONFIG_MACH_IMX51_DT=y +CONFIG_MACH_IMX53_DT=y +CONFIG_MACH_KZM_ARM11_01=y +CONFIG_MACH_MX31_3DS=y CONFIG_MACH_MX31ADS=y CONFIG_MACH_MX31LILLY=y CONFIG_MACH_MX31LITE=y -CONFIG_MACH_PCM037=y -CONFIG_MACH_MX31_3DS=y CONFIG_MACH_MX31MOBOARD=y -CONFIG_MACH_QONG=y -CONFIG_MACH_ARMADILLO5X0=y -CONFIG_MACH_KZM_ARM11_01=y -CONFIG_MACH_BUG=y -CONFIG_MACH_PCM043=y CONFIG_MACH_MX35_3DS=y -CONFIG_MACH_EUKREA_CPUIMX35=y +CONFIG_MACH_MX51_3DS=y +CONFIG_MACH_MX51_BABBAGE=y +CONFIG_MACH_MX51_EFIKAMX=y +CONFIG_MACH_MX51_EFIKASB=y +CONFIG_MACH_MX53_EVK=y +CONFIG_MACH_MX53_SMD=y +CONFIG_MACH_MX53_LOCO=y +CONFIG_MACH_MX53_ARD=y +CONFIG_MACH_PCM037=y +CONFIG_MACH_PCM037_EET=y +CONFIG_MACH_PCM043=y +CONFIG_MACH_QONG=y CONFIG_MACH_VPR200=y -CONFIG_SOC_IMX6Q=y + +CONFIG_W1_MASTER_MXC=m +CONFIG_DMA_CACHE_RWFO=y +CONFIG_IMX_DMA=y +CONFIG_IMX_SDMA=y +CONFIG_MXS_DMA=y CONFIG_MXC_IRQ_PRIOR=y CONFIG_MXC_PWM=m CONFIG_MXC_DEBUG_BOARD=y + # CONFIG_CPU_BPREDICT_DISABLE is not set CONFIG_CACHE_L2X0=y CONFIG_ARM_DMA_MEM_BUFFERABLE=y +CONFIG_ARM_ERRATA_326103=y CONFIG_ARM_ERRATA_411920=y CONFIG_PL310_ERRATA_588369=y CONFIG_PL310_ERRATA_727915=y CONFIG_ARM_ERRATA_364296=y + CONFIG_PATA_IMX=m CONFIG_NET_VENDOR_FREESCALE=y CONFIG_FEC=y @@ -50,19 +67,19 @@ CONFIG_I2C_IMX=m CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_MCP23S08=m # CONFIG_GPIO_MC9S08DZ60 is not set -CONFIG_DVB_TDA1004X=m -CONFIG_DVB_PLL=m -CONFIG_SND_IMX_SOC=m +CONFIG_PINCTRL_IMX51=y +CONFIG_PINCTRL_IMX53=y CONFIG_USB_EHCI_MXC=y +CONFIG_USB_MXS_PHY=m # CONFIG_USB_IMX21_HCD is not set CONFIG_MMC_SDHCI_ESDHC_IMX=m CONFIG_MMC_MXC=m CONFIG_RTC_MXC=y +CONFIG_RTC_DRV_MXC=m CONFIG_BACKLIGHT_PWM=m CONFIG_LEDS_PWM=m -CONFIG_MACH_PCM037_EET=y # CONFIG_MACH_MX31_3DS_MXC_NAND_USE_BBT is not set CONFIG_MXC_USE_EPIT=y CONFIG_HAVE_EPIT=y @@ -74,15 +91,19 @@ CONFIG_ARM_ERRATA_743622=y CONFIG_ARM_ERRATA_754322=y CONFIG_CAN_FLEXCAN=m CONFIG_MTD_NAND_MXC=m +CONFIG_MTD_NAND_GPMI_NAND=y CONFIG_INPUT_PWM_BEEPER=m CONFIG_SERIAL_IMX_CONSOLE=y CONFIG_IMX2_WDT=m + +CONFIG_SND_IMX_SOC=m CONFIG_SND_SOC_PHYCORE_AC97=m CONFIG_SND_SOC_EUKREA_TLV320=m +CONFIG_SND_SOC_IMX_SGTL5000=m CONFIG_PL310_ERRATA_769419=y CONFIG_LEDS_RENESAS_TPU=y -# CONFIG_ARM_LPAE is not set -# CONFIG_INPUT_GP2A is not set -# CONFIG_INPUT_GPIO_TILT_POLLED is not set +CONFIG_FB_IMX=m + +# CONFIG_NET_VENDOR_BROADCOM is not set diff --git a/freed-ora/current/master/config-arm-kirkwood b/freed-ora/current/master/config-arm-kirkwood index 4d6dbf8c9..f03057852 100644 --- a/freed-ora/current/master/config-arm-kirkwood +++ b/freed-ora/current/master/config-arm-kirkwood @@ -2,29 +2,37 @@ CONFIG_ARCH_KIRKWOOD=y CONFIG_ARCH_KIRKWOOD_DT=y # CONFIG_SMP is not set # CONFIG_VFP is not set + +CONFIG_MACH_D2NET_V2=y CONFIG_MACH_DB88F6281_BP=y -CONFIG_MACH_RD88F6192_NAS=y -CONFIG_MACH_RD88F6281=y -CONFIG_MACH_MV88F6281GTW_GE=y -CONFIG_MACH_SHEEVAPLUG=y +CONFIG_MACH_DOCKSTAR=y +CONFIG_MACH_DOCKSTAR_DT=y +CONFIG_MACH_DREAMPLUG_DT=y CONFIG_MACH_ESATA_SHEEVAPLUG=y +CONFIG_MACH_DLINK_KIRKWOOD_DT=y +CONFIG_MACH_GOFLEXNET_DT=y CONFIG_MACH_GURUPLUG=y -CONFIG_MACH_DREAMPLUG_DT=y -CONFIG_MACH_DOCKSTAR=y -CONFIG_MACH_TS219=y -CONFIG_MACH_TS41X=y -CONFIG_MACH_OPENRD_BASE=y -CONFIG_MACH_OPENRD_CLIENT=y -CONFIG_MACH_OPENRD_ULTIMATE=y -CONFIG_MACH_NETSPACE_V2=y +CONFIG_MACH_ICONNECT_DT=y +CONFIG_MACH_IB62X0_DT=y CONFIG_MACH_INETSPACE_V2=y +CONFIG_MACH_IOMEGA_IX2_200_DT=y +CONFIG_MACH_KM_KIRKWOOD_DT=y +CONFIG_MACH_LSXL_DT=y +CONFIG_MACH_MV88F6281GTW_GE=y +CONFIG_MACH_NETSPACE_V2=y CONFIG_MACH_NETSPACE_MAX_V2=y -CONFIG_MACH_D2NET_V2=y CONFIG_MACH_NET2BIG_V2=y CONFIG_MACH_NET5BIG_V2=y +CONFIG_MACH_OPENRD_BASE=y +CONFIG_MACH_OPENRD_CLIENT=y +CONFIG_MACH_OPENRD_ULTIMATE=y +CONFIG_MACH_RD88F6192_NAS=y +CONFIG_MACH_RD88F6281=y +CONFIG_MACH_SHEEVAPLUG=y +CONFIG_MACH_TS219=y +CONFIG_MACH_TS219_DT=y +CONFIG_MACH_TS41X=y CONFIG_MACH_T5325=y -# CONFIG_CPU_FEROCEON_OLD_ID is not set - CONFIG_CACHE_FEROCEON_L2=y CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH=y @@ -44,7 +52,11 @@ CONFIG_RTC_DRV_MV=y CONFIG_MV_XOR=y CONFIG_CRYPTO_DEV_MV_CESA=m +# CONFIG_CPU_FEROCEON_OLD_ID is not set # CONFIG_INPUT_GP2A is not set # CONFIG_INPUT_GPIO_TILT_POLLED is not set +# CONFIG_HIGHPTE is not set +# CONFIG_EDAC is not set + CONFIG_FB_XGI=m diff --git a/freed-ora/current/master/config-arm-omap b/freed-ora/current/master/config-arm-omap index 36041f82d..89ecea347 100644 --- a/freed-ora/current/master/config-arm-omap +++ b/freed-ora/current/master/config-arm-omap @@ -1,7 +1,4 @@ CONFIG_ARCH_OMAP=y -# CONFIG_GPIO_PCA953X is not set -# CONFIG_KEYBOARD_GPIO_POLLED is not set -# TI OMAP Common Features CONFIG_ARCH_OMAP_OTG=y # CONFIG_ARCH_OMAP1 is not set CONFIG_ARCH_OMAP2PLUS=y @@ -25,8 +22,13 @@ CONFIG_OMAP_DM_TIMER=y # CONFIG_OMAP_PM_NONE is not set CONFIG_OMAP_PM_NOOP=y CONFIG_OMAP_IOMMU=y +# CONFIG_OMAP_IOMMU_DEBUG is not set CONFIG_OMAP3_EMU=y CONFIG_HWSPINLOCK_OMAP=m +CONFIG_DMA_OMAP=y +# CONFIG_DMADEVICES_VDEBUG is not set + +CONFIG_ARM_OMAP2PLUS_CPUFREQ=y # # TI OMAP2/3/4 Specific Features @@ -36,47 +38,47 @@ CONFIG_ARCH_OMAP2PLUS_TYPICAL=y CONFIG_ARCH_OMAP3=y CONFIG_ARCH_OMAP4=y CONFIG_SOC_OMAP3430=y -# CONFIG_SOC_OMAPTI81XX is not set -# CONFIG_SOC_OMAPAM33XX is not set -# CONFIG_SOC_OMAPTI816X is not set +CONFIG_SOC_TI81XX=y +CONFIG_SOC_AM33XX=y +CONFIG_SOC_OMAPTI816X=y +CONFIG_SOC_OMAP5=y CONFIG_OMAP_PACKAGE_CBB=y CONFIG_OMAP_PACKAGE_CBL=y CONFIG_OMAP_PACKAGE_CBS=y # CONFIG_OMAP4_ERRATA_I688 is not set -CONFIG_ARM_OMAP2PLUS_CPUFREQ=y - # # OMAP Board Type # -CONFIG_MACH_OMAP_GENERIC=y -CONFIG_MACH_OMAP3_BEAGLE=y -CONFIG_MACH_DEVKIT8000=y -CONFIG_MACH_OMAP_LDP=y -CONFIG_MACH_OMAP3530_LV_SOM=y -CONFIG_MACH_OMAP3_TORPEDO=y -CONFIG_MACH_OVERO=y -CONFIG_MACH_OMAP3EVM=y -CONFIG_MACH_OMAP3517EVM=y -CONFIG_MACH_CRANEBOARD=y -CONFIG_MACH_OMAP3_PANDORA=y -CONFIG_MACH_OMAP3_TOUCHBOOK=y -CONFIG_MACH_OMAP_3430SDP=y -CONFIG_MACH_OMAP_ZOOM2=y -CONFIG_MACH_OMAP_ZOOM3=y CONFIG_MACH_CM_T35=y CONFIG_MACH_CM_T3517=y +CONFIG_MACH_CRANEBOARD=y +CONFIG_MACH_DEVKIT8000=y CONFIG_MACH_IGEP0020=y CONFIG_MACH_IGEP0030=y -CONFIG_MACH_SBC3530=y +CONFIG_MACH_OMAP_GENERIC=y +CONFIG_MACH_OMAP_LDP=y +CONFIG_MACH_OMAP_ZOOM2=y +CONFIG_MACH_OMAP_ZOOM3=y +CONFIG_MACH_OMAP_3430SDP=y CONFIG_MACH_OMAP_3630SDP=y CONFIG_MACH_OMAP_4430SDP=y +CONFIG_MACH_OMAP3_BEAGLE=y +CONFIG_MACH_OMAP3_PANDORA=y +CONFIG_MACH_OMAP3_TOUCHBOOK=y +CONFIG_MACH_OMAP3_TORPEDO=y +CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL=y +CONFIG_MACH_OMAP3EVM=y +CONFIG_MACH_OMAP3517EVM=y +CONFIG_MACH_OMAP3530_LV_SOM=y CONFIG_MACH_OMAP4_PANDA=y +CONFIG_MACH_OVERO=y +CONFIG_MACH_SBC3530=y +CONFIG_MACH_TI8148EVM=y CONFIG_MACH_TI8168EVM=y +CONFIG_MACH_TOUCHBOOK=y # CONFIG_MACH_NOKIA_RM680 is not set # CONFIG_MACH_NOKIA_RX51 is not set -# CONFIG_MACH_TI8148EVM is not set -CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL=y # CONFIG_OMAP3_SDRC_AC_TIMING is not set @@ -120,7 +122,6 @@ CONFIG_ARM_GIC=y CONFIG_HAVE_ARM_SCU=y CONFIG_HAVE_ARM_TWD=y CONFIG_HOTPLUG_CPU=y -CONFIG_LOCAL_TIMERS=y CONFIG_HZ=128 # CONFIG_THUMB2_KERNEL is not set CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y @@ -142,10 +143,16 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_ARCH_HAS_OPP=y CONFIG_PM_OPP=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_THERMAL=y + # # OMAP Hardware # +CONFIG_WL_TI=y +CONFIG_WLCORE_SDIO=m CONFIG_TI_ST=m +# CONFIG_TI_CPSW is not set CONFIG_GPIOLIB=y CONFIG_MTD_NAND_OMAP2=y CONFIG_MTD_NAND_OMAP_PREFETCH=y @@ -153,52 +160,77 @@ CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y CONFIG_WL1251_SPI=m CONFIG_WL12XX_SPI=m CONFIG_WL12XX_SDIO_TEST=m +CONFIG_WL18XX=m +CONFIG_NFC_WILINK=m CONFIG_INPUT_TWL4030_PWRBUTTON=m CONFIG_INPUT_TWL4030_VIBRA=m CONFIG_INPUT_TWL6040_VIBRA=m CONFIG_KEYBOARD_OMAP4=m +CONFIG_KEYBOARD_TWL4030=m CONFIG_TOUCHSCREEN_TI_TSCADC=m CONFIG_SERIAL_OMAP=y CONFIG_SERIAL_OMAP_CONSOLE=y CONFIG_OMAP_WATCHDOG=y CONFIG_TWL4030_CORE=y -# CONFIG_TWL4030_MADC is not set +CONFIG_TWL4030_MADC=m CONFIG_TWL4030_POWER=y CONFIG_TWL4030_CODEC=y +CONFIG_TWL4030_WATCHDOG=m CONFIG_GPIO_TWL4030=m CONFIG_CHARGER_TWL4030=m -# CONFIG_TWL6030_PWM is not set +CONFIG_TWL6030_PWM=m +CONFIG_TWL6040_CORE=y +CONFIG_SENSORS_TWL4030_MADC=m +CONFIG_TI_DAVINCI_EMAC=m +CONFIG_TI_DAVINCI_MDIO=m +CONFIG_TI_DAVINCI_CPDMA=m +CONFIG_LEDS_PWM=m CONFIG_MTD_ONENAND_OMAP2=y +CONFIG_HDQ_MASTER_OMAP=m CONFIG_I2C_OMAP=y CONFIG_SPI_OMAP24XX=y -# CONFIG_MFD_OMAP_USB_HOST is not set -# CONFIG_MFD_WL1273_CORE is not set +CONFIG_MFD_OMAP_USB_HOST=y +CONFIG_MFD_WL1273_CORE=m CONFIG_REGULATOR_TWL4030=y +# Enable V4L2 drivers for OMAP2+ +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VIDEO_VPFE_CAPTURE=m CONFIG_VIDEO_OMAP2_VOUT=m # CONFIG_VIDEO_OMAP3 is not set +# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver +CONFIG_V4L_TEST_DRIVERS=y +CONFIG_VIDEO_VIVI=m CONFIG_DRM=m CONFIG_DRM_OMAP=m +CONFIG_DRM_OMAP_NUM_CRTCS=2 # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set # CONFIG_FB_OMAP_LCD_VGA is not set CONFIG_OMAP2_VRAM=y +CONFIG_OMAP2_VRAM_SIZE=0 CONFIG_OMAP2_VRFB=y -CONFIG_OMAP2_DSS=y -CONFIG_OMAP2_VRAM_SIZE=12 +# CONFIG_FB_OMAP2 is not set + +CONFIG_OMAP2_DSS=m CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y # CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set CONFIG_OMAP2_DSS_DPI=y -# CONFIG_OMAP2_DSS_RFBI is not set -ONFIG_OMAP2_DSS_VENC=y +CONFIG_OMAP2_DSS_RFBI=y +CONFIG_OMAP2_DSS_VENC=y CONFIG_OMAP4_DSS_HDMI=y -# CONFIG_OMAP2_DSS_SDI is not set -# CONFIG_OMAP2_DSS_DSI is not set +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_DSI=y # CONFIG_OMAP2_DSS_FAKE_VSYNC is not set -CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1 +CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y -# CONFIG_FB_OMAP2 is not set + +CONFIG_PANEL_TFP410=m +CONFIG_PANEL_PICODLP=m +CONFIG_BACKLIGHT_PANDORA=m # # OMAP2/3 Display Device Drivers @@ -220,6 +252,7 @@ CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y CONFIG_SND_OMAP_SOC_ZOOM2=y CONFIG_SND_OMAP_SOC_IGEP0020=y +CONFIG_SND_OMAP_SOC_OMAP_HDMI=y # Because alsa is modular http://www.spinics.net/lists/linux-omap/msg67307.html # CONFIG_SND_OMAP_SOC_OMAP4_HDMI is not set CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m @@ -236,27 +269,63 @@ CONFIG_USB_OTG=y CONFIG_USB_EHCI_HCD_OMAP=y CONFIG_USB_MUSB_OMAP2PLUS=y CONFIG_USB_MUSB_HDRC=y -CONFIG_MUSB_PIO_ONLY=y +CONFIG_USB_OHCI_HCD_OMAP3=y +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_MUSB_PIO_ONLY is not set # CONFIG_USB_MUSB_DEBUG is not set # # CONFIG_USB_GADGET_OMAP is not set # CONFIG_ISP1301_OMAP is not set -CONFIG_MMC_OMAP=m + +# This block is temporary until we work out why the MMC modules don't work as modules +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_OF=y +CONFIG_MMC_SPI=y + +CONFIG_MMC_OMAP=y CONFIG_MMC_OMAP_HS=y CONFIG_TWL4030_USB=y CONFIG_TWL6030_USB=y CONFIG_RTC_DRV_TWL4030=y -CONFIG_TIDSPBRIDGE=m -CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000 +# CONFIG_TIDSPBRIDGE is not set +# CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000 # CONFIG_TIDSPBRIDGE_DEBUG is not set -CONFIG_TIDSPBRIDGE_RECOVERY=y +# CONFIG_TIDSPBRIDGE_RECOVERY=y # CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set -CONFIG_TIDSPBRIDGE_WDT3=y -CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5 +# CONFIG_TIDSPBRIDGE_WDT3=y +# CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5 # CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set # CONFIG_TIDSPBRIDGE_BACKTRACE is not set +# CONFIG_OMAP_REMOTEPROC is not set +# CONFIG_OMAP_BANDGAP is not set +# CONFIG_OMAP_IOVMM is not set + CONFIG_CRYPTO_DEV_OMAP_SHAM=m CONFIG_CRYPTO_DEV_OMAP_AES=m + +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_MTD_NAND_OMAP_BCH is not set +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_RC5T583 is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_REGULATOR_DUMMY is not set +# CONFIG_REGULATOR_LP3972 is not set +# CONFIG_REGULATOR_LP872X is not set + diff --git a/freed-ora/current/master/config-arm-tegra b/freed-ora/current/master/config-arm-tegra index 870ddc526..bf31669f3 100644 --- a/freed-ora/current/master/config-arm-tegra +++ b/freed-ora/current/master/config-arm-tegra @@ -8,18 +8,16 @@ CONFIG_TEGRA_PCI=y CONFIG_VFP=y CONFIG_VFPv3=y -CONFIG_MACH_HARMONY=y +# CONFIG_MACH_HARMONY is not set CONFIG_MACH_KAEN=y CONFIG_MACH_PAZ00=y CONFIG_MACH_SEABOARD=y CONFIG_MACH_TEGRA_DT=y CONFIG_MACH_TRIMSLICE=y CONFIG_MACH_WARIO=y -CONFIG_MACH_TEGRA_DT=y CONFIG_MACH_VENTANA=y CONFIG_TEGRA_DEBUG_UARTD=y -CONFIG_NR_CPUS=4 CONFIG_ARM_CPU_TOPOLOGY=y CONFIG_TEGRA_IOMMU_GART=y @@ -27,11 +25,21 @@ CONFIG_TEGRA_IOMMU_SMMU=y CONFIG_I2C_TEGRA=y +# This block is temporary until we work out why the MMC modules don't work as modules +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_OF=y +CONFIG_MMC_SPI=y + CONFIG_MMC_SDHCI_TEGRA=y # CONFIG_RCU_BOOST is not set CONFIG_TEGRA_SYSTEM_DMA=y CONFIG_TEGRA_EMC_SCALING_ENABLE=y +CONFIG_TEGRA_AHB=y +CONFIG_TEGRA20_APB_DMA=y CONFIG_ARM_THUMBEE=y CONFIG_SWP_EMULATE=y # CONFIG_CPU_BPREDICT_DISABLE is not set @@ -51,18 +59,17 @@ CONFIG_ARM_ERRATA_720789=y # CONFIG_ARM_ERRATA_754322 is not set # CONFIG_ARM_ERRATA_754327 is not set # CONFIG_ARM_ERRATA_764369 is not set -CONFIG_LOCAL_TIMERS=y # CONFIG_THUMB2_KERNEL is not set # CONFIG_NEON is not set CONFIG_GPIO_GENERIC_PLATFORM=y # CONFIG_GPIO_MCP23S08 is not set # CONFIG_KEYBOARD_TEGRA is not set -# CONFIG_MPCORE_WATCHDOG is not set CONFIG_USB_EHCI_TEGRA=y CONFIG_RTC_DRV_TEGRA=y CONFIG_SND_SOC_TEGRA=m CONFIG_SND_SOC_TEGRA_ALC5632=m +CONFIG_SND_SOC_TEGRA_WM8753=m CONFIG_SND_SOC_TEGRA_WM8903=m CONFIG_SND_SOC_TEGRA_TRIMSLICE=m # CONFIG_SND_SOC_TEGRA30_AHUB is not set @@ -78,7 +85,7 @@ CONFIG_NVEC_LEDS=y CONFIG_CPU_PM=y CONFIG_ARM_CPU_SUSPEND=y -#CONFIG_CRYPTO_DEV_TEGRA_AES=m +CONFIG_CRYPTO_DEV_TEGRA_AES=m CONFIG_PL310_ERRATA_753970=y CONFIG_LEDS_RENESAS_TPU=y @@ -88,4 +95,3 @@ CONFIG_SERIAL_OF_PLATFORM=y CONFIG_OF_GPIO=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y - diff --git a/freed-ora/current/master/config-arm-versatile b/freed-ora/current/master/config-arm-versatile index 54499f9b9..9c379361b 100644 --- a/freed-ora/current/master/config-arm-versatile +++ b/freed-ora/current/master/config-arm-versatile @@ -1,5 +1,6 @@ CONFIG_ARCH_VEXPRESS=y CONFIG_ARCH_VEXPRESS_CA9X4=y +CONFIG_ARCH_VEXPRESS_DT=y CONFIG_PLAT_VERSATILE_CLCD=y CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y CONFIG_PLAT_VERSATILE=y @@ -70,4 +71,25 @@ CONFIG_PL330_DMA=y CONFIG_RTC_DRV_PL030=y CONFIG_RTC_DRV_PL031=y -CONFIG_I2C_VERSATILE=y +CONFIG_I2C_VERSATILE=m + +CONFIG_OC_ETM=y + +CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y +CONFIG_ARM_THUMBEE=y +CONFIG_SWP_EMULATE=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CACHE_L2X0=y +CONFIG_ARM_ERRATA_430973=y +CONFIG_ARM_ERRATA_458693=y +CONFIG_ARM_ERRATA_460075=y +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_ARM_ERRATA_743622=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_NEON=y +CONFIG_PATA_PLATFORM=m +CONFIG_PATA_OF_PLATFORM=m +# CONFIG_NET_VENDOR_BROADCOM is not set + diff --git a/freed-ora/current/master/config-armv7 b/freed-ora/current/master/config-armv7 new file mode 100644 index 000000000..299e1428b --- /dev/null +++ b/freed-ora/current/master/config-armv7 @@ -0,0 +1,309 @@ +# ARM unified arch kernel +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +# CONFIG_ARCH_MULTI_V6 is not set +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_HIGHBANK=y +CONFIG_ARCH_PICOXCELL=y +CONFIG_ARCH_SOCFPGA=y +CONFIG_ARCH_VEXPRESS_CA9X4=y +CONFIG_ARCH_VEXPRESS_DT=y + +CONFIG_MACH_ARMADA_370_XP=y +CONFIG_MACH_ARMADA_370=y +CONFIG_MACH_ARMADA_XP=y + +# generic ARM config options +CONFIG_CMDLINE="" +CONFIG_ARM_ARCH_TIMER=y +CONFIG_AEABI=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_NEON=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_VMSPLIT_2G=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_GIC=y +CONFIG_ARM_ASM_UNIFIED=y +CONFIG_ARM_CPU_TOPOLOGY=y +CONFIG_ARM_DMA_MEM_BUFFERABLE=y +CONFIG_SWP_EMULATE=y +CONFIG_CPU_BPREDICT_DISABLE=y +CONFIG_CACHE_L2X0=y +CONFIG_HIGHPTE=y +# CONFIG_OABI_COMPAT is not set +# CONFIG_ATAGS is not set +# CONFIG_ATAGS_PROC is not set +# CONFIG_FPE_NWFPE is not set +# CONFIG_FPE_FASTFPE is not set +# CONFIG_APM_EMULATION is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_DMA_CACHE_RWFO is not set +# CONFIG_ARM_LPAE is not set +# CONFIG_THUMB2_KERNEL is not set +# CONFIG_XEN is not set +CONFIG_HVC_DCC=y + +# CONFIG_ARM_VIRT_EXT is not set + +# errata +# v5/v6 +# CONFIG_ARM_ERRATA_326103 is not set +# CONFIG_ARM_ERRATA_411920 is not set +# Cortex-A8 +# CONFIG_ARM_ERRATA_430973 is not set +# CONFIG_ARM_ERRATA_458693 is not set +# CONFIG_ARM_ERRATA_460075 is not set +# Cortex-A9 +CONFIG_ARM_ERRATA_742230=y +CONFIG_ARM_ERRATA_742231=y +CONFIG_ARM_ERRATA_743622=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_769419=y + +# generic that deviates from or should be merged into config-generic +CONFIG_SMP=y +CONFIG_NR_CPUS=4 +CONFIG_SMP_ON_UP=y +CONFIG_HIGHMEM=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y + +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y + +CONFIG_RCU_FANOUT=32 +CONFIG_RCU_FANOUT_LEAF=16 + +CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_CPU_IDLE_GOV_MENU=y + +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 +CONFIG_LSM_MMAP_MIN_ADDR=32768 + +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y + +CONFIG_SECCOMP=y +CONFIG_STRICT_DEVMEM=y + +CONFIG_PM=y +CONFIG_PM_STD_PARTITION="" +CONFIG_SUSPEND=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_CPU_TOPOLOGY=y + +CONFIG_LOCAL_TIMERS=y +CONFIG_HW_PERF_EVENTS=y +CONFIG_UACCESS_WITH_MEMCPY=y +CONFIG_CC_STACKPROTECTOR=y + +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set + +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y + + +CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_EARLY_PRINTK=y + +CONFIG_LBDAF=y + +# Versatile and highbank +CONFIG_ARM_TIMER_SP804=y + +CONFIG_SERIO_AMBAKMI=m +CONFIG_SERIAL_AMBA_PL010=y +CONFIG_SERIAL_AMBA_PL010_CONSOLE=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + +CONFIG_RTC_DRV_PL030=y +CONFIG_RTC_DRV_PL031=y + +CONFIG_PL330_DMA=y +CONFIG_AMBA_PL08X=y +CONFIG_ARM_SP805_WATCHDOG=m + +# highbank +CONFIG_EDAC_HIGHBANK_MC=m +CONFIG_EDAC_HIGHBANK_L2=m + +CONFIG_OC_ETM=y + +CONFIG_SATA_HIGHBANK=m + +# versatile +CONFIG_FB_ARMCLCD=m +CONFIG_I2C_VERSATILE=m +CONFIG_OC_ETM=y +CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y + +# unknown and needs review +CONFIG_ARM_AMBA=y + +# mvebu +CONFIG_MV_XOR=y +CONFIG_RTC_DRV_88PM80X=m +CONFIG_CRYPTO_DEV_MV_CESA=m +CONFIG_MV643XX_ETH=m +CONFIG_I2C_MV64XXX=m + +# exynos +# CONFIG_DRM_EXYNOS is not set + +# picoxcell +CONFIG_CRYPTO_DEV_PICOXCELL=m + +# ST Ericsson +# CONFIG_I2C_NOMADIK is not set +# General ARM drivers +# Device tree +CONFIG_OF=y +CONFIG_USE_OF=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_PROC_DEVICETREE=y +# CONFIG_OF_SELFTEST is not set +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_OF_GPIO=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_I2C_MUX_PINCTRL=m +CONFIG_OF_MDIO=m +CONFIG_MDIO_BUS_MUX_GPIO=m + +# MMC/SD +CONFIG_MMC=y +CONFIG_MMC_ARMMMCI=y +CONFIG_MMC_SDHCI_PLTFM=m +CONFIG_MMC_SDHCI_OF=m +CONFIG_MMC_SPI=m +CONFIG_MMC_DW=m +CONFIG_MMC_DW_PLTFM=m +CONFIG_MMC_DW_PCI=m +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_IDMAC is not set +CONFIG_MMC_TMIO=m +CONFIG_MMC_SDHCI_PXAV3=m +CONFIG_MMC_SDHCI_PXAV2=m +CONFIG_MMC_MVSDIO=m + +# usb +CONFIG_USB_ULPI=y +CONFIG_AX88796=m +CONFIG_AX88796_93CX6=y +CONFIG_SMC91X=m +CONFIG_SMC911X=m +CONFIG_SMSC911X=m +CONFIG_USB_ISP1760_HCD=m + +# HW crypto and rng +CONFIG_CRYPTO_SHA1_ARM=m +CONFIG_CRYPTO_AES_ARM=m +CONFIG_HW_RANDOM_ATMEL=m +CONFIG_HW_RANDOM_EXYNOS=m + +# Sound +CONFIG_SND_ARM=y +CONFIG_SND_ARMAACI=m +CONFIG_SND_SOC=m +CONFIG_SND_DESIGNWARE_I2S=m +CONFIG_SND_SIMPLE_CARD=m +CONFIG_SND_SOC_CACHE_LZO=y +CONFIG_SND_SOC_ALL_CODECS=m + +# EDAC +CONFIG_EDAC=y +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_LEGACY_SYSFS=y + +# Watchdog +CONFIG_MPCORE_WATCHDOG=m + +# Multi function devices +CONFIG_MFD_T7L66XB=y +CONFIG_MFD_TC6387XB=y +CONFIG_MFD_SYSCON=y + +# RTC +CONFIG_RTC_DRV_SNVS=m + +# Pin stuff +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_PINCTRL_SINGLE=m +# CONFIG_PINCTRL_SAMSUNG is not set +# CONFIG_PINCTRL_EXYNOS4 is not set + +# GPIO +CONFIG_GPIO_GENERIC_PLATFORM=m +CONFIG_GPIO_EM=m +CONFIG_GPIO_ADNP=m +CONFIG_GPIO_MCP23S08=m +CONFIG_RFKILL_GPIO=m +CONFIG_SERIAL_8250_EM=m +CONFIG_INPUT_GP2A=m +CONFIG_INPUT_GPIO_TILT_POLLED=m +CONFIG_MDIO_BUS_MUX_MMIOREG=m + +# MTD +CONFIG_MTD_OF_PARTS=y +# CONFIG_MG_DISK is not set + +# Needs work/investigation + +# CONFIG_ARM_CHARLCD is not set +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_BPF_JIT is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set +# CONFIG_PID_IN_CONTEXTIDR is not set +# CONFIG_DEPRECATED_PARAM_STRUCT is not set + +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_COMMON_CLK_DEBUG is not set +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_PINCTRL is not set + +# CONFIG_CS89x0 is not set +# CONFIG_DM9000 is not set + +# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set +# CONFIG_ARM_KPROBES_TEST is not set +# CONFIG_LEDS_RENESAS_TPU is not set + +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +CONFIG_THERMAL=y +# CONFIG_PATA_PLATFORM is not set +CONFIG_PERF_EVENTS=y + + +# We need to fix these as they should be either generic includes or kconfig fixes +# drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration] +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set diff --git a/freed-ora/current/master/config-debug b/freed-ora/current/master/config-debug index b9334f4ac..e1b3f9db2 100644 --- a/freed-ora/current/master/config-debug +++ b/freed-ora/current/master/config-debug @@ -111,3 +111,6 @@ CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024 # CONFIG_DEBUG_KMEMLEAK_TEST is not set CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y +CONFIG_MAC80211_MESSAGE_TRACING=y + +CONFIG_EDAC_DEBUG=y diff --git a/freed-ora/current/master/config-generic b/freed-ora/current/master/config-generic index 46e2ab379..f079eb084 100644 --- a/freed-ora/current/master/config-generic +++ b/freed-ora/current/master/config-generic @@ -189,31 +189,77 @@ CONFIG_EXTRA_FIRMWARE="" # # Memory Technology Devices (MTD) # -# CONFIG_MTD is not set +CONFIG_MTD=m +# CONFIG_MTD_TESTS is not set # CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +# CONFIG_MTD_CHAR is not set +# CONFIG_MTD_BLKDEVS is not set +# CONFIG_MTD_BLOCK is not set +# CONFIG_MTD_BLOCK_RO is not set # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set # CONFIG_MTD_OOPS is not set # CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# # CONFIG_MTD_CFI is not set # CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# # CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_TS5500 is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# Self-contained MTD device drivers +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# # CONFIG_MTD_DOCG3 is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_ONENAND is not set # CONFIG_MTD_NAND_VERIFY_WRITE is not set # CONFIG_MTD_NAND_ECC_BCH is not set # CONFIG_MTD_NAND_MUSEUM_IDS is not set # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_LPDDR is not set -# CONFIG_MTD_UBI is not set - +CONFIG_MTD_UBI=m +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set # # Parallel port support @@ -280,6 +326,7 @@ CONFIG_VMXNET3=m CONFIG_HW_RANDOM_VIRTIO=m CONFIG_VIRTIO_CONSOLE=y CONFIG_VHOST_NET=m +CONFIG_TCM_VHOST=m # # SCSI device support @@ -432,6 +479,7 @@ CONFIG_ATA_BMDMA=y CONFIG_ATA_VERBOSE_ERROR=y CONFIG_ATA_SFF=y CONFIG_ATA_PIIX=y +# CONFIG_SATA_HIGHBANK is not set CONFIG_ATA_ACPI=y CONFIG_BLK_DEV_SX8=m CONFIG_PDC_ADMA=m @@ -602,6 +650,7 @@ CONFIG_TCP_MD5SIG=y # Networking options # CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set CONFIG_UNIX=y CONFIG_UNIX_DIAG=m CONFIG_NET_KEY=m @@ -629,6 +678,7 @@ CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y CONFIG_ARPD=y CONFIG_SYN_COOKIES=y +CONFIG_NET_IPVTI=m CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m @@ -680,6 +730,7 @@ CONFIG_IPV6_MIP6=y CONFIG_IPV6_SIT=m CONFIG_IPV6_SIT_6RD=y CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_GRE is not set CONFIG_IPV6_SUBTREES=y CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_IPV6_MROUTE=y @@ -709,6 +760,7 @@ CONFIG_NF_CONNTRACK=m CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_ACCT=m CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_QUEUE_CT=y CONFIG_NETFILTER_NETLINK_LOG=m CONFIG_NETFILTER_TPROXY=m CONFIG_NETFILTER_XTABLES=y @@ -814,6 +866,7 @@ CONFIG_NF_CT_PROTO_DCCP=m CONFIG_NF_CT_PROTO_SCTP=m CONFIG_NF_CT_NETLINK=m # CONFIG_NF_CT_NETLINK_TIMEOUT is not set +CONFIG_NF_CT_NETLINK_HELPER=m CONFIG_NF_CT_PROTO_UDPLITE=m CONFIG_IP_NF_MATCH_AH=m @@ -821,7 +874,6 @@ CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_RPFILTER=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_TARGET_CLUSTERIP=m -CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_ECN=m @@ -829,6 +881,8 @@ CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_TTL=m +CONFIG_NF_NAT_IPV4=m +CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m @@ -860,6 +914,9 @@ CONFIG_IP6_NF_SECURITY=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m CONFIG_IP6_NF_TARGET_HL=m +CONFIG_NF_NAT_IPV6=m +# CONFIG_IP6_NF_TARGET_MASQUERADE is not set +# CONFIG_IP6_NF_TARGET_NPT is not set # # Bridge: Netfilter Configuration @@ -1002,6 +1059,7 @@ CONFIG_NET_EMATCH_META=m CONFIG_NET_EMATCH_NBYTE=m CONFIG_NET_EMATCH_STACK=32 CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_IPSET=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_ACT_CSUM=m @@ -1016,6 +1074,10 @@ CONFIG_NET_ACT_SIMP=m CONFIG_NET_ACT_SKBEDIT=m CONFIG_DCB=y +CONFIG_DNS_RESOLVER=m +CONFIG_BATMAN_ADV=m +CONFIG_BATMAN_ADV_BLA=y +# CONFIG_BATMAN_ADV_DEBUG is not set CONFIG_OPENVSWITCH=m CONFIG_NETPRIO_CGROUP=m @@ -1039,10 +1101,12 @@ CONFIG_NET_TEAM=m CONFIG_NET_TEAM_MODE_ROUNDROBIN=m CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m CONFIG_NET_TEAM_MODE_LOADBALANCE=m +CONFIG_NET_TEAM_MODE_BROADCAST=m CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m +CONFIG_VXLAN=m CONFIG_EQUALIZER=m CONFIG_TUN=m CONFIG_VETH=m @@ -1295,8 +1359,10 @@ CONFIG_NET_VENDOR_XIRCOM=y CONFIG_PCMCIA_XIRC2PS=m CONFIG_PHYLIB=y +CONFIG_AT803X_PHY=m CONFIG_AMD_PHY=m CONFIG_BROADCOM_PHY=m +CONFIG_BCM87XX_PHY=m CONFIG_CICADA_PHY=m CONFIG_DAVICOM_PHY=m CONFIG_DP83640_PHY=m @@ -1349,6 +1415,7 @@ CONFIG_MLX4_EN_DCB=y CONFIG_SFC=m CONFIG_SFC_MCDI_MON=y CONFIG_SFC_SRIOV=y +CONFIG_SFC_PTP=y # CONFIG_SFC_MTD is not set @@ -1446,13 +1513,13 @@ CONFIG_B43_SDIO=y CONFIG_B43_BCMA=y # CONFIG_B43_BCMA_EXTRA is not set CONFIG_B43_BCMA_PIO=y -# CONFIG_B43_DEBUG is not set +CONFIG_B43_DEBUG=y CONFIG_B43_PHY_LP=y CONFIG_B43_PHY_N=y CONFIG_B43_PHY_HT=y # CONFIG_B43_FORCE_PIO is not set CONFIG_B43LEGACY=m -# CONFIG_B43LEGACY_DEBUG is not set +CONFIG_B43LEGACY_DEBUG=y CONFIG_B43LEGACY_DMA=y CONFIG_B43LEGACY_PIO=y CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y @@ -1463,6 +1530,7 @@ CONFIG_BRCMFMAC=m CONFIG_BRCMFMAC_SDIO=y CONFIG_BRCMFMAC_SDIO_OOB=y CONFIG_BRCMFMAC_USB=y +# CONFIG_BRCMISCAN is not set # CONFIG_BRCMDBG is not set # CONFIG_HERMES is not set # CONFIG_HOSTAP is not set @@ -1513,6 +1581,7 @@ CONFIG_RT2800USB_RT35XX=y CONFIG_RT2800USB_RT53XX=y CONFIG_RT2800USB_UNKNOWN=y CONFIG_RT2800PCI=m +CONFIG_RT2800PCI_RT3290=y CONFIG_RT2800PCI_RT33XX=y CONFIG_RT2800PCI_RT35XX=y CONFIG_RT2800PCI_RT53XX=y @@ -1665,6 +1734,7 @@ CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_ATH3K=y +CONFIG_BT_HCIUART_3WIRE=y CONFIG_BT_HCIDTL1=m CONFIG_BT_HCIBT3C=m CONFIG_BT_HCIBLUECARD=m @@ -1932,6 +2002,7 @@ CONFIG_TOUCHSCREEN_AD7879_I2C=m # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set # CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set CONFIG_TOUCHSCREEN_DYNAPRO=m +CONFIG_TOUCHSCREEN_EDT_FT5X06=m CONFIG_TOUCHSCREEN_EETI=m CONFIG_TOUCHSCREEN_EGALAX=m CONFIG_TOUCHSCREEN_ELO=m @@ -1940,6 +2011,7 @@ CONFIG_TOUCHSCREEN_GUNZE=m # CONFIG_TOUCHSCREEN_HAMPSHIRE is not set CONFIG_TOUCHSCREEN_INEXIO=m CONFIG_TOUCHSCREEN_ILI210X=m +CONFIG_TOUCHSCREEN_MMS114=m CONFIG_TOUCHSCREEN_MTOUCH=m CONFIG_TOUCHSCREEN_MCS5000=m CONFIG_TOUCHSCREEN_MK712=m @@ -2005,6 +2077,7 @@ CONFIG_TIFM_CORE=m CONFIG_TIFM_7XX1=m CONFIG_TCG_TPM=m CONFIG_TCG_TIS=m +# CONFIG_TCG_TIS_I2C_INFINEON is not set CONFIG_TCG_NSC=m CONFIG_TCG_ATMEL=m # CONFIG_TCG_INFINEON is not set @@ -2031,6 +2104,7 @@ CONFIG_CYCLADES=m # CONFIG_ISI is not set # CONFIG_RIO is not set CONFIG_SERIAL_JSM=m +# CONFIG_SERIAL_SCCNXP is not set # CONFIG_SERIAL_MFD_HSU is not set # CONFIG_SERIAL_ALTERA_JTAGUART is not set @@ -2039,6 +2113,7 @@ CONFIG_SERIAL_JSM=m # # Non-8250 serial port support # +# CONFIG_SERIAL_KGDB_NMI is not set CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_XILINX_PS_UART is not set @@ -2127,6 +2202,7 @@ CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1029=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7410=m CONFIG_SENSORS_ADS7828=m CONFIG_SENSORS_ADT7462=m CONFIG_SENSORS_ADT7470=m @@ -2146,6 +2222,7 @@ CONFIG_SENSORS_G760A=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_GL520SM=m CONFIG_SENSORS_HDAPS=m +# CONFIG_SENSORS_HIH6130 is not set # CONFIG_SENSORS_I5K_AMB is not set # FIXME: IBMAEM x86 only? CONFIG_SENSORS_IBMAEM=m @@ -2245,6 +2322,7 @@ CONFIG_SENSORS_LTC2978=m CONFIG_SENSORS_MAX34440=m CONFIG_SENSORS_MAX8688=m CONFIG_SENSORS_MAX1668=m +CONFIG_SENSORS_MAX197=m # CONFIG_HMC6352 is not set # CONFIG_BMP085 is not set @@ -2253,7 +2331,25 @@ CONFIG_SENSORS_MAX1668=m # CONFIG_SERIAL_PCH_UART is not set # CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_W1 is not set +CONFIG_W1=m +CONFIG_W1_CON=y +# CONFIG_W1_MASTER_MATROX is not set +CONFIG_W1_MASTER_DS2490=m +CONFIG_W1_MASTER_DS2482=m +CONFIG_W1_MASTER_DS1WM=m +# CONFIG_HDQ_MASTER_OMAP is not set +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2408=m +CONFIG_W1_SLAVE_DS2423=m +CONFIG_W1_SLAVE_DS2431=m +CONFIG_W1_SLAVE_DS2433=m +CONFIG_W1_SLAVE_DS2433_CRC=y +CONFIG_W1_SLAVE_DS2760=m +CONFIG_W1_SLAVE_DS2780=m +CONFIG_W1_SLAVE_DS2781=m +CONFIG_W1_SLAVE_DS28E04=m +CONFIG_W1_SLAVE_BQ27000=m # # Mice @@ -2313,6 +2409,7 @@ CONFIG_W83697UG_WDT=m CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_TIMERIOMEM=m +CONFIG_HW_RANDOM_TPM=m # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_RTC_DEBUG is not set @@ -2346,6 +2443,7 @@ CONFIG_RTC_DRV_RS5C372=m # CONFIG_RTC_DRV_TEST is not set CONFIG_RTC_DRV_X1205=m CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_DS2404=m CONFIG_RTC_DRV_STK17TA8=m # CONFIG_RTC_DRV_S35390A is not set CONFIG_RTC_DRV_RX8581=m @@ -2387,7 +2485,7 @@ CONFIG_VGA_ARB_MAX_GPUS=16 # CONFIG_STUB_POULSBO is not set CONFIG_DRM=m -# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_AST=m # do not enable on f17 or older CONFIG_DRM_CIRRUS_QEMU=m # do not enable on f17 or older # CONFIG_DRM_TDFX is not set @@ -2403,6 +2501,8 @@ CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y CONFIG_DRM_VIA=m CONFIG_DRM_NOUVEAU=m +CONFIG_NOUVEAU_DEBUG=5 +CONFIG_NOUVEAU_DEBUG_DEFAULT=3 CONFIG_DRM_NOUVEAU_BACKLIGHT=y CONFIG_DRM_NOUVEAU_DEBUG=y # CONFIG_DRM_PSB is not set @@ -2410,6 +2510,7 @@ CONFIG_DRM_I2C_CH7006=m CONFIG_DRM_I2C_SIL164=m CONFIG_DRM_UDL=m CONFIG_DRM_VMWGFX=m +# CONFIG_DRM_VMWGFX_FBCON is not set CONFIG_DRM_VGEM=m # @@ -2425,10 +2526,17 @@ CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=8192 CONFIG_HANGCHECK_TIMER=m +CONFIG_MEDIA_USB_SUPPORT=y +CONFIG_MEDIA_PCI_SUPPORT=y # # Multimedia devices # CONFIG_MEDIA_SUPPORT=m +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +CONFIG_MEDIA_RADIO_SUPPORT=y +CONFIG_MEDIA_RC_SUPPORT=y CONFIG_MEDIA_CONTROLLER=y CONFIG_VIDEO_DEV=m # CONFIG_VIDEO_ADV_DEBUG is not set @@ -2477,6 +2585,7 @@ CONFIG_VIDEO_CX231XX_RC=y CONFIG_VIDEO_HEXIUM_ORION=m CONFIG_VIDEO_HEXIUM_GEMINI=m CONFIG_VIDEO_IVTV=m +# CONFIG_VIDEO_IVTV_ALSA is not set CONFIG_VIDEO_MEYE=m CONFIG_VIDEO_MXB=m CONFIG_VIDEO_PVRUSB2_DVB=y @@ -2488,6 +2597,8 @@ CONFIG_VIDEO_SAA7134_ALSA=m CONFIG_VIDEO_SAA7134_DVB=m CONFIG_VIDEO_SAA7134_RC=y CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_STK1160=m +CONFIG_VIDEO_STK1160_AC97=y CONFIG_VIDEO_W9966=m CONFIG_VIDEO_ZORAN=m CONFIG_VIDEO_ZORAN_AVS6EYES=m @@ -2516,6 +2627,8 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y # Radio Adapters # CONFIG_RADIO_MAXIRADIO=m +CONFIG_RADIO_SHARK=m +CONFIG_RADIO_SHARK2=m CONFIG_RADIO_WL1273=m # CONFIG_RADIO_WL128X is not set # depends on TI_ST which we don't enable @@ -2549,6 +2662,7 @@ CONFIG_DVB_BT8XX=m CONFIG_DVB_BUDGET_CORE=m CONFIG_DVB_PLUTO2=m CONFIG_SMS_SIANO_MDTV=m +CONFIG_MEDIA_SUBDRV_AUTOSELECT=y CONFIG_SMS_USB_DRV=m CONFIG_SMS_SDIO_DRV=m CONFIG_DVB_TTUSB_DEC=m @@ -2566,6 +2680,7 @@ CONFIG_DVB_FIREDTV=m CONFIG_DVB_NGENE=m CONFIG_DVB_DDBRIDGE=m CONFIG_DVB_USB_TECHNISAT_USB2=m +# CONFIG_DVB_USB_V2 is not set CONFIG_DVB_AV7110=m CONFIG_DVB_AV7110_OSD=y @@ -2578,7 +2693,10 @@ CONFIG_DVB_TTUSB_BUDGET=m CONFIG_DVB_USB_CINERGY_T2=m CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set + CONFIG_DVB_B2C2_FLEXCOP_PCI=m +# CONFIG_DVB_B2C2_FLEXCOP_PCI_DEBUG is not set CONFIG_DVB_B2C2_FLEXCOP_USB=m # CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set CONFIG_DVB_USB=m @@ -2625,8 +2743,11 @@ CONFIG_VIDEO_PVRUSB2_SYSFS=y # CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set CONFIG_RC_CORE=m +CONFIG_RC_DECODERS=y +CONFIG_LIRC=m CONFIG_RC_LOOPBACK=m CONFIG_RC_MAP=m +CONFIG_RC_DEVICES=y CONFIG_RC_ATI_REMOTE=m CONFIG_IR_NEC_DECODER=m CONFIG_IR_RC5_DECODER=m @@ -2646,9 +2767,14 @@ CONFIG_IR_REDRAT3=m CONFIG_IR_ENE=m CONFIG_IR_STREAMZAP=m CONFIG_IR_WINBOND_CIR=m +CONFIG_IR_IGUANA=m +CONFIG_IR_TTUSBIR=m CONFIG_IR_GPIO_CIR=m CONFIG_V4L_MEM2MEM_DRIVERS=y +# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set +# CONFIG_V4L_TEST_DRIVERS is not set + # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set # @@ -2986,7 +3112,7 @@ CONFIG_USB_STORAGE_REALTEK=m CONFIG_REALTEK_AUTOPM=y CONFIG_USB_STORAGE_ENE_UB6250=m # CONFIG_USB_LIBUSUAL is not set -# CONFIG_USB_UAS is not set +CONFIG_USB_UAS=m # @@ -3000,6 +3126,7 @@ CONFIG_HID=y CONFIG_HID_BATTERY_STRENGTH=y # debugging default is y upstream now CONFIG_HIDRAW=y +CONFIG_UHID=m CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y CONFIG_HID_LOGITECH_DJ=m @@ -3022,6 +3149,7 @@ CONFIG_HID_MULTITOUCH=m CONFIG_HID_NTRIG=y CONFIG_HID_QUANTA=y CONFIG_HID_PRIMAX=m +CONFIG_HID_PS3REMOTE=m CONFIG_HID_PRODIKEYS=m CONFIG_HID_DRAGONRISE=m CONFIG_HID_GYRATION=m @@ -3041,6 +3169,7 @@ CONFIG_HID_TOPSEED=m CONFIG_HID_THRUSTMASTER=m CONFIG_HID_ZEROPLUS=m CONFIG_HID_ZYDACRON=m +# CONFIG_HID_SENSOR_HUB is not set CONFIG_HID_EMS_FF=m CONFIG_HID_ELECOM=m CONFIG_HID_UCLOGIC=m @@ -3051,6 +3180,7 @@ CONFIG_HID_ACRUX=m CONFIG_HID_ACRUX_FF=y CONFIG_HID_KEYTOUCH=m CONFIG_HID_LCPOWER=m +CONFIG_HID_LENOVO_TPKBD=m CONFIG_HID_ROCCAT_ARVO=m CONFIG_HID_ROCCAT_ISKU=m CONFIG_HID_ROCCAT_KOVAPLUS=m @@ -3231,6 +3361,7 @@ CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_MOS7720=m CONFIG_USB_SERIAL_MOS7715_PARPORT=y # CONFIG_USB_SERIAL_ZIO is not set +# CONFIG_USB_SERIAL_ZTE is not set CONFIG_USB_SERIAL_MOS7840=m CONFIG_USB_SERIAL_MOTOROLA=m CONFIG_USB_SERIAL_NAVMAN=m @@ -3271,6 +3402,7 @@ CONFIG_USB_ADUTUX=m CONFIG_USB_SEVSEG=m CONFIG_USB_ALI_M5632=y CONFIG_USB_APPLEDISPLAY=m +# CONFIG_OMAP_USB2 is not set CONFIG_USB_ATM=m CONFIG_USB_CXACRU=m # CONFIG_USB_C67X00_HCD is not set @@ -3289,6 +3421,7 @@ CONFIG_USB_FILE_STORAGE=m CONFIG_USB_IOWARRIOR=m CONFIG_USB_ISIGHTFW=m CONFIG_USB_YUREX=m +CONFIG_USB_EZUSB_FX2=m CONFIG_USB_LCD=m CONFIG_USB_LD=m CONFIG_USB_LEGOTOWER=m @@ -3375,6 +3508,8 @@ CONFIG_MFD_SM501_GPIO=y # CONFIG_MFD_TPS65217 is not set # CONFIG_MFD_LM3533 is not set # CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_MFD_ARIZONA is not set +# CONFIG_MFD_ARIZONA_I2C is not set # # File systems @@ -3515,6 +3650,7 @@ CONFIG_NFS_V2=y CONFIG_NFS_V3=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y +# CONFIG_NFS_SWAP is not set CONFIG_NFS_V4_1=y CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" CONFIG_NFSD=m @@ -3536,6 +3672,7 @@ CONFIG_RPCSEC_GSS_KRB5=m CONFIG_CIFS=m CONFIG_CIFS_STATS=y # CONFIG_CIFS_STATS2 is not set +CONFIG_CIFS_SMB2=y CONFIG_CIFS_UPCALL=y CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y @@ -3577,7 +3714,11 @@ CONFIG_DLM_DEBUG=y CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=y -# CONFIG_UBIFS_FS is not set + +CONFIG_UBIFS_FS=m +CONFIG_UBIFS_FS_XATTR=y +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +# CONFIG_UBIFS_FS_DEBUG is not set # # Partition Types @@ -3676,6 +3817,7 @@ CONFIG_FRAME_POINTER=y # CONFIG_DEBUG_DRIVER is not set CONFIG_HEADERS_CHECK=y # CONFIG_LKDTM is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set # CONFIG_READABLE_ASM is not set # CONFIG_RT_MUTEX_TESTER is not set @@ -3702,6 +3844,7 @@ CONFIG_DEBUG_NX_TEST=m CONFIG_DEBUG_SET_MODULE_RONX=y CONFIG_DEBUG_BOOT_PARAMS=y CONFIG_DEBUG_VM=y +# CONFIG_DEBUG_VM_RB is not set # revisit this if performance isn't horrible # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set CONFIG_LOCKUP_DETECTOR=y # CONFIG_DEBUG_INFO_REDUCED is not set @@ -3865,6 +4008,8 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=m CONFIG_BACKLIGHT_PROGEAR=m # CONFIG_BACKLIGHT_ADP8860 is not set # CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3630 is not set +# CONFIG_BACKLIGHT_LM3639 is not set CONFIG_FB_NVIDIA_BACKLIGHT=y CONFIG_FB_RIVA_BACKLIGHT=y CONFIG_FB_RADEON_BACKLIGHT=y @@ -3894,10 +4039,11 @@ CONFIG_CGROUP_CPUACCT=y CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_SCHED=y -CONFIG_CGROUP_MEM_RES_CTLR=y -CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y # XXX disabled by default, pass 'swapaccount' -# CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set -CONFIG_CGROUP_MEM_RES_CTLR_KMEM=y +CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y # XXX disabled by default, pass 'swapaccount' +# CONFIG_MEMCG_SWAP_ENABLED is not set +CONFIG_MEMCG_KMEM=y +# CONFIG_CGROUP_HUGETLB is not set CONFIG_CGROUP_PERF=y CONFIG_BLK_CGROUP=y @@ -3915,10 +4061,15 @@ CONFIG_KEXEC=y CONFIG_HWMON=y # CONFIG_HWMON_DEBUG_CHIP is not set CONFIG_THERMAL_HWMON=y +# CONFIG_CPU_THERMAL is not set CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y +# +# Bus devices +# +# CONFIG_OMAP_OCP2SCP is not set CONFIG_CONNECTOR=y CONFIG_PROC_EVENTS=y @@ -3927,7 +4078,7 @@ CONFIG_IBMASR=m CONFIG_PM_DEBUG=y CONFIG_PM_TRACE=y CONFIG_PM_TRACE_RTC=y -# CONFIG_PM_TEST_SUSPEND is not set +CONFIG_PM_TEST_SUSPEND=y CONFIG_PM_RUNTIME=y # CONFIG_PM_OPP is not set # CONFIG_PM_AUTOSLEEP is not set @@ -3953,6 +4104,8 @@ CONFIG_NET_VENDOR_SMC=y # CONFIG_MOUSE_ATIXL is not set +# CONFIG_MEDIA_PARPORT_SUPPORT is not set + CONFIG_RADIO_ADAPTERS=y CONFIG_RADIO_TEA5764=m CONFIG_RADIO_SAA7706H=m @@ -3999,18 +4152,24 @@ CONFIG_LEDS_CLASS=y # CONFIG_LEDS_PCA9633 is not set CONFIG_LEDS_DELL_NETBOOKS=m # CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_LM355x is not set # CONFIG_LEDS_OT200 is not set CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_ONESHOT=m CONFIG_LEDS_TRIGGER_IDE_DISK=y CONFIG_LEDS_TRIGGER_HEARTBEAT=m CONFIG_LEDS_TRIGGER_BACKLIGHT=m +# CONFIG_LEDS_TRIGGER_CPU is not set CONFIG_LEDS_TRIGGER_DEFAULT_ON=m CONFIG_LEDS_TRIGGER_TRANSIENT=m CONFIG_LEDS_ALIX2=m CONFIG_LEDS_CLEVO_MAIL=m CONFIG_LEDS_INTEL_SS4200=m CONFIG_LEDS_LM3530=m +# CONFIG_LEDS_LM3642 is not set +CONFIG_LEDS_LM3556=m +CONFIG_LEDS_BLINKM=m CONFIG_LEDS_LP3944=m CONFIG_LEDS_LP5521=m CONFIG_LEDS_LP5523=m @@ -4042,6 +4201,8 @@ CONFIG_FTRACE_MCOUNT_RECORD=y # CONFIG_TRACE_BRANCH_PROFILING is not set CONFIG_FUNCTION_PROFILER=y CONFIG_RING_BUFFER_BENCHMARK=m +# CONFIG_RBTREE_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set CONFIG_FUNCTION_TRACER=y CONFIG_STACK_TRACER=y # CONFIG_FUNCTION_GRAPH_TRACER is not set @@ -4101,6 +4262,9 @@ CONFIG_UIO_SERCOS3=m CONFIG_UIO_PCI_GENERIC=m # CONFIG_UIO_NETX is not set +CONFIG_VFIO=m +CONFIG_VFIO_IOMMU_TYPE1=m +CONFIG_VFIO_PCI=m # LIRC @@ -4223,7 +4387,6 @@ CONFIG_USB_ATMEL=m # CONFIG_VIDEO_CX25821 is not set # CONFIG_R8187SE is not set # CONFIG_RTL8192U is not set -# CONFIG_BATMAN_ADV is not set # CONFIG_FB_SM7XX is not set # CONFIG_SPECTRA is not set # CONFIG_ZRAM is not set @@ -4254,9 +4417,20 @@ CONFIG_ALTERA_STAPL=m # CONFIG_USB_WPAN_HCD is not set # CONFIG_WIMAX_GDM72XX is not set # CONFIG_IPACK_BUS is not set -# +# CONFIG_CSR_WIFI is not set +# CONFIG_ZCACHE2 is not set +# CONFIG_NET_VENDOR_SILICOM is not set +# CONFIG_SBYPASS is not set +# CONFIG_BPCTL is not set +# CONFIG_CED1401 is not set +# CONFIG_DGRP is not set # END OF STAGING +# +# Remoteproc drivers (EXPERIMENTAL) +# +# CONFIG_STE_MODEM_RPROC is not set + CONFIG_LIBFC=m CONFIG_LIBFCOE=m CONFIG_FCOE=m @@ -4270,6 +4444,7 @@ CONFIG_IMA_AUDIT=y CONFIG_IMA_LSM_RULES=y # CONFIG_EVM is not set +# CONFIG_PWM is not set CONFIG_LSM_MMAP_MIN_ADDR=65536 @@ -4345,7 +4520,8 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_VX855 is not set # CONFIG_GPIO_PCH is not set # CONFIG_GPIO_ML_IOH is not set - +# CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_SX150X is not set # FIXME: Why? @@ -4354,6 +4530,8 @@ CONFIG_EVENT_POWER_TRACING_DEPRECATED=y CONFIG_TEST_KSTRTOX=y # CONFIG_XZ_DEC_TEST is not set +# CONFIG_POWER_AVS is not set + CONFIG_TARGET_CORE=m CONFIG_ISCSI_TARGET=m CONFIG_LOOPBACK_TARGET=m @@ -4367,6 +4545,9 @@ CONFIG_HWSPINLOCK=m CONFIG_PSTORE=y CONFIG_PSTORE_RAM=m +# CONFIG_PSTORE_CONSOLE is not set +# CONFIG_PSTORE_FTRACE is not set + # CONFIG_AVERAGE is not set @@ -4378,6 +4559,7 @@ CONFIG_BCMA=m CONFIG_BCMA_BLOCKIO=y CONFIG_BCMA_HOST_PCI_POSSIBLE=y CONFIG_BCMA_HOST_PCI=y +CONFIG_BCMA_DRIVER_GMAC_CMN=y # CONFIG_BCMA_DEBUG is not set # CONFIG_GOOGLE_FIRMWARE is not set diff --git a/freed-ora/current/master/config-nodebug b/freed-ora/current/master/config-nodebug index aaa75b2c4..b52b784e9 100644 --- a/freed-ora/current/master/config-nodebug +++ b/freed-ora/current/master/config-nodebug @@ -2,112 +2,115 @@ CONFIG_SND_VERBOSE_PRINTK=y CONFIG_SND_DEBUG=y CONFIG_SND_PCM_XRUN_DEBUG=y -# CONFIG_DEBUG_ATOMIC_SLEEP is not set - -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_PROVE_RCU is not set +CONFIG_DEBUG_ATOMIC_SLEEP=y + +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_RT_MUTEXES=y +CONFIG_DEBUG_LOCK_ALLOC=y +CONFIG_PROVE_LOCKING=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_PROVE_RCU=y # CONFIG_PROVE_RCU_REPEATEDLY is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set +CONFIG_DEBUG_PER_CPU_MAPS=y CONFIG_CPUMASK_OFFSTACK=y -# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set +CONFIG_CPU_NOTIFIER_ERROR_INJECT=m -# CONFIG_FAULT_INJECTION is not set -# CONFIG_FAILSLAB is not set -# CONFIG_FAIL_PAGE_ALLOC is not set -# CONFIG_FAIL_MAKE_REQUEST is not set -# CONFIG_FAULT_INJECTION_DEBUG_FS is not set -# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set -# CONFIG_FAIL_IO_TIMEOUT is not set -# CONFIG_FAIL_MMC_REQUEST is not set +CONFIG_FAULT_INJECTION=y +CONFIG_FAILSLAB=y +CONFIG_FAIL_PAGE_ALLOC=y +CONFIG_FAIL_MAKE_REQUEST=y +CONFIG_FAULT_INJECTION_DEBUG_FS=y +CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y +CONFIG_FAIL_IO_TIMEOUT=y +CONFIG_FAIL_MMC_REQUEST=y -# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SLUB_DEBUG_ON=y -# CONFIG_LOCK_STAT is not set +CONFIG_LOCK_STAT=y -# CONFIG_DEBUG_STACK_USAGE is not set +CONFIG_DEBUG_STACK_USAGE=y -# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_DEBUG=y # CONFIG_ACPI_DEBUG_FUNC_TRACE is not set -# CONFIG_DEBUG_SG is not set +CONFIG_DEBUG_SG=y # CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_OBJECTS is not set +CONFIG_DEBUG_WRITECOUNT=y +CONFIG_DEBUG_OBJECTS=y # CONFIG_DEBUG_OBJECTS_SELFTEST is not set -# CONFIG_DEBUG_OBJECTS_FREE is not set -# CONFIG_DEBUG_OBJECTS_TIMERS is not set -# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set +CONFIG_DEBUG_OBJECTS_FREE=y +CONFIG_DEBUG_OBJECTS_TIMERS=y +CONFIG_DEBUG_OBJECTS_RCU_HEAD=y CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 -# CONFIG_X86_PTDUMP is not set +CONFIG_X86_PTDUMP=y -# CONFIG_CAN_DEBUG_DEVICES is not set +CONFIG_CAN_DEBUG_DEVICES=y -# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULE_FORCE_UNLOAD=y -# CONFIG_SYSCTL_SYSCALL_CHECK is not set +CONFIG_SYSCTL_SYSCALL_CHECK=y -# CONFIG_DEBUG_NOTIFIERS is not set +CONFIG_DEBUG_NOTIFIERS=y -# CONFIG_DMA_API_DEBUG is not set +CONFIG_DMA_API_DEBUG=y -# CONFIG_MMIOTRACE is not set +CONFIG_MMIOTRACE=y -# CONFIG_DEBUG_CREDENTIALS is not set +CONFIG_DEBUG_CREDENTIALS=y # off in both production debug and nodebug builds, # on in rawhide nodebug builds -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y -# CONFIG_EXT4_DEBUG is not set +CONFIG_EXT4_DEBUG=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +CONFIG_DEBUG_PERF_USE_VMALLOC=y -# CONFIG_JBD2_DEBUG is not set +CONFIG_JBD2_DEBUG=y -# CONFIG_NFSD_FAULT_INJECTION is not set +CONFIG_NFSD_FAULT_INJECTION=y -# CONFIG_DEBUG_BLK_CGROUP is not set +CONFIG_DEBUG_BLK_CGROUP=y -# CONFIG_DRBD_FAULT_INJECTION is not set +CONFIG_DRBD_FAULT_INJECTION=y -# CONFIG_ATH_DEBUG is not set -# CONFIG_CARL9170_DEBUGFS is not set -# CONFIG_IWLWIFI_DEVICE_TRACING is not set +CONFIG_ATH_DEBUG=y +CONFIG_CARL9170_DEBUGFS=y +CONFIG_IWLWIFI_DEVICE_TRACING=y -# CONFIG_DEBUG_OBJECTS_WORK is not set +CONFIG_DEBUG_OBJECTS_WORK=y -# CONFIG_DMADEVICES_DEBUG is not set -# CONFIG_DMADEVICES_VDEBUG is not set +CONFIG_DMADEVICES_DEBUG=y +CONFIG_DMADEVICES_VDEBUG=y CONFIG_PM_ADVANCED_DEBUG=y -# CONFIG_CEPH_LIB_PRETTYDEBUG is not set -# CONFIG_QUOTA_DEBUG is not set +CONFIG_CEPH_LIB_PRETTYDEBUG=y +CONFIG_QUOTA_DEBUG=y CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y -# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set -# CONFIG_TEST_LIST_SORT is not set +CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y +CONFIG_TEST_LIST_SORT=y -# CONFIG_DETECT_HUNG_TASK is not set +CONFIG_DETECT_HUNG_TASK=y CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set -# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set +CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y -# CONFIG_DEBUG_KMEMLEAK is not set +CONFIG_DEBUG_KMEMLEAK=y CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024 # CONFIG_DEBUG_KMEMLEAK_TEST is not set CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y +# CONFIG_MAC80211_MESSAGE_TRACING is not set + +# CONFIG_EDAC_DEBUG is not set diff --git a/freed-ora/current/master/config-powerpc-generic b/freed-ora/current/master/config-powerpc-generic index 05f2a9313..a6ef1c4df 100644 --- a/freed-ora/current/master/config-powerpc-generic +++ b/freed-ora/current/master/config-powerpc-generic @@ -181,11 +181,11 @@ CONFIG_PMAC_APM_EMU=m CONFIG_HW_RANDOM_PASEMI=m CONFIG_EDAC=y -# CONFIG_EDAC_DEBUG is not set CONFIG_EDAC_MM_EDAC=m CONFIG_EDAC_PASEMI=m CONFIG_EDAC_AMD8131=m CONFIG_EDAC_AMD8111=m +CONFIG_EDAC_LEGACY_SYSFS=y # CONFIG_AXON_RAM is not set # CONFIG_OPROFILE_CELL is not set @@ -356,9 +356,6 @@ CONFIG_RFKILL_GPIO=m # CONFIG_NET_VENDOR_PASEMI is not set # CONFIG_NET_VENDOR_TOSHIBA is not set -# Disable btrfs until it is shown to work with 64k pages (rhbz 747079) -# CONFIG_BTRFS_FS is not set -# # CONFIG_CPU_IDLE is not set # CONFIG_OF_SELFTEST is not set # CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set @@ -374,3 +371,12 @@ CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_MDIO_BUS_MUX_GPIO is not set # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_FAIL_IOMMU is not set + +# CONFIG_PPC_DENORMALISATION is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +# CONFIG_GPIO_ADNP is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_RTC_DRV_SNVS is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set + diff --git a/freed-ora/current/master/config-powerpc64 b/freed-ora/current/master/config-powerpc64 index 46ffe87c9..f5a4898d4 100644 --- a/freed-ora/current/master/config-powerpc64 +++ b/freed-ora/current/master/config-powerpc64 @@ -164,8 +164,11 @@ CONFIG_PPC_ICSWX=y CONFIG_IO_EVENT_IRQ=y CONFIG_HW_RANDOM_AMD=m -# CONFIG_HW_RANDOM_PSERIES is not set -# CONFIG_CRYPTO_DEV_NX is not set +CONFIG_HW_RANDOM_PSERIES=m +CONFIG_CRYPTO_DEV_NX=y +CONFIG_CRYPTO_842=m +CONFIG_CRYPTO_DEV_NX_ENCRYPT=m +CONFIG_CRYPTO_DEV_NX_COMPRESS=m CONFIG_BPF_JIT=y diff --git a/freed-ora/current/master/config-powerpc64p7 b/freed-ora/current/master/config-powerpc64p7 new file mode 100644 index 000000000..38ae0683c --- /dev/null +++ b/freed-ora/current/master/config-powerpc64p7 @@ -0,0 +1,170 @@ +CONFIG_POWER7_CPU=y +# CONFIG_PPC_PMAC64 is not set +# CONFIG_PPC_MAPLE is not set +# CONFIG_PPC_CELL is not set +# CONFIG_PPC_IBM_CELL_BLADE is not set +# CONFIG_PPC_ISERIES is not set +# CONFIG_POWER3 is not set +CONFIG_PPC_PSERIES=y +# CONFIG_PPC_PMAC is not set +CONFIG_PPC_POWERNV=y +CONFIG_PPC_POWERNV_RTAS=y +# CONFIG_PPC_PASEMI is not set +# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set +# CONFIG_PPC_PS3 is not set +# CONFIG_PPC_CELLEB is not set +# CONFIG_PPC_CELL_QPACE is not set +CONFIG_IBMEBUS=y +CONFIG_RTAS_FLASH=y +# CONFIG_UDBG_RTAS_CONSOLE is not set +CONFIG_PPC_SPLPAR=y +CONFIG_SCANLOG=y +CONFIG_LPARCFG=y +CONFIG_SERIAL_ICOM=m +CONFIG_HVCS=m +CONFIG_HVC_CONSOLE=y +# CONFIG_HVC_OLD_HVSI is not set +CONFIG_HOTPLUG_PCI=y +CONFIG_THERM_PM72=y +CONFIG_IBMVETH=m +CONFIG_SCSI_IBMVSCSI=m +# CONFIG_HOTPLUG_PCI_CPCI is not set +CONFIG_HOTPLUG_PCI_SHPC=m +CONFIG_HOTPLUG_PCI_RPA=m +CONFIG_HOTPLUG_PCI_RPA_DLPAR=y +CONFIG_ADB_PMU_LED=y +CONFIG_ADB_PMU_LED_IDE=y +CONFIG_SCSI_IPR=m +CONFIG_SCSI_IPR_TRACE=y +CONFIG_SCSI_IPR_DUMP=y +CONFIG_HVC_RTAS=y +# CONFIG_HVC_ISERIES is not set +CONFIG_HVC_OPAL=y + +# iSeries device drivers +# +# CONFIG_ISERIES_VETH is not set +CONFIG_VIODASD=m +CONFIG_VIOCD=m +CONFIG_VIOTAPE=m + +CONFIG_SERIAL_OF_PLATFORM=m + +CONFIG_SERIAL_TXX9=y +CONFIG_SERIAL_TXX9_NR_UARTS=6 +CONFIG_SERIAL_TXX9_CONSOLE=y + +CONFIG_HVC_BEAT=y + +CONFIG_PPC_PMI=m + +CONFIG_PATA_SCC=m + +CONFIG_APM_EMULATION=m + +CONFIG_PPC64=y +CONFIG_VIRT_CPU_ACCOUNTING=y +CONFIG_NR_CPUS=1024 +# CONFIG_FB_PLATINUM is not set +# CONFIG_FB_VALKYRIE is not set +# CONFIG_FB_CT65550 is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set + +# CONFIG_POWER4_ONLY is not set + +CONFIG_RTAS_PROC=y +CONFIG_IOMMU_VMERGE=y +CONFIG_NUMA=y +CONFIG_PPC_64K_PAGES=y +CONFIG_PPC_SUBPAGE_PROT=y +CONFIG_SCHED_SMT=y + +CONFIG_HZ=100 +CONFIG_HZ_100=y +# CONFIG_HZ_1000 is not set + +CONFIG_MEMORY_HOTREMOVE=y + +# CONFIG_MV643XX_ETH is not set +CONFIG_IRQSTACKS=y +CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_INPUT_PCSPKR is not set + +CONFIG_EHEA=m +CONFIG_INFINIBAND_EHCA=m + +# CONFIG_HCALL_STATS is not set + +CONFIG_XMON_DISASSEMBLY=y + +CONFIG_SCSI_IBMVSCSIS=m + +CONFIG_SECCOMP=y + +# CONFIG_TUNE_CELL is not set +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +# CONFIG_BLK_DEV_PLATFORM is not set + +# CONFIG_VIRQ_DEBUG is not set + +CONFIG_EDAC_CPC925=m +CONFIG_FRAME_WARN=2048 + +CONFIG_PHYP_DUMP=y +CONFIG_FORCE_MAX_ZONEORDER=9 +CONFIG_VIRTUALIZATION=y + +CONFIG_VSX=y + +CONFIG_SCSI_IBMVFC=m +# CONFIG_SCSI_IBMVFC_TRACE is not set +CONFIG_IBM_BSR=m + +CONFIG_CRASH_DUMP=y +CONFIG_RELOCATABLE=y + +CONFIG_RCU_FANOUT=64 + +CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y +CONFIG_EVENT_PROFILE=y + +CONFIG_KVM_BOOK3S_64=m +CONFIG_KVM_BOOK3S_64_HV=y +# CONFIG_KVM_EXIT_TIMING is not set + +#-- bz#607175 +#-- active memory sharing +CONFIG_PPC_SMLPAR=y +CONFIG_CMM=y +#-- DLPAR memory remove +CONFIG_SPARSEMEM_VMEMMAP=y + +# CONFIG_COMPACTION is not set + +CONFIG_PSERIES_ENERGY=m + +CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_PSERIES_IDLE=y + +CONFIG_PPC_ICSWX=y +CONFIG_IO_EVENT_IRQ=y +CONFIG_HW_RANDOM_AMD=m + +CONFIG_HW_RANDOM_PSERIES=m +CONFIG_CRYPTO_DEV_NX=y +CONFIG_CRYPTO_842=m +CONFIG_CRYPTO_DEV_NX_ENCRYPT=m +CONFIG_CRYPTO_DEV_NX_COMPRESS=m + + +CONFIG_BPF_JIT=y +# CONFIG_PPC_ICSWX_PID is not set +# CONFIG_PPC_ICSWX_USE_SIGILL is not set +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_PCIEPORTBUS is not set + diff --git a/freed-ora/current/master/config-s390x b/freed-ora/current/master/config-s390x index 451512e9a..41e41c53c 100644 --- a/freed-ora/current/master/config-s390x +++ b/freed-ora/current/master/config-s390x @@ -241,3 +241,12 @@ CONFIG_STRICT_DEVMEM=y CONFIG_CRYPTO_GHASH_S390=m CONFIG_NET_CORE=y CONFIG_ETHERNET=y + +CONFIG_BPF_JIT=y +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_SCM_BUS is not set +# CONFIG_EADM_SCH is not set +# CONFIG_SCM_BLOCK is not set +# CONFIG_SCM_BLOCK_CLUSTER_WRITE is not set +# CONFIG_S390_PTDUMP is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set diff --git a/freed-ora/current/master/config-sparc64-generic b/freed-ora/current/master/config-sparc64-generic index 44e5699df..e15e2ef18 100644 --- a/freed-ora/current/master/config-sparc64-generic +++ b/freed-ora/current/master/config-sparc64-generic @@ -200,3 +200,18 @@ CONFIG_CRYPTO_DEV_NIAGARA2=y CONFIG_BPF_JIT=y # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_IRQ_DOMAIN_DEBUG is not set + +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_RTC_DRV_SNVS is not set +# CONFIG_CRYPTO_CRC32C_SPARC64 is not set +# CONFIG_CRYPTO_MD5_SPARC64 is not set +# CONFIG_CRYPTO_SHA1_SPARC64 is not set +# CONFIG_CRYPTO_SHA256_SPARC64 is not set +# CONFIG_CRYPTO_SHA512_SPARC64 is not set +# CONFIG_CRYPTO_AES_SPARC64 is not set +# CONFIG_CRYPTO_CAMELLIA_SPARC64 is not set +# CONFIG_CRYPTO_DES_SPARC64 is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set + diff --git a/freed-ora/current/master/config-x86-32-generic b/freed-ora/current/master/config-x86-32-generic index 70e872a88..1216d47e6 100644 --- a/freed-ora/current/master/config-x86-32-generic +++ b/freed-ora/current/master/config-x86-32-generic @@ -155,8 +155,6 @@ CONFIG_OLPC_XO1_SCI=y # staging # CONFIG_FB_OLPC_DCON is not set -# CONFIG_IRQ_DOMAIN_DEBUG is not set - # CONFIG_SPARSE_IRQ is not set CONFIG_RCU_FANOUT=32 @@ -192,6 +190,7 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_X86_INTEL_MID is not set CONFIG_MFD_CS5535=m +# CONFIG_MFD_SYSCON is not set # I2O enabled only for 32-bit x86, disabled for PAE kernel CONFIG_I2O=m @@ -213,5 +212,8 @@ CONFIG_I2O_BUS=m # CONFIG_GEOS is not set # CONFIG_NET5501 is not set # CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set # CONFIG_GPIO_SODAVILLE is not set +# CONFIG_GPIO_ADNP is not set # CONFIG_BACKLIGHT_OT200 is not set +# CONFIG_RTC_DRV_SNVS is not set diff --git a/freed-ora/current/master/config-x86-generic b/freed-ora/current/master/config-x86-generic index 32c309290..1716194e5 100644 --- a/freed-ora/current/master/config-x86-generic +++ b/freed-ora/current/master/config-x86-generic @@ -91,10 +91,11 @@ CONFIG_ACPI_APEI_MEMORY_FAILURE=y # CONFIG_ACPI_APEI_EINJ is not set CONFIG_ACPI_IPMI=m CONFIG_ACPI_CUSTOM_METHOD=m -CONFIG_ACPI_BGRT=m +CONFIG_ACPI_BGRT=y CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_PCC_CPUFREQ=y +CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_POWERNOW_K8=y CONFIG_X86_P4_CLOCKMOD=y # CONFIG_X86_SPEEDSTEP_CENTRINO is not set @@ -151,7 +152,6 @@ CONFIG_DELL_RBU=m CONFIG_DCDBAS=m CONFIG_EDAC=y -# CONFIG_EDAC_DEBUG is not set CONFIG_EDAC_MM_EDAC=m CONFIG_EDAC_AMD76X=m CONFIG_EDAC_AMD8111=m @@ -172,6 +172,7 @@ CONFIG_EDAC_R82600=m CONFIG_EDAC_X38=m CONFIG_EDAC_MCE_INJ=m CONFIG_EDAC_DECODE_MCE=m +CONFIG_EDAC_LEGACY_SYSFS=y CONFIG_SCHED_MC=y @@ -318,7 +319,8 @@ CONFIG_STRICT_DEVMEM=y # CONFIG_NO_BOOTMEM is not set # CONFIG_MEMTEST is not set -# CONFIG_MAXSMP is not set +# CONFIG_DEBUG_TLBFLUSH is not set +CONFIG_MAXSMP=y CONFIG_HP_ILO=m @@ -383,6 +385,8 @@ CONFIG_VIDEO_VIA_CAMERA=m CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_X86_RESERVE_LOW=64 +# CONFIG_IRQ_DOMAIN_DEBUG is not set + CONFIG_PCH_GBE=m CONFIG_PCH_PHUB=m @@ -417,6 +421,8 @@ CONFIG_DRM_GMA3600=y CONFIG_RCU_FANOUT_LEAF=16 +CONFIG_INTEL_MEI=m + # Maybe enable in debug kernels? # CONFIG_DEBUG_NMI_SELFTEST is not set @@ -425,3 +431,5 @@ CONFIG_MODULE_SIG=y # CONFIG_MODULE_SIG_SHA1 is not set CONFIG_MODULE_SIG_SHA256=y # CONFIG_MODULE_SIG_FORCE is not set +CONFIG_MODULE_SIG_BLACKLIST=y +CONFIG_MODULE_SIG_UEFI=y diff --git a/freed-ora/current/master/config-x86_64-generic b/freed-ora/current/master/config-x86_64-generic index 6df21fed1..6003f11c0 100644 --- a/freed-ora/current/master/config-x86_64-generic +++ b/freed-ora/current/master/config-x86_64-generic @@ -46,6 +46,10 @@ CONFIG_CRYPTO_SHA1_SSSE3=m CONFIG_CRYPTO_BLOWFISH_X86_64=m CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m CONFIG_CRYPTO_CAMELLIA_X86_64=m +CONFIG_CRYPTO_CAST5_AVX_X86_64=m +CONFIG_CRYPTO_CAST6_AVX_X86_64=m +CONFIG_CRYPTO_SERPENT_AVX_X86_64=m +CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set @@ -86,6 +90,7 @@ CONFIG_XEN_MAX_DOMAIN_MEMORY=128 # CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not set CONFIG_XEN_DEV_EVTCHN=m CONFIG_XEN_SYS_HYPERVISOR=y +# CONFIG_XEN_MCE_LOG is not set CONFIG_PROVIDE_OHCI1394_DMA_INIT=y @@ -104,6 +109,7 @@ CONFIG_X86_X2APIC=y CONFIG_SPARSE_IRQ=y CONFIG_RCU_FANOUT=64 +# CONFIG_RCU_USER_QS is not set CONFIG_INTEL_TXT=y diff --git a/freed-ora/current/master/crypto-aesni-intel-fix-wrong-kfree-pointer.patch b/freed-ora/current/master/crypto-aesni-intel-fix-wrong-kfree-pointer.patch deleted file mode 100644 index e9942c06f..000000000 --- a/freed-ora/current/master/crypto-aesni-intel-fix-wrong-kfree-pointer.patch +++ /dev/null @@ -1,45 +0,0 @@ -From bf084d8f6eb4ded3f90a6ab79bb682db00ebfbd4 Mon Sep 17 00:00:00 2001 -From: Milan Broz <mbroz@redhat.com> -Date: Thu, 28 Jun 2012 17:26:02 +0200 -Subject: [PATCH] crypto: aesni-intel - fix wrong kfree pointer - -kfree(new_key_mem) in rfc4106_set_key() should be called on malloced pointer, -not on aligned one, otherwise it can cause invalid pointer on free. - -(Seen at least once when running tcrypt tests with debug kernel.) - -Signed-off-by: Milan Broz <mbroz@redhat.com> -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> ---- - arch/x86/crypto/aesni-intel_glue.c | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index d662615..34fdcff 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -529,7 +529,7 @@ static int rfc4106_set_key(struct crypto_aead *parent, const u8 *key, - struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm); - struct aesni_rfc4106_gcm_ctx *child_ctx = - aesni_rfc4106_gcm_ctx_get(cryptd_child); -- u8 *new_key_mem = NULL; -+ u8 *new_key_align, *new_key_mem = NULL; - - if (key_len < 4) { - crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); -@@ -553,9 +553,9 @@ static int rfc4106_set_key(struct crypto_aead *parent, const u8 *key, - if (!new_key_mem) - return -ENOMEM; - -- new_key_mem = PTR_ALIGN(new_key_mem, AESNI_ALIGN); -- memcpy(new_key_mem, key, key_len); -- key = new_key_mem; -+ new_key_align = PTR_ALIGN(new_key_mem, AESNI_ALIGN); -+ memcpy(new_key_align, key, key_len); -+ key = new_key_align; - } - - if (!irq_fpu_usable()) --- -1.7.6.5 - diff --git a/freed-ora/current/master/crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch b/freed-ora/current/master/crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch deleted file mode 100644 index 9aef14c52..000000000 --- a/freed-ora/current/master/crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 6c79294f44fd7d1122cbaabff3b9815b074c0dd0 Mon Sep 17 00:00:00 2001 -From: Milan Broz <mbroz@redhat.com> -Date: Fri, 29 Jun 2012 22:08:09 +0200 -Subject: [PATCH] crypto: testmgr - allow aesni-intel and ghash_clmulni-intel - in fips mode - -Patch 863b557a88f8c033f7419fabafef4712a5055f85 added NULL entries -for intel accelerated drivers but did not marked these fips allowed. -This cause panic if running tests with fips=1. - -For ghash, fips_allowed flag was added in patch -18c0ebd2d8194cce4b3f67e2903fa01bea892cbc. - -Without patch, "modprobe tcrypt" fails with - alg: skcipher: Failed to load transform for cbc-aes-aesni: -2 - cbc-aes-aesni: cbc(aes) alg self test failed in fips mode! - (panic) - -Also add missing cryptd(__driver-cbc-aes-aesni) and -cryptd(__driver-gcm-aes-aesni) test to complement -null tests above, otherwise system complains with - alg: No test for __cbc-aes-aesni (cryptd(__driver-cbc-aes-aesni)) - alg: No test for __gcm-aes-aesni (cryptd(__driver-gcm-aes-aesni)) - -Signed-off-by: Milan Broz <mbroz@redhat.com> -Signed-off-by: Paul Wouters <pwouters@redhat.com> -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> ---- - crypto/testmgr.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 files changed, 38 insertions(+), 0 deletions(-) - -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index 36748a5..4308a11 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -1581,6 +1581,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "__driver-cbc-aes-aesni", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .cipher = { - .enc = { -@@ -1641,6 +1642,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "__driver-ecb-aes-aesni", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .cipher = { - .enc = { -@@ -1701,6 +1703,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "__ghash-pclmulqdqni", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .hash = { - .vecs = NULL, -@@ -1866,8 +1869,25 @@ static const struct alg_test_desc alg_test_descs[] = { - } - } - }, { -+ .alg = "cryptd(__driver-cbc-aes-aesni)", -+ .test = alg_test_null, -+ .fips_allowed = 1, -+ .suite = { -+ .cipher = { -+ .enc = { -+ .vecs = NULL, -+ .count = 0 -+ }, -+ .dec = { -+ .vecs = NULL, -+ .count = 0 -+ } -+ } -+ } -+ }, { - .alg = "cryptd(__driver-ecb-aes-aesni)", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .cipher = { - .enc = { -@@ -1926,8 +1946,25 @@ static const struct alg_test_desc alg_test_descs[] = { - } - } - }, { -+ .alg = "cryptd(__driver-gcm-aes-aesni)", -+ .test = alg_test_null, -+ .fips_allowed = 1, -+ .suite = { -+ .cipher = { -+ .enc = { -+ .vecs = NULL, -+ .count = 0 -+ }, -+ .dec = { -+ .vecs = NULL, -+ .count = 0 -+ } -+ } -+ } -+ }, { - .alg = "cryptd(__ghash-pclmulqdqni)", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .hash = { - .vecs = NULL, -@@ -2043,6 +2080,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "ecb(__aes-aesni)", - .test = alg_test_null, -+ .fips_allowed = 1, - .suite = { - .cipher = { - .enc = { --- -1.7.6.5 - diff --git a/freed-ora/current/master/deblob-3.5 b/freed-ora/current/master/deblob-3.6 index 689721f5c..1c6f38230 100755 --- a/freed-ora/current/master/deblob-3.5 +++ b/freed-ora/current/master/deblob-3.6 @@ -48,7 +48,7 @@ # For each kver release, start extra with an empty string, then count # from 1 if changes are needed that require rebuilding the tarball. -kver=3.5 extra= +kver=3.6 extra= case $1 in --force) @@ -598,6 +598,7 @@ undefault_firmware 'XC\(2028\|3028L\)' \ drivers/media/dvb/dvb-usb/dib0700_devices.c \ drivers/media/dvb/dvb-usb/cxusb.c reject_firmware drivers/media/common/tuners/tuner-xc2028.c +clean_blob drivers/media/common/tuners/tuner-xc2028.c clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC2028' clean_mk CONFIG_MEDIA_TUNER_XC2028 drivers/media/common/tuners/Makefile @@ -1448,6 +1449,15 @@ clean_blob drivers/net/wireless/brcm80211/brcmfmac/usb.c clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMFMAC_USB' clean_mk CONFIG_BRCMFMAC_USB drivers/net/wireless/brcm80211/brcmfmac/Makefile +announce CSR_WIFI - "CSR wireless driver" +reject_firmware drivers/staging/csr/unifi_priv.h +reject_firmware drivers/staging/csr/firmware.c +reject_firmware drivers/staging/csr/putest.c +reject_firmware drivers/staging/csr/sme_native.c +reject_firmware drivers/staging/csr/sme_sys.c +clean_kconfig drivers/staging/csr/Kconfig 'CSR_WIFI' +clean_mk CONFIG_CSR_WIFI drivers/staging/csr/Makefile + announce HERMES - "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)" reject_firmware drivers/net/wireless/orinoco/fw.c clean_blob drivers/net/wireless/orinoco/fw.c @@ -1506,10 +1516,10 @@ clean_mk CONFIG_IWL3945 drivers/net/wireless/iwlegacy/Makefile announce IWLWIFI - "Intel Wireless WiFi Next Gen AGN" reject_firmware drivers/net/wireless/iwlwifi/iwl-drv.c clean_blob drivers/net/wireless/iwlwifi/iwl-drv.c -clean_blob drivers/net/wireless/iwlwifi/iwl-5000.c -clean_blob drivers/net/wireless/iwlwifi/iwl-6000.c -clean_blob drivers/net/wireless/iwlwifi/iwl-1000.c -clean_blob drivers/net/wireless/iwlwifi/iwl-2000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/5000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/6000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/1000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/2000.c clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLWIFI' clean_mk CONFIG_IWLWIFI drivers/net/wireless/iwlwifi/Makefile @@ -1520,20 +1530,6 @@ clean_blob drivers/net/wireless/iwlegacy/4965.c clean_kconfig drivers/net/wireless/iwlegacy/Kconfig 'IWL4965' clean_mk CONFIG_IWL4965 drivers/net/wireless/iwlegacy/Makefile -announce IWM - "Intel Wireless Multicomm 3200 WiFi driver" -reject_firmware drivers/net/wireless/iwmc3200wifi/fw.c -clean_blob drivers/net/wireless/iwmc3200wifi/sdio.c -clean_kconfig drivers/net/wireless/iwmc3200wifi/Kconfig 'IWM' -clean_mk CONFIG_IWM drivers/net/wireless/iwmc3200wifi/Makefile - -announce IWMC3200TOP - "Intel Wireless MultiCom Top Driver" -reject_firmware drivers/misc/iwmc3200top/fw-download.c -undefine_macro '_FW_NAME(api)' '"/*(DEBLOBBED)*/"' \ - 'removed non-Free firmware name' drivers/misc/iwmc3200top/iwmc3200top.h -clean_blob drivers/misc/iwmc3200top/main.c -clean_kconfig drivers/misc/iwmc3200top/Kconfig 'IWMC3200TOP' -clean_mk CONFIG_IWMC3200TOP drivers/misc/iwmc3200top/Makefile - announce LIBERTAS - "Marvell 8xxx Libertas WLAN driver support" reject_firmware drivers/net/wireless/libertas/firmware.c clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS' @@ -1744,22 +1740,18 @@ clean_blob drivers/net/wireless/ti/wl12xx/main.c clean_kconfig drivers/net/wireless/ti/wl12xx/Kconfig 'WL12XX' clean_mk CONFIG_WL12XX drivers/net/wireless/ti/wl12xx/Makefile +announce WL18XX - "TI wl18xx support" +reject_firmware drivers/net/wireless/ti/wl18xx/main.c +clean_blob drivers/net/wireless/ti/wl18xx/main.c +clean_kconfig drivers/net/wireless/ti/wl18xx/Kconfig 'WL18XX' +clean_mk CONFIG_WL18XX drivers/net/wireless/ti/wl18xx/Makefile + announce WLCORE - "TI wlcore support" -clean_blob drivers/net/wireless/ti/wlcore/wl12xx.h reject_firmware drivers/net/wireless/ti/wlcore/main.c +clean_blob drivers/net/wireless/ti/wlcore/wlcore_i.h clean_kconfig drivers/net/wireless/ti/wlcore/Kconfig 'WLCORE' clean_mk CONFIG_WLCORE drivers/net/wireless/ti/wlcore/Makefile -announce WLCORE_SDIO - "TI wlcore SDIO support" -clean_blob drivers/net/wireless/ti/wlcore/sdio.c -clean_kconfig drivers/net/wireless/ti/wlcore/Kconfig 'WLCORE_SDIO' -clean_mk CONFIG_WLCORE_SDIO drivers/net/wireless/ti/wlcore/Makefile - -announce WLCORE_SPI - "TI wlcore SPI support" -clean_blob drivers/net/wireless/ti/wlcore/spi.c -clean_kconfig drivers/net/wireless/ti/wlcore/Kconfig 'WLCORE_SPI' -clean_mk CONFIG_WLCORE_SPI drivers/net/wireless/ti/wlcore/Makefile - announce USB_ZD1201 - "USB ZD1201 based Wireless device support" reject_firmware drivers/net/wireless/zd1201.c clean_blob drivers/net/wireless/zd1201.c @@ -1815,7 +1807,6 @@ clean_mk CONFIG_TI_ST drivers/misc/ti-st/Makefile announce WIMAX_I2400M - "Intel Wireless WiMAX Connection 2400" reject_firmware drivers/net/wimax/i2400m/fw.c -clean_blob drivers/net/wimax/i2400m/sdio.c clean_blob drivers/net/wimax/i2400m/usb.c clean_blob Documentation/wimax/README.i2400m clean_kconfig drivers/net/wimax/i2400m/Kconfig 'WIMAX_I2400M' @@ -1827,8 +1818,7 @@ clean_blob drivers/staging/bcm/Macros.h # the firmware proper. clean_sed ' /^static \(inline \)\?struct file \*open_firmware_file/,/^}$/ { - /oldfs *= *get_fs();/i\ - return /*(DEBLOBBED)*/ NULL; + s,\(flp *= *\)filp_open[^;]*,\1/*(DEBLOBBED)*/(void*)-ENOENT, }' drivers/staging/bcm/Misc.c 'disabled non-Free firmware loading machinery' clean_kconfig drivers/staging/bcm/Kconfig 'BCM_WIMAX' clean_mk CONFIG_BCM_WIMAX drivers/staging/bcm/Makefile @@ -1952,11 +1942,11 @@ clean_mk CONFIG_LIRC_ZILOG drivers/staging/media/lirc/Makefile # Data acquisition # #################### -announce COMEDI_PCI_DRIVERS - "Data acquisition support Comedi PCI drivers" +announce COMEDI_JR3_PCI - "JR3/PCI force sensor board support" reject_firmware drivers/staging/comedi/drivers/jr3_pci.c clean_blob drivers/staging/comedi/drivers/jr3_pci.c -clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_PCI_DRIVERS' -clean_mk CONFIG_COMEDI_PCI_DRIVERS drivers/staging/comedi/drivers/Makefile +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_JR3_PCI' +clean_mk CONFIG_COMEDI_JR3_PCI drivers/staging/comedi/drivers/Makefile announce COMEDI_USBDUX - "ITL USBDUX support" reject_firmware drivers/staging/comedi/drivers/usbdux.c diff --git a/freed-ora/current/master/deblob-3.7 b/freed-ora/current/master/deblob-3.7 new file mode 100755 index 000000000..f861dfef7 --- /dev/null +++ b/freed-ora/current/master/deblob-3.7 @@ -0,0 +1,2615 @@ +#!/bin/sh + +# Copyright (C) 2008-2012 Alexandre Oliva <lxoliva@fsfla.org> +# Copyright (C) 2008 Jeff Moe +# Copyright (C) 2009 Rubén RodrÃguez <ruben@gnu.org> +# +# This program is part of GNU Linux-libre, a GNU project that +# publishes scripts to clean up Linux so as to make it suitable for +# use in the GNU Project and in Free System Distributions. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +# deblob - remove non-free blobs from the vanilla linux kernel + +# http://www.fsfla.org/svn/fsfla/software/linux-libre + + +# This script, suited for the kernel version named below, in kver, +# attempts to remove only non-Free Software bits, without removing +# Free Software that happens to be in the same file. + +# Drivers that currently require non-Free firmware are retained, but +# firmware included in GPLed sources is replaced with /*(DEBLOBBED)*/ +# if the deblob-check script, that knows how to do this, is present. +# -lxoliva + + +# See also: +# http://wiki.debian.org/KernelFirmwareLicensing +# svn://svn.debian.org/kernel/dists/trunk/linux-2.6/debian/patches/debian/dfsg/files-1 +# http://wiki.gnewsense.org/Builder gen-kernel + +# Thanks to Brian Brazil @ gnewsense + + +# For each kver release, start extra with an empty string, then count +# from 1 if changes are needed that require rebuilding the tarball. +kver=3.7 extra=0-- + +case $1 in +--force) + echo "WARNING: Using the force, ignored errors will be" >&2 + die () { + echo ERROR: "$@" >&2 + errors=: + } + forced=: errors=false + shift + ;; +*) + die () { + echo ERROR: "$@" >&2 + echo Use --force to ignore + exit 1 + } + forced=false errors=false + ;; +esac + +check=`echo "$0" | sed 's,[^/]*$,,;s,^$,.,;s,/*$,,'`/deblob-check +if [ ! -f $check ] ; then + if $forced; then + die deblob-check script missing, will remove entire files + else + die deblob-check script missing + fi + have_check=false +else + have_check=: + [ -x $check ] || check="/bin/sh $check" +fi + +filetest () { + if [ ! -f $1 ]; then + die $1 does not exist, something is wrong && return 1 + fi +} + +announce () { + echo + echo "$@" +} + +clean_file () { + #$1 = filename + filetest $1 || return + rm $1 + echo $1: removed +} + +check_changed () { + #$1 = filename + if cmp $1.deblob $1 > /dev/null; then + rm $1.deblob + die $1 did not change, something is wrong && return 1 + fi + mv $1.deblob $1 +} + +clean_blob () { + #$1 = filename + filetest $1 || return + if $have_check; then + name=$1 + set fnord "$@" -d + shift 2 + if $check "$@" -i linux-$kver $name > $name.deblob; then + if [ ! -s $name.deblob ]; then + die got an empty file after removing blobs from $name + fi + else + die failed removing blobs from $name + fi + check_changed $name && echo $name: removed blobs + else + clean_file $1 + fi +} + +dummy_blob () { + #$1 = filename + if test -f $1; then + die $1 exists, something is wrong && return + elif test ! -f firmware/Makefile; then + die firmware/Makefile does not exist, something is wrong && return + fi + + clean_sed "s,`echo $1 | sed s,^firmware/,,`,\$(DEBLOBBED),g" \ + firmware/Makefile "dropped $1" +} + +clean_fw () { + #$1 = firmware text input, $2 = firmware output + filetest $1 || return + if test -f $2; then + die $2 exists, something is wrong && return + fi + clean_blob $1 -s 4 + dummy_blob $2 +} + +drop_fw_file () { + #$1 = firmware text input, $2 = firmware output + filetest $1 || return + if test -f $2; then + die $2 exists, something is wrong && return + fi + clean_file $1 + dummy_blob $2 +} + +clean_kconfig () { + #$1 = filename $2 = things to remove + case $1 in + -f) + shift + ;; + *) + if $have_check; then + return + fi + ;; + esac + filetest $1 || return + sed "/^config \\($2\\)\$/{p;i\ + depends on NONFREE +d;}" $1 > $1.deblob + check_changed $1 && echo $1: marked config $2 as depending on NONFREE +} + +clean_mk () { + #$1 = config $2 = Makefile name + # We don't clean up Makefiles any more --lxoliva + # sed -i "/\\($1\\)/d" $2 + # echo $2: removed $1 support + # check_changed $2 + filetest $2 || return + if sed -n "/\\($1\\)/p" $2 | grep . > /dev/null; then + : + else + die $2 does not contain matches for $1 + fi +} + +clean_sed () { + #$1 = sed-script $2 = file $3 = comment + filetest $2 || return + sed -e "$1" "$2" > "$2".deblob || { + die $2: failed: ${3-applied sed script $1} && return 1; } + check_changed $2 && echo $2: ${3-applied sed script $1} +} + +reject_firmware () { + #$1 = file $2 = pre sed pattern + filetest $1 || return + clean_sed "$2"' +s,request\(_ihex\)\?_firmware\(_nowait\)\?,reject_firmware\2,g +' "$1" 'disabled non-Free firmware-loading machinery' +} + +maybe_reject_firmware () { + #$1 = file $2 = pre sed pattern + filetest $1 || return + clean_sed "$2"' +s,request_\(ihex_\)\?firmware\(_nowait\)\?,maybe_reject_\1firmware\2,g +' "$1" 'retain Free firmware-loading machinery, disabling non-Free one' +} + +undefine_macro () { + #$1 - macro name + #$2 - substitution + #$3 - message + #rest - file names + macro=$1 repl=$2 msg=$3; shift 3 + for f in "$@"; do + clean_sed " +s,^#define $macro .*\$,/*(DEBLOBBED)*/,; +s,$macro,$repl,g; +" "$f" "$msg" + done +} + +undefault_firmware () { + #$1 - pattern such that $1_DEFAULT_FIRMWARE is #defined to non-Free firmware + #$@ other than $1 - file names + macro="$1"_DEFAULT_FIRMWARE; shift + undefine_macro "$macro" "\"/*(DEBLOBBED)*/\"" \ + "disabled non-Free firmware" "$@" +} + +# First, check that files that contain firmwares and their +# corresponding sources are present. + +for f in \ + drivers/gpu/drm/nouveau/core/engine/copy/fuc/nva3.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/copy/fuc/nva3.fuc \ + drivers/gpu/drm/nouveau/core/engine/copy/fuc/nvc0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/copy/fuc/nva3.fuc \ + drivers/gpu/drm/nouveau/core/engine/crypt/fuc/nv98.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/crypt/fuc/nv98.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnvc0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/nvc0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/nve0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/nvc0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h \ + drivers/gpu/drm/nouveau/core/engine/graph/fuc/nve0.fuc \ + drivers/net/wan/wanxlfw.inc_shipped \ + drivers/net/wan/wanxlfw.S \ + drivers/net/wireless/atmel.c \ + drivers/net/wireless/atmel.c \ + drivers/scsi/aic7xxx/aic79xx_seq.h_shipped \ + drivers/scsi/aic7xxx/aic79xx.seq \ + drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped \ + drivers/scsi/aic7xxx/aic7xxx.seq \ + drivers/scsi/aic7xxx_old/aic7xxx_seq.c \ + drivers/scsi/aic7xxx_old/aic7xxx.seq \ + drivers/scsi/53c700_d.h_shipped \ + drivers/scsi/53c700.scr \ + drivers/scsi/sym53c8xx_2/sym_fw1.h \ + drivers/scsi/sym53c8xx_2/sym_fw1.h \ + drivers/scsi/sym53c8xx_2/sym_fw2.h \ + drivers/scsi/sym53c8xx_2/sym_fw2.h \ + firmware/dsp56k/bootstrap.bin.ihex \ + firmware/dsp56k/bootstrap.asm \ + firmware/keyspan_pda/keyspan_pda.HEX \ + firmware/keyspan_pda/keyspan_pda.S \ + firmware/keyspan_pda/xircom_pgs.HEX \ + firmware/keyspan_pda/xircom_pgs.S \ + sound/pci/cs46xx/imgs/cwcdma.h \ + sound/pci/cs46xx/imgs/cwcdma.asp \ +; do + filetest $f +done + +# Identify the tarball. +grep -q 'EXTRAVERSION.*-gnu' Makefile || +clean_sed "s,^EXTRAVERSION.*,&-gnu$extra, +" Makefile 'added -gnu to EXTRAVERSION' + +grep -q Linux-libre README || +clean_sed ' +1,3 s,Linux kernel release.*kernel\.org.*,GNU Linux-libre <http://linux-libre.fsfla.org>, +2,5 s,Linux version [0-9.]*,GNU Linux-libre, +1,20 s,\(operating system \)\?Unix,Unix kernel, +/WHAT IS LINUX/i\ +WHAT IS GNU Linux-libre?\ +\ + GNU Linux-libre is a Free version of the kernel Linux (see below),\ + suitable for use with the GNU Operating System in 100% Free\ + GNU/Linux-libre System Distributions.\ + http://www.gnu.org/distros/\ +\ + It removes non-Free components from Linux, that are disguised as\ + source code or distributed in separate files. It also disables\ + run-time requests for non-Free components, shipped separately or as\ + part of Linux, and documentation pointing to them, so as to avoid\ + (Free-)baiting users into the trap of non-Free Software.\ + http://www.fsfla.org/anuncio/2010-11-Linux-2.6.36-libre-debait\ +\ + Linux-libre started within the gNewSense GNU/Linux distribution.\ + It was later adopted by Jeff Moe, who coined its name, and in 2008\ + it became a project maintained by FSF Latin America. In 2012, it\ + became part of the GNU Project.\ +\ + The GNU Linux-libre project takes a minimal-changes approach to\ + cleaning up Linux, making no effort to substitute components that\ + need to be removed with functionally equivalent Free ones.\ + Nevertheless, we encourage and support efforts towards doing so.\ + http://libreplanet.org/wiki/LinuxLibre:Devices_that_require_non-free_firmware\ +\ + Our mascot is Freedo, a light-blue penguin that has just come out\ + of the shower. Although we like penguins, GNU is a much greater\ + contribution to the entire system, so its mascot deserves more\ + promotion. See our web page for their images.\ + http://linux-libre.fsfla.org/\ + +' README 'added blurb about GNU Linux-libre' + +# Add reject_firmware and maybe_reject_firmware +grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h || +clean_sed '$i\ +#ifndef _LINUX_LIBRE_FIRMWARE_H\ +#define _LINUX_LIBRE_FIRMWARE_H\ +\ +#include <linux/device.h>\ +\ +#define NONFREE_FIRMWARE "/*(DEBLOBBED)*/"\ +\ +static inline int\ +report_missing_free_firmware(const char *name, const char *what)\ +{\ + printk(KERN_ERR "%s: Missing Free %s\\n", name,\ + what ? what : "firmware");\ + return -EINVAL;\ +}\ +static inline int\ +reject_firmware(const struct firmware **fw,\ + const char *name, struct device *device)\ +{\ + const struct firmware *xfw = NULL;\ + int retval;\ + report_missing_free_firmware(dev_name(device), NULL);\ + retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\ + if (!retval)\ + release_firmware(xfw);\ + return -EINVAL;\ +}\ +static inline int\ +maybe_reject_firmware(const struct firmware **fw,\ + const char *name, struct device *device)\ +{\ + if (strstr (name, NONFREE_FIRMWARE))\ + return reject_firmware(fw, name, device);\ + else\ + return request_firmware(fw, name, device);\ +}\ +static inline void\ +discard_rejected_firmware(const struct firmware *fw, void *context)\ +{\ + release_firmware(fw);\ +}\ +static inline int\ +reject_firmware_nowait(struct module *module, int uevent,\ + const char *name, struct device *device,\ + gfp_t gfp, void *context,\ + void (*cont)(const struct firmware *fw,\ + void *context))\ +{\ + int retval;\ + report_missing_free_firmware(dev_name(device), NULL);\ + retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ + device, gfp, NULL,\ + discard_rejected_firmware);\ + if (retval)\ + return retval;\ + return -EINVAL;\ +}\ +static inline int\ +maybe_reject_firmware_nowait(struct module *module, int uevent,\ + const char *name, struct device *device,\ + gfp_t gfp, void *context,\ + void (*cont)(const struct firmware *fw,\ + void *context))\ +{\ + if (strstr (name, NONFREE_FIRMWARE))\ + return reject_firmware_nowait(module, uevent, name,\ + device, gfp, context, cont);\ + else\ + return request_firmware_nowait(module, uevent, name,\ + device, gfp, context, cont);\ +}\ +\ +#endif /* _LINUX_LIBRE_FIRMWARE_H */\ +' include/linux/firmware.h 'added non-Free firmware notification support' + +grep -q _LINUX_LIBRE_IHEX_FIRMWARE_H include/linux/ihex.h || +clean_sed '$i\ +#ifndef _LINUX_LIBRE_IHEX_H\ +#define _LINUX_LIBRE_IHEX_H\ +\ +static inline int\ +maybe_reject_ihex_firmware(const struct firmware **fw,\ + const char *name, struct device *device)\ +{\ + if (strstr (name, NONFREE_FIRMWARE))\ + return reject_firmware(fw, name, device);\ + else\ + return request_ihex_firmware(fw, name, device);\ +}\ +\ +#endif /* _LINUX_LIBRE_IHEX_H */\ +' include/linux/ihex.h 'added non-Free ihex firmware notification support' + +######## +# Arch # +######## + +# x86 + +announce MICROCODE_AMD - "AMD microcode patch loading support" +reject_firmware arch/x86/kernel/microcode_amd.c +clean_blob arch/x86/kernel/microcode_amd.c +clean_kconfig arch/x86/Kconfig 'MICROCODE_AMD' +clean_mk CONFIG_MICROCODE_AMD arch/x86/kernel/Makefile + +announce MICROCODE_INTEL - "Intel microcode patch loading support" +reject_firmware arch/x86/kernel/microcode_intel.c +clean_blob arch/x86/kernel/microcode_intel.c +clean_kconfig arch/x86/Kconfig 'MICROCODE_INTEL' +clean_mk CONFIG_MICROCODE_INTEL arch/x86/kernel/Makefile + +# arm + +announce IXP4XX_NPE - "IXP4xx Network Processor Engine support" +reject_firmware arch/arm/mach-ixp4xx/ixp4xx_npe.c +clean_blob Documentation/arm/IXP4xx + +announce ARCH_NETX - "Hilscher NetX based" +clean_sed ' +s,\([" ]\)request_firmware(,\1reject_firmware(, +' arch/arm/mach-netx/xc.c 'disabled non-Free firmware-loading machinery' +clean_blob arch/arm/mach-netx/xc.c +clean_blob drivers/net/ethernet/netx-eth.c +clean_kconfig arch/arm/Kconfig 'ARCH_NETX' +clean_mk CONFIG_ARCH_NETX arch/arm/Makefile + +####### +# ATM # +####### + +announce ATM_AMBASSADOR - "Madge Ambassador, Collage PCI 155 Server" +reject_firmware drivers/atm/ambassador.c +clean_blob drivers/atm/ambassador.c +clean_fw firmware/atmsar11.HEX firmware/atmsar11.fw +clean_kconfig drivers/atm/Kconfig 'ATM_AMBASSADOR' +clean_mk CONFIG_ATM_AMBASSADOR drivers/atm/Makefile + +announce ATM_FORE200E - "FORE Systems 200E-series" +reject_firmware drivers/atm/fore200e.c +clean_blob drivers/atm/fore200e.c +clean_blob Documentation/networking/fore200e.txt +clean_blob drivers/atm/.gitignore +clean_blob Documentation/dontdiff +clean_kconfig drivers/atm/Kconfig 'ATM_FORE200E' +clean_mk CONFIG_ATM_FORE200E drivers/atm/Makefile + +announce ATM_SOLOS - "Solos ADSL2+ PCI Multiport card driver" +reject_firmware drivers/atm/solos-pci.c +clean_blob drivers/atm/solos-pci.c +clean_kconfig drivers/atm/Kconfig 'ATM_SOLOS' +clean_mk CONFIG_ATM_SOLOS drivers/atm/Makefile + +######## +# tty # +######## + +announce CYCLADES - "Cyclades async mux support" +reject_firmware drivers/tty/cyclades.c +clean_blob drivers/tty/cyclades.c +clean_kconfig drivers/tty/Kconfig 'CYCLADES' +clean_mk CONFIG_CYCLADES drivers/tty/Makefile + +announce ISI - "Multi-Tech multiport card support" +reject_firmware drivers/tty/isicom.c +clean_blob drivers/tty/isicom.c +clean_kconfig drivers/tty/Kconfig 'ISI' +clean_mk CONFIG_ISI drivers/tty/Makefile + +announce MOXA_INTELLIO - "Moxa Intellio support" +reject_firmware drivers/tty/moxa.c +clean_blob drivers/tty/moxa.c +clean_kconfig drivers/tty/Kconfig 'MOXA_INTELLIO' +clean_mk CONFIG_MOXA_INTELLIO drivers/tty/Makefile + +# gpu drm + +announce DRM_NOUVEAU - "Nouveau (nVidia) cards" +reject_firmware drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c +clean_blob drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c +clean_kconfig drivers/gpu/drm/nouveau/Kconfig 'DRM_NOUVEAU' +clean_mk CONFIG_DRM_NOUVEAU drivers/gpu/drm/nouveau/Makefile + +announce DRM_MGA - "Matrox g200/g400" +drop_fw_file firmware/matrox/g200_warp.H16 firmware/matrox/g200_warp.fw +drop_fw_file firmware/matrox/g400_warp.H16 firmware/matrox/g400_warp.fw +reject_firmware drivers/gpu/drm/mga/mga_warp.c +clean_blob drivers/gpu/drm/mga/mga_warp.c +clean_kconfig drivers/gpu/drm/Kconfig 'DRM_MGA' +clean_mk CONFIG_DRM_MGA drivers/gpu/drm/Makefile + +announce DRM_R128 - "ATI Rage 128" +drop_fw_file firmware/r128/r128_cce.bin.ihex firmware/r128/r128_cce.bin +reject_firmware drivers/gpu/drm/r128/r128_cce.c +clean_blob drivers/gpu/drm/r128/r128_cce.c +clean_kconfig drivers/gpu/drm/Kconfig 'DRM_R128' +clean_mk CONFIG_DRM_R128 drivers/gpu/drm/Makefile + +announce DRM_RADEON - "ATI Radeon" +drop_fw_file firmware/radeon/R100_cp.bin.ihex firmware/radeon/R100_cp.bin +drop_fw_file firmware/radeon/R200_cp.bin.ihex firmware/radeon/R200_cp.bin +drop_fw_file firmware/radeon/R300_cp.bin.ihex firmware/radeon/R300_cp.bin +drop_fw_file firmware/radeon/R420_cp.bin.ihex firmware/radeon/R420_cp.bin +drop_fw_file firmware/radeon/R520_cp.bin.ihex firmware/radeon/R520_cp.bin +drop_fw_file firmware/radeon/R600_me.bin.ihex firmware/radeon/R600_me.bin +drop_fw_file firmware/radeon/R600_pfp.bin.ihex firmware/radeon/R600_pfp.bin +drop_fw_file firmware/radeon/RS600_cp.bin.ihex firmware/radeon/RS600_cp.bin +drop_fw_file firmware/radeon/RS690_cp.bin.ihex firmware/radeon/RS690_cp.bin +drop_fw_file firmware/radeon/RS780_me.bin.ihex firmware/radeon/RS780_me.bin +drop_fw_file firmware/radeon/RS780_pfp.bin.ihex firmware/radeon/RS780_pfp.bin +drop_fw_file firmware/radeon/RV610_me.bin.ihex firmware/radeon/RV610_me.bin +drop_fw_file firmware/radeon/RV610_pfp.bin.ihex firmware/radeon/RV610_pfp.bin +drop_fw_file firmware/radeon/RV620_me.bin.ihex firmware/radeon/RV620_me.bin +drop_fw_file firmware/radeon/RV620_pfp.bin.ihex firmware/radeon/RV620_pfp.bin +drop_fw_file firmware/radeon/RV630_me.bin.ihex firmware/radeon/RV630_me.bin +drop_fw_file firmware/radeon/RV630_pfp.bin.ihex firmware/radeon/RV630_pfp.bin +drop_fw_file firmware/radeon/RV635_me.bin.ihex firmware/radeon/RV635_me.bin +drop_fw_file firmware/radeon/RV635_pfp.bin.ihex firmware/radeon/RV635_pfp.bin +drop_fw_file firmware/radeon/RV670_me.bin.ihex firmware/radeon/RV670_me.bin +drop_fw_file firmware/radeon/RV670_pfp.bin.ihex firmware/radeon/RV670_pfp.bin +drop_fw_file firmware/radeon/RV710_me.bin.ihex firmware/radeon/RV710_me.bin +drop_fw_file firmware/radeon/RV710_pfp.bin.ihex firmware/radeon/RV710_pfp.bin +drop_fw_file firmware/radeon/RV730_me.bin.ihex firmware/radeon/RV730_me.bin +drop_fw_file firmware/radeon/RV730_pfp.bin.ihex firmware/radeon/RV730_pfp.bin +drop_fw_file firmware/radeon/RV770_me.bin.ihex firmware/radeon/RV770_me.bin +drop_fw_file firmware/radeon/RV770_pfp.bin.ihex firmware/radeon/RV770_pfp.bin +reject_firmware drivers/gpu/drm/radeon/radeon_cp.c +clean_blob drivers/gpu/drm/radeon/radeon_cp.c +reject_firmware drivers/gpu/drm/radeon/r100.c +clean_blob drivers/gpu/drm/radeon/r100.c +reject_firmware drivers/gpu/drm/radeon/r600.c +clean_blob drivers/gpu/drm/radeon/r600.c +reject_firmware drivers/gpu/drm/radeon/r600_cp.c +clean_blob drivers/gpu/drm/radeon/r600_cp.c +reject_firmware drivers/gpu/drm/radeon/ni.c +clean_blob drivers/gpu/drm/radeon/ni.c +reject_firmware drivers/gpu/drm/radeon/si.c +clean_blob drivers/gpu/drm/radeon/si.c +clean_kconfig drivers/gpu/drm/Kconfig 'DRM_RADEON' +clean_mk CONFIG_DRM_RADEON drivers/gpu/drm/Makefile + +####### +# dma # +####### + +announce IMX_SDMA - "i.MX SDMA support" +reject_firmware drivers/dma/imx-sdma.c +clean_blob arch/arm/mach-imx/mm-imx25.c +clean_blob arch/arm/mach-imx/mm-imx3.c +clean_blob arch/arm/mach-imx/mm-imx5.c +clean_blob arch/arm/boot/dts/imx51.dtsi +clean_blob arch/arm/boot/dts/imx53.dtsi +clean_blob arch/arm/boot/dts/imx6q.dtsi +clean_blob Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +clean_kconfig drivers/dma/Kconfig 'IMX_SDMA' +clean_mk CONFIG_IMX_SDMA drivers/dma/Makefile + +######### +# Media # +######### + +# media/tuner + +announce MEDIA_TUNER_XC2028 - "XCeive xc2028/xc3028 tuners" +undefault_firmware 'XC\(2028\|3028L\)' \ + drivers/media/tuners/tuner-xc2028.h \ + drivers/media/pci/saa7134/saa7134-cards.c \ + drivers/media/pci/ivtv/ivtv-driver.c \ + drivers/media/pci/cx18/cx18-driver.c \ + drivers/media/pci/cx18/cx18-dvb.c \ + drivers/media/pci/cx23885/cx23885-dvb.c \ + drivers/media/pci/cx23885/cx23885-video.c \ + drivers/media/pci/cx88/cx88-dvb.c \ + drivers/media/pci/cx88/cx88-cards.c \ + drivers/media/usb/em28xx/em28xx-cards.c \ + drivers/media/usb/dvb-usb/dib0700_devices.c \ + drivers/media/usb/dvb-usb/cxusb.c +reject_firmware drivers/media/tuners/tuner-xc2028.c +clean_blob drivers/media/tuners/tuner-xc2028.c +clean_kconfig drivers/media/tuners/Kconfig 'MEDIA_TUNER_XC2028' +clean_mk CONFIG_MEDIA_TUNER_XC2028 drivers/media/tuners/Makefile + +announce VIDEO_TM6000_DVB - "DVB Support for tm6000 based TV cards" +clean_blob drivers/media/usb/tm6000/tm6000-cards.c +clean_kconfig drivers/media/usb/tm6000/Kconfig 'VIDEO_TM6000_DVB' +clean_mk CONFIG_VIDEO_TM6000_DVB drivers/media/usb/tm6000/Makefile + +announce MEDIA_TUNER_XC4000 - "Xceive XC4000 silicon tuner" +undefault_firmware 'XC4000' drivers/media/tuners/xc4000.c +maybe_reject_firmware drivers/media/tuners/xc4000.c +clean_kconfig drivers/media/tuners/Kconfig 'MEDIA_TUNER_XC4000' +clean_mk CONFIG_MEDIA_TUNER_XC4000 drivers/media/tuners/Makefile + +announce MEDIA_TUNER_XC5000 - "Xceive XC5000 silicon tuner" +undefault_firmware 'XC5000' \ + drivers/media/usb/cx231xx/cx231xx-cards.c +reject_firmware drivers/media/tuners/xc5000.c +clean_blob drivers/media/tuners/xc5000.c +clean_kconfig drivers/media/tuners/Kconfig 'MEDIA_TUNER_XC5000' +clean_mk CONFIG_MEDIA_TUNER_XC5000 drivers/media/tuners/Makefile + +announce DVB_USB - "Support for various USB DVB devices" +reject_firmware drivers/media/usb/dvb-usb/dvb-usb-firmware.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB' +clean_mk CONFIG_DVB_USB drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_V2 - "Support for various USB DVB devices v2" +reject_firmware drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_V2' +clean_mk CONFIG_DVB_USB_V2 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_B2C2_FLEXCOP - "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" +reject_firmware drivers/media/common/b2c2/flexcop-fe-tuner.c + +announce DVB_BT8XX - "BT8xx based PCI cards" +reject_firmware drivers/media/pci/bt8xx/dvb-bt8xx.c + +announce DVB_USB_A800 - "AVerMedia AverTV DVB-T USB 2.0 (A800)" +clean_blob drivers/media/usb/dvb-usb/a800.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_A800' +clean_mk CONFIG_DVB_USB_A800 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_AF9005 - "Afatech AF9005 DVB-T USB1.1 support" +clean_file drivers/media/usb/dvb-usb/af9005-script.h +clean_sed ' +s,^ deb_info("load init script\\n");$, {\n err("Missing Free init script\\n");\n return scriptlen = ret = -EINVAL;\n ,; +' drivers/media/usb/dvb-usb/af9005-fe.c 'report missing Free init script' +clean_blob drivers/media/usb/dvb-usb/af9005-fe.c +clean_blob drivers/media/usb/dvb-usb/af9005.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_AF9005' +clean_mk CONFIG_DVB_USB_AF9005 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_AF9015 - "Afatech AF9015 DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb-v2/af9015.h +clean_blob drivers/media/usb/dvb-usb-v2/af9015.c +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_AF9015' +clean_mk CONFIG_DVB_USB_AF9015 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_AF9035 - "Afatech AF9035 DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb-v2/af9035.h +clean_blob drivers/media/usb/dvb-usb-v2/af9035.c +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_AF9035' +clean_mk CONFIG_DVB_USB_AF9035 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_AZ6007 - "Azurewave 6007 and clones DVB-T/C USB2.0 support" +clean_blob drivers/media/usb/dvb-usb-v2/az6007.c +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_AZ6007' +clean_mk CONFIG_DVB_USB_AZ6007 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_AZ6027 - "Azurewave DVB-S/S2 USB2.0 AZ6027 support" +clean_blob drivers/media/usb/dvb-usb/az6027.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_AZ6027' +clean_mk CONFIG_DVB_USB_AZ6027 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_CXUSB - "Conexant USB2.0 hybrid reference design support" +clean_blob drivers/media/usb/dvb-usb/cxusb.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_CXUSB' +clean_mk CONFIG_DVB_USB_CXUSB drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DIB0700 - "DiBcom DiB0700 USB DVB devices" +reject_firmware drivers/media/usb/dvb-usb/dib0700_devices.c +clean_blob drivers/media/usb/dvb-usb/dib0700_devices.c +clean_blob drivers/media/usb/dvb-usb/dib0700_core.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DIB0700' +clean_mk CONFIG_DVB_USB_DIB0700 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DIBUSB_MB - "DiBcom USB DVB-T devices (based on the DiB3000M-B)" +clean_blob drivers/media/usb/dvb-usb/dibusb-mb.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DIBUSB_MB' +clean_mk CONFIG_DVB_USB_DIBUSB_MB drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DIBUSB_MC - "DiBcom USB DVB-T devices (based on the DiB3000M-C/P)" +clean_blob drivers/media/usb/dvb-usb/dibusb-mc.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DIBUSB_MC' +clean_mk CONFIG_DVB_USB_DIBUSB_MC drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DIGITV - "Nebula Electronics uDigiTV DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/digitv.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DIGITV' +clean_mk CONFIG_DVB_USB_DIGITV drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DTT200U - "WideView WT-200U and WT-220U (pen) DVB-T USB2.0 support (Yakumo/Hama/Typhoon/Yuan)" +clean_blob drivers/media/usb/dvb-usb/dtt200u.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DTT200U' +clean_mk CONFIG_DVB_USB_DTT200U drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_DW2102 - "DvbWorld DVB-S/S2 USB2.0 support" +reject_firmware drivers/media/usb/dvb-usb/dw2102.c +clean_blob drivers/media/usb/dvb-usb/dw2102.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_DW2102' +clean_mk CONFIG_DVB_USB_DW2102 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_EC168 - "E3C EC168 DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb-v2/ec168.h +clean_blob drivers/media/usb/dvb-usb-v2/ec168.c +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_EC168' +clean_mk CONFIG_DVB_USB_EC168 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_GP8PSK - "GENPIX 8PSK->USB module support" +reject_firmware drivers/media/usb/dvb-usb/gp8psk.c +clean_blob drivers/media/usb/dvb-usb/gp8psk.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_GP8PSK' +clean_mk CONFIG_DVB_USB_GP8PSK drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_IT913X - "it913x driver" +clean_blob drivers/media/usb/dvb-usb-v2/it913x.c +clean_file Documentation/dvb/it9137.txt +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_IT913X' +clean_mk CONFIG_DVB_USB_IT913X drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_LME2510 - "LME DM04/QQBOX DVB-S USB2.0 support" +reject_firmware drivers/media/usb/dvb-usb-v2/lmedm04.c +clean_blob drivers/media/usb/dvb-usb-v2/lmedm04.c +clean_file Documentation/dvb/lmedm04.txt +clean_kconfig drivers/media/usb/dvb-usb-v2/Kconfig 'DVB_USB_LME2510' +clean_mk CONFIG_DVB_USB_LME2510 drivers/media/usb/dvb-usb-v2/Makefile + +announce DVB_USB_M920X - "Uli m920x DVB-T USB2.0 support" +reject_firmware drivers/media/usb/dvb-usb/m920x.c +clean_blob drivers/media/usb/dvb-usb/m920x.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_M920X' +clean_mk CONFIG_DVB_USB_M920X drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_NOVA_T_USB2 - "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/nova-t-usb2.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_NOVA_T_USB2' +clean_mk CONFIG_DVB_USB_NOVA_T_USB2 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_OPERA1 - "Opera1 DVB-S USB2.0 receiver" +reject_firmware drivers/media/usb/dvb-usb/opera1.c +clean_blob drivers/media/usb/dvb-usb/opera1.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_OPERA1' +clean_mk CONFIG_DVB_USB_OPERA1 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_TECHNISAT_USB2 - "Technisat DVB-S/S2 USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/technisat-usb2.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_TECHNISAT_USB2' +clean_mk CONFIG_DVB_USB_TECHNISAT_USB2 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_TTUSB2 - "Pinnacle 400e DVB-S USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/ttusb2.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_TTUSB2' +clean_mk CONFIG_DVB_USB_TTUSB2 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_UMT_010 - "HanfTek UMT-010 DVB-T USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/umt-010.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_UMT_010' +clean_mk CONFIG_DVB_USB_UMT_010 drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_VP702X - "TwinhanDTV StarBox and clones DVB-S USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/vp702x.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_VP702X' +clean_mk CONFIG_DVB_USB_VP702X drivers/media/usb/dvb-usb/Makefile + +announce DVB_USB_VP7045 - "TwinhanDTV Alpha/MagicBoxII, DNTV tinyUSB2, Beetle USB2.0 support" +clean_blob drivers/media/usb/dvb-usb/vp7045.c +clean_kconfig drivers/media/usb/dvb-usb/Kconfig 'DVB_USB_VP7045' +clean_mk CONFIG_DVB_USB_VP7045 drivers/media/usb/dvb-usb/Makefile + +# dvb/frontends + +announce DVB_AF9013 - "Afatech AF9013 demodulator" +reject_firmware drivers/media/dvb-frontends/af9013.c +clean_blob drivers/media/dvb-frontends/af9013.c +clean_blob drivers/media/dvb-frontends/af9013_priv.h +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_AF9013' +clean_mk CONFIG_DVB_AF9013 drivers/media/dvb-frontends/Makefile + +announce DVB_BCM3510 - "Broadcom BCM3510" +undefault_firmware 'BCM3510' drivers/media/dvb-frontends/bcm3510.c +reject_firmware drivers/media/dvb-frontends/bcm3510.c +reject_firmware drivers/media/dvb-frontends/bcm3510.h +clean_sed ' +/You.ll need a firmware/,/dvb-fe-bcm/d; +' drivers/media/dvb-frontends/bcm3510.c \ + "removed non-Free firmware notes" +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_BCM3510' +clean_mk CONFIG_DVB_BCM3510 drivers/media/dvb-frontends/Makefile + +announce DVB_DS3000 - "Montage Tehnology DS3000 based" +undefault_firmware 'DS3000' \ + drivers/media/dvb-frontends/ds3000.c +reject_firmware drivers/media/dvb-frontends/ds3000.c +clean_blob drivers/media/dvb-frontends/ds3000.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_DS3000' +clean_mk CONFIG_DVB_DS3000 drivers/media/dvb-frontends/Makefile + +announce DVB_LGS8GXX - "Legend Silicon LGS8913/LGS8GL5/LGS8GXX DMB-TH demodulator" +reject_firmware drivers/media/dvb-frontends/lgs8gxx.c +clean_blob drivers/media/dvb-frontends/lgs8gxx.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_LGS8GXX' +clean_mk CONFIG_DVB_LGS8GXX drivers/media/dvb-frontends/Makefile + +announce DVB_NXT200X - "NxtWave Communications NXT2002/NXT2004 based" +undefault_firmware 'NXT200[24]' drivers/media/dvb-frontends/nxt200x.c +reject_firmware drivers/media/dvb-frontends/nxt200x.c +clean_blob drivers/media/dvb-frontends/nxt200x.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_NXT200X' +clean_mk CONFIG_DVB_NXT200X drivers/media/dvb-frontends/Makefile + +announce DVB_OR51132 - "Oren OR51132 based" +reject_firmware drivers/media/dvb-frontends/or51132.c +clean_blob drivers/media/dvb-frontends/or51132.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_OR51132' +clean_mk CONFIG_DVB_OR51132 drivers/media/dvb-frontends/Makefile + +announce DVB_OR51211 - "Oren OR51211 based" +undefault_firmware 'OR51211' drivers/media/dvb-frontends/or51211.c +reject_firmware drivers/media/dvb-frontends/or51211.c +reject_firmware drivers/media/dvb-frontends/or51211.h +clean_blob drivers/media/dvb-frontends/or51211.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_OR51211' +clean_mk CONFIG_DVB_OR51211 drivers/media/dvb-frontends/Makefile + +announce DVB_SP8870 - "Spase sp8870" +undefault_firmware 'SP8870' drivers/media/dvb-frontends/sp8870.c +reject_firmware drivers/media/dvb-frontends/sp8870.c +reject_firmware drivers/media/dvb-frontends/sp8870.h +clean_blob drivers/media/dvb-frontends/sp8870.c +clean_kconfig drivers/media/dvb-frontends 'DVB_SP8870' +clean_mk CONFIG_DVB_SP8870 drivers/media/dvb-frontends/Makefile + +announce DVB_CX24116 - "Conexant CX24116 based" +undefault_firmware CX24116 drivers/media/dvb-frontends/cx24116.c +reject_firmware drivers/media/dvb-frontends/cx24116.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_CX24116' +clean_mk CONFIG_DVB_CX24116 drivers/media/dvb-frontends/Makefile + +announce DVB_SP887X - "Spase sp887x based" +undefault_firmware 'SP887X' drivers/media/dvb-frontends/sp887x.c +reject_firmware drivers/media/dvb-frontends/sp887x.c +reject_firmware drivers/media/dvb-frontends/sp887x.h +clean_blob drivers/media/dvb-frontends/sp887x.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_SP887X' +clean_mk CONFIG_DVB_SP887X drivers/media/dvb-frontends/Makefile + +announce DVB_TDA10048 - "Philips TDA10048HN based" +undefine_macro 'TDA10048_DEFAULT_FIRMWARE_SIZE' 0 \ + 'removed non-Free firmware size' drivers/media/dvb-frontends/tda10048.c +undefault_firmware 'TDA10048' drivers/media/dvb-frontends/tda10048.c +reject_firmware drivers/media/dvb-frontends/tda10048.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_TDA10048' +clean_mk CONFIG_DVB_TDA10048 drivers/media/dvb-frontends/Makefile + +announce DVB_TDA1004X - "Philips TDA10045H/TDA10046H" +undefault_firmware 'TDA1004[56]' drivers/media/dvb-frontends/tda1004x.c +reject_firmware drivers/media/dvb-frontends/tda1004x.c +reject_firmware drivers/media/dvb-frontends/tda1004x.h +clean_blob drivers/media/dvb-frontends/tda1004x.c +clean_kconfig drivers/media/dvb-frontends 'DVB_TDA1004X' +clean_mk CONFIG_DVB_TDA1004X drivers/media/dvb-frontends/Makefile + +announce DVB_TDA10071 - "NXP TDA10071" +reject_firmware drivers/media/dvb-frontends/tda10071.c +clean_blob drivers/media/dvb-frontends/tda10071.c +clean_blob drivers/media/dvb-frontends/tda10071_priv.h +clean_kconfig drivers/media/dvb-frontends 'DVB_TDA10071' +clean_mk CONFIG_DVB_TDA10071 drivers/media/dvb-frontends/Makefile + +# dvb + +announce DVB_AS102 - "Abilis AS102 DVB receiver" +reject_firmware drivers/staging/media/as102/as102_fw.c +clean_blob drivers/staging/media/as102/as102_fw.c +clean_kconfig drivers/staging/media/as102/Kconfig 'DVB_AS102' +clean_mk CONFIG_DVB_AS102 drivers/staging/media/as102/Makefile + +announce DVB_AV7110 - "AV7110 cards" +reject_firmware drivers/media/pci/ttpci/av7110.c +clean_blob drivers/media/pci/ttpci/av7110.c +clean_kconfig drivers/media/pci/ttpci/Kconfig 'DVB_AV7110' +clean_mk CONFIG_DVB_AV7110 drivers/media/pci/ttpci/Makefile + +announce DVB_BUDGET - "Budget cards" +reject_firmware drivers/media/pci/ttpci/budget.c +reject_firmware drivers/media/dvb-frontends/tdhd1.h + +announce DVB_BUDGET_AV - "Budget cards with analog video inputs" +reject_firmware drivers/media/pci/ttpci/budget-av.c + +announce DVB_BUDGET_CI - "Budget cards with onboard CI connector" +reject_firmware drivers/media/pci/ttpci/budget-ci.c + +announce DVB_DRXD - "Micronas DRXD driver" +reject_firmware drivers/media/dvb-frontends/drxd_hard.c +clean_blob drivers/media/dvb-frontends/drxd_hard.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_DRXD' +clean_mk CONFIG_DVB_DRXD drivers/media/dvb-frontends/Makefile + +announce DVB_DRXK - "Micronas DRXK based" +reject_firmware drivers/media/dvb-frontends/drxk_hard.c +clean_kconfig drivers/media/dvb-frontends/Kconfig 'DVB_DRXK' +clean_mk CONFIG_DVB_DRXK drivers/media/dvb-frontends/Makefile + +announce DVB_NGENE - "Micronas nGene support" +reject_firmware drivers/media/pci/ngene/ngene-core.c +clean_blob drivers/media/pci/ngene/ngene-core.c +clean_kconfig drivers/media/pci/ngene/Kconfig 'DVB_NGENE' +clean_mk CONFIG_DVB_NGENE drivers/media/pci/ngene/Makefile + +announce DVB_PLUTO2 - "Pluto2 cards" +reject_firmware drivers/media/pci/pluto2/pluto2.c + +announce SMS_SIANO_MDTV - "Siano SMS1xxx based MDTV receiver" +reject_firmware drivers/media/common/siano/smscoreapi.c +clean_blob drivers/media/common/siano/smscoreapi.c +clean_blob drivers/media/common/siano/sms-cards.c +clean_kconfig drivers/media/common/siano/Kconfig 'SMS_SIANO_MDTV' +clean_mk CONFIG_SMS_SIANO_MDTV drivers/media/common/siano/Makefile + +announce SMS_USB_DRV - "Siano's USB interface support" +reject_firmware drivers/media/usb/siano/smsusb.c +clean_blob drivers/media/usb/siano/smsusb.c +clean_kconfig drivers/media/usb/siano/Kconfig 'SMS_USB_DRV' +clean_mk CONFIG_SMS_USB_DRV drivers/media/usb/siano/Makefile + +announce DVB_TTUSB_BUDGET - "Technotrend/Hauppauge Nova-USB devices" +drop_fw_file firmware/ttusb-budget/dspbootcode.bin.ihex firmware/ttusb-budget/dspbootcode.bin +reject_firmware drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +clean_blob drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +clean_kconfig drivers/media/usb/ttusb-budget/Kconfig 'DVB_TTUSB_BUDGET' +clean_mk CONFIG_DVB_TTUSB_BUDGET drivers/media/usb/ttusb-budget/Makefile + +announce DVB_TTUSB_DEC - "Technotrend/Hauppauge USB DEC devices" +reject_firmware drivers/media/usb/ttusb-dec/ttusb_dec.c +clean_blob drivers/media/usb/ttusb-dec/ttusb_dec.c +clean_blob Documentation/dvb/ttusb-dec.txt +clean_kconfig drivers/media/usb/ttusb-dec/Kconfig 'DVB_TTUSB_DEC' +clean_mk CONFIG_DVB_TTUSB_DEC drivers/media/usb/ttusb-dec/Makefile + +# video + +announce VIDEO_BT848 - "BT848 Video For Linux" +reject_firmware drivers/media/pci/bt8xx/bttv-cards.c +clean_blob drivers/media/pci/bt8xx/bttv-cards.c +clean_blob Documentation/video4linux/bttv/README +clean_kconfig drivers/media/pci/bt8xx/Kconfig 'VIDEO_BT848' +clean_mk CONFIG_VIDEO_BT848 drivers/media/pci/bt8xx/Makefile + +announce VIDEO_CODA - "Chips&Media Coda multi-standard codec IP" +reject_firmware drivers/media/platform/coda.c +clean_blob drivers/media/platform/coda.c +clean_kconfig drivers/media/platform/Kconfig 'VIDEO_CODA' +clean_mk CONFIG_VIDEO_CODA drivers/media/platform/Makefile + +announce VIDEO_CPIA2 - "CPiA2 Video For Linux" +clean_fw firmware/cpia2/stv0672_vp4.bin.ihex firmware/cpia2/stv0672_vp4.bin +reject_firmware drivers/media/usb/cpia2/cpia2_core.c +clean_blob drivers/media/usb/cpia2/cpia2_core.c +clean_kconfig drivers/media/usb/cpia2/Kconfig 'VIDEO_CPIA2' +clean_mk CONFIG_VIDEO_CPIA2 drivers/media/usb/cpia2/Makefile + +announce VIDEO_CX18 - "Conexant cx23418 MPEG encoder support" +reject_firmware drivers/media/pci/cx18/cx18-av-firmware.c +reject_firmware drivers/media/pci/cx18/cx18-dvb.c +reject_firmware drivers/media/pci/cx18/cx18-firmware.c +clean_blob drivers/media/pci/cx18/cx18-av-firmware.c +clean_blob drivers/media/pci/cx18/cx18-dvb.c +clean_blob drivers/media/pci/cx18/cx18-firmware.c +clean_blob drivers/media/pci/cx18/cx18-driver.c +clean_kconfig drivers/media/pci/cx18/Kconfig 'VIDEO_CX18' +clean_mk CONFIG_VIDEO_CX18 drivers/media/pci/cx18/Makefile + +announce VIDEO_CX231XX - "Conexant cx231xx USB video capture support" +reject_firmware drivers/media/usb/cx231xx/cx231xx-417.c +clean_blob drivers/media/usb/cx231xx/cx231xx-417.c +clean_kconfig drivers/media/usb/cx231xx/Kconfig 'VIDEO_CX231XX' +clean_mk CONFIG_VIDEO_CX231XX drivers/media/usb/cx231xx/Makefile + +announce VIDEO_CX23885 - "Conexant cx23885 (2388x successor) support" +reject_firmware drivers/media/pci/cx23885/cx23885-417.c +clean_blob drivers/media/pci/cx23885/cx23885-417.c +reject_firmware drivers/media/pci/cx23885/cx23885-cards.c +clean_blob drivers/media/pci/cx23885/cx23885-cards.c +clean_kconfig drivers/media/pci/cx23885/Kconfig 'VIDEO_CX23885' +clean_mk CONFIG_VIDEO_CX23885 drivers/media/pci/cx23885/Makefile + +announce VIDEO_CX25840 - "Conexant CX2584x audio/video decoders" +reject_firmware drivers/media/i2c/cx25840/cx25840-firmware.c +clean_blob drivers/media/i2c/cx25840/cx25840-firmware.c +clean_kconfig drivers/media/i2c/cx25840/Kconfig 'VIDEO_CX25840' +clean_mk CONFIG_VIDEO_CX25840 drivers/media/i2c/cx25840/Makefile + +announce VIDEO_CX88_BLACKBIRD - "Blackbird MPEG encoder support (cx2388x + cx23416)" +reject_firmware drivers/media/pci/cx88/cx88-blackbird.c +clean_kconfig drivers/media/pci/cx88/Kconfig 'VIDEO_CX88_BLACKBIRD' +clean_mk CONFIG_VIDEO_CX88_BLACKBIRD drivers/media/pci/cx88/Makefile + +announce VIDEO_EM28XX_DVB - "DVB/ATSC Support for em28xx based TV cards" +clean_blob drivers/media/usb/em28xx/em28xx-dvb.c +clean_kconfig drivers/media/usb/em28xx/Kconfig 'VIDEO_EM28XX_DVB' +clean_mk CONFIG_VIDEO_EM28XX_DVB drivers/media/usb/em28xx/Makefile + +announce VIDEO_IVTV - "Conexant cx23416/cx23415 MPEG encoder/decoder support" +reject_firmware drivers/media/pci/ivtv/ivtv-firmware.c +clean_blob drivers/media/pci/ivtv/ivtv-firmware.c +clean_kconfig drivers/media/pci/ivtv/Kconfig 'VIDEO_IVTV' +clean_mk CONFIG_VIDEO_IVTV drivers/media/pci/ivtv/Makefile + +announce VIDEO_PVRUSB2 - "Hauppauge WinTV-PVR USB2 support" +reject_firmware drivers/media/usb/pvrusb2/pvrusb2-hdw.c +clean_blob drivers/media/usb/pvrusb2/pvrusb2-devattr.c +clean_kconfig drivers/media/usb/pvrusb2/Kconfig 'VIDEO_PVRUSB2' +clean_mk CONFIG_VIDEO_PVRUSB2 drivers/media/usb/pvrusb2/Makefile + +announce "VIDEO_CX23885, VIDEO_CX88_BLACKBIRD, VIDEO_IVTV, VIDEO_PVRUSB2" - "See above" +clean_blob include/media/cx2341x.h + +announce VIDEO_GO7007 - "Go 7007 support" +reject_firmware drivers/staging/media/go7007/go7007-driver.c +clean_blob drivers/staging/media/go7007/go7007-driver.c +reject_firmware drivers/staging/media/go7007/go7007-fw.c +clean_blob drivers/staging/media/go7007/go7007-usb.c +clean_blob drivers/staging/media/go7007/saa7134-go7007.c +clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007' +clean_mk CONFIG_VIDEO_GO7007 drivers/staging/media/go7007/Makefile + +announce VIDEO_GO7007_USB_S2250_BOARD - "Sensoray 2250/2251 support" +reject_firmware drivers/staging/media/go7007/s2250-loader.c +clean_blob drivers/staging/media/go7007/s2250-loader.c +clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007_USB_S2250_BOARD' +clean_mk CONFIG_VIDEO_GO7007_USB_S2250_BOARD drivers/staging/media/go7007/Makefile + +announce VIDEO_SAA7134_DVB - "DVB/ATSC Support for saa7134 based TV cards" +reject_firmware drivers/media/pci/saa7134/saa7134-dvb.c +clean_kconfig drivers/media/pci/saa7134/Kconfig 'VIDEO_SAA7134_DVB' +clean_mk CONFIG_VIDEO_SAA7134_DVB drivers/media/pci/saa7134/Makefile + +announce VIDEO_SAA7164 - "NXP SAA7164 support" +reject_firmware drivers/media/pci/saa7164/saa7164-fw.c +clean_blob drivers/media/pci/saa7164/saa7164-fw.c +clean_kconfig drivers/media/pci/saa7164/Kconfig 'VIDEO_SAA7164' +clean_mk CONFIG_VIDEO_SAA7164 drivers/media/pci/saa7164/Makefile + +announce VIDEO_TLG2300 - "Telegent TLG2300 USB video capture support" +reject_firmware drivers/media/usb/tlg2300/pd-main.c +clean_blob drivers/media/usb/tlg2300/pd-main.c +clean_kconfig drivers/media/usb/tlg2300/Kconfig 'VIDEO_TLG2300' +clean_mk CONFIG_VIDEO_TLG2300 drivers/media/usb/tlg2300/Makefile + +announce VIDEO_S5K4ECGX - "Samsung S5K4ECGX sensor support" +reject_firmware drivers/media/i2c/s5k4ecgx.c +clean_blob drivers/media/i2c/s5k4ecgx.c +clean_kconfig drivers/media/i2c/s5k4ecgx.c 'VIDEO_S5K4ECGX' +clean_mk CONFIG_VIDEO_S5K4ECGX drivers/media/i2c/Makefile + +announce VIDEO_SAMSUNG_S5P_MFC - "Samsung S5P MFC 5.1 Video Codec" +reject_firmware drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +clean_blob drivers/media/platform/s5p-mfc/s5p_mfc.c +clean_kconfig drivers/media/platform/Kconfig 'VIDEO_SAMSUNG_S5P_MFC' +clean_mk CONFIG_VIDEO_SAMSUNG_S5P_MFC drivers/media/platform/s5p-mfc/Makefile + +announce USB_DABUSB - "left-over DABUSB firmware" +clean_fw firmware/dabusb/bitstream.bin.ihex firmware/dabusb/bitstream.bin +clean_fw firmware/dabusb/firmware.HEX firmware/dabusb/firmware.fw + +announce USB_S2255 - "USB Sensoray 2255 video capture device" +reject_firmware drivers/media/usb/s2255/s2255drv.c +clean_blob drivers/media/usb/s2255/s2255drv.c +clean_kconfig drivers/media/usb/Kconfig 'USB_S2255' +clean_mk CONFIG_USB_S2255 drivers/media/usb/s2255/Makefile + +announce USB_GSPCA_VICAM - "USB 3com HomeConnect, AKA vicam" +drop_fw_file firmware/vicam/firmware.H16 firmware/vicam/firmware.fw +reject_firmware drivers/media/usb/gspca/vicam.c +clean_blob drivers/media/usb/gspca/vicam.c +clean_kconfig drivers/media/usb/gspca/Kconfig 'USB_GSPCA_VICAM' +clean_mk CONFIG_USB_GSPCA_VICAM drivers/media/usb/gspca/Makefile + +# radio + +announce RADIO_WL1273 - "Texas Instruments WL1273 I2C FM Radio" +reject_firmware drivers/media/radio/radio-wl1273.c +clean_blob drivers/media/radio/radio-wl1273.c +clean_kconfig drivers/media/radio/Kconfig 'RADIO_WL1273' +clean_mk CONFIG_RADIO_WL1273 drivers/media/radio/Makefile + +announce RADIO_WL128X - "Texas Instruments WL128x FM Radio" +clean_blob drivers/media/radio/wl128x/fmdrv_common.h +reject_firmware drivers/media/radio/wl128x/fmdrv_common.c +clean_blob drivers/media/radio/wl128x/fmdrv_common.c +clean_kconfig drivers/media/radio/Kconfig 'RADIO_WL128X' +clean_mk CONFIG_RADIO_WL128X drivers/media/radio/Makefile + +####### +# net # +####### + +announce ACENIC - "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit" +drop_fw_file firmware/acenic/tg1.bin.ihex firmware/acenic/tg1.bin +drop_fw_file firmware/acenic/tg2.bin.ihex firmware/acenic/tg2.bin +reject_firmware drivers/net/ethernet/alteon/acenic.c +clean_blob drivers/net/ethernet/alteon/acenic.c +clean_kconfig drivers/net/ethernet/alteon/Kconfig 'ACENIC' +clean_mk CONFIG_ACENIC drivers/net/ethernet/alteon/Makefile + +announce ADAPTEC_STARFIRE - "Adaptec Starfire/DuraLAN support" +clean_fw firmware/adaptec/starfire_rx.bin.ihex firmware/adaptec/starfire_rx.bin +clean_fw firmware/adaptec/starfire_tx.bin.ihex firmware/adaptec/starfire_tx.bin +reject_firmware drivers/net/ethernet/adaptec/starfire.c +clean_blob drivers/net/ethernet/adaptec/starfire.c +clean_kconfig drivers/net/ethernet/adaptec/Kconfig 'ADAPTEC_STARFIRE' +clean_mk CONFIG_ADAPTEC_STARFIRE drivers/net/ethernet/adaptec/Makefile + +announce BNA - "Brocade 1010/1020 10Gb Ethernet Driver support" +clean_blob drivers/net/ethernet/brocade/bna/bnad.c +clean_blob drivers/net/ethernet/brocade/bna/cna.h +reject_firmware drivers/net/ethernet/brocade/bna/bnad_ethtool.c +reject_firmware drivers/net/ethernet/brocade/bna/cna_fwimg.c +clean_kconfig drivers/net/ethernet/brocade/bna/Kconfig 'BNA' +clean_mk CONFIG_BNA drivers/net/ethernet/brocade/bna/Makefile + +announce BNX2 - "Broadcom NetXtremeII" +drop_fw_file firmware/bnx2/bnx2-mips-09-6.2.1a.fw.ihex firmware/bnx2/bnx2-mips-09-6.2.1a.fw +drop_fw_file firmware/bnx2/bnx2-rv2p-09-6.0.17.fw.ihex firmware/bnx2/bnx2-rv2p-09-6.0.17.fw +drop_fw_file firmware/bnx2/bnx2-rv2p-09ax-6.0.17.fw.ihex firmware/bnx2/bnx2-rv2p-09ax-6.0.17.fw +drop_fw_file firmware/bnx2/bnx2-mips-06-6.2.1.fw.ihex firmware/bnx2/bnx2-mips-06-6.2.1.fw +drop_fw_file firmware/bnx2/bnx2-rv2p-06-6.0.15.fw.ihex firmware/bnx2/bnx2-rv2p-06-6.0.15.fw +reject_firmware drivers/net/ethernet/broadcom/bnx2.c +clean_blob drivers/net/ethernet/broadcom/bnx2.c +clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'BNX2' +clean_mk CONFIG_BNX2 drivers/net/ethernet/broadcom/Makefile + +announce BNX2X - "Broadcom NetXtremeII 10Gb support" +drop_fw_file firmware/bnx2x/bnx2x-e1-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e1-6.2.9.0.fw +drop_fw_file firmware/bnx2x/bnx2x-e1h-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e1h-6.2.9.0.fw +drop_fw_file firmware/bnx2x/bnx2x-e2-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e2-6.2.9.0.fw +reject_firmware drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +clean_sed ' +/^#include "bnx2x_init\.h"/,/^$/{ + /^$/i\ +#define bnx2x_init_block(bp, start, end) \\\ + return (printk(KERN_ERR "%s: Missing Free firmware\\n", bp->dev->name),\\\ + -EINVAL) +}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 'report missing Free firmware' +clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +clean_sed ' +/^bool bnx2x_test_firmware_version/,/^}$/{ + /^ u32 my_fw = /i\ + /*(DEBLOBBED)*/ + /^ u32 my_fw = /,/<< 24);/d; + /^ u32 loaded_fw = /,/^$/{ + /^$/i\ +\ + u32 my_fw = ~loaded_fw; + } +}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 'fail already-loaded test' +clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +clean_sed ' +/static void bnx2x_init_wr_wb/{ + i\ +extern void bnx2x_init_wr_wb(struct bnx2x *, u32, const u32 *, u32); +}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h 'declare removed function' +clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'BNX2X' +clean_mk CONFIG_BNX2X drivers/net/ethernet/broadcom/bnx2x/Makefile + +announce CASSINI - "Sun Cassini" +drop_fw_file firmware/sun/cassini.bin.ihex firmware/sun/cassini.bin +reject_firmware drivers/net/ethernet/sun/cassini.c +clean_blob drivers/net/ethernet/sun/cassini.c +clean_kconfig drivers/net/ethernet/sun/Kconfig 'CASSINI' +clean_mk CONFIG_CASSINI drivers/net/ethernet/sun/Makefile + +announce CHELSIO_T3 - "Chelsio AEL 2005 support" +drop_fw_file firmware/cxgb3/t3b_psram-1.1.0.bin.ihex firmware/cxgb3/t3b_psram-1.1.0.bin +drop_fw_file firmware/cxgb3/t3c_psram-1.1.0.bin.ihex firmware/cxgb3/t3c_psram-1.1.0.bin +drop_fw_file firmware/cxgb3/ael2005_opt_edc.bin.ihex firmware/cxgb3/ael2005_opt_edc.bin +drop_fw_file firmware/cxgb3/ael2005_twx_edc.bin.ihex firmware/cxgb3/ael2005_twx_edc.bin +drop_fw_file firmware/cxgb3/ael2020_twx_edc.bin.ihex firmware/cxgb3/ael2020_twx_edc.bin +reject_firmware drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +clean_blob drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +clean_kconfig drivers/net/ethernet/chelsio/Kconfig 'CHELSIO_T3' +clean_mk CONFIG_CHELSIO_T3 drivers/net/ethernet/chelsio/cxgb3/Makefile + +announce CHELSIO_T4 - "Chelsio Communications T4 Ethernet support" +reject_firmware drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +clean_blob drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +clean_kconfig drivers/net/ethernet/chelsio/Kconfig 'CHELSIO_T4' +clean_mk CONFIG_CHELSIO_T4 drivers/net/ethernet/chelsio/cxgb4/Makefile + +announce E100 - "Intel PRO/100+" +drop_fw_file firmware/e100/d101m_ucode.bin.ihex firmware/e100/d101m_ucode.bin +drop_fw_file firmware/e100/d101s_ucode.bin.ihex firmware/e100/d101s_ucode.bin +drop_fw_file firmware/e100/d102e_ucode.bin.ihex firmware/e100/d102e_ucode.bin +reject_firmware drivers/net/ethernet/intel/e100.c +clean_sed ' +/^static const struct firmware \*e100_\(reject\|request\)_firmware(/,/^}$/{ + s:^\(.*\)return ERR_PTR(err);$:\1netif_err(nic, probe, nic->netdev, "Proceeding without firmware\\n");\n\1return NULL;: +}' drivers/net/ethernet/intel/e100.c 'proceed without firmware' +clean_blob drivers/net/ethernet/intel/e100.c +clean_kconfig drivers/net/ethernet/intel/Kconfig 'E100' +clean_mk CONFIG_E100 drivers/net/ethernet/intel/Makefile + +announce FT1000_PCMCIA - "Driver for ft1000 pcmcia device." +clean_file drivers/staging/ft1000/ft1000-pcmcia/ft1000.img +reject_firmware drivers/staging/ft1000/TODO +clean_blob drivers/staging/ft1000/ft1000-pcmcia/boot.h +clean_sed ' +/^static int ft1000_reset_card/,/^}$/ { + /card_bootload/i\ + return /*(DEBLOBBED)*/ false; +} +' drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c \ + 'disabled non-Free firmware-loading machinery' +reject_firmware drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +clean_blob drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +clean_kconfig drivers/staging/ft1000/Kconfig 'FT1000_PCMCIA' +clean_mk CONFIG_FT1000_PCMCIA drivers/staging/ft1000/Makefile + +announce FT1000_USB - "Driver for ft1000 USB devices." +clean_file drivers/staging/ft1000/ft1000-usb/ft3000.img +reject_firmware drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +clean_blob drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +clean_kconfig drivers/staging/ft1000/Kconfig 'FT1000_USB' +clean_mk CONFIG_FT1000_USB drivers/staging/ft1000/Makefile + +announce MYRI_SBUS - "MyriCOM Gigabit Ethernet" +drop_fw_file firmware/myricom/lanai.bin.ihex firmware/myricom/lanai.bin + +announce MYRI10GE - "Myricom Myri-10G Ethernet support" +reject_firmware drivers/net/ethernet/myricom/myri10ge/myri10ge.c +clean_blob drivers/net/ethernet/myricom/myri10ge/myri10ge.c +clean_kconfig drivers/net/ethernet/myricom/Kconfig 'MYRI10GE' +clean_mk CONFIG_MYRI10GE drivers/net/ethernet/myricom/myri10ge/Makefile + +announce NETXEN_NIC - "NetXen Multi port (1/10) Gigabit Ethernet NIC" +reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic.h +reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +clean_blob drivers/net/ethernet/qlogic/netxen/netxen_nic.h +clean_blob drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +clean_kconfig drivers/net/ethernet/qlogic/Kconfig 'NETXEN_NIC' +clean_mk CONFIG_NETXEN_NIC drivers/net/ethernet/qlogic/Makefile + +announce QLCNIC - "QLOGIC QLCNIC 1/10Gb Converged Ethernet NIC Support" +reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +clean_kconfig drivers/net/ethernet/qlogic/Kconfig 'QLCNIC' +clean_mk CONFIG_QLCNIC drivers/net/ethernet/qlogic/qlcnic/Makefile + +announce R8169 - "Realtek 8169 gigabit ethernet support" +reject_firmware drivers/net/ethernet/realtek/r8169.c +clean_blob drivers/net/ethernet/realtek/r8169.c +clean_kconfig drivers/net/ethernet/realtek/Kconfig R8169 +clean_mk CONFIG_R8169 drivers/net/ethernet/realtek/Makefile + +announce SLICOSS - "Alacritech Gigabit IS-NIC cards" +reject_firmware drivers/staging/slicoss/slicoss.c +clean_blob drivers/staging/slicoss/slicoss.c +clean_kconfig drivers/staging/slicoss/Kconfig 'SLICOSS' +clean_mk CONFIG_SLICOSS drivers/staging/slicoss/Makefile + +announce SPIDER_NET - "Spider Gigabit Ethernet driver" +reject_firmware drivers/net/ethernet/toshiba/spider_net.c +clean_sed 's,spider_fw\.bin,DEBLOBBED.bin,g' \ + drivers/net/ethernet/toshiba/spider_net.c 'removed non-Free firmware notes' +clean_blob drivers/net/ethernet/toshiba/spider_net.c +clean_blob drivers/net/ethernet/toshiba/spider_net.h +clean_kconfig drivers/net/ethernet/toshiba/Kconfig 'SPIDER_NET' +clean_mk CONFIG_SPIDER_NET drivers/net/ethernet/toshiba/Makefile + +announce TEHUTI - "Tehuti Networks 10G Ethernet" +drop_fw_file firmware/tehuti/bdx.bin.ihex firmware/tehuti/bdx.bin +reject_firmware drivers/net/ethernet/tehuti/tehuti.c +clean_blob drivers/net/ethernet/tehuti/tehuti.c +clean_kconfig drivers/net/ethernet/tehuti/Kconfig 'TEHUTI' +clean_mk CONFIG_TEHUTI drivers/net/ethernet/tehuti/Makefile + +announce TIGON3 - "Broadcom Tigon3" +drop_fw_file firmware/tigon/tg3.bin.ihex firmware/tigon/tg3.bin +drop_fw_file firmware/tigon/tg3_tso.bin.ihex firmware/tigon/tg3_tso.bin +drop_fw_file firmware/tigon/tg3_tso5.bin.ihex firmware/tigon/tg3_tso5.bin +reject_firmware drivers/net/ethernet/broadcom/tg3.c +clean_blob drivers/net/ethernet/broadcom/tg3.c +clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'TIGON3' +clean_mk CONFIG_TIGON3 drivers/net/ethernet/broadcom/Makefile + +announce TYPHOON - "3cr990 series Typhoon" +drop_fw_file firmware/3com/typhoon.bin.ihex firmware/3com/typhoon.bin +reject_firmware drivers/net/ethernet/3com/typhoon.c +clean_blob drivers/net/ethernet/3com/typhoon.c +clean_kconfig drivers/net/ethernet/3com/Kconfig 'TYPHOON' +clean_mk CONFIG_TYPHOON drivers/net/ethernet/3com/Makefile + +announce VXGE - "Exar X3100 Series 10GbE PCIe Server Adapter" +reject_firmware drivers/net/ethernet/neterion/vxge/vxge-main.c +clean_blob drivers/net/ethernet/neterion/vxge/vxge-main.c +clean_kconfig drivers/net/ethernet/neterion/Kconfig 'VXGE' +clean_mk CONFIG_VXGE drivers/net/ethernet/neterion/vxge/Makefile + +# appletalk + +announce COPS - "COPS LocalTalk PC" +clean_sed ' +/sizeof(\(ff\|lt\)drv_code)/{ + i\ + printk(KERN_INFO "%s: Missing Free firmware.\\n", dev->name);\ + return; +} +/\(ff\|lt\)drv_code/d; +' drivers/net/appletalk/cops.c 'report missing Free firmware' +clean_blob drivers/net/appletalk/cops.c +clean_file drivers/net/appletalk/cops_ffdrv.h +clean_file drivers/net/appletalk/cops_ltdrv.h +clean_kconfig drivers/net/appletalk/Kconfig 'COPS' +clean_mk CONFIG_COPS drivers/net/appletalk/Makefile + +# hamradio + +announce YAM - "YAM driver for AX.25" +drop_fw_file firmware/yam/1200.bin.ihex firmware/yam/1200.bin +drop_fw_file firmware/yam/9600.bin.ihex firmware/yam/9600.bin +reject_firmware drivers/net/hamradio/yam.c +clean_blob drivers/net/hamradio/yam.c +clean_kconfig drivers/net/hamradio/Kconfig 'YAM' +clean_mk CONFIG_YAM drivers/net/hamradio/Makefile + +# irda + +announce USB_IRDA - "IrDA USB dongles" +reject_firmware drivers/net/irda/irda-usb.c +clean_blob drivers/net/irda/irda-usb.c +clean_kconfig drivers/net/irda/Kconfig 'USB_IRDA' +clean_mk CONFIG_USB_IRDA drivers/net/irda/Makefile + +# smsc + +announce PCMCIA_SMC91C92 - "SMC 91Cxx PCMCIA" +drop_fw_file firmware/ositech/Xilinx7OD.bin.ihex firmware/ositech/Xilinx7OD.bin +reject_firmware drivers/net/ethernet/smsc/smc91c92_cs.c +clean_blob drivers/net/ethernet/smsc/smc91c92_cs.c +clean_kconfig drivers/net/ethernet/smsc/Kconfig 'PCMCIA_SMC91C92' +clean_mk CONFIG_PCMCIA_SMC91C92 drivers/net/ethernet/smsc/Makefile + +# near-field communication + +announce NFC_WILINK - "Texas Instruments NFC WiLink driver" +reject_firmware drivers/nfc/nfcwilink.c +clean_blob drivers/nfc/nfcwilink.c +clean_kconfig drivers/nfc/Kconfig 'NFC_WILINK' +clean_mk CONFIG_NFC_WILINK drivers/nfc/Makefile + +# pcmcia + +# CIS files are not software. +# announce PCCARD - "PCCard (PCMCIA/CardBus) support" +# reject_firmware drivers/pcmcia/ds.c +# clean_kconfig drivers/pcmcia/Kconfig 'PCCARD' +# clean_mk CONFIG_PCCARD drivers/pcmcia/Makefile + +announce PCMCIA_3C574 - "3Com 3c574 PCMCIA support" +# This is not software; it's Free, but GPLed without in-tree sources. +drop_fw_file firmware/cis/3CCFEM556.cis.ihex firmware/cis/3CCFEM556.cis +# clean_blob drivers/net/pcmcia/3c574_cs.c +# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C574' +# clean_mk CONFIG_PCMCIA_3C574 drivers/net/pcmcia/Makefile + +announce PCMCIA_3C589 - "3Com 3c589 PCMCIA support" +# This is not software; it's Free, but GPLed without in-tree sources. +drop_fw_file firmware/cis/3CXEM556.cis.ihex firmware/cis/3CXEM556.cis +# clean_blob drivers/net/pcmcia/3c589_cs.c +# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C589' +# clean_mk CONFIG_PCMCIA_3C589 drivers/net/pcmcia/Makefile + +announce PCMCIA_PCNET - "NE2000 compatible PCMCIA support" +# These are not software; they're Free, but GPLed without in-tree sources. +drop_fw_file firmware/cis/LA-PCM.cis.ihex firmware/cis/LA-PCM.cis +drop_fw_file firmware/cis/PCMLM28.cis.ihex firmware/cis/PCMLM28.cis +drop_fw_file firmware/cis/DP83903.cis.ihex firmware/cis/DP83903.cis +drop_fw_file firmware/cis/NE2K.cis.ihex firmware/cis/NE2K.cis +drop_fw_file firmware/cis/tamarack.cis.ihex firmware/cis/tamarack.cis +drop_fw_file firmware/cis/PE-200.cis.ihex firmware/cis/PE-200.cis +drop_fw_file firmware/cis/PE520.cis.ihex firmware/cis/PE520.cis +# clean_blob drivers/net/pcmcia/pcnet_cs.c +# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_PCNET' +# clean_mk CONFIG_PCMCIA_PCNET drivers/net/pcmcia/Makefile + +# usb + +announce USB_KAWETH - "USB KLSI KL5USB101-based ethernet device support" +drop_fw_file firmware/kaweth/new_code.bin.ihex firmware/kaweth/new_code.bin +drop_fw_file firmware/kaweth/new_code_fix.bin.ihex firmware/kaweth/new_code_fix.bin +drop_fw_file firmware/kaweth/trigger_code.bin.ihex firmware/kaweth/trigger_code.bin +drop_fw_file firmware/kaweth/trigger_code_fix.bin.ihex firmware/kaweth/trigger_code_fix.bin +reject_firmware drivers/net/usb/kaweth.c +clean_blob drivers/net/usb/kaweth.c +clean_kconfig drivers/net/usb/Kconfig 'USB_KAWETH' +clean_mk CONFIG_USB_KAWETH drivers/net/usb/Makefile + +# wireless + +announce ATMEL "Atmel at76c50x chipset 802.11b support" +reject_firmware drivers/net/wireless/atmel.c +clean_blob drivers/net/wireless/atmel.c +clean_kconfig drivers/net/wireless/Kconfig 'ATMEL' +clean_mk CONFIG_ATMEL drivers/net/wireless/Makefile + +announce AT76C50X_USB - "Atmel at76c503/at76c505/at76c505a USB cards" +reject_firmware drivers/net/wireless/at76c50x-usb.c +clean_blob drivers/net/wireless/at76c50x-usb.c +clean_kconfig drivers/net/wireless/Kconfig 'AT76C50X_USB' +clean_mk CONFIG_AT76C50X_USB drivers/net/wireless/Makefile + +announce B43 - "Broadcom 43xx wireless support (mac80211 stack)" +maybe_reject_firmware drivers/net/wireless/b43/main.c +clean_sed ' +/^static int b43_upload_microcode(/,/^}$/{ + / if (dev->fw\.opensource) {$/i\ + if (!dev->fw.opensource) {\ + b43err(dev->wl, "Rejected non-Free firmware\\n");\ + err = -EOPNOTSUPP;\ + goto error;\ + } +}' drivers/net/wireless/b43/main.c 'double-check and reject non-Free firmware' +# Major portions of firmware filenames not deblobbed. +clean_blob drivers/net/wireless/b43/main.c +clean_kconfig drivers/net/wireless/b43/Kconfig 'B43' +clean_mk CONFIG_B43 drivers/net/wireless/b43/Makefile + +announce B43LEGACY - "Broadcom 43xx-legacy wireless support (mac80211 stack)" +reject_firmware drivers/net/wireless/b43legacy/main.c +# Major portions of firwmare filenames not deblobbed. +clean_blob drivers/net/wireless/b43legacy/main.c +clean_kconfig drivers/net/wireless/b43legacy/Kconfig 'B43LEGACY' +clean_mk CONFIG_B43LEGACY drivers/net/wireless/b43legacy/Makefile + +announce BRCMSMAC - "Broadcom IEEE802.11n PCIe SoftMAC WLAN driver" +reject_firmware drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +clean_blob drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMSMAC' +clean_mk CONFIG_BRCMSMAC drivers/net/wireless/brcm80211/Makefile + +announce BRCMFMAC_SDIO - "Broadcom IEEE802.11n SDIO FullMAC WLAN driver" +reject_firmware drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +clean_blob drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMFMAC_SDIO' +clean_mk CONFIG_BRCMFMAC_SDIO drivers/net/wireless/brcm80211/brcmfmac/Makefile + +announce BRCMFMAC_USB - "Broadcom IEEE802.11n USB FullMAC WLAN driver" +reject_firmware drivers/net/wireless/brcm80211/brcmfmac/usb.c +clean_blob drivers/net/wireless/brcm80211/brcmfmac/usb.c +clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMFMAC_USB' +clean_mk CONFIG_BRCMFMAC_USB drivers/net/wireless/brcm80211/brcmfmac/Makefile + +announce CSR_WIFI - "CSR wireless driver" +reject_firmware drivers/staging/csr/unifi_priv.h +reject_firmware drivers/staging/csr/firmware.c +reject_firmware drivers/staging/csr/putest.c +reject_firmware drivers/staging/csr/sme_native.c +reject_firmware drivers/staging/csr/sme_sys.c +clean_kconfig drivers/staging/csr/Kconfig 'CSR_WIFI' +clean_mk CONFIG_CSR_WIFI drivers/staging/csr/Makefile + +announce HERMES - "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)" +reject_firmware drivers/net/wireless/orinoco/fw.c +clean_blob drivers/net/wireless/orinoco/fw.c +clean_kconfig drivers/net/wireless/orinoco/Kconfig 'HERMES' +clean_mk CONFIG_HERMES drivers/net/wireless/orinoco/Makefile + +announce ORINOCO_USB - "Agere Orinoco USB support" +reject_firmware drivers/net/wireless/orinoco/orinoco_usb.c +clean_blob drivers/net/wireless/orinoco/orinoco_usb.c +clean_kconfig drivers/net/wireless/orinoco/Kconfig 'ORINOCO_USB' +clean_mk CONFIG_ORINOCO_USB drivers/net/wireless/orinoco/Makefile + +announce WLAGS49_H2 - "Agere Systems HERMES II Wireless PC Card Model 0110" +# Some pieces of the firmware images are most definitely data, but +# others seem to be code. +clean_blob drivers/staging/wlags49_h2/ap_h2.c +clean_blob drivers/staging/wlags49_h2/sta_h2.c +echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h2.c +echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h2.c +clean_blob drivers/staging/wlags49_h2/wl_profile.c +clean_sed ' + s,\(.*hcf_status = \)dhf_download_fw(.*&fw_image );,//& /*(DEBLOBBED)*/\n\1HCF_ERR_INCOMP_FW;, +' drivers/staging/wlags49_h2/wl_main.c 'reject built-in non-Free firmware' +clean_kconfig drivers/staging/wlags49_h2/Kconfig 'WLAGS49_H2' +clean_mk CONFIG_WLAGS49_H2 drivers/staging/Makefile + +announce WLAGS49_H25 - "Linksys Systems HERMES II.5 Wireless-G_CompactFlash_Card" +# Some pieces of the firmware images are most definitely data, but +# others seem to be code. +clean_blob drivers/staging/wlags49_h2/ap_h25.c +clean_blob drivers/staging/wlags49_h2/sta_h25.c +echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h25.c +echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h25.c +clean_kconfig drivers/staging/wlags49_h25/Kconfig 'WLAGS49_H25' +clean_mk CONFIG_WLAGS49_H25 drivers/staging/Makefile + +announce IPW2100 - "Intel PRO/Wireless 2100 Network Connection" +reject_firmware drivers/net/wireless/ipw2x00/ipw2100.c +clean_blob drivers/net/wireless/ipw2x00/ipw2100.c +clean_kconfig drivers/net/wireless/Kconfig 'IPW2100' +clean_mk CONFIG_IPW2100 drivers/net/wireless/ipw2x00/Makefile + +announce IPW2200 - "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" +reject_firmware drivers/net/wireless/ipw2x00/ipw2200.c +clean_blob drivers/net/wireless/ipw2x00/ipw2200.c +clean_kconfig drivers/net/wireless/Kconfig 'IPW2200' +clean_mk CONFIG_IPW2200 drivers/net/wireless/ipw2x00/Makefile + +announce IWL3945 - "Intel PRO/Wireless 3945ABG/BG Network Connection" +reject_firmware drivers/net/wireless/iwlegacy/3945-mac.c +clean_blob drivers/net/wireless/iwlegacy/3945-mac.c +clean_blob drivers/net/wireless/iwlegacy/3945.h +clean_kconfig drivers/net/wireless/iwlegacy/Kconfig 'IWL3945' +clean_mk CONFIG_IWL3945 drivers/net/wireless/iwlegacy/Makefile + +announce IWLWIFI - "Intel Wireless WiFi Next Gen AGN" +reject_firmware drivers/net/wireless/iwlwifi/iwl-drv.c +clean_blob drivers/net/wireless/iwlwifi/iwl-drv.c +clean_blob drivers/net/wireless/iwlwifi/pcie/5000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/6000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/1000.c +clean_blob drivers/net/wireless/iwlwifi/pcie/2000.c +clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLWIFI' +clean_mk CONFIG_IWLWIFI drivers/net/wireless/iwlwifi/Makefile + +announce IWL4965 - "Intel Wireless WiFi 4965AGN" +reject_firmware drivers/net/wireless/iwlegacy/4965-mac.c +clean_blob drivers/net/wireless/iwlegacy/4965-mac.c +clean_blob drivers/net/wireless/iwlegacy/4965.c +clean_kconfig drivers/net/wireless/iwlegacy/Kconfig 'IWL4965' +clean_mk CONFIG_IWL4965 drivers/net/wireless/iwlegacy/Makefile + +announce LIBERTAS - "Marvell 8xxx Libertas WLAN driver support" +reject_firmware drivers/net/wireless/libertas/firmware.c +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS' +clean_mk CONFIG_LIBERTAS drivers/net/wireless/libertas/Makefile + +announce LIBERTAS_CS - "Marvell Libertas 8385 CompactFlash 802.11b/g cards" +clean_blob drivers/net/wireless/libertas/if_cs.c +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_CS' +clean_mk CONFIG_LIBERTAS_CS drivers/net/wireless/libertas/Makefile + +announce LIBERTAS_SDIO - "Marvell Libertas 8385 and 8686 SDIO 802.11b/g cards" +clean_blob drivers/net/wireless/libertas/if_sdio.c +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_SDIO' +clean_mk CONFIG_LIBERTAS_SDIO drivers/net/wireless/libertas/Makefile + +announce LIBERTAS_SPI - "Marvell Libertas 8686 SPI 802.11b/g cards" +clean_blob drivers/net/wireless/libertas/if_spi.c +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_SPI' +clean_mk CONFIG_LIBERTAS_SPI drivers/net/wireless/libertas/Makefile + +announce LIBERTAS_USB - "Marvell Libertas 8388 USB 802.11b/g cards" +clean_blob drivers/net/wireless/libertas/if_usb.c +clean_blob drivers/net/wireless/libertas/README +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_USB' +clean_mk CONFIG_LIBERTAS_USB drivers/net/wireless/libertas/Makefile + +announce LIBERTAS_THINFIRM_USB - "Marvell Libertas 8388 USB 802.11b/g cards with thin firmware" +reject_firmware drivers/net/wireless/libertas_tf/if_usb.c +clean_blob drivers/net/wireless/libertas_tf/if_usb.c +clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_THINFIRM_USB' +clean_mk CONFIG_LIBERTAS_THINFIRM_USB drivers/net/wireless/libertas_tf/Makefile + +announce MWIFIEX - "Marvell WiFi-Ex Driver" +clean_blob drivers/net/wireless/mwifiex/README +reject_firmware drivers/net/wireless/mwifiex/main.c +clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX' +clean_mk CONFIG_MWIFIEX drivers/net/wireless/mwifiex/Makefile + +announce MWIFIEX_SDIO - "Marvell WiFi-Ex Driver for SD8787" +clean_blob drivers/net/wireless/mwifiex/sdio.h +clean_blob drivers/net/wireless/mwifiex/sdio.c +clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX_SDIO' +clean_mk CONFIG_MWIFIEX_SDIO drivers/net/wireless/mwifiex/Makefile + +announce MWIFIEX_PCIE - "Marvell WiFi-Ex Driver for PCI 8766" +clean_blob drivers/net/wireless/mwifiex/pcie.h +clean_blob drivers/net/wireless/mwifiex/pcie.c +clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX_PCIE' +clean_mk CONFIG_MWIFIEX_PCIE drivers/net/wireless/mwifiex/Makefile + +announce MWIFIEX_USB - "Marvell WiFi-Ex Driver for USB8797" +clean_blob drivers/net/wireless/mwifiex/usb.h +clean_blob drivers/net/wireless/mwifiex/usb.c +clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX_USB' +clean_mk CONFIG_MWIFIEX_USB drivers/net/wireless/mwifiex/Makefile + +announce MWL8K - "Marvell 88W8xxx PCI/PCIe Wireless support" +reject_firmware drivers/net/wireless/mwl8k.c +clean_blob drivers/net/wireless/mwl8k.c +clean_kconfig drivers/net/wireless/Kconfig 'MWL8K' +clean_mk CONFIG_MWL8K drivers/net/wireless/Makefile + +announce ATH6KL - "Atheros ath6kl support" +reject_firmware drivers/net/wireless/ath/ath6kl/init.c +clean_blob drivers/net/wireless/ath/ath6kl/init.c +clean_blob drivers/net/wireless/ath/ath6kl/core.h +clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL' +clean_mk CONFIG_ATH6KL drivers/net/wireless/ath/ath6kl/Makefile + +announce ATH6KL_SDIO - "Atheros ath6kl SDIO support" +clean_blob drivers/net/wireless/ath/ath6kl/sdio.c +clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL_SDIO' +clean_mk CONFIG_ATH6KL_SDIO drivers/net/wireless/ath/ath6kl/Makefile + +announce ATH6KL_USB - "Atheros ath6kl USB support" +clean_blob drivers/net/wireless/ath/ath6kl/usb.c +clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL_USB' +clean_mk CONFIG_ATH6KL_USB drivers/net/wireless/ath/ath6kl/Makefile + +announce ATH9K_HTC - "Atheros HTC based wireless cards support" +reject_firmware drivers/net/wireless/ath/ath9k/hif_usb.c +clean_blob drivers/net/wireless/ath/ath9k/hif_usb.c +clean_kconfig drivers/net/wireless/ath/ath9k/Kconfig 'ATH9K_HTC' +clean_mk CONFIG_ATH9K_HTC drivers/net/wireless/ath/ath9k/Makefile + +announce PRISM2_USB - "Prism2.5/3 USB driver" +reject_firmware drivers/staging/wlan-ng/prism2fw.c +clean_blob drivers/staging/wlan-ng/prism2fw.c +clean_kconfig drivers/staging/wlan-ng/Kconfig PRISM2_USB +clean_mk CONFIG_PRISM2_USB drivers/staging/wlan-ng/Makefile + +announce P54_PCI - "Prism54 PCI support" +reject_firmware drivers/net/wireless/p54/p54pci.c +clean_blob drivers/net/wireless/p54/p54pci.c +clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_PCI' +clean_mk CONFIG_P54_PCI drivers/net/wireless/p54/Makefile + +announce P54_SPI - "Prism54 SPI (stlc45xx) support" +# There's support for loading custom 3826.eeprom here, with a default +# eeprom that is clearly pure data. Without Free 3826.arm, there's +# little point in trying to retain the ability to load 3826.eeprom, so +# we drop it altogether. +reject_firmware drivers/net/wireless/p54/p54spi.c +clean_blob drivers/net/wireless/p54/p54spi.c +clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_SPI' +clean_mk CONFIG_P54_SPI drivers/net/wireless/p54/Makefile + +announce P54_USB - "Prism54 USB support" +reject_firmware drivers/net/wireless/p54/p54usb.c +clean_blob drivers/net/wireless/p54/p54usb.c +clean_blob drivers/net/wireless/p54/p54usb.h +clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_USB' +clean_mk CONFIG_P54_USB drivers/net/wireless/p54/Makefile + +announce PRISM54 - "Intersil Prism GT/Duette/Indigo PCI/Cardbus" +reject_firmware drivers/net/wireless/prism54/islpci_dev.c +clean_blob drivers/net/wireless/prism54/islpci_dev.c +clean_kconfig drivers/net/wireless/Kconfig 'PRISM54' +clean_mk CONFIG_PRISM54 drivers/net/wireless/prism54/Makefile + +announce RT2X00_LIB_FIRMWARE - "Ralink driver firmware support" +reject_firmware drivers/net/wireless/rt2x00/rt2x00firmware.c +clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT2X00_LIB_FIRMWARE' +clean_mk CONFIG_RT2X00_LIB_FIRMWARE drivers/net/wireless/rt2x00/Makefile + +announce RT61PCI - "Ralink rt2501/rt61 (PCI/PCMCIA) support" +clean_blob drivers/net/wireless/rt2x00/rt61pci.h +clean_blob drivers/net/wireless/rt2x00/rt61pci.c +clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT61PCI' +clean_mk CONFIG_RT61PCI drivers/net/wireless/rt2x00/Makefile + +announce RT73USB - "Ralink rt2501/rt73 (USB) support" +clean_blob drivers/net/wireless/rt2x00/rt73usb.h +clean_blob drivers/net/wireless/rt2x00/rt73usb.c +clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT73USB' +clean_mk CONFIG_RT73USB drivers/net/wireless/rt2x00/Makefile + +announce RT2800PCI - "Ralink rt2800 (PCI/PCMCIA) support" +clean_blob drivers/net/wireless/rt2x00/rt2800pci.h +clean_blob drivers/net/wireless/rt2x00/rt2800pci.c +clean_kconfig drivers/net/wireless/rt2x00/Kconfig RT2800PCI +clean_mk CONFIG_RT2800PCI drivers/net/wireless/rt2x00/Makefile + +announce RT2800USB - "Ralink rt2800 (USB) support" +clean_blob drivers/net/wireless/rt2x00/rt2800usb.h +clean_blob drivers/net/wireless/rt2x00/rt2800usb.c +clean_kconfig drivers/net/wireless/rt2x00/Kconfig RT2800USB +clean_mk CONFIG_RT2800USB drivers/net/wireless/rt2x00/Makefile + +announce RTL8192CE - "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" +reject_firmware drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +clean_blob drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192CE +clean_mk CONFIG_RTL8192CE drivers/net/wireless/rtlwifi/rtl8192ce/Makefile + +announce RTL8192CU - "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" +reject_firmware drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +clean_blob drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192CU +clean_mk CONFIG_RTL8192CU drivers/net/wireless/rtlwifi/rtl8192cu/Makefile + +announce RTL8192DE - "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" +reject_firmware drivers/net/wireless/rtlwifi/rtl8192de/sw.c +clean_blob drivers/net/wireless/rtlwifi/rtl8192de/sw.c +clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192DE +clean_mk CONFIG_RTL8192DE drivers/net/wireless/rtlwifi/rtl8192de/Makefile + +announce RTL8192SE - "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" +reject_firmware drivers/net/wireless/rtlwifi/rtl8192se/sw.c +clean_blob drivers/net/wireless/rtlwifi/rtl8192se/sw.c +clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192SE +clean_mk CONFIG_RTL8192SE drivers/net/wireless/rtlwifi/rtl8192se/Makefile + +announce RTL8192E - "RealTek RTL8192E Wireless LAN NIC driver" +reject_firmware drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +clean_blob drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h +clean_blob drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +clean_blob drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c +clean_blob drivers/staging/rtl8192e/rtl8192e/rtl_core.c +clean_kconfig drivers/staging/rtl8192e/Kconfig RTL8192E +clean_mk CONFIG_RTL8192E drivers/staging/rtl8192e/Makefile + +announce RTL8192U - "RealTek RTL8192U Wireless LAN NIC driver" +reject_firmware drivers/staging/rtl8192u/r819xU_firmware.c +clean_blob drivers/staging/rtl8192u/r819xU_firmware.c +clean_kconfig drivers/staging/rtl8192u/Kconfig 'RTL8192U' +clean_mk CONFIG_RTL8192U drivers/staging/rtl8192u/Makefile + +announce R8712U - "RealTek RTL8712U (RTL8192SU) Wireless LAN NIC driver" +reject_firmware drivers/staging/rtl8712/hal_init.c +clean_blob drivers/staging/rtl8712/hal_init.c +clean_kconfig drivers/staging/rtl8712/Kconfig 'R8712U' +clean_mk CONFIG_R8712U drivers/staging/rtl8712/Makefile + +announce VT6656 - "VIA Technologies VT6656 support" +reject_firmware drivers/staging/vt6656/firmware.c +clean_blob drivers/staging/vt6656/firmware.c +clean_kconfig drivers/staging/vt6656/Kconfig 'VT6656' +clean_mk CONFIG_VT6656 drivers/staging/vt6656/Makefile + +announce WL1251 - "TI wl1251 support" +reject_firmware drivers/net/wireless/ti/wl1251/main.c +clean_blob drivers/net/wireless/ti/wl1251/main.c +clean_blob drivers/net/wireless/ti/wl1251/wl1251.h +clean_kconfig drivers/net/wireless/ti/wl1251/Kconfig 'WL1251' +clean_mk CONFIG_WL1251 drivers/net/wireless/ti/wl1251/Makefile + +announce WL12XX - "TI wl12xx support" +clean_blob drivers/net/wireless/ti/wl12xx/main.c +clean_kconfig drivers/net/wireless/ti/wl12xx/Kconfig 'WL12XX' +clean_mk CONFIG_WL12XX drivers/net/wireless/ti/wl12xx/Makefile + +announce WL18XX - "TI wl18xx support" +reject_firmware drivers/net/wireless/ti/wl18xx/main.c +clean_blob drivers/net/wireless/ti/wl18xx/main.c +clean_kconfig drivers/net/wireless/ti/wl18xx/Kconfig 'WL18XX' +clean_mk CONFIG_WL18XX drivers/net/wireless/ti/wl18xx/Makefile + +announce WLCORE - "TI wlcore support" +reject_firmware drivers/net/wireless/ti/wlcore/main.c +clean_blob drivers/net/wireless/ti/wlcore/main.c +clean_blob drivers/net/wireless/ti/wlcore/wlcore_i.h +clean_kconfig drivers/net/wireless/ti/wlcore/Kconfig 'WLCORE' +clean_mk CONFIG_WLCORE drivers/net/wireless/ti/wlcore/Makefile + +announce USB_ZD1201 - "USB ZD1201 based Wireless device support" +reject_firmware drivers/net/wireless/zd1201.c +clean_blob drivers/net/wireless/zd1201.c +clean_kconfig drivers/net/wireless/Kconfig 'USB_ZD1201' +clean_mk CONFIG_USB_ZD1201 drivers/net/wireless/Makefile + +announce ZD1211RW - "ZyDAS ZD1211/ZD1211B USB-wireless support" +reject_firmware drivers/net/wireless/zd1211rw/zd_usb.c +clean_blob drivers/net/wireless/zd1211rw/zd_usb.c +clean_kconfig drivers/net/wireless/zd1211rw/Kconfig 'ZD1211RW' +clean_mk CONFIG_ZD1211RW drivers/net/wireless/zd1211rw/Makefile + +# bluetooth + +announce BT_ATH3K - "Atheros firmware download driver" +reject_firmware drivers/bluetooth/ath3k.c +clean_blob drivers/bluetooth/ath3k.c +clean_kconfig drivers/bluetooth/Kconfig 'BT_ATH3K' +clean_mk CONFIG_BT_ATH3K drivers/bluetooth/Makefile + +announce BT_HCIBCM203X - "HCI BCM203x USB driver" +reject_firmware drivers/bluetooth/bcm203x.c +clean_blob drivers/bluetooth/bcm203x.c +clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBCM203X' +clean_mk CONFIG_BT_HCIBCM203X drivers/bluetooth/Makefile + +announce BT_HCIBFUSB - "HCI BlueFRITZ! USB driver" +reject_firmware drivers/bluetooth/bfusb.c +clean_blob drivers/bluetooth/bfusb.c +clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBFUSB' +clean_mk CONFIG_BT_HCIBFUSB drivers/bluetooth/Makefile + +announce BT_HCIBT3C - "HCI BT3C (PC Card) driver" +reject_firmware drivers/bluetooth/bt3c_cs.c +clean_blob drivers/bluetooth/bt3c_cs.c +clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBT3C' +clean_mk CONFIG_BT_HCIBT3C drivers/bluetooth/Makefile + +announce BT_MRVL_SDIO - "Marvell BT-over-SDIO driver" +reject_firmware drivers/bluetooth/btmrvl_sdio.c +clean_blob drivers/bluetooth/btmrvl_sdio.c +clean_blob Documentation/btmrvl.txt +clean_kconfig drivers/bluetooth/Kconfig 'BT_MRVL_SDIO' +clean_mk CONFIG_BT_MRVL_SDIO drivers/bluetooth/Makefile + +announce TI_ST - "Texas Instruments shared transport line discipline" +reject_firmware drivers/misc/ti-st/st_kim.c +clean_blob drivers/misc/ti-st/st_kim.c +clean_kconfig drivers/misc/ti-st/Kconfig 'TI_ST' +clean_mk CONFIG_TI_ST drivers/misc/ti-st/Makefile + +# wimax + +announce WIMAX_I2400M - "Intel Wireless WiMAX Connection 2400" +reject_firmware drivers/net/wimax/i2400m/fw.c +clean_blob drivers/net/wimax/i2400m/usb.c +clean_blob Documentation/wimax/README.i2400m +clean_kconfig drivers/net/wimax/i2400m/Kconfig 'WIMAX_I2400M' +clean_mk CONFIG_WIMAX_I2400M drivers/net/wimax/i2400m/Makefile + +announce BCM_WIMAX - "Beceem BCS200/BCS220-3 and BCSM250 wimax support" +clean_blob drivers/staging/bcm/Macros.h +# This disables loading of the .cfg file as well, but it's useless without +# the firmware proper. +clean_sed ' +/^static \(inline \)\?struct file \*open_firmware_file/,/^}$/ { + s,\(flp *= *\)filp_open[^;]*,\1/*(DEBLOBBED)*/(void*)-ENOENT, +}' drivers/staging/bcm/Misc.c 'disabled non-Free firmware loading machinery' +clean_kconfig drivers/staging/bcm/Kconfig 'BCM_WIMAX' +clean_mk CONFIG_BCM_WIMAX drivers/staging/bcm/Makefile + +announce WIMAX_GDM72XX_SDIO - "GCT GDM72xx WiMAX support: SDIO interface" +clean_sed ' +/^static int download_image/,/^}/ { + /filp = filp_open/ s,filp = .*;,/*(DEBLOBBED)*/, + s,if (IS_ERR(filp)),if (1 /*(DEBLOBBED)*/), +}' drivers/staging/gdm72xx/sdio_boot.c \ + 'disabled non-Free firmware loading machinery' +clean_blob drivers/staging/gdm72xx/sdio_boot.c +clean_kconfig drivers/staging/gdm72xx/Kconfig 'WIMAX_GDM72XX_SDIO' +clean_mk CONFIG_WIMAX_GDM72XX_SDIO drivers/staging/gdm72xx/Makefile + +announce WIMAX_GDM72XX_USB - "GCT GDM72xx WiMAX support: USB interface" +reject_firmware drivers/staging/gdm72xx/usb_boot.c +clean_blob drivers/staging/gdm72xx/usb_boot.c +clean_kconfig drivers/staging/gdm72xx/Kconfig 'WIMAX_GDM72XX_USB' +clean_mk CONFIG_WIMAX_GDM72XX_USB drivers/staging/gdm72xx/Makefile + +# infiniband + +announce INFINIBAND_QIB - "QLogic PCIe HCA support" +drop_fw_file firmware/qlogic/sd7220.fw.ihex firmware/qlogic/sd7220.fw +reject_firmware drivers/infiniband/hw/qib/qib_sd7220.c +clean_blob drivers/infiniband/hw/qib/qib_sd7220.c +clean_kconfig drivers/infiniband/hw/qib/Kconfig 'INFINIBAND_QIB' +clean_mk CONFIG_INFINIBAND_QIB drivers/infiniband/hw/qib/Makefile + +# CAN + +announce CAN_SOFTING - "Softing Gmbh CAN generic support" +reject_firmware drivers/net/can/softing/softing_fw.c +clean_kconfig drivers/net/can/softing/Kconfig 'CAN_SOFTING' +clean_mk CONFIG_CAN_SOFTING drivers/net/can/softing/Makefile + +announce CAN_SOFTING_CS - "Softing Gmbh CAN pcmcia cards" +clean_blob drivers/net/can/softing/softing_cs.c +clean_blob drivers/net/can/softing/softing_platform.h +clean_sed ' +/^config CAN_SOFTING_CS$/,${ + /You need firmware/i\ + /*(DEBLOBBED)*/ + /You need firmware/,/softing-fw.*tar\.gz/d +}' drivers/net/can/softing/Kconfig 'removed firmware notes' +clean_kconfig drivers/net/can/softing/Kconfig 'CAN_SOFTING_CS' +clean_mk CONFIG_CAN_SOFTING_CS drivers/net/can/softing/Makefile + +######## +# ISDN # +######## + +announce ISDN_DIVAS - "Support Eicon DIVA Server cards" +clean_blob drivers/isdn/hardware/eicon/cardtype.h +clean_blob drivers/isdn/hardware/eicon/dsp_defs.h +clean_kconfig drivers/isdn/hardware/eicon/Kconfig 'ISDN_DIVAS' +clean_mk CONFIG_ISDN_DIVAS drivers/isdn/hardware/eicon/Makefile + +announce MISDN_SPEEDFAX - "Support for Sedlbauer Speedfax+" +reject_firmware drivers/isdn/hardware/mISDN/speedfax.c +clean_blob drivers/isdn/hardware/mISDN/speedfax.c +clean_kconfig drivers/isdn/hardware/mISDN/Kconfig 'MISDN_SPEEDFAX' +clean_mk CONFIG_MISDN_SPEEDFAX drivers/isdn/hardware/mISDN/Makefile + +########## +# Serial # +########## + +announce SERIAL_8250_CS - "8250/16550 PCMCIA device support" +# These are not software; they're Free, but GPLed without in-tree sources. +drop_fw_file firmware/cis/MT5634ZLX.cis.ihex firmware/cis/MT5634ZLX.cis +drop_fw_file firmware/cis/RS-COM-2P.cis.ihex firmware/cis/RS-COM-2P.cis +drop_fw_file firmware/cis/COMpad2.cis.ihex firmware/cis/COMpad2.cis +drop_fw_file firmware/cis/COMpad4.cis.ihex firmware/cis/COMpad4.cis +# These are not software; they're Free, but GPLed without textual sources. +# It could be assumed that these binaries *are* sources, since they +# can be trivially converted back to a textual form, without loss, +# but we're better off safe than sorry, so remove them from our tree. +drop_fw_file firmware/cis/SW_555_SER.cis.ihex firmware/cis/SW_555_SER.cis +drop_fw_file firmware/cis/SW_7xx_SER.cis.ihex firmware/cis/SW_7xx_SER.cis +drop_fw_file firmware/cis/SW_8xx_SER.cis.ihex firmware/cis/SW_8xx_SER.cis +# clean_blob drivers/tty/serial/serial_cs.c +# clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_8250_CS' +# clean_mk CONFIG_SERIAL_8250_CS drivers/tty/serial/Makefile + +announce SERIAL_ICOM - "IBM Multiport Serial Adapter" +reject_firmware drivers/tty/serial/icom.c +clean_blob drivers/tty/serial/icom.c +clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_ICOM' +clean_mk CONFIG_SERIAL_ICOM drivers/tty/serial/Makefile + +announce SERIAL_QE - "Freescale QUICC Engine serial port support" +reject_firmware drivers/tty/serial/ucc_uart.c +clean_blob drivers/tty/serial/ucc_uart.c +clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_QE' +clean_mk CONFIG_SERIAL_QE drivers/tty/serial/Makefile + +######### +# input # +######### + +announce TOUCHSCREEN_ATMEL_MXT - "Atmel mXT I2C Touchscreen" +reject_firmware drivers/input/touchscreen/atmel_mxt_ts.c +clean_blob drivers/input/touchscreen/atmel_mxt_ts.c +clean_kconfig drivers/input/touchscreen/Kconfig 'TOUCHSCREEN_ATMEL_MXT' +clean_mk CONFIG_TOUCHSCREEN_ATMEL_MXT drivers/input/touchscreen/Makefile + +announce LIRC_ZILOG - "Zilog/Hauppauge IR Transmitter" +reject_firmware drivers/staging/media/lirc/lirc_zilog.c +clean_blob drivers/staging/media/lirc/lirc_zilog.c +clean_kconfig drivers/staging/media/lirc/Kconfig 'LIRC_ZILOG' +clean_mk CONFIG_LIRC_ZILOG drivers/staging/media/lirc/Makefile + +#################### +# Data acquisition # +#################### + +announce COMEDI_DAQBOARD2000 - "IOtech DAQboard/2000 support" +reject_firmware drivers/staging/comedi/drivers/daqboard2000.c +clean_blob drivers/staging/comedi/drivers/daqboard2000.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_DAQBOARD2000' +clean_mk CONFIG_COMEDI_DAQBOARD2000 drivers/staging/comedi/drivers/Makefile + +announce COMEDI_JR3_PCI - "JR3/PCI force sensor board support" +reject_firmware drivers/staging/comedi/drivers/jr3_pci.c +clean_blob drivers/staging/comedi/drivers/jr3_pci.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_JR3_PCI' +clean_mk CONFIG_COMEDI_JR3_PCI drivers/staging/comedi/drivers/Makefile + +announce COMEDI_ME_DAQ - "Meilhaus ME-2000i, ME-2600i, ME-3000vm1 support" +reject_firmware drivers/staging/comedi/drivers/me_daq.c +clean_blob drivers/staging/comedi/drivers/me_daq.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_ME_DAQ' +clean_mk CONFIG_COMEDI_ME_DAQ drivers/staging/comedi/drivers/Makefile + +announce COMEDI_NI_PCIDIO - "NI PCI-DIO32HS, PCI-6533, PCI-6534 support" +reject_firmware drivers/staging/comedi/drivers/ni_pcidio.c +clean_blob drivers/staging/comedi/drivers/ni_pcidio.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_NI_PCIDIO' +clean_mk CONFIG_COMEDI_NI_PCIDIO drivers/staging/comedi/drivers/Makefile + +announce COMEDI_USBDUX - "ITL USBDUX support" +reject_firmware drivers/staging/comedi/drivers/usbdux.c +clean_blob drivers/staging/comedi/drivers/usbdux.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUX' +clean_mk CONFIG_COMEDI_USBDUX drivers/staging/comedi/drivers/Makefile + +announce COMEDI_USBDUXFAST - "ITL USB-DUXfast support" +reject_firmware drivers/staging/comedi/drivers/usbduxfast.c +clean_blob drivers/staging/comedi/drivers/usbduxfast.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUXFAST' +clean_mk CONFIG_COMEDI_USBDUXFAST drivers/staging/comedi/drivers/Makefile + +announce COMEDI_USBDUXSIGMA - "ITL USB-DUXsigma support" +reject_firmware drivers/staging/comedi/drivers/usbduxsigma.c +clean_blob drivers/staging/comedi/drivers/usbduxsigma.c +clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUXSIGMA' +clean_mk CONFIG_COMEDI_USBDUXSIGMA drivers/staging/comedi/drivers/Makefile + + +####### +# MMC # +####### + +announce MMC_VUB300 - "VUB300 USB to SDIO/SD/MMC Host Controller support" +clean_sed ' +/^config MMC_VUB300/,/^config /{ + /Some SDIO cards/i\ + /*(DEBLOBBED)*/ + /Some SDIO cards/,/obtainable data rate\.$/d +} +' drivers/mmc/host/Kconfig "removed firmware notes" +reject_firmware drivers/mmc/host/vub300.c +clean_blob drivers/mmc/host/vub300.c +clean_kconfig drivers/mmc/host/Kconfig 'MMC_VUB300' +clean_mk CONFIG_MMC_VUB300 drivers/mmc/host/Makefile + +######## +# SCSI # +######## + +announce SCSI_QLOGICPTI - "PTI Qlogic, ISP Driver" +drop_fw_file firmware/qlogic/isp1000.bin.ihex firmware/qlogic/isp1000.bin +reject_firmware drivers/scsi/qlogicpti.c +clean_blob drivers/scsi/qlogicpti.c +clean_kconfig drivers/scsi/Kconfig 'SCSI_QLOGICPTI' +clean_mk CONFIG_SCSI_QLOGICPTI drivers/scsi/Makefile + +announce SCSI_ADVANSYS - "AdvanSys SCSI" +drop_fw_file firmware/advansys/mcode.bin.ihex firmware/advansys/mcode.bin +drop_fw_file firmware/advansys/3550.bin.ihex firmware/advansys/3550.bin +drop_fw_file firmware/advansys/38C0800.bin.ihex firmware/advansys/38C0800.bin +drop_fw_file firmware/advansys/38C1600.bin.ihex firmware/advansys/38C1600.bin +reject_firmware drivers/scsi/advansys.c +clean_blob drivers/scsi/advansys.c +clean_kconfig drivers/scsi/Kconfig 'SCSI_ADVANSYS' +clean_mk CONFIG_SCSI_ADVANSYS drivers/scsi/Makefile + +announce SCSI_QLOGIC_1280 - "Qlogic QLA 1240/1x80/1x160 SCSI" +drop_fw_file firmware/qlogic/1040.bin.ihex firmware/qlogic/1040.bin +drop_fw_file firmware/qlogic/1280.bin.ihex firmware/qlogic/1280.bin +drop_fw_file firmware/qlogic/12160.bin.ihex firmware/qlogic/12160.bin +reject_firmware drivers/scsi/qla1280.c +clean_blob drivers/scsi/qla1280.c +clean_kconfig drivers/scsi/Kconfig 'SCSI_QLOGIC_1280' +clean_mk CONFIG_SCSI_QLOGIC_1280 drivers/scsi/Makefile + +announce SCSI_AIC94XX - "Adaptec AIC94xx SAS/SATA support" +reject_firmware drivers/scsi/aic94xx/aic94xx_seq.c +clean_blob drivers/scsi/aic94xx/aic94xx_seq.c +clean_blob drivers/scsi/aic94xx/aic94xx_seq.h +clean_kconfig drivers/scsi/aic94xx/Kconfig 'SCSI_AIC94XX' +clean_mk CONFIG_SCSI_AIC94XX drivers/scsi/aic94xx/Makefile + +announce SCSI_BFA_FC - "Brocade BFA Fibre Channel Support" +reject_firmware drivers/scsi/bfa/bfad.c +clean_blob drivers/scsi/bfa/bfad.c +clean_kconfig drivers/scsi/Kconfig 'SCSI_BFA_FC' +clean_mk CONFIG_SCSI_BFA_FC drivers/scsi/bfa/Makefile + +announce SCSI_LPFC - "Emulex LightPulse Fibre Channel Support" +# The firmware name is built out of Vital Product Data read from the +# adapter. The firmware is definitely code, and I couldn't find +# evidence it is Free, so I'm disabling it. It's not clear whether +# this is the hardware or the software inducing to the installation of +# non-Free firmware. +reject_firmware drivers/scsi/lpfc/lpfc_init.c +clean_kconfig drivers/scsi/Kconfig 'SCSI_LPFC' +clean_mk CONFIG_SCSI_LPFC drivers/scsi/lpfc/Makefile + +announce SCSI_QLA_FC - "QLogic QLA2XXX Fibre Channel Support" +reject_firmware drivers/scsi/qla2xxx/qla_gbl.h +reject_firmware drivers/scsi/qla2xxx/qla_init.c +reject_firmware drivers/scsi/qla2xxx/qla_os.c +reject_firmware drivers/scsi/qla2xxx/qla_nx.c +clean_sed ' +/^config SCSI_QLA_FC$/,/^config /{ + /^ By default, firmware/i\ + /*(DEBLOBBED)*/ + /^ By default, firmware/,/ftp:[/][/].*firmware[/]/d +}' drivers/scsi/qla2xxx/Kconfig 'removed firmware notes' +clean_blob drivers/scsi/qla2xxx/qla_os.c +clean_kconfig drivers/scsi/qla2xxx/Kconfig 'SCSI_QLA_FC' +clean_mk CONFIG_SCSI_QLA_FC drivers/scsi/qla2xxx/Makefile + + +####### +# USB # +####### + +# atm + +announce USB_CXACRU - "Conexant AccessRunner USB support" +reject_firmware drivers/usb/atm/cxacru.c +clean_blob drivers/usb/atm/cxacru.c +clean_kconfig drivers/usb/atm/Kconfig 'USB_CXACRU' +clean_mk CONFIG_USB_CXACRU drivers/usb/atm/Makefile + +announce USB_SPEEDTOUCH - "Speedtouch USB support" +reject_firmware drivers/usb/atm/speedtch.c +clean_blob drivers/usb/atm/speedtch.c +clean_kconfig drivers/usb/atm/Kconfig 'USB_SPEEDTOUCH' +clean_mk CONFIG_USB_SPEEDTOUCH drivers/usb/atm/Makefile + +announce USB_UEAGLEATM - "ADI 930 and eagle USB DSL modem" +reject_firmware drivers/usb/atm/ueagle-atm.c +clean_blob drivers/usb/atm/ueagle-atm.c +clean_kconfig drivers/usb/atm/Kconfig 'USB_UEAGLEATM' +clean_mk CONFIG_USB_UEAGLEATM drivers/usb/atm/Makefile + +# misc + +announce USB_EMI26 - "EMI 2|6 USB Audio interface" +# These files are not under the GPL, better remove them all. +drop_fw_file firmware/emi26/bitstream.HEX firmware/emi26/bitstream.fw +drop_fw_file firmware/emi26/firmware.HEX firmware/emi26/firmware.fw +drop_fw_file firmware/emi26/loader.HEX firmware/emi26/loader.fw +reject_firmware drivers/usb/misc/emi26.c +clean_blob drivers/usb/misc/emi26.c +clean_kconfig drivers/usb/misc/Kconfig 'USB_EMI26' +clean_mk CONFIG_USB_EMI26 drivers/usb/misc/Makefile + +announce USB_EMI62 - "EMI 6|2m USB Audio interface" +# These files are probably not under the GPL, better remove them all. +drop_fw_file firmware/emi62/bitstream.HEX firmware/emi62/bitstream.fw +drop_fw_file firmware/emi62/loader.HEX firmware/emi62/loader.fw +drop_fw_file firmware/emi62/midi.HEX firmware/emi62/midi.fw +drop_fw_file firmware/emi62/spdif.HEX firmware/emi62/spdif.fw +reject_firmware drivers/usb/misc/emi62.c +clean_blob drivers/usb/misc/emi62.c +clean_kconfig drivers/usb/misc/Kconfig 'USB_EMI62' +clean_mk CONFIG_USB_EMI62 drivers/usb/misc/Makefile + +announce USB_EZUSB_FX2 - "Functions for loading firmware on EZUSB chips" +maybe_reject_firmware drivers/usb/misc/ezusb.c + +announce USB_ISIGHTFW - "iSight firmware loading support" +reject_firmware drivers/usb/misc/isight_firmware.c +clean_blob drivers/usb/misc/isight_firmware.c +clean_kconfig drivers/usb/misc/Kconfig 'USB_ISIGHTFW' +clean_mk CONFIG_USB_ISIGHTFW drivers/usb/misc/Makefile + +# storage + +announce USB_STORAGE_ENE_UB6250 - "USB ENE card reader support" +reject_firmware drivers/usb/storage/ene_ub6250.c +clean_blob drivers/usb/storage/ene_ub6250.c +clean_kconfig drivers/usb/storage/Kconfig 'USB_STORAGE_ENE_UB6250' +clean_mk 'CONFIG_USB_STORAGE_ENE_UB6250' drivers/usb/storage/Makefile + +announce USB_ENESTORAGE - "USB ENE card reader support" +clean_blob drivers/staging/keucr/init.h +clean_sed ' +/^int ENE_LoadBinCode(/,/^}$/ { + /kmalloc/i\ + return /*(DEBLOBBED)*/ USB_STOR_TRANSPORT_ERROR; +} +' drivers/staging/keucr/init.c 'disable non-Free firmware loading machinery' +clean_kconfig drivers/staging/keucr/Kconfig 'USB_ENESTORAGE' +clean_mk 'CONFIG_USB_ENESTORAGE' drivers/staging/keucr/Makefile + +# serial + +announce USB_SERIAL_KEYSPAN - "USB Keyspan USA-xxx Serial Driver" +drop_fw_file firmware/keyspan/mpr.HEX firmware/keyspan/mpr.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_MPR' +drop_fw_file firmware/keyspan/usa18x.HEX firmware/keyspan/usa18x.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA18X' +drop_fw_file firmware/keyspan/usa19.HEX firmware/keyspan/usa19.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19' +drop_fw_file firmware/keyspan/usa19qi.HEX firmware/keyspan/usa19qi.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19QI' +drop_fw_file firmware/keyspan/usa19qw.HEX firmware/keyspan/usa19qw.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19QW' +drop_fw_file firmware/keyspan/usa19w.HEX firmware/keyspan/usa19w.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19W' +drop_fw_file firmware/keyspan/usa28.HEX firmware/keyspan/usa28.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28' +drop_fw_file firmware/keyspan/usa28xa.HEX firmware/keyspan/usa28xa.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28XA' +drop_fw_file firmware/keyspan/usa28xb.HEX firmware/keyspan/usa28xb.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28XB' +drop_fw_file firmware/keyspan/usa28x.HEX firmware/keyspan/usa28x.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28X' +drop_fw_file firmware/keyspan/usa49w.HEX firmware/keyspan/usa49w.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA49W' +drop_fw_file firmware/keyspan/usa49wlc.HEX firmware/keyspan/usa49wlc.fw +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA49WLC' +clean_blob drivers/usb/serial/keyspan.c +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN' +clean_mk CONFIG_USB_SERIAL_KEYSPAN drivers/usb/serial/Makefile + +announce USB_SERIAL_EDGEPORT - "USB Inside Out Edgeport Serial Driver" +clean_fw firmware/edgeport/boot.H16 firmware/edgeport/boot.fw +clean_fw firmware/edgeport/boot2.H16 firmware/edgeport/boot2.fw +clean_fw firmware/edgeport/down.H16 firmware/edgeport/down.fw +clean_fw firmware/edgeport/down2.H16 firmware/edgeport/down2.fw +reject_firmware drivers/usb/serial/io_edgeport.c +clean_blob drivers/usb/serial/io_edgeport.c +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_EDGEPORT' +clean_mk CONFIG_USB_SERIAL_EDGEPORT drivers/usb/serial/Makefile + +announce USB_SERIAL_EDGEPORT_TI - "USB Inside Out Edgeport Serial Driver (TI devices)" +clean_fw firmware/edgeport/down3.bin.ihex firmware/edgeport/down3.bin +reject_firmware drivers/usb/serial/io_ti.c +clean_blob drivers/usb/serial/io_ti.c +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_EDGEPORT_TI' +clean_mk CONFIG_USB_SERIAL_EDGEPORT_TI drivers/usb/serial/Makefile + +announce USB_SERIAL_TI - "USB TI 3410/5052 Serial Driver" +drop_fw_file firmware/ti_3410.fw.ihex firmware/ti_3410.fw +drop_fw_file firmware/ti_5052.fw.ihex firmware/ti_5052.fw +drop_fw_file firmware/mts_cdma.fw.ihex firmware/mts_cdma.fw +drop_fw_file firmware/mts_gsm.fw.ihex firmware/mts_gsm.fw +drop_fw_file firmware/mts_edge.fw.ihex firmware/mts_edge.fw +reject_firmware drivers/usb/serial/ti_usb_3410_5052.c +clean_blob drivers/usb/serial/ti_usb_3410_5052.c +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_TI' +clean_mk CONFIG_USB_SERIAL_TI drivers/usb/serial/Makefile + +announce USB_SERIAL_WHITEHEAT - "USB ConnectTech WhiteHEAT Serial Driver" +clean_fw firmware/whiteheat.HEX firmware/whiteheat.fw +clean_fw firmware/whiteheat_loader.HEX firmware/whiteheat_loader.fw +clean_fw firmware/whiteheat_loader_debug.HEX firmware/whiteheat_loader_debug.fw +clean_blob drivers/usb/serial/whiteheat.c +clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_WHITEHEAT' +clean_mk CONFIG_USB_SERIAL_WHITEHEAT drivers/usb/serial/Makefile + +# uwb + +announce UWB_I1480U - Support for Intel Wireless UWB Link 1480 HWA +reject_firmware drivers/uwb/i1480/dfu/i1480-dfu.h +reject_firmware drivers/uwb/i1480/dfu/mac.c +reject_firmware drivers/uwb/i1480/dfu/phy.c +clean_blob drivers/uwb/i1480/dfu/usb.c +clean_kconfig drivers/uwb/Kconfig 'UWB_I1480U' +clean_mk CONFIG_UWB_I1480U drivers/uwb/i1480/dfu/Makefile + + + +############## +# RemoteProc # +############## + +announce STE_MODEM_RPROC - "STE-Modem remoteproc support" +maybe_reject_firmware drivers/remoteproc/remoteproc_core.c +undefine_macro SPROC_MODEM_FIRMWARE "\"/*(DEBLOBBED)*/\"" \ + "disabled non-Free firmware" drivers/remoteproc/ste_modem_rproc.c +clean_kconfig drivers/remoteproc/Kconfig 'STE_MODEM_RPROC' +clean_mk CONFIG_STE_MODEM_RPROC drivers/remoteproc/Makefile + + +######### +# Sound # +######### + +announce SND_ASIHPI - "AudioScience ASIxxxx" +reject_firmware sound/pci/asihpi/hpidspcd.c +clean_blob sound/pci/asihpi/hpidspcd.c +clean_blob sound/pci/asihpi/hpioctl.c +clean_kconfig sound/pci/Kconfig 'SND_ASIHPI' +clean_mk CONFIG_SND_ASIHPI sound/pci/asihpi/Makefile + +announce SND_CS46XX - "Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x" +# This appears to have been extracted from some non-Free driver +clean_file sound/pci/cs46xx/cs46xx_image.h +# The following blobs are definitely extracted from non-Free drivers. +clean_file sound/pci/cs46xx/imgs/cwc4630.h +clean_file sound/pci/cs46xx/imgs/cwcasync.h +clean_file sound/pci/cs46xx/imgs/cwcsnoop.h +clean_sed ' +/^\(int \)\?snd_cs46xx_download_image([^;]*$/,/^}$/{ + /for.*BA1_MEMORY_COUNT/i\ +#if 0 + /^}$/{ + i\ +#else\ + snd_printk(KERN_ERR "cs46xx: Missing Free firmware\\n");\ + return -EINVAL;\ +#endif + } +} +s/cs46xx_dsp_load_module(chip, [&]cwc\(4630\|async\|snoop\)_module)/(snd_printk(KERN_ERR "cs46xx: Missing Free firmware\\n"),-EINVAL)/ +' sound/pci/cs46xx/cs46xx_lib.c 'report missing Free firmware' +clean_blob sound/pci/cs46xx/cs46xx_lib.c +clean_kconfig sound/pci/Kconfig 'SND_CS46XX' +clean_mk 'CONFIG_SND_CS46XX' sound/pci/cs46xx/Makefile + +announce SND_KORG1212 - "Korg 1212 IO" +drop_fw_file firmware/korg/k1212.dsp.ihex firmware/korg/k1212.dsp +reject_firmware sound/pci/korg1212/korg1212.c +clean_blob sound/pci/korg1212/korg1212.c +clean_kconfig sound/pci/Kconfig 'SND_KORG1212' +clean_mk 'CONFIG_SND_KORG1212' sound/pci/korg1212/Makefile + +announce SND_MAESTRO3 - "ESS Allegro/Maestro3" +drop_fw_file firmware/ess/maestro3_assp_kernel.fw.ihex firmware/ess/maestro3_assp_kernel.fw +drop_fw_file firmware/ess/maestro3_assp_minisrc.fw.ihex firmware/ess/maestro3_assp_minisrc.fw +reject_firmware sound/pci/maestro3.c +clean_blob sound/pci/maestro3.c +clean_kconfig sound/pci/Kconfig 'SND_MAESTRO3' +clean_mk 'CONFIG_SND_MAESTRO3' sound/pci/Makefile + +announce SND_YMFPCI - "Yamaha YMF724/740/744/754" +drop_fw_file firmware/yamaha/ds1_ctrl.fw.ihex firmware/yamaha/ds1_ctrl.fw +drop_fw_file firmware/yamaha/ds1_dsp.fw.ihex firmware/yamaha/ds1_dsp.fw +drop_fw_file firmware/yamaha/ds1e_ctrl.fw.ihex firmware/yamaha/ds1e_ctrl.fw +reject_firmware sound/pci/ymfpci/ymfpci_main.c +clean_blob sound/pci/ymfpci/ymfpci_main.c +clean_kconfig sound/pci/Kconfig 'SND_YMFPCI' +clean_mk 'CONFIG_SND_YMFPCI' sound/pci/ymfpci/Makefile + +announce SND_SB16_CSP - "SB16 Advanced Signal Processor" +drop_fw_file firmware/sb16/alaw_main.csp.ihex firmware/sb16/alaw_main.csp +drop_fw_file firmware/sb16/mulaw_main.csp.ihex firmware/sb16/mulaw_main.csp +drop_fw_file firmware/sb16/ima_adpcm_init.csp.ihex firmware/sb16/ima_adpcm_init.csp +drop_fw_file firmware/sb16/ima_adpcm_capture.csp.ihex firmware/sb16/ima_adpcm_capture.csp +drop_fw_file firmware/sb16/ima_adpcm_playback.csp.ihex firmware/sb16/ima_adpcm_playback.csp +reject_firmware sound/isa/sb/sb16_csp.c +clean_blob sound/isa/sb/sb16_csp.c +clean_kconfig sound/isa/Kconfig 'SND_SB16_CSP' +clean_mk 'CONFIG_SND_SB16_CSP' sound/isa/sb/Makefile + +announce SND_WAVEFRONT - "Turtle Beach Maui,Tropez,Tropez+ (Wavefront)" +drop_fw_file firmware/yamaha/yss225_registers.bin.ihex firmware/yamaha/yss225_registers.bin +reject_firmware sound/isa/wavefront/wavefront_fx.c +clean_blob sound/isa/wavefront/wavefront_fx.c +reject_firmware sound/isa/wavefront/wavefront_synth.c +clean_blob sound/isa/wavefront/wavefront_synth.c +clean_kconfig sound/isa/Kconfig 'SND_WAVEFRONT' +clean_mk 'CONFIG_SND_WAVEFRONT' sound/isa/wavefront/Makefile + +announce SND_VX_LIB - Digigram VX soundcards +reject_firmware sound/drivers/vx/vx_hwdep.c +clean_blob sound/drivers/vx/vx_hwdep.c +clean_kconfig sound/drivers/Kconfig 'SND_VX_LIB' +clean_mk CONFIG_SND_VX_LIB sound/drivers/vx/Makefile + +announce SND_DARLA20 - "(Echoaudio) Darla20" +clean_blob sound/pci/echoaudio/darla20.c +clean_kconfig sound/pci/Kconfig 'SND_DARLA20' +clean_mk CONFIG_SND_DARLA20 sound/pci/echoaudio/Makefile + +announce SND_DARLA24 - "(Echoaudio) Darla24" +clean_blob sound/pci/echoaudio/darla24.c +clean_kconfig sound/pci/Kconfig 'SND_DARLA24' +clean_mk CONFIG_SND_DARLA24 sound/pci/echoaudio/Makefile + +announce SND_ECHO3G - "(Echoaudio) 3G cards" +clean_blob sound/pci/echoaudio/echo3g.c +clean_kconfig sound/pci/Kconfig 'SND_ECHO3G' +clean_mk CONFIG_SND_ECHO3G sound/pci/echoaudio/Makefile + +announce SND_GINA20 - "(Echoaudio) Gina20" +clean_blob sound/pci/echoaudio/gina20.c +clean_kconfig sound/pci/Kconfig 'SND_GINA20' +clean_mk CONFIG_SND_GINA20 sound/pci/echoaudio/Makefile + +announce SND_GINA24 - "(Echoaudio) Gina24" +clean_blob sound/pci/echoaudio/gina24.c +clean_kconfig sound/pci/Kconfig 'SND_GINA24' +clean_mk CONFIG_SND_GINA24 sound/pci/echoaudio/Makefile + +announce SND_INDIGO - "(Echoaudio) Indigo" +clean_blob sound/pci/echoaudio/indigo.c +clean_kconfig sound/pci/Kconfig 'SND_INDIGO' +clean_mk CONFIG_SND_INDIGO sound/pci/echoaudio/Makefile + +announce SND_INDIGODJ - "(Echoaudio) Indigo DJ" +clean_blob sound/pci/echoaudio/indigodj.c +clean_kconfig sound/pci/Kconfig 'SND_INDIGODJ' +clean_mk CONFIG_SND_INDIGODJ sound/pci/echoaudio/Makefile + +announce SND_INDIGODJX - "(Echoaudio) Indigo DJx" +clean_blob sound/pci/echoaudio/indigodjx.c +clean_kconfig sound/pci/Kconfig 'SND_INDIGODJX' +clean_mk CONFIG_SND_INDIGODJX sound/pci/echoaudio/Makefile + +announce SND_INDIGOIO - "(Echoaudio) Indigo IO" +clean_blob sound/pci/echoaudio/indigoio.c +clean_kconfig sound/pci/Kconfig 'SND_INDIGOIO' +clean_mk CONFIG_SND_INDIGOIO sound/pci/echoaudio/Makefile + +announce SND_INDIGOIOX - "(Echoaudio) Indigo IOx" +clean_blob sound/pci/echoaudio/indigoiox.c +clean_kconfig sound/pci/Kconfig 'SND_INDIGOIOX' +clean_mk CONFIG_SND_INDIGOIOX sound/pci/echoaudio/Makefile + +announce SND_LAYLA20 - "(Echoaudio) Layla20" +clean_blob sound/pci/echoaudio/layla20.c +clean_kconfig sound/pci/Kconfig 'SND_LAYLA20' +clean_mk CONFIG_SND_LAYLA20 sound/pci/echoaudio/Makefile + +announce SND_LAYLA24 - "(Echoaudio) Layla24" +clean_blob sound/pci/echoaudio/layla24.c +clean_kconfig sound/pci/Kconfig 'SND_LAYLA24' +clean_mk CONFIG_SND_LAYLA24 sound/pci/echoaudio/Makefile + +announce SND_MIA - "(Echoaudio) Mia" +clean_blob sound/pci/echoaudio/mia.c +clean_kconfig sound/pci/Kconfig 'SND_MIA' +clean_mk CONFIG_SND_MIA sound/pci/echoaudio/Makefile + +announce SND_MONA - "(Echoaudio) Mona" +clean_blob sound/pci/echoaudio/mona.c +clean_kconfig sound/pci/Kconfig 'SND_MONA' +clean_mk CONFIG_SND_MONA sound/pci/echoaudio/Makefile + +announce SND_'<(Echoaudio)>' - "(Echoaudio) all of the above " +reject_firmware sound/pci/echoaudio/echoaudio.c +clean_blob sound/pci/echoaudio/echoaudio.c + +announce SND_EMU10K1 - "Emu10k1 (SB Live!, Audigy, E-mu APS)" +reject_firmware sound/pci/emu10k1/emu10k1_main.c +clean_blob sound/pci/emu10k1/emu10k1_main.c +clean_kconfig sound/pci/Kconfig 'SND_EMU10K1' +clean_mk CONFIG_SND_EMU10K1 sound/pci/emu10k1/Makefile + +announce SND_MIXART - "Digigram miXart" +reject_firmware sound/pci/mixart/mixart_hwdep.c +clean_blob sound/pci/mixart/mixart_hwdep.c +clean_kconfig sound/pci/Kconfig 'SND_MIXART' +clean_mk CONFIG_SND_MIXART sound/pci/mixart/Makefile + +announce SND_PCXHR - "Digigram PCXHR" +reject_firmware sound/pci/pcxhr/pcxhr_hwdep.c +clean_blob sound/pci/pcxhr/pcxhr_hwdep.c +clean_kconfig sound/pci/Kconfig 'SND_PCXHR' +clean_mk CONFIG_SND_PCXHR sound/pci/pcxhr/Makefile + +announce SND_RIPTIDE - "Conexant Riptide" +reject_firmware sound/pci/riptide/riptide.c +clean_blob sound/pci/riptide/riptide.c +clean_kconfig sound/pci/Kconfig 'SND_RIPTIDE' +clean_mk CONFIG_SND_RIPTIDE sound/pci/riptide/Makefile + +# This is ok, patch filenames are supplied as module parameters, and +# they are text files with patch instructions. +#announce SND_HDA_PATCH_LOADER - "Support initialization patch loading for HD-audio" +#reject_firmware sound/pci/hda/hda_hwdep.c +#clean_kconfig sound/pci/hda/Kconfig 'SND_HDA_PATCH_LOADER' + +announce SND_HDSP - "RME Hammerfall DSP Audio" +reject_firmware sound/pci/rme9652/hdsp.c +clean_blob sound/pci/rme9652/hdsp.c +clean_kconfig sound/pci/Kconfig 'SND_HDSP' +clean_mk CONFIG_SND_HDSP sound/pci/rme9652/Makefile + +announce SND_AICA - "Dreamcast Yamaha AICA sound" +reject_firmware sound/sh/aica.c +clean_blob sound/sh/aica.c +clean_kconfig sound/sh/Kconfig 'SND_AICA' +clean_mk CONFIG_SND_AICA sound/sh/Makefile + +announce SND_MSND_PINNACLE - "Support for Turtle Beach MultiSound Pinnacle" +clean_blob sound/isa/msnd/msnd_pinnacle.h +reject_firmware sound/isa/msnd/msnd_pinnacle.c +clean_blob sound/isa/msnd/msnd_pinnacle.c +clean_kconfig sound/isa/Kconfig 'SND_MSND_PINNACLE' +clean_mk CONFIG_SND_MSND_PINNACLE sound/isa/msnd/Makefile + +announce SND_MSND_CLASSIC - "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey" +clean_blob sound/isa/msnd/msnd_classic.h +clean_kconfig sound/isa/Kconfig 'SND_MSND_CLASSIC' +clean_mk CONFIG_SND_MSND_CLASSIC sound/isa/msnd/Makefile + +announce SOUND_MSNDCLAS - "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey (oss)" +clean_blob sound/oss/msnd_classic.h +clean_kconfig sound/oss/Kconfig 'SOUND_MSNDCLAS' +clean_sed ' +/^config MSNDCLAS_INIT_FILE$/, /^config / { + /^ default.*msndinit\.bin/ s,".*","/*(DEBLOBBED)*/",; +} +/^config MSNDCLAS_PERM_FILE$/, /^config / { + /^ default.*msndperm\.bin/ s,".*","/*(DEBLOBBED)*/",; +}' sound/oss/Kconfig 'removed default firmware' +clean_mk CONFIG_SOUND_MSNDCLAS sound/oss/Makefile + +announce SOUND_MSNDPIN - "Support for Turtle Beach MultiSound Pinnacle (oss)" +clean_blob sound/oss/msnd_pinnacle.h +clean_kconfig sound/oss/Kconfig 'SOUND_MSNDPIN' +clean_sed ' +/^config MSNDPIN_INIT_FILE$/, /^config / { + /^ default.*pndspini\.bin/ s,".*","/*(DEBLOBBED)*/",; +} +/^config MSNDPIN_PERM_FILE$/, /^config / { + /^ default.*pndsperm\.bin/ s,".*","/*(DEBLOBBED)*/",; +}' sound/oss/Kconfig 'removed default firmware' +clean_mk CONFIG_SOUND_MSNDPIN sound/oss/Makefile + +announce SND_SSCAPE - "Ensoniq SoundScape driver" +reject_firmware sound/isa/sscape.c +clean_blob sound/isa/sscape.c +clean_sed ' +/^config SND_SSCAPE$/, /^config / { + s,"\(scope\|sndscape\)\.co[d?]","/*(DEBLOBBED)*/",g; +}' sound/isa/Kconfig 'removed firmware names' +clean_kconfig sound/isa/Kconfig 'SND_SSCAPE' +clean_mk CONFIG_SND_SSCAPE sound/isa/Makefile + +announce SND_SOC_ADAU1701 - "ADAU1701 SigmaDSP processor" +clean_blob sound/soc/codecs/adau1701.c +clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_ADAU1701' +clean_mk CONFIG_SND_SOC_ADAU1701 sound/soc/codecs/Makefile + +announce SND_SOC_SIGMADSP - "SigmaStudio firmware loader" +maybe_reject_firmware sound/soc/codecs/sigmadsp.c + +announce SND_SOC_WM0010 - "WM0010 DSP driver" +reject_firmware sound/soc/codecs/wm0010.c +clean_blob sound/soc/codecs/wm0010.c +clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_WM0010' +clean_mk CONFIG_SND_SOC_WM0010 sound/soc/codecs/Makefile + +# It's not clear that wm2000_anc.bin is pure data. +# Check with developer, clean up for now. +announce SND_SOC_WM2000 - "WM2000 ALSA Soc Audio codecs" +reject_firmware sound/soc/codecs/wm2000.c +clean_blob sound/soc/codecs/wm2000.c +clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_WM2000' +clean_mk CONFIG_SND_SOC_WM2000 sound/soc/codecs/Makefile + +announce SND_SOC_WM8994 - "WM8994 ALSA Soc Audio codecs" +reject_firmware sound/soc/codecs/wm8958-dsp2.c +clean_blob sound/soc/codecs/wm8958-dsp2.c +clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_WM8994' +clean_mk CONFIG_SND_SOC_WM8994 sound/soc/codecs/Makefile + +announce SND_SOC_SH4_SIU - "ALSA SoC driver for Renesas SH7343, SH7722 SIU peripheral" +reject_firmware sound/soc/sh/siu_dai.c +clean_blob sound/soc/sh/siu_dai.c +clean_kconfig sound/soc/sh/Kconfig 'SND_SOC_SH4_SIU' +clean_mk CONFIG_SND_SOC_SH4_SIU sound/soc/sh/Makefile + +announce SOUND_TRIX - "MediaTrix AudioTrix Pro support" +clean_blob sound/oss/trix.c +clean_kconfig sound/oss/Kconfig 'SOUND_TRIX' +clean_sed ' +/^config TRIX_BOOT_FILE$/, /^config / { + /^ default.*trxpro\.hex/ s,".*","/*(DEBLOBBED)*/",; +}' sound/oss/Kconfig 'removed default firmware' +clean_mk CONFIG_SOUND_TRIX sound/oss/Makefile + +announce SOUND_TRIX - "See above," +announce SOUND_PAS - "ProAudioSpectrum 16 support," +announce SOUND_SB - "100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support" +clean_blob sound/oss/sb_common.c +clean_kconfig sound/oss/Kconfig 'SOUND_PAS' +clean_kconfig sound/oss/Kconfig 'SOUND_SB' +clean_mk CONFIG_SOUND_PAS sound/oss/Makefile +clean_mk CONFIG_SOUND_SB sound/oss/Makefile + +announce SOUND_PSS - "PSS (AD1848, ADSP-2115, ESC614) support" +clean_sed 's,^\( [*] .*synth"\)\.$,\1/*.,' sound/oss/pss.c 'avoid nested comments' +clean_blob sound/oss/pss.c +clean_kconfig sound/oss/Kconfig 'SOUND_PSS' +clean_sed ' +/^config PSS_BOOT_FILE$/, /^config / { + /^ default.*dsp001\.ld/ s,".*","/*(DEBLOBBED)*/",; +}' sound/oss/Kconfig 'removed default firmware' +clean_mk CONFIG_SOUND_PSS sound/oss/Makefile + +announce SND_USB_6FIRE - "TerraTec DMX 6Fire USB" +reject_firmware sound/usb/6fire/firmware.c +clean_blob sound/usb/6fire/firmware.c +clean_kconfig sound/usb/Kconfig 'SND_USB_6FIRE' +clean_mk 'CONFIG_SND_USB_6FIRE' sound/usb/6fire/Makefile + +################# +# Documentation # +################# + +announce Documentation - "non-Free firmware scripts and documentation" +clean_blob Documentation/dvb/avermedia.txt +clean_blob Documentation/dvb/opera-firmware.txt +clean_blob Documentation/sound/alsa/ALSA-Configuration.txt +clean_blob Documentation/sound/oss/MultiSound +clean_blob Documentation/sound/oss/PSS +clean_blob Documentation/sound/oss/PSS-updates +clean_blob Documentation/sound/oss/README.OSS +clean_file Documentation/dvb/get_dvb_firmware +clean_file Documentation/video4linux/extract_xc3028.pl +clean_sed s,usb8388,whatever,g drivers/base/Kconfig 'removed blob name' +clean_blob firmware/README.AddingFirmware +clean_blob firmware/WHENCE + +if $errors; then + echo errors above were ignored because of --force >&2 +fi + +exit 0 diff --git a/freed-ora/current/master/deblob-check b/freed-ora/current/master/deblob-check index b2e21fe85..794eab404 100755 --- a/freed-ora/current/master/deblob-check +++ b/freed-ora/current/master/deblob-check @@ -1,6 +1,6 @@ #! /bin/sh -# deblob-check version 2012-07-21 +# deblob-check version 2012-11-27 # Inspired in gNewSense's find-firmware script. # Written by Alexandre Oliva <lxoliva@fsfla.org> @@ -253,7 +253,8 @@ # This makes it much faster, and mostly immune to non-ASCII stuff, as # long as a 8-bit-safe sed is used. Probably a safe assumption these # days. -case ${LANG+set} in set) LANG=C; export LANG;; esac +LC_ALL=C; export LC_ALL +LANGUAGE=C; export LANGUAGE rm="rm -f" @@ -1025,8 +1026,8 @@ set_except () { initnc '[ ]int[ ]bcomm_irq\[3[*]16\][ ]=' initnc '[ ]static[ ]const[ ]int8[ ]countLeadingZerosHigh\[\][ ]=' initnc 'static[ ]struct[ ]nic_qp_map[ ]nic_qp_mapping_[01]\[\][ ]=' - initnc 'static[ ]struct[ ]regval[ ]ov_initvals\[\][ ]=' - initnc 'static[ ]struct[ ]regval[ ]stk1125_initvals\[\][ ]=' + initnc 'static[ ]struct[ ]regval[ ]ov_initvals\[\][ ]=' drivers/media/usb/stkwebcam/stk-sensor.c + initnc 'static[ ]struct[ ]regval[ ]stk1125_initvals\[\][ ]=' drivers/media/usb/stkwebcam/stk-webcam.c initnc 'static[ ]u8[ ]bnx2x_stats_len_arr\[BNX2X_NUM_STATS\][ ]=' defsnc 'static[ ]const[ ]struct[ ]arb_line[ ]read_arb_data\[NUM_RD_Q\]\[MAX_RD_ORD[ ][+][ ]1\][ ]=' drivers/net/bnx2x/bnx2x_init_opts.h defsnc 'static[ ]const[ ]struct[ ]arb_line[ ]write_arb_data\[NUM_WR_Q\]\[MAX_WR_ORD[ ][+][ ]1\][ ]=' drivers/net/bnx2x/bnx2x_init_opts.h @@ -1060,7 +1061,7 @@ set_except () { accept ':03000000020200F9[\n]:040023000205\(9B0037\|5F0073\)[\n]\(:050030000000000000CB[\n]\|:0400430002010000B6[\n]\)*'"$sepx$blobpat*"'[\n]:\(0E06E0006400670065007400060334003700F4\|0606A000060334003700E0\)[\n]:00000001FF' 'firmware/keyspan_pda/\(keyspan_pda\|xircom_pgs\).HEX' accept ':100000000C004000000000000000000000000000A4[\n]'"$sepx$blobpat*"'[\n][/][*][ ]DSP56001[ ]bootstrap[ ]code[ ][*][/]' firmware/dsp56k/bootstrap.bin.ihex initnc 'static[ ]const[ ]u16[ ]uda1380_reg\[UDA1380_CACHEREGNUM\][ ]=' sound/soc/codecs/uda1380.c - initnc 'static[ ]const[ ]u16[ ]wm8510_reg\[WM8510_CACHEREGNUM\][ ]=' sound/soc/codecs/wm8510.c + defsnc 'static[ ]const[ ]u16[ ]wm8510_reg\[WM8510_CACHEREGNUM\][ ]=' sound/soc/codecs/wm8510.c initnc 'static[ ]const[ ]unsigned[ ]short[ ]atkbd_unxlate_table\[128\][ ]=' drivers/input/keyboard/atkbd.c initnc 'static[ ]const[ ]unsigned[ ]char[ ]usb_kbd_keycode\[256\][ ]=' drivers/hid/usbhid/usbkbd.c initnc '[ ][ ]u8[ ]buf,[ ]bufs\[\][ ]=' drivers/media/dvb/dvb-usb/cxusb.c @@ -1841,7 +1842,7 @@ set_except () { initc 'static[ ]uint32_t[ ]cuda_images\[\]\[PCXW_IMAGE_SIZE[/]sizeof[(]uint32_t[)]\][ ]__read_mostly[ ]=' # These are regarded as ok - initnc 'static[ ]const[ ]u8[ ]SN9C102_\(Y\|UV\)_QTABLE[01]\[64\][ ]=[ ][{]' + initnc 'static[ ]const[ ]u8[ ]SN9C102_\(Y\|UV\)_QTABLE[01]\[64\][ ]=[ ][{]' drivers/media/usb/sn9c102/sn9c102_config.h initnc '[ ]static[ ]\(const[ ]\)\?u8[ ]jpeg_header\[589\][ ]=[ ][{]' media/video/sn9c102/sn9c102_core.c accept '[ ][ ]\?err[ ]=[ ]sn9c102_write_const_regs[(]cam\(,[ \n]\+[{]0x[0-9a-fA-F][0-9a-fA-F],[ ]0x[0-9a-fA-F][0-9a-fA-F][}]\)*[)][;]' @@ -1896,24 +1897,24 @@ set_except () { initnc '[ ]static[ ]const[ ]unsigned[ ]int[ ]avg_pkts\[NCCTRL_WIN\][ ]=' initnc '[ ]static[ ]const[ ]unsigned[ ]short[ ]ac97_defaults\[\][ ]=' initnc '[ ]static[ ]int[ ]exp_lut\[256\][ ]=' - initnc '[ ]static[ ]u16[ ]jpeg_tables\[\]\[70\][ ]=' - initnc '[ ]static[ ]u16[ ]tables\[\][ ]=' + defsnc '[ ]static[ ]u16[ ]jpeg_tables\[\]\[70\][ ]=' drivers/media/pci/meye/meye.c + defsnc '[ ]static[ ]u16[ ]tables\[\][ ]=' drivers/media/pci/meye/meye.c initnc '[ ]static[ ]u32[ ]logMagTable\[128\][ ]=' - initnc '[ ]static[ ]u8[ ]init_bufs\[13\]\[5\][ ]=' + defsnc '[ ]static[ ]u8[ ]init_bufs\[13\]\[5\][ ]=' drivers/media/pci/cx88/cx88-cards.c initnc '[ ]static[ ]u_short[ ]geometry_table\[\]\[[45]\][ ]=' initnc '[ ]static[ ]unsigned[ ]char[ ]CRCTable1\[\][ ]=' initnc '[ ]static[ ]unsigned[ ]char[ ]CRCTable2\[\][ ]=' initnc '[ ]static[ ]unsigned[ ]char[ ]default_colors\[\][ ]=' - initnc '[ ]static[ ]unsigned[ ]char[ ]iso_regs\[8\]\[4\][ ]=' + defsnc '[ ]static[ ]unsigned[ ]char[ ]iso_regs\[8\]\[4\][ ]=' drivers/media/usb/cpia2/cpia2_usb.c initnc '[ ]static[ ]unsigned[ ]char[ ]log_scale\[101\][ ]=' sound/oss/pss.c initnc '[ ]static[ ]unsigned[ ]char[ ]msg\[\][ ]=' - initnc '[ ]static[ ]unsigned[ ]char[ ]static_pad\[\][ ]=' + defsnc '[ ]static[ ]unsigned[ ]char[ ]static_pad\[\][ ]=' drivers/s390/crypto/zcrypt_msgtype6.c defsnc '[ ]static[ ]unsigned[ ]char[ ]table_alaw2ulaw\[\][ ]=' drivers/staging/telephony/ixj.c defsnc '[ ]static[ ]unsigned[ ]char[ ]table_ulaw2alaw\[\][ ]=' drivers/staging/telephony/ixj.c defsnc '[ ]\(static[ ]const[ ]\)\?u32[ ]reg_boundaries\[\][ ]=' drivers/net/bnx2.c - initnc '[ ]u8[ ]b\[\][ ]=' + defsnc '[ ]u8[ ]b\[\][ ]=' drivers/media/usb/ttusb-dec/ttusbdecfe.c initnc '[ ]uint8_t[ ]tx\[\][ ]=' - initnc '[ ]unsigned[ ]char[ ]saa7111_regs\[\][ ]=' + defsnc '[ ]unsigned[ ]char[ ]saa7111_regs\[\][ ]=' drivers/media/parport/w9966.c initnc '[ ]unsigned[ ]char[ ]sas_pcd_m_pg\[\][ ]=' initnc '[ ][}][ ]modedb\[5\][ ]=' defsnc '[ ][}][ ]reg_tbl\[\][ ]=' drivers/net/bnx2.c @@ -1946,8 +1947,8 @@ set_except () { initnc 'static[ ]u_char[ ]irq_to_siureg\[\][ ]=' defsnc 'static[ ]Byte_t[ ]RData\[RDATASIZE\][ ]=' drivers/tty/rocket.c initnc 'static[ ]__const__[ ]__u16[ ]gx_coeff\[256\][ ]=' - initnc 'static[ ]__u8[ ]init7121ntsc\[\][ ]=' - initnc 'static[ ]__u8[ ]init7121pal\[\][ ]=' + defsnc 'static[ ]__u8[ ]init7121ntsc\[\][ ]=' drivers/media/video/saa7121.h + defsnc 'static[ ]__u8[ ]init7121pal\[\][ ]=' drivers/media/video/saa7121.h defsnc 'static[ ]byte[ ]capidtmf_leading_zeroes_table\[0x100\][ ]=' drivers/isdn/hardware/eicon/capidtmf.c defsnc 'static[ ]char[ ]channel_map_madi_[sdq]s\[HDSPM_MAX_CHANNELS\][ ]=' sound/pci/rme9652/hdspm.c initnc 'static[ ]char[ ]coefficients\[NM_TOTAL_COEFF_COUNT[ ][*][ ]4\][ ]=' @@ -1993,7 +1994,7 @@ set_except () { initnc 'static[ ]const[ ]u32[ ]SS[0-3]\[256\][ ]=' initnc 'static[ ]const[ ]u32[ ]S[1-8]\[64\][ ]=' initnc 'static[ ]const[ ]u32[ ]T[0-5]\[256\][ ]=' - initnc 'static[ ]const[ ]u32[ ]Tm\[24\]\[8\][ ]=' + defsnc 'static[ ]const[ ]u32[ ]Tm\[24\]\[8\][ ]=' crypto/cast6_generic.c initnc 'static[ ]const[ ]u32[ ]bass_table\[41\]\[5\][ ]=' initnc 'static[ ]const[ ]u32[ ]bf_sbox\[256[ ][*][ ]4\][ ]=' defsnc 'static[ ]const[ ]u32[ ]camellia_sp0222\[256\][ ]=' crypto/camellia.c @@ -2005,14 +2006,14 @@ set_except () { initnc 'static[ ]const[ ]u32[ ]m8xx_size_to_gray\[M8XX_SIZES_NO\][ ]=' initnc 'static[ ]const[ ]u32[ ]mds\[4\]\[256\][ ]=' initnc 'static[ ]const[ ]u32[ ]pc2\[1024\][ ]=' - initnc 'static[ ]const[ ]u32[ ]s[1-7]\[256\][ ]=' - initnc 'static[ ]const[ ]u32[ ]sb8\[256\][ ]=' + defsnc 'static[ ]const[ ]u32[ ]s[1-7]\[256\][ ]=' crypto/cast5_generic.c + defsnc 'static[ ]const[ ]u32[ ]sb8\[256\][ ]=' crypto/cast5_generic.c initnc 'static[ ]const[ ]u32[ ]tfrc_calc_x_lookup\[TFRC_CALC_X_ARRSIZE\]\[2\][ ]=' initnc 'static[ ]const[ ]u32[ ]treble_table\[41\]\[5\][ ]=' initnc 'static[ ]const[ ]u64[ ][CT][0-7]\[256\][ ]=' initnc 'static[ ]const[ ]u64[ ]sbox[1-4]\[256\][ ]=' initnc 'static[ ]const[ ]u64[ ]sha512_K\[80\][ ]=' 'crypto/sha512\(_generic\)\?.c' - initnc 'static[ ]const[ ]u8[ ]Tr\[4\]\[8\][ ]=' + defsnc 'static[ ]const[ ]u8[ ]Tr\[4\]\[8\][ ]=' crpto/cast6_generic.c initnc 'static[ ]const[ ]u8[ ]aes_sbox\[256\][ ]=' initnc 'static[ ]const[ ]u8[ ]calc_sb_tbl\[512\][ ]=' initnc 'static[ ]const[ ]u8[ ]exp_to_poly\[492\][ ]=' @@ -2037,16 +2038,16 @@ set_except () { initnc 'static[ ]const[ ]unsigned[ ]char[ ]comet_miireg2offset\[32\][ ]=' initnc 'static[ ]\(const[ ]\)\?unsigned[ ]char[ ]euc2sjisibm_g3upper_map\[\]\[2\][ ]=' initnc 'static[ ]const[ ]unsigned[ ]char[ ]green\[256\][ ]=' - initnc 'static[ ]const[ ]unsigned[ ]char[ ]hash_table_ops\[64[*]4\][ ]=' + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]hash_table_ops\[64[*]4\][ ]=' drivers/media/usb/pwc/pwc-dec23.c defsnc 'static[ ]const[ ]unsigned[ ]char[ ]hid_keyboard\[256\][ ]=' drivers/hid/hid-input.c initnc 'static[ ]const[ ]unsigned[ ]char[ ]mts_direction\[256[/]8\][ ]=' initnc 'static[ ]const[ ]unsigned[ ]char[ ]red\[256\][ ]=' initnc 'static[ ]\(const[ ]\)\?unsigned[ ]char[ ]sjisibm2euc_map\[\]\[2\][ ]=' initnc 'static[ ]const[ ]unsigned[ ]char[ ]vol_cvt_datt\[128\][ ]=' - initnc 'static[ ]const[ ]unsigned[ ]int[ ]MulIdx\[16\]\[16\][ ]=' + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]MulIdx\[16\]\[16\][ ]=' drivers/media/usb/pwc/pwc-dec23.c initnc 'static[ ]const[ ]unsigned[ ]int[ ]crctab32\[\][ ]=' initnc 'static[ ]const[ ]unsigned[ ]short[ ]crc_flex_table\[\][ ]=' - initnc 'static[ ]const[ ]unsigned[ ]short[ ]logtable\[256\][ ]=' + defsnc 'static[ ]const[ ]unsigned[ ]short[ ]logtable\[256\][ ]=' drivers/media/dvb-core/dvb_math.c initnc 'static[ ]const[ ]unsigned[ ]short[ ]wd7000_iobase\[\][ ]=' defsnc 'static[ ]const[ ]unsigned[ ]short[ ]x86_keycodes\[256\][ ]=' drivers/tty/vt/keyboard.c initnc 'static[ ]const[ ]unsigned[ ]table\[\][ ]=' @@ -2065,7 +2066,7 @@ set_except () { initnc 'static[ ]short[ ]isdn_audio_[ua]law_to_s16\[\][ ]=' defsnc 'static[ ]struct[ ]iw\?l\(3945\)\?_tx_power[ ]power_gain_table\[2\]\[IW\?L_MAX_GAIN_ENTRIES\][ ]=' drivers/net/wireless/iwlegacy/iwl-3945.c initnc 'static[ ]struct[ ]ovcamchip_regvals[ ]regvals_init_\(76be\|7[16]20\|7x10\)\[\][ ]=' - initnc 'static[ ]struct[ ]regval_list[ ]ov7670_default_regs\[\][ ]=' + initnc 'static[ ]struct[ ]regval_list[ ]ov7670_default_regs\[\][ ]=' drivers/media/i2c/ov7670.c initnc 'static[ ]struct[ ]s_c2[ ]SetRate48000\[\][ ]=' initnc 'static[ ]struct[ ]tea6420_multiplex[ ]TEA6420_line\[MXB_AUDIOS[+]1\]\[2\][ ]=' initnc 'static[ ]struct[ ]wm_info[ ]i810_wm_16_100\[\][ ]=' @@ -2078,15 +2079,15 @@ set_except () { initnc 'static[ ]u16[ ]asEqCoefsPipes\[64\][ ]=' initnc 'static[ ]u16[ ]asEqCoefsZeros\[50\][ ]=' initnc 'static[ ]u16[ ]asEqOutStateZeros\[48\][ ]=' - initnc 'static[ ]u16[ ]default_key_map[ ]\[256\][ ]=' + defsnc 'static[ ]u16[ ]default_key_map[ ]\[256\][ ]=' drivers/media/pci/ttpci/av7110_ir.c initnc 'static[ ]u16[ ]eq_levels\[64\][ ]=' initnc 'static[ ]u32[ ][ ]crc32tab\[\][ ]__attribute__[ ][(][(]aligned[(]8[)][)][)][ ]=' - initnc 'static[ ]u32[ ]ac3_frames\[3\]\[32\][ ]=' + defsnc 'static[ ]u32[ ]ac3_frames\[3\]\[32\][ ]=' drivers/media/dvb-core/dvb_filter.c initnc 'static[ ]u32[ ]adwDecim8\[33\][ ]=' initnc 'static[ ]u32[ ]h_prescale\[64\][ ]=' initnc 'static[ ]u32[ ]v_gain\[64\][ ]=' - initnc 'static[ ]u8[ ]SRAM_Table\[\]\[60\][ ]=' - initnc 'static[ ]u8[ ]alps_tdee4_stv0297_inittab\[\][ ]=' + defsnc 'static[ ]u8[ ]SRAM_Table\[\]\[60\][ ]=' drivers/media/pci/bt8xx/bttv-driver.c + defsnc 'static[ ]u8[ ]alps_tdee4_stv0297_inittab\[\][ ]=' drivers/media/common/b2c2/flexcop-fe-tuner.c defsnc 'static[ ]u8[ ]bnx2_570[68]_stats_len_arr\[BNX2_NUM_STATS\][ ]=' drivers/net/bnx2.c initnc 'static[ ]u8[ ]flit_desc_map\[\][ ]=' defsnc 'static[ ]\(const[ ]\)\?u8[ ]init_tab[ ]\?\[\][ ]=' 'drivers/media/dvb/frontends/cx2270\(0\|2\)\.c' @@ -2095,9 +2096,9 @@ set_except () { initnc 'static[ ]u8[ ]mt2131_config1\[\][ ]=' drivers/media/common/tuners/mt2131.c # >= 2.6.26 initnc 'static[ ]u8[ ]mt2266_init2\[\][ ]=' drivers/media/dvb/frontends/mt2266.c # <= 2.6.25 initnc 'static[ ]u8[ ]mt2266_init2\[\][ ]=' drivers/media/common/tuners/mt2266.c # >= 2.6.26 - initnc 'static[ ]u8[ ]opera1_inittab\[\][ ]=' - initnc 'static[ ]u8[ ]saa7113_init_regs\[\][ ]=' - initnc 'static[ ]u8[ ]samsung_tbmu24112_inittab\[\][ ]=' + defsnc 'static[ ]u8[ ]opera1_inittab\[\][ ]=' drivers/media/usb/dvb-usb/opera1.c + defsnc 'static[ ]u8[ ]saa7113_init_regs\[\][ ]=' drivers/media/pci/ttpci/av7110_v4l.c + defsnc 'static[ ]u8[ ]samsung_tbmu24112_inittab\[\][ ]=' drivers/media/common/b2c2/flexcop-fe-tuner.c defsnc 'static[ ]u8[ ]w1_crc8_table\[\][ ]=' drivers/w1/w1_io.c initnc 'static[ ]u_char[ ]const[ ]data_sizes_32\[32\][ ]=' initnc 'static[ ]u_long[ ]ident_map\[32\][ ]=' @@ -2130,7 +2131,7 @@ set_except () { initnc 'static[ ]unsigned[ ]char[ ]crystal_key\[\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]dsp_ulaw\[\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]expressiontab\[128\][ ]=' - initnc 'static[ ]unsigned[ ]char[ ]header2\[\][ ]=' + defsnc 'static[ ]unsigned[ ]char[ ]header2\[\][ ]=' drivers/media/usb/zr364xx/zr364xx.c initnc 'static[ ]unsigned[ ]char[ ]hidp_keycode\[256\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]nkbd_keycode\[128\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]pan_volumes\[256\][ ]=' @@ -2150,9 +2151,9 @@ set_except () { initnc 'static[ ]unsigned[ ]char[ ]voltab[12]\[128\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]vpd89_data\[\][ ]=' initnc 'static[ ]unsigned[ ]char[ ]xtkbd_keycode\[256\][ ]=' - initnc 'static[ ]unsigned[ ]int[ ]ac3_bitrates\[32\][ ]=' + defsnc 'static[ ]unsigned[ ]int[ ]ac3_bitrates\[32\][ ]=' drivers/media/dvb-core/dvb_filter.c initnc 'static[ ]unsigned[ ]int[ ]bass_volume_table\[\][ ]=' - initnc 'static[ ]unsigned[ ]int[ ]bitrates\[3\]\[16\][ ]=' + defsnc 'static[ ]unsigned[ ]int[ ]bitrates\[3\]\[16\][ ]=' drivers/media/dvb-core/dvb_filter.c initnc 'static[ ]unsigned[ ]int[ ]isa_dma_port\[8\]\[7\][ ]=' initnc 'static[ ]unsigned[ ]int[ ]master_volume_table\[\][ ]=' initnc 'static[ ]unsigned[ ]int[ ]mixer_volume_table\[\][ ]=' @@ -2162,7 +2163,7 @@ set_except () { initnc 'static[ ]unsigned[ ]int[ ]treble_volume_table\[\][ ]=' initnc 'static[ ]unsigned[ ]int[ ]valid_mem\[\][ ]=' initnc 'static[ ]unsigned[ ]long[ ]arthur_to_linux_signals\[32\][ ]=' - initnc 'static[ ]unsigned[ ]long[ ]shmedia_opcode_table\[64\][ ]=' + defsnc 'static[ ]unsigned[ ]long[ ]shmedia_opcode_table\[64\][ ]=' arch/sh/kernel/traps_64.c initnc 'static[ ]unsigned[ ]nv\([34]\|10\)TableP\(FIFO\|GRAPH\|RAMIN\)\[\]\[2\][ ]=' initnc 'static[ ]unsigned[ ]short[ ]fcstab\[256\][ ]=' initnc 'static[ ]unsigned[ ]short[ ]init[1234]\[128\][ ][/][*]__devinitdata[*][/][ ]=' @@ -2186,17 +2187,17 @@ set_except () { initnc '\(uint16_t\|u16\)[ ]e1000_igp_2_cable_length_table\[IGP02E1000_AGC_LENGTH_TABLE_SIZE\][ ]=' drivers/net/e1000/e1000_hw.c # u16 on 2.6.26 initnc '[}][ ]euc2sjisibm_jisx0212_map\[\][ ]=' initnc '[}][ ]freq\[\][ ]=' - initnc '[}][ ]hps_h_coeff_tab[ ]\[\][ ]=' - initnc '[}][ ]hps_v_coeff_tab[ ]\[\][ ]=' - initnc '[}][ ]init_tab\[\][ ]=' + defsnc '[}][ ]hps_h_coeff_tab[ ]\[\][ ]=' drivers/media/common/saa7146/saa7146_hlp.c + defsnc '[}][ ]hps_v_coeff_tab[ ]\[\][ ]=' drivers/media/common/saa7146/saa7146_hlp.c + defsnc '[}][ ]init_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c initnc '[}][ ]maven_gamma\[\][ ]=' defsnc '[}][ ]mem_table\[\][ ]=' drivers/net/ethernet/8390/smc-mca.c - initnc '[}][ ]mxb_saa7740_init\[\][ ]=' + defsnc '[}][ ]mxb_saa7740_init\[\][ ]=' drivers/media/pci/saa7146/mxb.c initnc '[}][ ]pll_table\[\][ ]=' drivers/video/geode/lxfb_ops.c - initnc '[}][ ]qam256_snr_tab\[\][ ]=' - initnc '[}][ ]qam64_snr_tab\[\][ ]=' + defsnc '[}][ ]qam256_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c + defsnc '[}][ ]qam64_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c initnc '[}][ ]sil_port\[\][ ]=' - initnc '[}][ ]vsb_snr_tab\[\][ ]=' + defsnc '[}][ ]vsb_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c # new in 2.6.30 defsnc 'static[ ]const[ ]unsigned[ ]char[ ]sync\[\][ ]=' Documentation/networking/timestamping/timestamping.c @@ -2802,8 +2803,8 @@ set_except () { accept 'resume[/]restore[,][ ]but[ ]they[ ]cannot[ ]do[ ]it[ ]by[ ]calling[ ]request_firmware[(][)]' Documentation/power/notifiers.txt accept '[ ][ ][ ]interrupts[ ]=[ ]<\([\n][ ][ ][ ][ ]0xe[0-7][ ]0[ ]0[ ]0\)*>[;]' arch/powerpc/boot/dts/p1022ds.dts accept '[ ][ ][ ][ ]gzip[ ]-n[ ]--force[ ]-9[ ]--stdout[ ]["][$]ofile\.bin["][ ]>[ ]["][$]odir[/]otheros\.bld["]' arch/powerpc/boot/wrapper - defsnc 'uint32_t[ ]nva3_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nva3_copy.fuc.h - defsnc 'uint32_t[ ]nvc0_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_copy.fuc.h + defsnc '\(uint32_t\|u32\)[ ]nva3_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nva3_copy.fuc.h + defsnc '\(uint32_t\|u32\)[ ]nvc0_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_copy.fuc.h accept '[ ]struct[ ]nvc0_graph_fuc[ ]fuc4\(09\|1a\)[cd]' drivers/gpu/drm/nouveau/nvc0_graph.h defsnc 'static[ ]const[ ]u8[ ]sht15_crc8_table\[\][ ]=' drivers/hwmon/sht15.c defsnc 'static[ ]u8[ ]stv0288_bsbe1_d01a_inittab\[\][ ]=' drivers/media/dvb/frontends/bsbe1-d01a.h @@ -3112,12 +3113,557 @@ set_except () { blobname 'bdata\(\.SD31\|\.DB132\)\?\.bin' drivers/net/wireless/ath/ath6kl/core.h blobname 'mrvl[/]sd8786_uapsta\.bin' 'drivers/net/wireless/mwifiex/sdio\.[ch]' accept '[ ][ ][*][ ]the[ ]isl3886[+]net2280' drivers/net/wireless/p54/p54usb.c + + # New in 3.6: + defsnc 'static[ ]unsigned[ ]char[ ]mcf_host_slot2sid\[32\][ ]=' arch/m68k/platform/coldfire/pci.c + defsnc 'static[ ]struct[ ]aead_testvec[ ]hmac_sha\(1\|256\|512\)_aes_cbc_enc_tv_template\[\][ ]=' crypto/testmgr.h + defsnc 'static[ ]struct[ ]hash_testvec[ ]bfin_crc_tv_template\[\][ ]=' crypto/testmgr.h + defsnc '[ ]static[ ]u8[ ]bw_params\[3\]\[32\][ ]=' drivers/media/dvb/frontends/rtl2832.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm51\(02\|10\)_reva_patch\[\][ ]=' drivers/mfd/wm5102-tables.c + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_\(radio\|baseband\|mac\)_postamble\[\]\[5\][ ]' drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_\(\(radio\|mac\|baseband\)_core\|common_\(wo_xlna_\)\?rx_gain_table\)\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_modes_\(no_\)\?xpa_tx_gain_table\[\]\[9\][ ]=' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h + blobname 'ti-connectivity[/]wl12[78]x-fw-5-\([ms]r\|plt\)\.bin' drivers/net/wireless/wl12xx/main.c + blobname 'ti-connectivity[/]wl18xx-\(fw\|conf\)\.bin' drivers/net/wireless/wl18xx/main.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]\(ldo5\|buck1\)_voltage_map\[\][ ]=' drivers/regulator/lp3972.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]\(lp872x_ldo\|lp8720_ldo4\|lp8725_\(lilo\|buck\)\)_vtbl\[\][ ]=' drivers/regulator/lp872x.c + defsnc 'const[ ]int[ ]lp8788_dldo1239_vtbl\[\][ ]=' drivers/regulator/lp8788-ldo.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]mc13892_sw1\?\[\][ ]=' drivers/regulator/mc13892-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]VCORE_VSEL_table\[\][ ]=' drivers/regulator/tps65023-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]VDCDCx_VSEL_table\[\][ ]=' drivers/regulator/tps6507x-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]dcdc[12]_voltages\[\][ ]=' drivers/regulator/tps6524x-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]tps6586x_\(ldo4\|sm2\|dvm\)_voltages\[\][ ]=' drivers/regulator/tps6586x-regulator.c + defsnc 'static[ ]struct[ ]bcm_ddr_setting[ ]asT3\(LP\)\?B\?_DDRSetting\(160\|133\|100\|80\)MHz\[\][ ]\?=' drivers/staging/bcm/DDRInit.c + defsnc '[ ]*static[ ]const[ ]u8[ ]arp_req\[36\][ ]=' drivers/staging/csr/sme_sys.c + defsnc 'omap4430_adc_to_temp\[OMAP4430_ADC_END_VALUE[ ]-[ ]OMAP4430_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap4-thermal.c + defsnc 'omap4460_adc_to_temp\[OMAP4460_ADC_END_VALUE[ ]-[ ]OMAP4460_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap4-thermal.c + defsnc 'omap5430_adc_to_temp\[OMAP5430_ADC_END_VALUE[ ]-[ ]OMAP5430_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap5-thermal.c + defsnc 'static[ ]struct[ ]vesa_mode[ ]vesa_mode_table\[\][ ]=' drivers/staging/sm7xxfb/sm7xxfb.c + defsnc 'static[ ]struct[ ]SiS_\(LCD\|LVDS\)Data[ ][ ]*XGI_\(\(\(St\|Ext\)LCD\|LVDS\)\(1024x768\|1280x1024\|1400x1050\)\|NoScaling\)Data\(_[12]\)\?\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]unsigned[ ]char[ ]rdesc\[\][ ]=' samples/uhid/uhid-example.c + defsnc 'static[ ]struct[ ]reg_default[ ]isabelle_reg_defs\[\][ ]=' sound/soc/codecs/isabelle.c + blobname 'dvb-usb-terratec-htc-stick-drxk\.fw' drivers/media/video/em28xx/em28xx-dvb.c + blobname 'rtl_nic[/]rtl8106e-1\.fw' drivers/net/ethernet/realtek/r8169.c + blobname 'rtl_nic[/]rtl8168g-1\.fw' drivers/net/ethernet/realtek/r8169.c + defsnc '[ ]static[ ]const[ ]u16[ ]mac_ocp_patch\[\][ ]=' in drivers/net/ethernet/realtek/r8169.c + blobname 'rt3290\.bin\(\.[\n][ ][ ][*][/]\)\?' drivers/net/wireless/rt2x00/rt2800pci.h + + # New in 3.7: + blobname 'imx[/]sdma[/]sdma-imx6q-to1\.bin' arch/arm/boot/dts/imx6q.dtsi + accept 'AES_T[ed]:\([\n]\.word[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*[\n][@][ ]T[ed]4\[256\]\([\n]\.byte[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*\([\n][@][ ]rcon\[\]\([\n]\.word[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*\([,][ ]0\)*\)\?' arch/arm/crypto/aes-armv4.S + defsnc 'const[ ]u32[ ]cast5_s[1234]\[256\][ ]=' crypto/cast5_generic.c + defsnc 'const[ ]u32[ ]cast6_s[1234]\[256\][ ]=' crypto/cast6_generic.c + accept '[ ][*][ ]Once[ ]it[ ]returns[ ]successfully[,][ ]driver[ ]can[ ]use[ ]request_firmware' drivers/base/firmware_class.c + accept 'int[\n ]cache_firmware[(]const[ ]char[ ][*]fw_name[)][\n][{]\([\n]\+[^\n}][^\n]*\)*ret[ ]=[ ]request_firmware[(][^\n]*\([\n]\+[^\n}][^\n]*\)*[\n]\+[}][\n]' drivers/base/firmware_class.c + accept '[ ][*][ ]If[ ]one[ ]device[ ]called[ ]request_firmware' drivers/base/firmware_class.c + defsnc 'static[ ]const[ ]struct[ ]mV_pos[ ]__cpuinitconst[ ]\(vrm85\|mobilevrm\)_mV\[32\][ ]=' drivers/cpufreq/longhaul.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]__cpuinitconst[ ]mV_\(vrm85\|mobilevrm\)\[32\][ ]=' drivers/cpufreq/longhaul.h + # Sources for these are in the corresponding .fuc files. + defsnc 'static[ ]u32[ ]nva3_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/copy/fuc/nva3.fuc.h + defsnc 'static[ ]u32[ ]nvc0_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/copy/fuc/nvc0.fuc.h + defsnc 'static[ ]uint32_t[ ]nv98_pcrypt_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/crypt/fuc/nv98.fuc.h + defsnc 'uint32_t[ ]nve0_grgpc_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h + defsnc 'uint32_t[ ]nve0_grhub_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h + defsnc 'nv04_graph_ctx_regs\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/nv04.c + accept '[ ]*ret[ ]=[ ]request_firmware[(]&fw[,][ ]source[,][ ]&nv_device[(]bios[)]->pdev->dev[)][;]' drivers/gpu/drm/nouveau/core/subdev/bios/base.c + defsnc 'static[ ]u8[ ][*]edid_load[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*err[ ]=[ ]request_firmware[(][&]fw[,][ ]name[,][ ][&]pdev' drivers/gpu/drm/drm_edid_load.c + defsnc 'static[ ]const[ ]RegInitializer[ ]initData\[\][ ]__initconst[ ]=' drivers/ide/ali14xx.c + defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_fc2580\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h + defsnc '[ ]static[ ]const[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb-frontends/rtl2830.c + blobname 's5k4ecgx\.bin' drivers/media/i2c/s5k4ecgx.c + blobname 'v4l-coda\(dx6-imx27\|7541-imx53\)\.bin' drivers/media/platform/coda.c + blobname 's5p-mfc\(-v6\)\?\.fw' drivers/media/platform/s5p-mfc/s5p_mfc.c + defsnc 'static[ ]const[ ]struct[ ]e4000_lna_filter[ ]e400_lna_filter_lut\[\][ ]=' drivers/media/tuners/e4000_priv.h + defsnc 'static[ ]const[ ]struct[ ]e4000_if_filter[ ]e4000_if_filter_lut\[\][ ]=' drivers/media/tuners/e4000_priv.h + defsnc 'static[ ]const[ ]struct[ ]fc2580_reg_val[ ]fc2580_init_reg_vals\[\][ ]=' drivers/media/tuners/fc2580_priv.h + defsnc 'static[ ]const[ ]struct[ ]fc2580_freq_regs[ ]fc2580_freq_regs_lut\[\][ ]=' drivers/media/tuners/fc2580_priv.h + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm5110_revb_patch\[\][ ]=' drivers/mfd/wm5110-tables.c + defsnc 'static[ ]struct[ ]nand_ecclayout[ ]lpc32xx_nand_oob[ ]=' drivers/mtd/nand/lpc32xx_mlc.c + defsnc 'static[ ]struct[ ]nand_ecclayout[ ]flctl_4secc_oob_64[ ]=' drivers/mtd/nand/sh_flctl.c + defsnc 'static[ ]const[ ]struct[ ]atl1c_platform_patch[ ]plats\[\][ ]__devinitconst[ ]=' drivers/net/ethernet/atheros/atl1c/atl1c_main.c + defsnc 'static[ ]const[ ]u32[ ]ar9565_1p0_\(\(mac\|baseband\|radio\)_core\|[Cc]ommon_\(wo_xlna_\)\?rx_gain_table\)\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9565_1p0_\(\(mac\|baseband\)_postamble\|[Mm]odes_\(low\(est\)\?\|high\)_\(ob_db\|power\)_tx_gain_table\)\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h + defsnc 'static[ ]u16[ ]r2057_rev[4578]a\?_init\[[45][245]\]\[2\][ ]=' drivers/net/wireless/b43/radio_2057.c + defsnc '[ ]*tbl_rf_control_override_rev7_over[01]\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c + defsnc 'static[ ]const[ ]unsigned[ ]pci_pins\[\][ ]=' drivers/pinctrl/spear/pinctrl-spear1310.c + defsnc 'static[ ]int[ ]array_soc\[\]\[2\][ ]=' drivers/power/88pm860x_battery.c + defsnc 'static[ ]const[ ]int[ ]mc13783_sw[12]x_val\[\][ ]=' drivers/regulator/mc13783-regulator.c + # remoteproc uses request_firmware, but it is generic and names + # no blobs of its own, so we change it to maybe_request_firmware. + accept '[ ]ret[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]FW_ACTION_HOTPLUG[,][\n][ ]*rproc->firmware[,][ ][&]rproc->dev[,][ ]GFP_KERNEL[,][\n][ ]*rproc[,][ ]rproc_fw_config_virtio[)][;][\n][ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(][&]rproc->dev[,][ ]["]request_firmware_nowait[ ]err' drivers/remoteproc/remoteproc_core.c + # This remoteproc client does name blobs, but we discard it + # with undefine_macro. + blob 'SPROC_MODEM_NAME[ ]["]-fw\.bin["]' drivers/remoteproc/ste_modem_rproc.c + accept '[ ]if[ ][(]request_firmware[(]&fw_entry,[ ]fname,[ ]&ioa_cfg->pdev->dev[)][)]' drivers/scsi/ipr.c + blobname 'daqboard2000_firmware\.bin' drivers/staging/comedi/drivers/daqboard2000.c + blobname 'me2600_firmware\.bin' drivers/staging/comedi/drivers/me_daq.c + blobname 'ni6534a\.bin' drivers/staging/comedi/drivers/ni_pcidio.c + blobname 'niscrb0[12]\.bin' drivers/staging/comedi/drivers/ni_pcidio.c + defsnc 'static[ ]const[ ]struct[ ]SiS_TVData[ ]XGI_\(St\|Ext\)\(PAL\|NTSC\|YPbPr\(525\|750\)[ip]\)Data\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]XGI330_\(NTSC\|PAL\|HiTV\(Ext\|St[12]\|Text\)\|YPbPr\(525\|750\)[ip]\)Timing\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]XGI330_\(HiTV\|Ren\(525\|750\)p\)Group3\(Data\|Simu\|Text\)\?\[\][ ]=' drivers/staging/xgifb/vb_table.h + accept 'static[ ]inline[ ]int[\n]\(maybe_\)\?reject_ihex_firmware\(_nowait\)\?[(][^{;]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}]' include/linux/firmware.h + defsnc '[/][*][ ]callback[ ]from[ ]request_firmware_nowait' sound/pci/hda/hda_intel.c + defsnc 'static[ ]int[ ]__devinit[ ]azx_probe[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*request_firmware[^\n]*' sound/pci/hda/hda_intel.c + defsnc 'static[ ]struct[ ]reg_default[ ]da9055_reg_defaults\[\][ ]=' sound/soc/codecs/da9055.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]sta32x_regs\[\][ ]=' sound/soc/codecs/sta32x.c + blobname 'wm0010\(_stage2\.bin\|\.dfw\)' sound/soc/codecs/wm0010.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm5102_sysclk_reva_patch\[\][ ]=' sound/soc/codecs/wm5102.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8510_reg_defaults\[\][ ]=' sound/soc/codecs/wm8510.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8580_reg_defaults\[\][ ]=' sound/soc/codecs/wm8580.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8776_reg_defaults\[\][ ]=' sound/soc/codecs/wm8776.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8900_reg_defaults\[\][ ]=' sound/soc/codecs/wm8900.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8960_reg_defaults\[\][ ]=' sound/soc/codecs/wm8960.c + accept '[ ][ ]priv->firmware[ ]=[ ]true[;]' drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c + accept '[ ][ ]*\(if[ ][(]\|[ ][ ][ ][ ]\)nvc0_graph_ctor_fw[(]priv[,][ ]["]fuc4\(09\|1a\)[cd]["][,][ ][&]priv->fuc4\(09\|1a\)[cd][)]' 'drivers/gpu/drm/nouveau/core/engine/graph/nv[ce]0\.c' + accept '[ ][ ]*nvc0_graph_dtor_fw[(]&priv->fuc4\(09\|1a\)[cd][)][;]' 'drivers/gpu/drm/nouveau/nv[ce]0\.c' + accept '[ ][ ]*nvc0_graph_init_fw[(]priv[,][ ]0x4\(09\|1a\)000[,][ ][&]priv->fuc4\(09\|1a\)c[,][ \n ]*[&]priv->fuc4\(09\|1a\)d[)][;]' 'drivers/gpu/drm/nouveau/core/engine/graph/nv[ce]0\.c' + blobname 'dvb-fe-xc5000c-4\.1\.30\.7\.fw' drivers/media/tuners/xc5000.c + accept '[ ]\.firmware[ ]=[ ]AF9015_FIRMWARE' drivers/media/usb/dvb-usb-v2/af9015.c + accept '[ ]\.firmware[ ]=[ ]AF9035_FIRMWARE' drivers/media/usb/dvb-usb-v2/af9035.c + accept '[ ]\.firmware[ ]*=[ ]AZ6007_FIRMWARE' drivers/media/usb/dvb-usb-v2/az6007.c + accept '[ ]\.firmware[ ]=[ ]EC168_FIRMWARE' drivers/media/usb/dvb-usb-v2/ec168.c + blobname 'brcm[/]brcmfmac43\(143\|242a\)\.bin' drivers/net/wireless/brcm80211/brcmfmac/usb.c + accept '[ ]priv->firmware[ ]=[ ]fw[;]' drivers/net/wireless/p54/p54pci.c + blobname 'c[bt]2\?fw-3\.1\.0\.0\.bin' drivers/scsi/bfa/bfad.c + blobname 'gdmuimg\.bin' drivers/staging/gdm72xx/usb_boot.c + blobname 'CMV4[pi]\.bin\(\.v2\)\?' drivers/usb/atm/ueagle-atm.c + blobname 'dvb-fe-tda10071\.fw' drivers/media/dvb/frontends/tda10071_priv.h + accept '[ ]st->it913x_config\.firmware[ ]=' drivers/media/usb/dvb-usb-v2/it913x.c ;; */*freedo*.patch | */*logo*.patch) accept 'P[13]\([\n]#[^\n]*\)*[\n]*\([\n][0-9 ]*\)\+' drivers/video/logo/logo_libre_clut224.ppm ;; + */patch-3.6*) + # Present in patch for 3.6.4. + accept 'MODULE_FIRMWARE[(]["]keyspan_pda[/]\(keyspan_pda\|xircom_pgs\)\.fw["][)][;]' drivers/usb/serial/keyspan_pda.c + # Present in patch for 3.6.5. + defsnc 'static[ ]const[ ]u32[ ]ar9300Modes_high_power_tx_gain_table_2p2\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h + # Specific to the 3.7 patch + accept '[ ]\.firmware[ ]*=[ ]["][/][*][(]DEBLOBBED[)][*][/]["]' + accept '[ ]\(p1100\|s660\|p7500\)->firmware[ ]=[ ]["][/][*][(]DEBLOBBED[)][*][/]["]' + accept '[ ]-[ ]calls[ ]request_firmware[(]' Documentation/firmware_class/README + accept '[ ]7[)],[ ]kernel:[ ]request_firmware[(]' Documentation/firmware_class/README + accept '[ ][ ]request_firmware[(][)][ ]returns[ ]non-zero' Documentation/firmware_class/README + accept '\(static[ ]\(int\|void\)[\n ]\)\?_request_firmware\(_prepare\|_cleanup\)\?[(]const[ ]struct[ ]firmware[ ][*][*]\?' drivers/base/firmware_class.c + accept '[ ][ ]_request_firmware_cleanup[(]firmware_p[)][;]' drivers/base/firmware_class.c + accept '[ ][*][ ]Asynchronous[ ]variant[ ]of[ ]request_firmware[(][)]' drivers/base/firmware_class.c + accept 'request_firmware\(_nowait\)\?[(]' drivers/base/firmware_class.c + accept 'static[ ]inline[ ]int[ ]request_firmware\(_nowait\)\?[(]' include/linux/firmware.h + accept '[ ][ ]err[ ]=[ ]request_firmware_nowait[(]THIS_MODULE,[ ]true,[ ]patch\[dev\],' sound/pci/hda/hda_intel.c + accept '[ ][{]0x00009e1c,[ ]0x0001cf9c,[ ]0x[0-9a-fx{},\n ]*' drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h + accept '[;][/][*]@@[ ]-391,17[ ][+]407,17[ ]@@[*][/][;][\n]\([ ]*[123],\)*[\n]\(\([ ]*[ 1234][0-9],\)*[\n]\)*[\n]\(\([ ]*[ 1234][0-9],\)*[\n]\)*\([ ]*1,\)*' scripts/dtc/dtc-lexer.lex.c_shipped + accept '[;][/][*]@@[ ]-395,16[ ][+]423,16[ ]@@[*][/][;][\n][ ]*0,\([ ]*2,\)*[\n]\(\([ ]*[ 1234][0-9],\)*[\n]\)*\([ ]*2,\)*' scripts/dtc/dtc-parser.tab.c_shipped + accept '[;][/][*]@@[ ]-418,45[ ][+]446,68[ ]@@[*][/][;][\n]\([ ]*[2],\)*[\n]\(\([ ]*[ 12][0-9],\)*[\n]\)*\([ ]*[12][0-9],\)*[ ]*24' scripts/dtc/dtc-parser.tab.c_shipped + + # Already in 3.6, but changed or moved thus present in patch to 3.7: + initnc '[/][*][\n][ ][*][ ]\(cfa_coef\|gamma\|luma_enhance\|noise_filter\)_table\.h[\n][ ][*]\([^\n]*[\n][ ][*]\)*[/]' 'drivers/media/video/omap3isp/\(cfa_coef\|gamma\|luma_enhance\|noise_filter\)_table\.h' + accept '[ ][ ][ ][/][*][ ]\(SQCIF\|QSIF\|QCIF\|SIF\|CIF\|VGA\)[ ][*][/][\n][ ][ ][ ][{][\n][ ][ ][ ][ ][ ][ ][{]'"$blobpat*" drivers/media/video/pwc/pwc-nala.h + accept 'FIRMWARE[ ]LOADER[ ][(]request_firmware[)]' MAINTAINERS + accept '[ ]INIT_WORK[(][&]fw_work->work[,][ ]request_firmware_work_func[)][;]' drivers/base/firmware_class.c + accept '[ ]\+request_firmware[(][)][ ]will[ ]hit[ ]an[ ]OOPS' drivers/media/dvb/frontends/dib7000p.c + defsnc 'static[ ]struct[ ]clk_pll_\(freq_\)\?table[ ]tegra_pll_[adpxm]_\(freq_\)\?table\[\][ ]=' arch/arm/mach-tegra/tegra2_clocks.c + defsnc 'static[ ]struct[ ]clk_pll_freq_table[ ]tegra_pll_[cu]_freq_table\[\][ ]=' arch/arm/mach-tegra/tegra30_clocks.c + defsnc 'const[ ]u64[ ]camellia_sp\(10011110\|22000222\|03303033\|00444404\|02220222\|30333033\|44044404\|11101110\)\[256\][ ]=' arch/x86/crypto/camellia_glue.c + defsnc 'static[ ]const[ ]u32[ ]s[1-7]\[256\][ ]=' crypto/cast5_generic.c + defsnc 'static[ ]const[ ]u32[ ]sb8\[256\][ ]=' crypto/cast5_generic.c + defsnc 'static[ ]const[ ]u32[ ]Tm\[24\]\[8\][ ]=' crypto/cast6_generic.c + defsnc 'static[ ]const[ ]u8[ ]Tr\[4\]\[8\][ ]=' crpto/cast6_generic.c + defsnc 'static[ ]struct[ ]cipher_testvec[ ]\(aes\|anubis\|bf\|camellia\|cts_mode\|des3_ede\|cast6\|salsa20_stream\|serpent\|tf\|tnepres\|xeta\|x\?tea\)\(_\(cbc\|ctr\(_rfc3686\)\?\|xts\)\)\?_\(enc\|dec\)_tv_template\[\][ ]=' 'crypto/\(tcrypt\|testmgr\).h' + accept '\([ ]request_firmware[(][)][ ]hotplug[ ]interface:[\n][ ]--*[\n].*[ ]\)\?-[ ]request_firmware_nowait[(][)][ ]is[ ]also[ ]provided[ ]for[ ]convenience' Documentation/firmware_class/README + accept '\(static[ ]\(int\|void\)[\n ]\)\?_request_firmware\(_prepare\|_cleanup\)\?[(]const[ ]struct[ ]firmware[ ][*][*]\?firmware\(_p\)\?[,)][^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c + accept 'static[ ]int[ ]_request_firmware_load[(]struct[ ]firmware_priv[ ][*]fw_priv[,]' drivers/base/firmware_class.c + accept 'static[ ]void[ ]request_firmware_work_func[(]struct[ ]work_struct[ ][*]work[)]' drivers/base/firmware_class.c + accept 'EXPORT_SYMBOL[(]request_firmware\(_nowait\)\?[)][;]' drivers/base/firmware_class.c + accept '[ ]fw_priv[ ]=[ ]_request_firmware_prepare[(][&]fw[,]' drivers/base/firmware_class.c + accept '[ ][ ]ret[ ]=[ ]_request_firmware_load[(]fw_priv[,]' drivers/base/firmware_class.c + accept '[ ][ ]_request_firmware_cleanup[(][&]fw[)][;]' drivers/base/firmware_class.c + defsnc 'uint32_t[ ]nvc0_grgpc_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h + defsnc 'uint32_t[ ]nvc0_grhub_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h + defsnc 'static[ ]int[ ]nv10_graph_ctx_regs[ ]\?\[\][ ]=' drivers/char/drm/nv10_graph.c + defsnc 'static[ ]int[ ]types\[0x80\][ ]=' drivers/gpu/drm/nouveau/nv50_vram.c + defsnc 'static[ ]const[ ]u8[ ]types\[256\][ ]=' drivers/gpu/drm/nouveau/nvc0_vram.c + defsnc 'static[ ]u8[ ]samsung_tbmu24112_inittab\[\][ ]=' drivers/media/common/b2c2/flexcop-fe-tuner.c + defsnc 'static[ ]u8[ ]alps_tdee4_stv0297_inittab\[\][ ]=' drivers/media/common/b2c2/flexcop-fe-tuner.c + defsnc '[}][ ]hps_h_coeff_tab[ ]\[\][ ]=' drivers/media/common/saa7146/saa7146_hlp.c + defsnc '[}][ ]hps_v_coeff_tab[ ]\[\][ ]=' drivers/media/common/saa7146/saa7146_hlp.c + defsnc 'static[ ]unsigned[ ]int[ ]bitrates\[3\]\[16\][ ]=' drivers/media/dvb-core/dvb_filter.c + defsnc 'static[ ]unsigned[ ]int[ ]ac3_bitrates\[32\][ ]=' drivers/media/dvb-core/dvb_filter.c + defsnc 'static[ ]u32[ ]ac3_frames\[3\]\[32\][ ]=' drivers/media/dvb-core/dvb_filter.c + defsnc 'static[ ]const[ ]unsigned[ ]short[ ]logtable\[256\][ ]=' drivers/media/dvb-core/dvb_math.c + defsnc 'static[ ]const[ ]struct[ ]af9013_coeff[ ]coeff_lut\[\][ ]=' drivers/media/dvb/frontends/af9013_priv.h + defsnc 'static[ ]\(const[ ]\)\?struct[ ]\(snr_table\|af9013_snr\)[ ]\(qpsk\|qam\(16\|64\)\)_snr_\(table\|lut\)\[\][ ]=' drivers/media/dvb/frontends/af9013_priv.h + defsnc 'static[ ]\(const[ ]\)\?struct[ ]\(regdesc\|af9013_reg_bit\)[ ]\(ofsm_init\|tuner_init_\(env77h11d5\|mt2060\(_2\)\?\|mxl500\(3d\|5\)\|qt1010\|mc44s803\|unknown\|tda18271\)\)\[\][ ]=' drivers/media/dvb/frontends/af9013_priv.h + defsnc '[ ]struct[ ]reg_val_mask[ ]tab\[\][ ]=' 'drivers/media/dvb/frontends/\(cxd2820r_\(c\|t2\)\|af9033\)\.c' + defsnc 'static[ ]const[ ]struct[ ]coeff[ ]coeff_lut\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h + defsnc 'static[ ]const[ ]struct[ ]val_snr[ ]\(qpsk\|qam\(16\|64\)\)_snr_lut\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h + defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]\(ofsm_init\|tuner_init_\(tua9001\|fc0011\|mxl5007t\|tda18218\)\)\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h + defsnc '\(static[ ]\)\?\(const[ ]\)\?struct[ ]au8522_register_config[ ]lpfilter_coef\[\][ ]=' drivers/media/dvb/frontends/au8522_decoder.c + defsnc 'static[ ]struct[ ]mse2snr_tab[ ]\(vsb\|qam\(64\|256\)\)_mse2snr_tab\[\][ ]=' drivers/media/dvb/frontends/au8522.c + defsnc '[}][ ]\(VSB\|QAM\(64\|256\)\?\)_mod_tab\[\][ ]=' 'drivers/media/dvb/frontends/au8522\(_dig\)\?\.c' + defsnc 'static[ ]u8[ ]stv0288_bsbe1_d01a_inittab\[\][ ]=' drivers/media/dvb/frontends/bsbe1-d01a.h + defsnc 'static[ ]\(const[ ]\)\?u8[ ]init_tab[ ]\?\[\][ ]=' 'drivers/media/dvb/frontends/cx2270\(0\|2\)\.c' + defsnc 'static[ ]const[ ]u16[ ]dib0090_defaults\[\][ ]=' drivers/media/dvb/frontends/dib0090.c + defsnc 'static[ ]const[ ]struct[ ]dib0090_pll[ ]dib0090_\(p1g_\)\?pll_table\[\][ ]=' drivers/media/dvb/frontends/dib0090.c + defsnc '[ ]static[ ]u8[ ]sine\[\][ ]=' drivers/media/dvb/frontends/dib7000p.c + accept '[ ]\+request_firmware[(][)][ ]will[ ]hit[ ]an[ ]OOPS' drivers/media/dvb/frontends/dib7000p.c + defsnc '\(static[ ]const[ ]\)\?u32[ ]fe_info\[44\][ ]=' drivers/media/dvb/frontends/dib9000.c + defsnc 'static[ ]u8[ ]ds3000_dvbs2\?_init_tab\[\][ ]=' drivers/media/dvb/frontends/ds3000.c + defsnc '[ ]static[ ]const[ ]u16[ ]dvbs2_snr_tab\[\][ ]=' drivers/media/dvb/frontends/ds3000.c + defsnc 'static[ ]struct[ ]dvb_pll_desc[ ][^\n]*[ ]=[ ][{]' drivers/media/dvb/frontends/dvb-pll.c + defsnc 'static[ ]u8[ ]stv0288_earda_inittab\[\][ ]=' drivers/media/dvb/frontends/eds1547.h + defsnc 'static[ ]const[ ]struct[ ]reg_mod_vals[ ]reg_mod_vals_tab\[\][ ]=' drivers/media/dvb/frontends/hd29l2_priv.h + defsnc 'static[ ]struct[ ]adctable[ ]tab[1-8]\[\][ ]=' drivers/media/dvb/frontends/it913x-fe-priv.h + initnc '[}][ ]itd1000_\(lpf_pga\|fre_values\)\[\][ ]=' drivers/media/dvb/frontends/itd1000.c + defsnc 'static[ ]const[ ]struct[ ]cnr[ ]cnr_tab\[\][ ]=' drivers/media/dvb/frontends/mb86a16.c + defsnc 'static[ ]struct[ ]regdata[ ]mb86a20s_init\[\][ ]=' drivers/media/dvb/frontends/mb86a20s.c + defsnc '[ ]struct[ ]rtl2830_reg_val_mask[ ]tab\[\][ ]=' drivers/media/dvb/frontends/rtl2830.c + defsnc '[ ]static[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb/frontends/rtl2830.c + defsnc '[ ]static[ ]u8[ ]bw_params\[3\]\[32\][ ]=' drivers/media/dvb/frontends/rtl2832.c + defsnc '[}][ ]init_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c + defsnc '[}][ ]vsb_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c + defsnc '[}][ ]qam256_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c + defsnc '[}][ ]qam64_snr_tab\[\][ ]=' drivers/media/dvb-frontends/s5h1409.c + defsnc 'static[ ]struct[ ]regdata[ ]s921_init\[\][ ]=' drivers/media/dvb/frontends/s921.c + defsnc 'static[ ]u8[ ]serit_sp1511lhb_inittab\[\][ ]=' drivers/media/dvb/frontends/si21xx.c + defsnc 'static[ ]\(const[ ]\)\?struct[ ]stb0899_tab[ ]stb0899_\(cn\|dvbs2\?rf\|quant\|est\)_tab\[\][ ]=' drivers/media/dvb/frontends/stb0899_drv.c + defsnc 'static[ ]const[ ]struct[ ]stb6100_lkup[ ]lkup\[\][ ]=' drivers/media/dvb/frontends/stb6100.c + defsnc 'static[ ]u8[ ]stv0288_inittab\[\][ ]=' drivers/media/dvb/frontends/stv0288.c + defsnc 'static[ ]u8[ ]tda10021_inittab\[0x40\]=' drivers/media/dvb/frontends/tda10021.c + initnc '[}][ ]snr_tab\[\][ ]=' drivers/media/dvb/frontends/tda10048.c + defsnc '[ ]struct[ ]tda10071_reg_val_mask[ ]tab2\[\][ ]=' drivers/media/dvb/frontends/tda10071.c + defsnc '[ ]static[ ]u8[ ]InitRegs\[\][ ]=' drivers/media/dvb/frontends/tda18271c2dd.c + defsnc 'static[ ]struct[ ]SMapI[ ]m_RF_Cal_Map\[\][ ]=' drivers/media/dvb/frontends/tda18271c2dd_maps.h + defsnc 'static[ ]struct[ ]SMap2[ ]m_\(Main\|Cal\)_PLL_Map\[\][ ]=' drivers/media/dvb/frontends/tda18271c2dd_maps.h + defsnc 'static[ ]struct[ ]SMap2\?[ ]*m_\(GainTaper\|RF_Cal_DC_Over_DT\|CID_Target\)_Map\[\][ ]=' drivers/media/dvb/frontends/tda18271c2dd_maps.h + defsnc 'static[ ]u8[ ]tda8083_init_tab[ ]\[\][ ]=' drivers/media/dvb/frontends/tda8083.c + defsnc 'static[ ]u8[ ]ves1820_inittab\[\][ ]=' drivers/media/dvb/frontends/ves1820.c + defsnc 'static[ ]u8[ ]init_1[89]93_w\?tab[ ]\?\[\][ ]=' drivers/media/dvb/frontends/ves1x93.c + defsnc '[ ]static[ ]const[ ]u8[ ]biphase_tbl\[\][ ]=' + initnc 'static[ ]struct[ ]regval_list[ ]ov7670_default_regs\[\][ ]=' drivers/media/i2c/ov7670.c + defsnc 'static[ ]struct[ ]s5k6aa_regval[ ]s5k6aa_analog_config\[\][ ]=' drivers/media/video/s5k6aa.c + initnc 'static[ ]u32[ ]reg_init_initialize\[\][ ]=' drivers/media/video/saa717x.c + initnc '[ ][}][ ]vals\[\][ ]=' drivers/media/video/saa717x.c + defsnc 'static[ ]const[ ]struct[ ]regval_list[ ]ov2640_init_regs\[\][ ]=' drivers/media/video/ov2640.c + defsnc 'static[ ]struct[ ]regval_list[ ]ov5642_default_regs_\(init\|finalise\)\[\][ ]=' drivers/media/video/ov5642.c + defsnc 'static[ ]const[ ]struct[ ]ov9640_reg[ ]ov9640_regs_dflt\[\][ ]=' drivers/media/video/ov9640.c + defsnc 'static[ ]const[ ]struct[ ]ov9740_reg[ ]ov9740_defaults\[\][ ]=' drivers/media/video/ov9740.c + defsnc '\(const[ ]static\|static[ ]const\)[ ]struct[ ]rj54n1_reg_val[ ]bank_[4578]\[\][ ]=' drivers/media/video/rj54n1cb0c.c + defsnc 'static[ ]const[ ]u16[ ]vs6624_p1\[\][ ]=' drivers/media/video/vs6624.c + defsnc '[ ]unsigned[ ]char[ ]saa7111_regs\[\][ ]=' drivers/media/parport/w9966.c + initnc 'static[ ]int[ ]miro_fmtuner\[\][ ][ ]=' drivers/media/video/bt8xx/bt-cards.c + initnc 'static[ ]int[ ]miro_tunermap\[\][ ]=' drivers/media/video/bt8xx/bt-cards.c + defsnc 'static[ ]u8[ ]SRAM_Table\[\]\[60\][ ]=' drivers/media/pci/bt8xx/bttv-driver.c + defsnc '[ ]static[ ]u8[ ]init_bufs\[13\]\[5\][ ]=' drivers/media/pci/cx88/cx88-cards.c + defsnc 'static[ ]\(const[ ]\)\?u8[ ]samsung_smt_7020_inittab\[\][ ]=' drivers/media/video/cx88/cx88-dvb.c + initnc '[ ]static[ ]const[ ]u8[ ]mpeg_hdr_data\[\][ ]=' drivers/media/video/cx18/cx18-vbi.c + defsnc 'u8[ ]lgtdqcs001f_inittab\[\][ ]=' drivers/media/dvb/mantis/mantis_vp1033.c + defsnc '[ ]static[ ]u16[ ]jpeg_tables\[\]\[70\][ ]=' drivers/media/pci/meye/meye.c + defsnc '[ ]static[ ]u16[ ]tables\[\][ ]=' drivers/media/pci/meye/meye.c + defsnc 'static[ ]u8[ ]ITUDecoderSetup\[4\]\[16\][ ]=' drivers/media/dvb/ngene/ngene-core.c + defsnc 'static[ ]const[ ]u8[ ]va1j5jf8007[ts]_\(2[05]mhz_\)\?prepare_bufs\[\]\[2\][ ]=' 'drivers/media/dvb/pt1/va1j5jf8007[st]\.c' + defsnc '[}][ ]mxb_saa7740_init\[\][ ]=' drivers/media/pci/saa7146/mxb.c + defsnc 'static[ ]u8[ ]nexusca_stv0297_inittab\[\][ ]=' drivers/media/dvb/ttpci/av7110.c + accept '[ ]const[ ]char[ ]\*fw_name[ ]=[ ]["]av7110[/]bootcode\.bin["][;]' drivers/media/dvb/ttpci/av7110_hw.c + accept '[ ]ret[ ]=[ ]request_firmware[(][^;]*[)][;][\n][ ]if[ ][(]ret[)][ ][{][^}]*[}][\n][\n][ ]mwdebi[(]av7110,[ ]DEBISWAB,[ ]DPRAM_BASE' drivers/media/dvb/ttpci/av7110_fw.c + accept 'MODULE_FIRMWARE[(]["]av7110[/]bootcode\.bin["][)][;]' drivers/media/dvb/ttpci/av7110_fw.c + defsnc 'static[ ]u16[ ]default_key_map[ ]\[256\][ ]=' drivers/media/pci/ttpci/av7110_ir.c + defsnc 'static[ ]u8[ ]saa7113_init_regs\[\][ ]=' drivers/media/pci/ttpci/av7110_v4l.c + defsnc 'static[ ]const[ ]u8[ ]saa7113_tab\[\][ ]=' drivers/media/dvb/ttpci/budget-av.c + defsnc 'static[ ]u8[ ]philips_sd1878_inittab\[\][ ]=' drivers/media/dvb/ttpci/budget-av.c + defsnc 'static[ ]u8[ ]philips_su1278_tt_inittab\[\][ ]=' drivers/media/dvb/ttpci/budget-ci.c + defsnc 'static[ ]u8[ ]dvbc_philips_tdm1316l_inittab\[\][ ]=' drivers/media/dvb/ttpci/budget-ci.c + defsnc 'static[ ]const[ ]char[ ]zr360[56]0_dqt\[0x86\][ ]=' 'drivers/media/video/zr36060\.c\|drivers/media/video/zoran/zr36060\.c' + defsnc 'static[ ]const[ ]char[ ]zr360[56]0_dht\[0x1a4\][ ]=' 'drivers/media/video/zr36060\.c\|drivers/media/video/zoran/zr36060\.c' + defsnc 'static[ ]const[ ]char[ ]zr360[56]0_dqt\[0x86\][ ]=' 'drivers/media/video/zr36060\.c\|drivers/media/video/zoran/zr36060\.c' + defsnc 'static[ ]const[ ]struct[ ]isprsz_coef[ ]filter_coefs[ ]=' drivers/media/video/omap3isp/ispresizer.c + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]qtbl_\(lu\|chro\)minance\[4\]\[64\][ ]=' drivers/media/video/s5p-jpeg/jpeg-core.c + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]hactblg0\[162\][ ]=' drivers/media/video/s5p-jpeg/jpeg-core.c + defsnc 'static[ ]const[ ]struct[ ]hdmiphy_conf[ ]hdmiphy_conf_\(s5pv210\|exynos4[24]1[02]\)\[\][ ]=' drivers/media/video/s5p-tv/hdmiphy_drv.c + defsnc 'static[ ]const[ ]u8[ ]filter_y_vert_tap4\[\][ ]=' drivers/media/video/s5p-tv/mixer_reg.c + initnc 'static[ ]u8[ ]mt2131_config1\[\][ ]=' drivers/media/common/tuners/mt2131.c # >= 2.6.26 + initnc 'static[ ]u8[ ]mt2266_init2\[\][ ]=' drivers/media/common/tuners/mt2266.c # >= 2.6.26 + defsnc '[ ]static[ ]u8[ ]def_regs\[\][ ]=' drivers/media/common/tuners/tda18218.c + defsnc '[ ]static[ ]unsigned[ ]char[ ]iso_regs\[8\]\[4\][ ]=' drivers/media/usb/cpia2/cpia2_usb.c + initnc '[ ][ ]u8[ ]buf,[ ]bufs\[\][ ]=' drivers/media/dvb/dvb-usb/cxusb.c + defsnc 'static[ ]struct[ ]dib0090_wbd_slope[ ]dib7090e_wbd_table\[\][ ]=' drivers/media/dvb/dvb-usb/dib0700_devices.c + defsnc '[ ][}][ ]regs\[\][ ]=' drivers/media/video/em28xx/em28xx-dvb.c + defsnc 'static[ ]u8[ ]init_code\[\]\[2\][ ]=' drivers/media/dvb/dvb-usb/friio-fe.c + defsnc 'static[ ]u8[ ]opera1_inittab\[\][ ]=' drivers/media/usb/dvb-usb/opera1.c + defsnc 'static[ ]u8[ ]s7395_inittab\[\][ ]=' drivers/media/dvb/dvb-usb/lmedm04.h + defsnc '[ ][}][ ]regs\[\][ ]=' drivers/media/video/em28xx/em28xx-dvb.c + defsnc 'static[ ]const[ ]__u8[ ]cx11646_fw1\[\]\[3\][ ]=' drivers/media/video/gspca/conex.c + defsnc 'static[ ]const[ ]__u8[ ]cx_inits_\(176\|320\|352\|640\)\[\][ ]=' drivers/media/video/gspca/conex.c + defsnc 'static[ ]const[ ]__u8[ ]cx_jpeg_init\[\]\[8\][ ]=' drivers/media/video/gspca/conex.c + defsnc 'static[ ]const[ ]__u8[ ]cxjpeg_\(640\|352\|320\|176\|qtable\)\[\]\[8\][ ]=' drivers/media/video/gspca/conex.c + defsnc 'static[ ]struct[ ]validx[ ]tbl_\(commm\?on\|init_\(at_startup\|post_alt\)\|sensor_settings_common\(_[ab]\|1\)\|big\(_[abc]\|[123]\)\|640\|800\)\[\][ ]=' 'drivers/media/video/gspca/gl860/gl860-\(mi2020\|mi1320\|ov9655\|ov2640\).c' + defsc 'static[ ]struct[ ]idxdata[ ]tbl_common\(_[a-e]\|5\|_\?3B\?\)\[\][ ]=' 'drivers/media/video/gspca/gl860/gl860-\(mi2020\|mi1320\|ov9655\|ov2640\)\.c' + defsnc 'static[ ]u8[ ][*]tbl_\(640\|800\|1280\)\[\][ ]=' 'drivers/media/video/gspca/gl860/gl860-\(mi1320\|ov9655\).c' + defsnc '[ ]struct[ ]jlj_command[ ]start_commands\[\][ ]=' drivers/media/video/gspca/jeilinj.c + defsnc 'static[ ]const[ ]u8[ ]jpeg_head\[\][ ]=' drivers/media/video/gspca/jpeg.h + defsnc '[ ][ ]\(static[ ]\)\?const[ ]struct[ ]sensor_w_data[ ]\(cif\|vga\)_sensor[01]_init_data\[\][ ]=' drivers/media/video/gspca/mr97310a.c + defsnc 'static[ ]const[ ]u8[ ]\(nw80[012]\|spacecam2\?\|cvideopro\|dlink\|ds3303\|kr651\|kritter\|mustek\|proscope\|twinkle\|dvcv6\)_start\(_\([12]\|q\?vga\)\)\?\[\][ ]=' drivers/media/video/gspca/nw80x.c + defsnc 'static[ ]const[ ]struct[ ]ov_i2c_regvals[ ]norm_7660\[\][ ]=' drivers/media/video/ov519.c + initc '[ ]\?static[ ]const[ ]struct[ ]ov_i2c_regvals[ ]norm_76[1247]0\[\][ ]=' drivers/media/video/gspca/ov519.c + defsnc '[ ]const[ ]unsigned[ ]char[ ]\(y\|uv\)QuanTable51[18]\[\][ ]=' 'drivers/media/video/\(ov511\|gspca/ov519\)\.c' + defsnc '[ ]static[ ]const[ ]struct[ ]ov_regvals[ ]bridge_ov7660\[2\]\[10\][ ]=' drivers/media/video/gspca/ov519.c + defsnc '[ ]static[ ]const[ ]u8[ ]fr_tb\[2\]\[6\]\[3\][ ]=' drivers/media/video/gspca/ov519.c + defsnc '[ ]static[ ]const[ ]struct[ ]ov_i2c_regvals[ ]\(brit\|contrast\|colors\)_7660\[\]\[\(6\|7\|31\)\][ ]=' drivers/media/video/gspca/ov519.c + defsnc 'static[ ]const[ ]u8[ ]\(bridge\|sensor\)_init\(_2\)\?\[\]\[2\][ ]=' drivers/media/video/gspca/ov534_9.c + defsnc 'static[ ]const[ ]u8[ ]\(ov965x\|ov971x\|ov562x\)_init\(_2\)\?\[\]\[2\][ ]=' drivers/media/video/gspca/ov534_9.c + defsnc 'static[ ]const[ ]u8[ ]bridge_start_\([qs]\?v\|x\)ga\[\]\[2\][ ]=' drivers/media/video/gspca/ov534_9.c + defsnc 'static[ ]const[ ]u8[ ]\(bridge\|sensor\)_init_7\(67\|72\)x\[\]\[2\][ ]=' drivers/media/video/gspca/ov534.c + defsnc '[ ]*static[ ]u8[ ]color_tb\[\]\[6\][ ]=' drivers/media/video/gspca/ov534.c + initnc 'static[ ]const[ ]__u8[ ]pac207_sensor_init\[\]\[8\][ ]=' drivers/media/video/gspca/pac207.c + defsnc 'static[ ]const[ ]u8[ ]\(start\|page3\)_7302\[\][ ]=' drivers/media/video/gspca/pac7302.c + initnc 'static[ ]const[ ]__u8[ ]pac7311_jpeg_header\[\][ ]=' drivers/media/video/gspca/pac7311.c + defsnc 'static[ ]const[ ]__u8[ ]\(start\|page[34]\)_73\(02\|11\)\[\][ ]=' drivers/media/video/gspca/pac7311.c + defsnc '[ ]struct[ ]init_command[ ]\(spy\|cif\|ms350\|genius\|vivitar\)_start_commands\[\][ ]=' drivers/media/video/gspca/sn9c2028.c + defsnc 'static[ ]const[ ]\(int\|s16\)[ ]hsv_\(red\|green\|blue\)_[xy]\[\][ ]=' drivers/media/video/gspca/sn9c20x.c + defsnc 'static[ ]const[ ]u16[ ]bridge_init\[\]\[2\][ ]=' drivers/media/video/gspca/sn9c20x.c + defsnc 'static[ ]const[ ]struct[ ]i2c_reg_u8[ ]\(soi968\|ov\(7670\|965[05]\)\|hv7131r\)_init\[\][ ]=' drivers/media/video/gspca/sn9c20x.c + defsnc 'static[ ]const[ ]struct[ ]i2c_reg_u16[ ]\(mt9v[01]1[12]\)_init\[\][ ]=' drivers/media/video/gspca/sn9c20x.c + initnc 'static[ ]const[ ]__u8[ ]init\(Hv7131\|Ov\(6650\|7630\(_3\)\?\)\|Pas\(106\|202\)\|Tas51[13]0\)\[\][ ]=' drivers/media/video/gspca/sonixb.c + initnc 'static[ ]const[ ]__u8[ ]\(hv7131\|ov\(6650\|7630\(_3\)\?\)\|pas\(106\|202\)\|tas51[13]0\)_sensor_init\(_com\)\?\[\]\[8\][ ]=' drivers/media/video/gspca/sonixb.c + defsnc 'static[ ]const[ ]u8[ ]\(adcm1700\|om6802\|po1030\)_sensor_\(init\|param1\)\[\]\[8\][ ]=' drivers/media/video/gspca/sonixj.c + defsnc 'static[ ]const[ ]u8[ ]\(gc0307\|po2030n\|soi768\)_sensor_\(init\|param1\)\[\]\[8\][ ]=' drivers/media/video/gspca/sonixj.c + defsnc 'static[ ]\(const[ ]\)\?\(__\)\?u8[ ]\(mt9v111\|sp80708\|hv7131[rd]\|mi0360b\?\|mo4000\|ov76\([36]0\|48\)\|om6802\|po1030\)_sensor_\(init\|param1\)\[\]\[8\][ ]=' drivers/media/video/gspca/sonixj.c + defsnc '[ ]static[ ]const[ ]u8[ ]probe_tb\[\]\[4\]\[8\][ ]=' drivers/media/video/gspca/sonixj.c + initnc 'static[ ]const[ ]__u16[ ]\(spca500_visual\|Clicksmart510\)_defaults\[\]\[3\][ ]=' drivers/media/video/gspca/spca500.c + initnc 'static[ ]const[ ]__u8[ ]qtable_\(creative_pccam\|kodak_ez200\|pocketdv\)\[2\]\[64\][ ]=' drivers/media/video/gspca/spca500.c + initnc 'static[ ]const[ ]__u16[ ]spca501c\?_\(\(3com\|arowana\|mysterious\)_\)\?\(init\|open\)_data\[\]\[3\][ ]=' drivers/media/video/gspca/spca501.c + defsnc 'static[ ]const[ ]\(__u16\|u8\)[ ]spca505b\?_\(init\|open\)_data\(_ccd\)\?\[\]\[3\][ ]=' drivers/media/video/gspca/spca505.c + defsnc 'static[ ]const[ ]\(__\)\?u16[ ]spca508\(cs110\|_sightcam2\?\|_vista\)\?_init_data\[\]\[[23]\][ ]=' drivers/media/video/gspca/spca508.c + defsnc 'static[ ]const[ ]struct[ ]ucbus_write_cmd[ ]\(icx098bq\|lz24bp\)_start_[012]\[\][ ]=' drivers/media/video/gspca/sq930x.c + defsnc '[}][ ]capconfig\[4\]\[2\][ ]=' drivers/media/video/gspca/sq930x.c + defsnc 'static[ ]const[ ]\(__u16\|struct[ ]cmd\)[ ]spca504\(_pccam600\|A_clicksmart420\)_\(init\|open\)_data\[\]\(\[3\]\)\?[ ]=' drivers/media/video/gspca/sunplus.c + defsnc 'static[ ]const[ ]\(__\)\?u8[ ]qtable_\(creative_pccam\|spca504_default\)\[2\]\[64\][ ]=' drivers/media/video/gspca/sunplus.c + defsnc 'static[ ]const[ ]u8[ ]n4_\(om6802\|other\|tas5130a\)\[\][ ]=' drivers/media/video/gspca/t613.c + defsnc 'static[ ]const[ ]u8[ ]n4_lt168g\[\][ ]=' drivers/media/video/gspca/t613.c + defsnc 'static[ ]const[ ]u8[ ]DQT\[17\]\[130\][ ]=' drivers/media/video/gspca/topro.c + defsnc 'static[ ]const[ ]struct[ ]cmd[ ]tp6810_late_start\[\][ ]=' drivers/media/video/gspca/topro.c + defsnc '[ ]static[ ]const[ ]struct[ ]cmd[ ]sensor_init\[\][ ]=' drivers/media/video/gspca/topro.c + defsnc '[ ]static[ ]const[ ]u8[ ]gamma_tb\[NGAMMA\]\[3\]\[1024\][ ]=' drivers/media/video/gspca/topro.c + defsnc 'static[ ]const[ ]u8[ ]eeprom_data\[\]\[3\][ ]=' drivers/media/gspca/tv8532.c + initc 'static[ ]const[ ]\(__\)\?u8[ ]\(mi\(0360\|13[12]0\)\|po\(1200\|3130\)\|hv7131r\|ov76[67]0\)_\(\(soc\)\?_\?[iI]nit\(Q\?V\|SX\)GA\(_\(JPG\|data\)\)\?\|rundata\)\[\]\[4\][ ]=\([ ][{][*][/][;]\)\?' drivers/media/video/gspca/vc032x.c + defsnc 'static[ ]const[ ]u8[ ]poxxxx_\(init\(_common\|Q\?VGA\|_end_1\|_start_3\)\|gamma\)\[\]\[4\][ ]=' drivers/media/video/gspca/vc032x.c + defsnc 'static[ ]const[ ]u16[ ]rca_initdata\[\]\[3\][ ]=' drivers/media/video/gspca/xirlink_cit.c + defsnc 'static[ ]const[ ]struct[ ]usb_action[ ]\(cs2102\|hdcs2020xx\|icm105a\(xx\)\?\|ov7630c\|mt9v111_[13]\|pb0330\([3x]x\)\?\|mi0360soc\)_Initial\(Scale\)\?\[\][ ]=' drivers/media/video/gspca/zc3xx.c + defsnc '[ ]static[ ]const[ ]u8[ ]gamma_tb\[6\]\[16\][ ]=' drivers/media/video/gspca/zc3xx.c + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]hash_table_ops\[64[*]4\][ ]=' drivers/media/usb/pwc/pwc-dec23.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]MulIdx\[16\]\[16\][ ]=' drivers/media/usb/pwc/pwc-dec23.c + defsnc 'const[ ]struct[ ]Kiara_table_entry[ ]Kiara_table\[PSZ_MAX\]\[6\]\[4\][ ]=' drivers/media/video/pwc/pwc-kiara.c + defsnc 'const[ ]unsigned[ ]int[ ]KiaraRomTable[ ]\[8\]\[2\]\[16\]\[8\][ ]=' drivers/media/video/pwc/pwc-kiara.c + defsnc 'const[ ]struct[ ]Timon_table_entry[ ]Timon_table\[PSZ_MAX\]\[PWC_FPS_MAX_TIMON\]\[4\][ ]=' drivers/media/video/pwc/pwc-timon.c + defsnc 'const[ ]unsigned[ ]int[ ]TimonRomTable[ ]\[16\]\[2\]\[16\]\[8\][ ]=' drivers/media/video/pwc/pwc-timon.c + initnc 'static[ ]const[ ]u8[ ]SN9C102_\(Y\|UV\)_QTABLE[01]\[64\][ ]=[ ][{]' drivers/media/usb/sn9c102/sn9c102_config.h + initnc '[ ]static[ ]\(const[ ]\)\?u8[ ]jpeg_header\[589\][ ]=[ ][{]' media/video/sn9c102/sn9c102_core.c + accept '[ ][ ]\?err[ ]=[ ]sn9c102_write_const_regs[(]cam\(,[ \n]\+[{]0x[0-9a-fA-F][0-9a-fA-F],[ ]0x[0-9a-fA-F][0-9a-fA-F][}]\)*[)][;]' + initnc 'static[ ]struct[ ]regval[ ]ov_initvals\[\][ ]=' drivers/media/usb/stkwebcam/stk-sensor.c + initnc 'static[ ]struct[ ]regval[ ]stk1125_initvals\[\][ ]=' drivers/media/usb/stkwebcam/stk-webcam.c + defsnc 'static[ ]u8[ ]dvbc_philips_tdm1316l_inittab\[\][ ]=' drivers/media/dvb/ttpci/budget-ci.c + defsnc '[ ]u8[ ]b\[\][ ]=' drivers/media/usb/ttusb-dec/ttusbdecfe.c + defsnc '[ ]static[ ]char[ ]init_values\[38\]\[3\][ ]=' drivers/media/video/usbvision/usbvision-core.c + defsnc 'static[ ]unsigned[ ]char[ ]header2\[\][ ]=' drivers/media/usb/zr364xx/zr364xx.c + defsnc '[ ]static[ ]const[ ]char[ ][*][ ]const[ ]vui_sar_idc\[\][ ]=' drivers/media/video/v4l2-ctrls.c + defsnc '[ ]static[ ]unsigned[ ]char[ ]static_pad\[\][ ]=' drivers/s390/crypto/zcrypt_msgtype6.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]muxonechan\[\][ ]=' drivers/staging/comedi/drivers/adv_pci1710.c + accept '#define[ ]_MAP_0_32_ASCII_SEG7_NON_PRINTABLE[ ]\\[\n][ ]\(0,\)\+$' 'drivers/input/misc/map_to_7segment\.h\|include/linux/map_to_7segment\.h' + defsnc 'static[ ]yyconst[ ]\(flex_int\(16\|32\)_t\|\(\(short[ ]\)\?int\)\)[ ]yy_[^[]*\[[][0-9]*\][ ]=' + defsnc 'static[ ]const[ ]\(yytype_u\?int\(8\|16\)\|\(unsigned[ ]\)\?\(short\([ ]int\)\?\|char\)\)[ ]yy[^[]*\[\][ ]=' + defsnc 'static[ ]int[ ]__devinit[ ]azx_probe[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*request_firmware[^\n]*' sound/pci/hda/hda_intel.c + # New in 3.7: + blobname 'imx[/]sdma[/]sdma-imx6q-to1\.bin' arch/arm/boot/dts/imx6q.dtsi + accept 'AES_T[ed]:\([\n]\.word[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*[\n][@][ ]T[ed]4\[256\]\([\n]\.byte[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*\([\n][@][ ]rcon\[\]\([\n]\.word[ ]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*\)*\([,][ ]0\)*\)\?' arch/arm/crypto/aes-armv4.S + defsnc 'const[ ]u32[ ]cast5_s[1234]\[256\][ ]=' crypto/cast5_generic.c + defsnc 'const[ ]u32[ ]cast6_s[1234]\[256\][ ]=' crypto/cast6_generic.c + accept '[ ][*][ ]Once[ ]it[ ]returns[ ]successfully[,][ ]driver[ ]can[ ]use[ ]request_firmware' drivers/base/firmware_class.c + accept 'int[\n ]cache_firmware[(]const[ ]char[ ][*]fw_name[)][\n][{]\([\n]\+[^\n}][^\n]*\)*ret[ ]=[ ]request_firmware[(][^\n]*\([\n]\+[^\n}][^\n]*\)*[\n]\+[}][\n]' drivers/base/firmware_class.c + accept '[ ][*][ ]If[ ]one[ ]device[ ]called[ ]request_firmware' drivers/base/firmware_class.c + defsnc 'static[ ]const[ ]struct[ ]mV_pos[ ]__cpuinitconst[ ]\(vrm85\|mobilevrm\)_mV\[32\][ ]=' drivers/cpufreq/longhaul.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]__cpuinitconst[ ]mV_\(vrm85\|mobilevrm\)\[32\][ ]=' drivers/cpufreq/longhaul.h + # Sources for these are in the corresponding .fuc files. + defsnc 'static[ ]u32[ ]nva3_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/copy/fuc/nva3.fuc.h + defsnc 'static[ ]u32[ ]nvc0_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/copy/fuc/nvc0.fuc.h + defsnc 'static[ ]uint32_t[ ]nv98_pcrypt_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/crypt/fuc/nv98.fuc.h + defsnc 'uint32_t[ ]nve0_grgpc_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpcnve0.fuc.h + defsnc 'uint32_t[ ]nve0_grhub_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h + defsnc 'nv04_graph_ctx_regs\[\][ ]=' drivers/gpu/drm/nouveau/core/engine/graph/nv04.c + accept '[ ]*ret[ ]=[ ]request_firmware[(]&fw[,][ ]source[,][ ]&nv_device[(]bios[)]->pdev->dev[)][;]' drivers/gpu/drm/nouveau/core/subdev/bios/base.c + defsnc 'static[ ]u8[ ][*]edid_load[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*err[ ]=[ ]request_firmware[(][&]fw[,][ ]name[,][ ][&]pdev' drivers/gpu/drm/drm_edid_load.c + defsnc 'static[ ]const[ ]RegInitializer[ ]initData\[\][ ]__initconst[ ]=' drivers/ide/ali14xx.c + defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_fc2580\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h + defsnc '[ ]static[ ]const[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb-frontends/rtl2830.c + blobname 's5k4ecgx\.bin' drivers/media/i2c/s5k4ecgx.c + blobname 'v4l-coda\(dx6-imx27\|7541-imx53\)\.bin' drivers/media/platform/coda.c + blobname 's5p-mfc\(-v6\)\?\.fw' drivers/media/platform/s5p-mfc/s5p_mfc.c + defsnc 'static[ ]const[ ]struct[ ]e4000_lna_filter[ ]e400_lna_filter_lut\[\][ ]=' drivers/media/tuners/e4000_priv.h + defsnc 'static[ ]const[ ]struct[ ]e4000_if_filter[ ]e4000_if_filter_lut\[\][ ]=' drivers/media/tuners/e4000_priv.h + defsnc 'static[ ]const[ ]struct[ ]fc2580_reg_val[ ]fc2580_init_reg_vals\[\][ ]=' drivers/media/tuners/fc2580_priv.h + defsnc 'static[ ]const[ ]struct[ ]fc2580_freq_regs[ ]fc2580_freq_regs_lut\[\][ ]=' drivers/media/tuners/fc2580_priv.h + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm5110_revb_patch\[\][ ]=' drivers/mfd/wm5110-tables.c + defsnc 'static[ ]struct[ ]nand_ecclayout[ ]lpc32xx_nand_oob[ ]=' drivers/mtd/nand/lpc32xx_mlc.c + defsnc 'static[ ]struct[ ]nand_ecclayout[ ]flctl_4secc_oob_64[ ]=' drivers/mtd/nand/sh_flctl.c + defsnc 'static[ ]const[ ]struct[ ]atl1c_platform_patch[ ]plats\[\][ ]__devinitconst[ ]=' drivers/net/ethernet/atheros/atl1c/atl1c_main.c + defsnc 'static[ ]const[ ]u32[ ]ar9565_1p0_\(\(mac\|baseband\|radio\)_core\|[Cc]ommon_\(wo_xlna_\)\?rx_gain_table\)\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9565_1p0_\(\(mac\|baseband\)_postamble\|[Mm]odes_\(low\(est\)\?\|high\)_\(ob_db\|power\)_tx_gain_table\)\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h + defsnc 'static[ ]u16[ ]r2057_rev[4578]a\?_init\[[45][245]\]\[2\][ ]=' drivers/net/wireless/b43/radio_2057.c + defsnc '[ ]*tbl_rf_control_override_rev7_over[01]\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c + defsnc 'static[ ]const[ ]unsigned[ ]pci_pins\[\][ ]=' drivers/pinctrl/spear/pinctrl-spear1310.c + defsnc 'static[ ]int[ ]array_soc\[\]\[2\][ ]=' drivers/power/88pm860x_battery.c + defsnc 'static[ ]const[ ]int[ ]mc13783_sw[12]x_val\[\][ ]=' drivers/regulator/mc13783-regulator.c + # remoteproc uses request_firmware, but it is generic and names + # no blobs of its own, so we change it to maybe_request_firmware. + accept '[ ]ret[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]FW_ACTION_HOTPLUG[,][\n][ ]*rproc->firmware[,][ ][&]rproc->dev[,][ ]GFP_KERNEL[,][\n][ ]*rproc[,][ ]rproc_fw_config_virtio[)][;][\n][ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(][&]rproc->dev[,][ ]["]request_firmware_nowait[ ]err' drivers/remoteproc/remoteproc_core.c + # This remoteproc client does name blobs, but we discard it + # with undefine_macro. + blob 'SPROC_MODEM_NAME[ ]["]-fw\.bin["]' drivers/remoteproc/ste_modem_rproc.c + accept '[ ]if[ ][(]request_firmware[(]&fw_entry,[ ]fname,[ ]&ioa_cfg->pdev->dev[)][)]' drivers/scsi/ipr.c + blobname 'daqboard2000_firmware\.bin' drivers/staging/comedi/drivers/daqboard2000.c + blobname 'me2600_firmware\.bin' drivers/staging/comedi/drivers/me_daq.c + blobname 'ni6534a\.bin' drivers/staging/comedi/drivers/ni_pcidio.c + blobname 'niscrb0[12]\.bin' drivers/staging/comedi/drivers/ni_pcidio.c + defsnc 'static[ ]const[ ]struct[ ]SiS_TVData[ ]XGI_\(St\|Ext\)\(PAL\|NTSC\|YPbPr\(525\|750\)[ip]\)Data\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]XGI330_\(NTSC\|PAL\|HiTV\(Ext\|St[12]\|Text\)\|YPbPr\(525\|750\)[ip]\)Timing\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]XGI330_\(HiTV\|Ren\(525\|750\)p\)Group3\(Data\|Simu\|Text\)\?\[\][ ]=' drivers/staging/xgifb/vb_table.h + accept 'static[ ]inline[ ]int[\n]\(maybe_\)\?reject_ihex_firmware\(_nowait\)\?[(][^{;]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}]' include/linux/firmware.h + defsnc '[/][*][ ]callback[ ]from[ ]request_firmware_nowait' sound/pci/hda/hda_intel.c + defsnc 'static[ ]int[ ]__devinit[ ]azx_probe[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*request_firmware[^\n]*' sound/pci/hda/hda_intel.c + defsnc 'static[ ]struct[ ]reg_default[ ]da9055_reg_defaults\[\][ ]=' sound/soc/codecs/da9055.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]sta32x_regs\[\][ ]=' sound/soc/codecs/sta32x.c + blobname 'wm0010\(_stage2\.bin\|\.dfw\)' sound/soc/codecs/wm0010.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm5102_sysclk_reva_patch\[\][ ]=' sound/soc/codecs/wm5102.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8510_reg_defaults\[\][ ]=' sound/soc/codecs/wm8510.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8580_reg_defaults\[\][ ]=' sound/soc/codecs/wm8580.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8776_reg_defaults\[\][ ]=' sound/soc/codecs/wm8776.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8900_reg_defaults\[\][ ]=' sound/soc/codecs/wm8900.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8960_reg_defaults\[\][ ]=' sound/soc/codecs/wm8960.c + accept '[ ][ ]priv->firmware[ ]=[ ]true[;]' drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c + accept '[ ][ ]*\(if[ ][(]\|[ ][ ][ ][ ]\)nvc0_graph_ctor_fw[(]priv[,][ ]["]fuc4\(09\|1a\)[cd]["][,][ ][&]priv->fuc4\(09\|1a\)[cd][)]' 'drivers/gpu/drm/nouveau/core/engine/graph/nv[ce]0\.c' + accept '[ ][ ]*nvc0_graph_dtor_fw[(]&priv->fuc4\(09\|1a\)[cd][)][;]' 'drivers/gpu/drm/nouveau/nv[ce]0\.c' + accept '[ ][ ]*nvc0_graph_init_fw[(]priv[,][ ]0x4\(09\|1a\)000[,][ ][&]priv->fuc4\(09\|1a\)c[,][ \n ]*[&]priv->fuc4\(09\|1a\)d[)][;]' 'drivers/gpu/drm/nouveau/core/engine/graph/nv[ce]0\.c' + blobname 'dvb-fe-xc5000c-4\.1\.30\.7\.fw' drivers/media/tuners/xc5000.c + accept '[ ]\.firmware[ ]=[ ]AF9015_FIRMWARE' drivers/media/usb/dvb-usb-v2/af9015.c + accept '[ ]\.firmware[ ]=[ ]AF9035_FIRMWARE' drivers/media/usb/dvb-usb-v2/af9035.c + accept '[ ]\.firmware[ ]*=[ ]AZ6007_FIRMWARE' drivers/media/usb/dvb-usb-v2/az6007.c + accept '[ ]\.firmware[ ]=[ ]EC168_FIRMWARE' drivers/media/usb/dvb-usb-v2/ec168.c + blobname 'brcm[/]brcmfmac43\(143\|242a\)\.bin' drivers/net/wireless/brcm80211/brcmfmac/usb.c + accept '[ ]priv->firmware[ ]=[ ]fw[;]' drivers/net/wireless/p54/p54pci.c + blobname 'c[bt]2\?fw-3\.1\.0\.0\.bin' drivers/scsi/bfa/bfad.c + blobname 'gdmuimg\.bin' drivers/staging/gdm72xx/usb_boot.c + blobname 'CMV4[pi]\.bin\(\.v2\)\?' drivers/usb/atm/ueagle-atm.c + blobname 'dvb-fe-tda10071\.fw' drivers/media/dvb/frontends/tda10071_priv.h + accept '[ ]st->it913x_config\.firmware[ ]=' drivers/media/usb/dvb-usb-v2/it913x.c + # Present in 3.6 but removed in the patch: + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]__\(cpu\)\?initdata[ ]mV_vrm85\[32\][ ]=' arch/x86/kernel/cpu/cpufreq/longhaul.h + accept '[ ][ ]snprintf[(]fname[,][ ]sizeof[(]fname[)][,][ ]["]nouveau[/]%s["][,][ ]nouveau_vbios[)][;][\n][ ][ ]ret[ ]=[ ]request_firmware[(]' drivers/gpu/drm/nouveau/nouveau_bios.c + defsnc '\(static[ ]uint32_t\|[}]\)[ ]nv04_graph_ctx_regs[ ]\?\[\][ ]=' drivers/char/drm/nv04_graph.c + defsc 'uint32_t[ ]nv98_pcrypt_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nv98_crypt.fuc.h + defsnc '\(uint32_t\|u32\)[ ]nva3_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nva3_copy.fuc.h + defsnc '\(uint32_t\|u32\)[ ]nvc0_pcopy_\(data\|code\)\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_copy.fuc.h + accept '[ ]it913x_config\.firmware[ ]=[ ]' drivers/media/dvb/dvb-usb/it913x.c + accept '[ ]*props->firmware[ ]=[ ]fw_it913\(5_v[12]\|7\)' drivers/media/dvb/dvb-usb/it913x.c + defsnc '[ ]static[ ]const[ ]u8[ ]rsshash\[40\][ ]=' drivers/net/igb/igb_main.c + accept '[ ]hif_dev->firmware[ ]=[ ]fw[;]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept '[ ]hif_dev->firmware[ ]=[ ]NULL[;]' drivers/net/wireless/ath/ath9k/hif_usb.c + defsnc 'static[ ]const[ ]unsigned[ ]\(rgmii\|smii_0_1_2\|nand_8bit\|mcif\|pci_sata\|clcd\|arm_trace\|miphy_dbg\|emi\)_pins\[\][ ]=' drivers/pinctrl/spear/pinctrl-spear1310.c + accept '[ ]ret[ ]=[ ]request_firmware\([(][&]firmware_p[,][ ]rproc->firmware[,][ ]dev[)]\|_nowait[(]THIS_MODULE[,][ ]FW_ACTION_HOTPLUG[,][\n][ ]*rproc->firmware[,][ ]dev[,][ ]GFP_KERNEL[,][\n][ ]*rproc[,][ ]rproc_fw_config_virtio[)]\)[;][\n][ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(]dev[,][ ]["]request_firmware\(_nowait\)\?[ ]failed' drivers/remoteproc/remoteproc_core.c + accept '[ ]if[(]request_firmware[(]&fw_entry,[ ]fname,[ ]&ioa_cfg->pdev->dev[)][)]' drivers/scsi/ipr.c + defsnc 'const[ ]unsigned[ ]char[ ]map_table\[\][ ]=' drivers/staging/lirc/lirc_ttusbir.c + defsnc 'static[ ]struct[ ]SiS_\(LCD\|LVDS\)Data[ ][ ]*XGI_\(\(\(St\|Ext\)LCD\|LVDS\)\(1024x768\|1280x1024\|1400x1050\)\|NoScaling\)Data\(_[12]\)\?\[\][ ]=' drivers/staging/xgifb/vb_table.h + accept '[ ]if[ ][(][/][*]KEYSPAN_PDA[*][/]request_ihex_firmware' drivers/usb/serial/keyspan_pda.c + defsnc 'static[ ]const[ ]u8[ ]sta32x_regs\[STA32X_REGISTER_COUNT\][ ]=' sound/soc/codecs/sta32x.c + defsnc 'static[ ]const[ ]u16[ ]wm8510_reg\[WM8510_CACHEREGNUM\][ ]=' sound/soc/codecs/wm8510.c + defsnc 'static[ ]const[ ]u16[ ]wm8900_reg_defaults\[WM8900_MAXREG\][ ]=' sound/soc/wm8900.c + defsnc 'static[ ]const[ ]u16[ ]wm8960_reg\[WM8960_CACHEREGNUM\][ ]=' sound/soc/codecs/wm8960.c + # Specific for the 3.7-to-3.6 reverse patch: + accept '[ ]err[ ]=[ ]request_firmware[(]&fw,[ ]patch,[ ]dev[)][;]' sound/pci/hda/hda_hwdep.c + defsnc '\(static[ ]const[ ]struct[ ]\(stk1160\|saa7113\)config\|[}]\)[ ]\(stk1160\|saa7113\)config\(PAL\|NTSC\)\?\[\(256\)\?\][ ]=' drivers/staging/easycap/easycap_low.c + accept '[ ]kernel[(]driver[)]:[ ]calls[ ]request_firmware[(]' Documentation/firmware_class/README + accept '[ ]kernel:[ ]request_firmware[(]' Documentation/firmware_class/README + accept '[ ][ ]\.firmware[ ]*=[ ]["][/][*][(]DEBLOBBED[)][*][/]["]' + accept '[;][/][*]@@[ ]-418,45[ ][+]446,68[ ]@@[*][/][;][\n]\([ ]*[2],\)*[\n]\(\([ ]*[1-4],\)*[\n]\)*\([ ]*[ 1][0-9],\)*[ ]*12' scripts/dtc/dtc-parser.tab.c_shipped + ;; + + */patch-3.5*) + accept '[;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]static[ ]void[ ]b43_request_firmware[(]' drivers/net/wireless/b43/main.c + accept '[ ][*][ ][ ][ ]3[ ]3[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[\n][ ][*][ ][ ][ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0' arch/arm/include/asm/pgtable.h + # Present in 3.5 and in patch to 3.6: + accept '[ ]*nvidia,emc-registers[ ]=[ ]<[ ]\(0[ \n]*\)*>' Documentation/devicetree/bindings/arm/tegra/emc.txt + accept '[ ]*nvidia,emc-registers[ ]=[ ]<\(0x[0-9a-f]*[ \n]*\)*>[;]' arch/arm/boot/dts/tegra-seaboard.dts + defsnc 'static[ ]unsigned[ ]long[ ]shmedia_opcode_table\[64\][ ]=' arch/sh/kernel/traps_64.c + initnc 'static[ ]const[ ]u32[ ]ar9340_1p0_baseband_postamble\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + initnc 'static[ ]const[ ]u32[ ]ar9340_1p0_baseband_core\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + initnc 'static[ ]const[ ]u32[ ]ar9340Modes_\(\(high\|low\|mixed\)_\(power\|ob_db\)\|ub124\)_tx_gain_table_1p0\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9485\(Common_wo_xlna_rx_gain\)\?_1_1\(_\(baseband\|mac\)_core\)\?\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9485_1_1_baseband_postamble\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + accept '[ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(]dev[,][ ]["]request_firmware\(_nowait\)\?[ ]failed[^\n]*[\n][ ]*complete_all[(][&]rproc->firmware_loading_complete' drivers/remoteproc/remoteproc_core.c + accept '[ ]rproc->firmware[ ][=][ ]firmware[;]' drivers/remoteproc/remoteproc_core.c + defsnc 'static[ ]int[ ]sh_clk_div6_divisors\[64\][ ]=' '\(arch/sh/kernel/cpu/clock-\|drivers/sh/clk/\)cpg\.c' + defsnc 'struct[ ]ModeInit[ ]VGAMode\[\][ ]=' drivers/staging/sm7xx/smtcfb.h + accept '[/][*][ ]*\([ 1-4][0-9][ ][ ]\)*\(5[0-6][ ][ ]\)*[*][/]' drivers/staging/vt6656/channel.c + defsnc 'static[ ]const[ ]long[ ]frequency_list\[\][ ]=' drivers/staging/vt6655/iwctl.c + accept '[ ][{]\(0x0000a288[,][ ]0x00000220\|0x0000a430[,][ ]0x1ce739ce\|0x0000a540[,][ ]0x\(49005e72\|4e02246c\)\|0x0000a5f4[,][ ]0x\(6f82bf16\|778a308c\)\|0x0000a50c[,][ ]0x10000023\|0x00009e04[,][ ]0x001c2020\|0x00009e44[,][ ]0x62321e27\)\([,][ ]0x[0-9a-f]*\)*[}][,]\([\n][ ][{]0x[0-9a-f]*\([,][ ]0x[0-9a-f]*\)*[}][,]\)*' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + # For reversal of 3.5-to-3.6 patch only. + initnc '\.irp[ ]idx' arch/x86/include/asm/entry_arch.h + initnc 'uint32_t[ ]nva3_pcopy_data\[\][ ]=' drivers/gpu/drm/nouveau/nva3_copy.fuc.h + initnc 'uint32_t[ ]nvc0_pcopy_data\[\][ ]=' drivers/gpu/drm/nouveau/nvc0_copy.fuc.h + initnc 'static[ ]__u8[ ]mode8420\(pro\|con\)\[\][ ]=' drivers/media/video/cs8420.h + defsnc 'static[ ]__u8[ ]init7121ntsc\[\][ ]=' drivers/media/video/saa7121.h + defsnc 'static[ ]__u8[ ]init7121pal\[\][ ]=' drivers/media/video/saa7121.h + defsnc 'static[ ]const[ ]u32[ ]ar9331_\(1p[12]_\(baseband\|mac\)_postamble\|modes_\(low\(est\)\?\|high\)_\(ob_db\|power\)_tx_gain_1p[12]\)\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9331_\(1p[12]_\(radio\|baseband\|mac\)_core\|common_\(wo_xlna_\)\?rx_gain_1p[12]\)\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9340_1p0_\(mac\|baseband\)_postamble\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9340Common_\(wo_xlna_\)\?rx_gain_table_1p0\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9485\(\(C\|_c\)ommon_\(wo_xlna_\)\?rx_gain\)\?_1_[01]\(_\(radio\|baseband\|mac\)_core\)\?\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9485_1_[01]_\(mac\|baseband\)_postamble\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar9485\(M\|_m\)odes_\(high\|low\|green\)\(est\)\?_\(power\|ob_db\)_tx_gain_1_[01]\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + defsnc 'static[ ]const[ ]u32[ ]\(ar9\(462\|580\)_\([12]p0_\)\?\(\(baseband\|mac\|radio\)_core\(_emulation\)\?\|\(common_\)\?\(wo_xlna_\|mixed_\)\?rx_gain_table\(_ar9280\)\?\(_[12]p0\)*\)\|ar9200_ar9280_2p0_radio_core\(_1p0\)\?\)\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9\(462\|580\)_[12]p0_initvals\.h' + defsnc 'static[ ]const[ ]u32[ ]ar9\(462\|580\)_\([12]p0_\)\?\(\(tx_gain_table_\)\?\(baseband\|mac\|radio\)_postamble\(_emulation\)\?\|\(modes_\)\?\(high\|low\(est\)\?\|mixed\|green\)_\(ob_db\|power\)_tx_gain_table\(_[12]p0\)\?\)\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9\(462\|580\)_[12]p0_initvals\.h' + defsnc 'static[ ]int[ ]ath_max_4ms_framelen\[4\]\[32\][ ]=' drivers/net/wireless/ath/ath9k/xmit.c + defsnc 'static[ ]const[ ]int[ ]\(ldo5\|buck1\)_voltage_map\[\][ ]=' drivers/regulator/lp3972.c + defsnc 'static[ ]const[ ]u16[ ]VCORE_VSEL_table\[\][ ]=' drivers/regulator/tps65023-regulator.c + defsnc 'static[ ]const[ ]u16[ ]\(VDCDC[1x]\|LDO[12]\)_VSEL_table\[\][ ]=' 'drivers/regulator/tps650\(23\|7x\)-regulator\.c' + defsnc 'static[ ]int[ ]tps6586x_\(ldo4\|sm2\|dvm\)_voltages\[\][ ]=' drivers/regulator/tps6586x-regulator.c + defsnc 'static[ ]struct[ ]vesa_mode_table[ ]vesa_mode\[\][ ]=' drivers/staging/sm7xx/smtcfb.c + defsnc 'static[ ]const[ ]unsigned[ ]short[ ]XGINew_DDRDRAM_TYPE20\[12\]\[5\][ ]=' drivers/staging/xgifb/vb_init.c + # New in 3.6: + defsnc 'static[ ]unsigned[ ]char[ ]mcf_host_slot2sid\[32\][ ]=' arch/m68k/platform/coldfire/pci.c + defsnc 'static[ ]struct[ ]aead_testvec[ ]hmac_sha\(1\|256\|512\)_aes_cbc_enc_tv_template\[\][ ]=' crypto/testmgr.h + defsnc 'static[ ]struct[ ]hash_testvec[ ]bfin_crc_tv_template\[\][ ]=' crypto/testmgr.h + defsnc '[ ]static[ ]u8[ ]bw_params\[3\]\[32\][ ]=' drivers/media/dvb/frontends/rtl2832.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm51\(02\|10\)_reva_patch\[\][ ]=' drivers/mfd/wm5102-tables.c + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_\(radio\|baseband\|mac\)_postamble\[\]\[5\][ ]' drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_\(\(radio\|mac\|baseband\)_core\|common_\(wo_xlna_\)\?rx_gain_table\)\[\]\[2\][ ]=' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h + defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_modes_\(no_\)\?xpa_tx_gain_table\[\]\[9\][ ]=' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h + blobname 'ti-connectivity[/]wl12[78]x-fw-5-\([ms]r\|plt\)\.bin' drivers/net/wireless/wl12xx/main.c + blobname 'ti-connectivity[/]wl18xx-\(fw\|conf\)\.bin' drivers/net/wireless/wl18xx/main.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]\(ldo5\|buck1\)_voltage_map\[\][ ]=' drivers/regulator/lp3972.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]\(lp872x_ldo\|lp8720_ldo4\|lp8725_\(lilo\|buck\)\)_vtbl\[\][ ]=' drivers/regulator/lp872x.c + defsnc 'const[ ]int[ ]lp8788_dldo1239_vtbl\[\][ ]=' drivers/regulator/lp8788-ldo.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]mc13892_sw1\?\[\][ ]=' drivers/regulator/mc13892-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]VCORE_VSEL_table\[\][ ]=' drivers/regulator/tps65023-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]VDCDCx_VSEL_table\[\][ ]=' drivers/regulator/tps6507x-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]dcdc[12]_voltages\[\][ ]=' drivers/regulator/tps6524x-regulator.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]tps6586x_\(ldo4\|sm2\|dvm\)_voltages\[\][ ]=' drivers/regulator/tps6586x-regulator.c + defsnc 'static[ ]struct[ ]bcm_ddr_setting[ ]asT3\(LP\)\?B\?_DDRSetting\(160\|133\|100\|80\)MHz\[\][ ]\?=' drivers/staging/bcm/DDRInit.c + defsnc '[ ]*static[ ]const[ ]u8[ ]arp_req\[36\][ ]=' drivers/staging/csr/sme_sys.c + defsnc 'omap4430_adc_to_temp\[OMAP4430_ADC_END_VALUE[ ]-[ ]OMAP4430_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap4-thermal.c + defsnc 'omap4460_adc_to_temp\[OMAP4460_ADC_END_VALUE[ ]-[ ]OMAP4460_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap4-thermal.c + defsnc 'omap5430_adc_to_temp\[OMAP5430_ADC_END_VALUE[ ]-[ ]OMAP5430_ADC_START_VALUE[ ][+][ ]1\][ ]=' drivers/staging/oma-thermal/omap5-thermal.c + defsnc 'static[ ]struct[ ]vesa_mode[ ]vesa_mode_table\[\][ ]=' drivers/staging/sm7xxfb/sm7xxfb.c + defsnc 'static[ ]struct[ ]SiS_\(LCD\|LVDS\)Data[ ][ ]*XGI_\(\(\(St\|Ext\)LCD\|LVDS\)\(1024x768\|1280x1024\|1400x1050\)\|NoScaling\)Data\(_[12]\)\?\[\][ ]=' drivers/staging/xgifb/vb_table.h + defsnc 'static[ ]unsigned[ ]char[ ]rdesc\[\][ ]=' samples/uhid/uhid-example.c + defsnc 'static[ ]struct[ ]reg_default[ ]isabelle_reg_defs\[\][ ]=' sound/soc/codecs/isabelle.c + blobname 'dvb-usb-terratec-htc-stick-drxk\.fw' drivers/media/video/em28xx/em28xx-dvb.c + blobname 'rtl_nic[/]rtl8106e-1\.fw' drivers/net/ethernet/realtek/r8169.c + blobname 'rtl_nic[/]rtl8168g-1\.fw' drivers/net/ethernet/realtek/r8169.c + defsnc '[ ]static[ ]const[ ]u16[ ]mac_ocp_patch\[\][ ]=' in drivers/net/ethernet/realtek/r8169.c + blobname 'rt3290\.bin\(\.[\n][ ][ ][*][/]\)\?' drivers/net/wireless/rt2x00/rt2800pci.h + ;; + */patch-3.4*gnu*3.5*) # This is far too general for deblobbing, but ok for patch checking. defsnc '[;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[*][/][;][\n][ ][{]0x0000\(9830\|a288\|a0b4\|a138\)[,][ ]0x00000[0-9a-f]*[}]\?[,]' drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h @@ -3318,8 +3864,9 @@ set_except () { accept '[ ][{]0xa1[,][ ]0x6e[,][ ][0-9xa-f, ]*[,][ ]0x00[,][ ]0x10[}][,]\([\n][ ][{]0x[ac]1[,][ ]0x6e[,][ ][0-9xa-f, ]*[,][ ]0x00[,][ ]0x10[}][,][}][,]\)*' drivers/media/video/gspca/sonixj.c ;; - */3.4.1-stable-queue.patch* | */patch-3.4.*) + */3.4.1-stable-queue.patch* | */patch-3.4*) accept '[;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]static[ ]void[ ]b43legacy_request_firmware[(]s[^\n]*[*][/][;]' drivers/net/wireless/b43legacy/main.c + accept '[ ][*][ ][ ][ ]3[ ]3[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]2[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[ ]1[\n][ ][*][ ][ ][ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0[ ]9[ ]8[ ]7[ ]6[ ]5[ ]4[ ]3[ ]2[ ]1[ ]0' arch/arm/include/asm/pgtable.h ;; */atl1c_net_next_update-3.[34].patch) diff --git a/freed-ora/current/master/deblob-main b/freed-ora/current/master/deblob-main index 6ec8e69bf..63d0c9325 100755 --- a/freed-ora/current/master/deblob-main +++ b/freed-ora/current/master/deblob-main @@ -74,6 +74,10 @@ case $1 in *) force=;; esac +# We don't want e.g. diff output translations to affect us. +LC_ALL=C; export LC_ALL +LANGUAGE=C; export LANGUAGE + mver=$1 extra=$2 sver=$3 kver=$mver$sver gnu=gnu$extra deblob= dir=`echo "$0" | sed 's,[^/]*$,,;s,^$,.,;s,/*$,,'` diff --git a/freed-ora/current/master/efivarfs-3.7.patch b/freed-ora/current/master/efivarfs-3.7.patch new file mode 100644 index 000000000..300910716 --- /dev/null +++ b/freed-ora/current/master/efivarfs-3.7.patch @@ -0,0 +1,1630 @@ +From cb6f23ee9601297c3c70d0cfe3d77dfde9bd119d Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Fri, 5 Oct 2012 13:54:56 +0800 +Subject: [PATCH 01/17] efi: Add support for a UEFI variable filesystem + +The existing EFI variables code only supports variables of up to 1024 +bytes. This limitation existed in version 0.99 of the EFI specification, +but was removed before any full releases. Since variables can now be +larger than a single page, sysfs isn't the best interface for this. So, +instead, let's add a filesystem. Variables can be read, written and +created, with the first 4 bytes of each variable representing its UEFI +attributes. The create() method doesn't actually commit to flash since +zero-length variables can't exist per-spec. + +Updates from Jeremy Kerr <jeremy.kerr@canonical.com>. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 384 ++++++++++++++++++++++++++++++++++++++++++++- + include/linux/efi.h | 5 + + 2 files changed, 383 insertions(+), 6 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index d10c987..b605c48 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -80,6 +80,10 @@ + #include <linux/slab.h> + #include <linux/pstore.h> + ++#include <linux/fs.h> ++#include <linux/ramfs.h> ++#include <linux/pagemap.h> ++ + #include <asm/uaccess.h> + + #define EFIVARS_VERSION "0.08" +@@ -91,6 +95,7 @@ MODULE_LICENSE("GPL"); + MODULE_VERSION(EFIVARS_VERSION); + + #define DUMP_NAME_LEN 52 ++#define GUID_LEN 37 + + /* + * The maximum size of VariableName + Data = 1024 +@@ -108,7 +113,6 @@ struct efi_variable { + __u32 Attributes; + } __attribute__((packed)); + +- + struct efivar_entry { + struct efivars *efivars; + struct efi_variable var; +@@ -122,6 +126,9 @@ struct efivar_attribute { + ssize_t (*store)(struct efivar_entry *entry, const char *buf, size_t count); + }; + ++static struct efivars __efivars; ++static struct efivar_operations ops; ++ + #define PSTORE_EFI_ATTRIBUTES \ + (EFI_VARIABLE_NON_VOLATILE | \ + EFI_VARIABLE_BOOTSERVICE_ACCESS | \ +@@ -629,14 +636,380 @@ static struct kobj_type efivar_ktype = { + .default_attrs = def_attrs, + }; + +-static struct pstore_info efi_pstore_info; +- + static inline void + efivar_unregister(struct efivar_entry *var) + { + kobject_put(&var->kobj); + } + ++static int efivarfs_file_open(struct inode *inode, struct file *file) ++{ ++ file->private_data = inode->i_private; ++ return 0; ++} ++ ++static ssize_t efivarfs_file_write(struct file *file, ++ const char __user *userbuf, size_t count, loff_t *ppos) ++{ ++ struct efivar_entry *var = file->private_data; ++ struct efivars *efivars; ++ efi_status_t status; ++ void *data; ++ u32 attributes; ++ struct inode *inode = file->f_mapping->host; ++ int datasize = count - sizeof(attributes); ++ ++ if (count < sizeof(attributes)) ++ return -EINVAL; ++ ++ data = kmalloc(datasize, GFP_KERNEL); ++ ++ if (!data) ++ return -ENOMEM; ++ ++ efivars = var->efivars; ++ ++ if (copy_from_user(&attributes, userbuf, sizeof(attributes))) { ++ count = -EFAULT; ++ goto out; ++ } ++ ++ if (attributes & ~(EFI_VARIABLE_MASK)) { ++ count = -EINVAL; ++ goto out; ++ } ++ ++ if (copy_from_user(data, userbuf + sizeof(attributes), datasize)) { ++ count = -EFAULT; ++ goto out; ++ } ++ ++ if (validate_var(&var->var, data, datasize) == false) { ++ count = -EINVAL; ++ goto out; ++ } ++ ++ status = efivars->ops->set_variable(var->var.VariableName, ++ &var->var.VendorGuid, ++ attributes, datasize, ++ data); ++ ++ switch (status) { ++ case EFI_SUCCESS: ++ mutex_lock(&inode->i_mutex); ++ i_size_write(inode, count); ++ mutex_unlock(&inode->i_mutex); ++ break; ++ case EFI_INVALID_PARAMETER: ++ count = -EINVAL; ++ break; ++ case EFI_OUT_OF_RESOURCES: ++ count = -ENOSPC; ++ break; ++ case EFI_DEVICE_ERROR: ++ count = -EIO; ++ break; ++ case EFI_WRITE_PROTECTED: ++ count = -EROFS; ++ break; ++ case EFI_SECURITY_VIOLATION: ++ count = -EACCES; ++ break; ++ case EFI_NOT_FOUND: ++ count = -ENOENT; ++ break; ++ default: ++ count = -EINVAL; ++ break; ++ } ++out: ++ kfree(data); ++ ++ return count; ++} ++ ++static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, ++ size_t count, loff_t *ppos) ++{ ++ struct efivar_entry *var = file->private_data; ++ struct efivars *efivars = var->efivars; ++ efi_status_t status; ++ unsigned long datasize = 0; ++ u32 attributes; ++ void *data; ++ ssize_t size; ++ ++ status = efivars->ops->get_variable(var->var.VariableName, ++ &var->var.VendorGuid, ++ &attributes, &datasize, NULL); ++ ++ if (status != EFI_BUFFER_TOO_SMALL) ++ return 0; ++ ++ data = kmalloc(datasize + 4, GFP_KERNEL); ++ ++ if (!data) ++ return 0; ++ ++ status = efivars->ops->get_variable(var->var.VariableName, ++ &var->var.VendorGuid, ++ &attributes, &datasize, ++ (data + 4)); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ memcpy(data, &attributes, 4); ++ size = simple_read_from_buffer(userbuf, count, ppos, ++ data, datasize + 4); ++ kfree(data); ++ ++ return size; ++} ++ ++static void efivarfs_evict_inode(struct inode *inode) ++{ ++ clear_inode(inode); ++} ++ ++static const struct super_operations efivarfs_ops = { ++ .statfs = simple_statfs, ++ .drop_inode = generic_delete_inode, ++ .evict_inode = efivarfs_evict_inode, ++ .show_options = generic_show_options, ++}; ++ ++static struct super_block *efivarfs_sb; ++ ++static const struct inode_operations efivarfs_dir_inode_operations; ++ ++static const struct file_operations efivarfs_file_operations = { ++ .open = efivarfs_file_open, ++ .read = efivarfs_file_read, ++ .write = efivarfs_file_write, ++ .llseek = no_llseek, ++}; ++ ++static struct inode *efivarfs_get_inode(struct super_block *sb, ++ const struct inode *dir, int mode, dev_t dev) ++{ ++ struct inode *inode = new_inode(sb); ++ ++ if (inode) { ++ inode->i_ino = get_next_ino(); ++ inode->i_uid = inode->i_gid = 0; ++ inode->i_mode = mode; ++ inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; ++ switch (mode & S_IFMT) { ++ case S_IFREG: ++ inode->i_fop = &efivarfs_file_operations; ++ break; ++ case S_IFDIR: ++ inode->i_op = &efivarfs_dir_inode_operations; ++ inode->i_fop = &simple_dir_operations; ++ inc_nlink(inode); ++ break; ++ } ++ } ++ return inode; ++} ++ ++static void efivarfs_hex_to_guid(const char *str, efi_guid_t *guid) ++{ ++ guid->b[0] = hex_to_bin(str[6]) << 4 | hex_to_bin(str[7]); ++ guid->b[1] = hex_to_bin(str[4]) << 4 | hex_to_bin(str[5]); ++ guid->b[2] = hex_to_bin(str[2]) << 4 | hex_to_bin(str[3]); ++ guid->b[3] = hex_to_bin(str[0]) << 4 | hex_to_bin(str[1]); ++ guid->b[4] = hex_to_bin(str[11]) << 4 | hex_to_bin(str[12]); ++ guid->b[5] = hex_to_bin(str[9]) << 4 | hex_to_bin(str[10]); ++ guid->b[6] = hex_to_bin(str[16]) << 4 | hex_to_bin(str[17]); ++ guid->b[7] = hex_to_bin(str[14]) << 4 | hex_to_bin(str[15]); ++ guid->b[8] = hex_to_bin(str[19]) << 4 | hex_to_bin(str[20]); ++ guid->b[9] = hex_to_bin(str[21]) << 4 | hex_to_bin(str[22]); ++ guid->b[10] = hex_to_bin(str[24]) << 4 | hex_to_bin(str[25]); ++ guid->b[11] = hex_to_bin(str[26]) << 4 | hex_to_bin(str[27]); ++ guid->b[12] = hex_to_bin(str[28]) << 4 | hex_to_bin(str[29]); ++ guid->b[13] = hex_to_bin(str[30]) << 4 | hex_to_bin(str[31]); ++ guid->b[14] = hex_to_bin(str[32]) << 4 | hex_to_bin(str[33]); ++ guid->b[15] = hex_to_bin(str[34]) << 4 | hex_to_bin(str[35]); ++} ++ ++static int efivarfs_create(struct inode *dir, struct dentry *dentry, ++ umode_t mode, bool excl) ++{ ++ struct inode *inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0); ++ struct efivars *efivars = &__efivars; ++ struct efivar_entry *var; ++ int namelen, i = 0, err = 0; ++ ++ if (dentry->d_name.len < 38) ++ return -EINVAL; ++ ++ if (!inode) ++ return -ENOSPC; ++ ++ var = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL); ++ ++ if (!var) ++ return -ENOMEM; ++ ++ namelen = dentry->d_name.len - GUID_LEN; ++ ++ efivarfs_hex_to_guid(dentry->d_name.name + namelen + 1, ++ &var->var.VendorGuid); ++ ++ for (i = 0; i < namelen; i++) ++ var->var.VariableName[i] = dentry->d_name.name[i]; ++ ++ var->var.VariableName[i] = '\0'; ++ ++ inode->i_private = var; ++ var->efivars = efivars; ++ var->kobj.kset = efivars->kset; ++ ++ err = kobject_init_and_add(&var->kobj, &efivar_ktype, NULL, "%s", ++ dentry->d_name.name); ++ if (err) ++ goto out; ++ ++ kobject_uevent(&var->kobj, KOBJ_ADD); ++ spin_lock(&efivars->lock); ++ list_add(&var->list, &efivars->list); ++ spin_unlock(&efivars->lock); ++ d_instantiate(dentry, inode); ++ dget(dentry); ++out: ++ if (err) ++ kfree(var); ++ return err; ++} ++ ++static int efivarfs_unlink(struct inode *dir, struct dentry *dentry) ++{ ++ struct efivar_entry *var = dentry->d_inode->i_private; ++ struct efivars *efivars = var->efivars; ++ efi_status_t status; ++ ++ spin_lock(&efivars->lock); ++ ++ status = efivars->ops->set_variable(var->var.VariableName, ++ &var->var.VendorGuid, ++ 0, 0, NULL); ++ ++ if (status == EFI_SUCCESS || status == EFI_NOT_FOUND) { ++ list_del(&var->list); ++ spin_unlock(&efivars->lock); ++ efivar_unregister(var); ++ drop_nlink(dir); ++ dput(dentry); ++ return 0; ++ } ++ ++ spin_unlock(&efivars->lock); ++ return -EINVAL; ++}; ++ ++int efivarfs_fill_super(struct super_block *sb, void *data, int silent) ++{ ++ struct inode *inode = NULL; ++ struct dentry *root; ++ struct efivar_entry *entry, *n; ++ struct efivars *efivars = &__efivars; ++ int err; ++ ++ efivarfs_sb = sb; ++ ++ sb->s_maxbytes = MAX_LFS_FILESIZE; ++ sb->s_blocksize = PAGE_CACHE_SIZE; ++ sb->s_blocksize_bits = PAGE_CACHE_SHIFT; ++ sb->s_magic = PSTOREFS_MAGIC; ++ sb->s_op = &efivarfs_ops; ++ sb->s_time_gran = 1; ++ ++ inode = efivarfs_get_inode(sb, NULL, S_IFDIR | 0755, 0); ++ if (!inode) { ++ err = -ENOMEM; ++ goto fail; ++ } ++ inode->i_op = &efivarfs_dir_inode_operations; ++ ++ root = d_make_root(inode); ++ sb->s_root = root; ++ if (!root) { ++ err = -ENOMEM; ++ goto fail; ++ } ++ ++ list_for_each_entry_safe(entry, n, &efivars->list, list) { ++ struct inode *inode; ++ struct dentry *dentry, *root = efivarfs_sb->s_root; ++ char *name; ++ unsigned long size = 0; ++ int len, i; ++ ++ len = utf16_strlen(entry->var.VariableName); ++ ++ /* GUID plus trailing NULL */ ++ name = kmalloc(len + 38, GFP_ATOMIC); ++ ++ for (i = 0; i < len; i++) ++ name[i] = entry->var.VariableName[i] & 0xFF; ++ ++ name[len] = '-'; ++ ++ efi_guid_unparse(&entry->var.VendorGuid, name + len + 1); ++ ++ name[len+GUID_LEN] = '\0'; ++ ++ inode = efivarfs_get_inode(efivarfs_sb, root->d_inode, ++ S_IFREG | 0644, 0); ++ dentry = d_alloc_name(root, name); ++ ++ efivars->ops->get_variable(entry->var.VariableName, ++ &entry->var.VendorGuid, ++ &entry->var.Attributes, ++ &size, ++ NULL); ++ ++ mutex_lock(&inode->i_mutex); ++ inode->i_private = entry; ++ i_size_write(inode, size+4); ++ mutex_unlock(&inode->i_mutex); ++ d_add(dentry, inode); ++ } ++ ++ return 0; ++fail: ++ iput(inode); ++ return err; ++} ++ ++static struct dentry *efivarfs_mount(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *data) ++{ ++ return mount_single(fs_type, flags, data, efivarfs_fill_super); ++} ++ ++static void efivarfs_kill_sb(struct super_block *sb) ++{ ++ kill_litter_super(sb); ++ efivarfs_sb = NULL; ++} ++ ++static struct file_system_type efivarfs_type = { ++ .name = "efivarfs", ++ .mount = efivarfs_mount, ++ .kill_sb = efivarfs_kill_sb, ++}; ++ ++static const struct inode_operations efivarfs_dir_inode_operations = { ++ .lookup = simple_lookup, ++ .unlink = efivarfs_unlink, ++ .create = efivarfs_create, ++}; ++ ++static struct pstore_info efi_pstore_info; ++ + #ifdef CONFIG_PSTORE + + static int efi_pstore_open(struct pstore_info *psi) +@@ -1198,6 +1571,8 @@ int register_efivars(struct efivars *efivars, + pstore_register(&efivars->efi_pstore_info); + } + ++ register_filesystem(&efivarfs_type); ++ + out: + kfree(variable_name); + +@@ -1205,9 +1580,6 @@ out: + } + EXPORT_SYMBOL_GPL(register_efivars); + +-static struct efivars __efivars; +-static struct efivar_operations ops; +- + /* + * For now we register the efi subsystem with the firmware subsystem + * and the vars subsystem with the efi subsystem. In the future, it +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 8670eb1..b2af157 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -29,7 +29,12 @@ + #define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1))) + #define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1))) + #define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1))) ++#define EFI_NOT_READY ( 6 | (1UL << (BITS_PER_LONG-1))) ++#define EFI_DEVICE_ERROR ( 7 | (1UL << (BITS_PER_LONG-1))) ++#define EFI_WRITE_PROTECTED ( 8 | (1UL << (BITS_PER_LONG-1))) ++#define EFI_OUT_OF_RESOURCES ( 9 | (1UL << (BITS_PER_LONG-1))) + #define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1))) ++#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1))) + + typedef unsigned long efi_status_t; + typedef u8 efi_bool_t; +-- +1.7.12.1 + + +From 2fc1dc88e97665c70f203f0132232ea55e8dd7eb Mon Sep 17 00:00:00 2001 +From: Jeremy Kerr <jeremy.kerr@canonical.com> +Date: Fri, 5 Oct 2012 13:54:56 +0800 +Subject: [PATCH 02/17] efi: Handle deletions and size changes in + efivarfs_write_file + +A write to an efivarfs file will not always result in a variable of +'count' size after the EFI SetVariable() call. We may have appended to +the existing data (ie, with the EFI_VARIABLE_APPEND_WRITE attribute), or +even have deleted the variable (with an authenticated variable update, +with a zero datasize). + +This change re-reads the updated variable from firmware, to check for +size changes and deletions. In the latter case, we need to drop the +dentry. + +Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 49 ++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 39 insertions(+), 10 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index b605c48..d7658b4 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -658,6 +658,7 @@ static ssize_t efivarfs_file_write(struct file *file, + u32 attributes; + struct inode *inode = file->f_mapping->host; + int datasize = count - sizeof(attributes); ++ unsigned long newdatasize; + + if (count < sizeof(attributes)) + return -EINVAL; +@@ -696,32 +697,60 @@ static ssize_t efivarfs_file_write(struct file *file, + + switch (status) { + case EFI_SUCCESS: +- mutex_lock(&inode->i_mutex); +- i_size_write(inode, count); +- mutex_unlock(&inode->i_mutex); + break; + case EFI_INVALID_PARAMETER: + count = -EINVAL; +- break; ++ goto out; + case EFI_OUT_OF_RESOURCES: + count = -ENOSPC; +- break; ++ goto out; + case EFI_DEVICE_ERROR: + count = -EIO; +- break; ++ goto out; + case EFI_WRITE_PROTECTED: + count = -EROFS; +- break; ++ goto out; + case EFI_SECURITY_VIOLATION: + count = -EACCES; +- break; ++ goto out; + case EFI_NOT_FOUND: + count = -ENOENT; +- break; ++ goto out; + default: + count = -EINVAL; +- break; ++ goto out; + } ++ ++ /* ++ * Writing to the variable may have caused a change in size (which ++ * could either be an append or an overwrite), or the variable to be ++ * deleted. Perform a GetVariable() so we can tell what actually ++ * happened. ++ */ ++ newdatasize = 0; ++ status = efivars->ops->get_variable(var->var.VariableName, ++ &var->var.VendorGuid, ++ NULL, &newdatasize, ++ NULL); ++ ++ if (status == EFI_BUFFER_TOO_SMALL) { ++ mutex_lock(&inode->i_mutex); ++ i_size_write(inode, newdatasize + sizeof(attributes)); ++ mutex_unlock(&inode->i_mutex); ++ ++ } else if (status == EFI_NOT_FOUND) { ++ spin_lock(&efivars->lock); ++ list_del(&var->list); ++ spin_unlock(&efivars->lock); ++ efivar_unregister(var); ++ drop_nlink(inode); ++ dput(file->f_dentry); ++ ++ } else { ++ pr_warn("efivarfs: inconsistent EFI variable implementation? " ++ "status = %lx\n", status); ++ } ++ + out: + kfree(data); + +-- +1.7.12.1 + + +From c98611fc95672862950c9bc4d6a3a4c4453a3c3e Mon Sep 17 00:00:00 2001 +From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com> +Date: Fri, 5 Oct 2012 13:54:56 +0800 +Subject: [PATCH 03/17] efi: add efivars kobject to efi sysfs folder + +UEFI variable filesystem need a new mount point, so this patch add +efivars kobject to efi_kobj for create a /sys/firmware/efi/efivars +folder. + +Cc: Matthew Garrett <mjg@redhat.com> +Cc: H. Peter Anvin <hpa@zytor.com> +Signed-off-by: Lee, Chun-Yi <jlee@suse.com> +Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 9 +++++++++ + include/linux/efi.h | 1 + + 2 files changed, 10 insertions(+) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index d7658b4..6793965 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -1527,6 +1527,7 @@ void unregister_efivars(struct efivars *efivars) + sysfs_remove_bin_file(&efivars->kset->kobj, efivars->del_var); + kfree(efivars->new_var); + kfree(efivars->del_var); ++ kobject_put(efivars->kobject); + kset_unregister(efivars->kset); + } + EXPORT_SYMBOL_GPL(unregister_efivars); +@@ -1558,6 +1559,14 @@ int register_efivars(struct efivars *efivars, + goto out; + } + ++ efivars->kobject = kobject_create_and_add("efivars", parent_kobj); ++ if (!efivars->kobject) { ++ pr_err("efivars: Subsystem registration failed.\n"); ++ error = -ENOMEM; ++ kset_unregister(efivars->kset); ++ goto out; ++ } ++ + /* + * Per EFI spec, the maximum storage allocated for both + * the variable name and variable data is 1024 bytes. +diff --git a/include/linux/efi.h b/include/linux/efi.h +index b2af157..337aefb 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -662,6 +662,7 @@ struct efivars { + spinlock_t lock; + struct list_head list; + struct kset *kset; ++ struct kobject *kobject; + struct bin_attribute *new_var, *del_var; + const struct efivar_operations *ops; + struct efivar_entry *walk_entry; +-- +1.7.12.1 + + +From 8ef5f49da57087022f2031820ceb3b1c6101d76c Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Thu, 4 Oct 2012 09:57:31 +0100 +Subject: [PATCH 04/17] efivarfs: Add documentation for the EFI variable + filesystem + +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + Documentation/filesystems/00-INDEX | 2 ++ + Documentation/filesystems/efivarfs.txt | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+) + create mode 100644 Documentation/filesystems/efivarfs.txt + +diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX +index 8c624a1..7b52ba7 100644 +--- a/Documentation/filesystems/00-INDEX ++++ b/Documentation/filesystems/00-INDEX +@@ -38,6 +38,8 @@ dnotify_test.c + - example program for dnotify + ecryptfs.txt + - docs on eCryptfs: stacked cryptographic filesystem for Linux. ++efivarfs.txt ++ - info for the efivarfs filesystem. + exofs.txt + - info, usage, mount options, design about EXOFS. + ext2.txt +diff --git a/Documentation/filesystems/efivarfs.txt b/Documentation/filesystems/efivarfs.txt +new file mode 100644 +index 0000000..c477af0 +--- /dev/null ++++ b/Documentation/filesystems/efivarfs.txt +@@ -0,0 +1,16 @@ ++ ++efivarfs - a (U)EFI variable filesystem ++ ++The efivarfs filesystem was created to address the shortcomings of ++using entries in sysfs to maintain EFI variables. The old sysfs EFI ++variables code only supported variables of up to 1024 bytes. This ++limitation existed in version 0.99 of the EFI specification, but was ++removed before any full releases. Since variables can now be larger ++than a single page, sysfs isn't the best interface for this. ++ ++Variables can be created, deleted and modified with the efivarfs ++filesystem. ++ ++efivarfs is typically mounted like this, ++ ++ mount -t efivarfs none /sys/firmware/efi/efivars +-- +1.7.12.1 + + +From f69c39248e2f1eebf24f5ee55139602c56d15aec Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft <apw@canonical.com> +Date: Thu, 11 Oct 2012 11:32:17 +0100 +Subject: [PATCH 05/17] efivarfs: efivarfs_file_read ensure we free data in + error paths + +Signed-off-by: Andy Whitcroft <apw@canonical.com> +Acked-by: Matthew Garrett <mjg@redhat.com> +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 6793965..b7c9a32 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -766,7 +766,7 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + unsigned long datasize = 0; + u32 attributes; + void *data; +- ssize_t size; ++ ssize_t size = 0; + + status = efivars->ops->get_variable(var->var.VariableName, + &var->var.VendorGuid, +@@ -784,13 +784,13 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + &var->var.VendorGuid, + &attributes, &datasize, + (data + 4)); +- + if (status != EFI_SUCCESS) +- return 0; ++ goto out_free; + + memcpy(data, &attributes, 4); + size = simple_read_from_buffer(userbuf, count, ppos, + data, datasize + 4); ++out_free: + kfree(data); + + return size; +-- +1.7.12.1 + + +From 429136e16c7c43bbebb8b8030203161a2d3fc3ce Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft <apw@canonical.com> +Date: Thu, 11 Oct 2012 11:32:18 +0100 +Subject: [PATCH 06/17] efivarfs: efivarfs_create() ensure we drop our + reference on inode on error + +Signed-off-by: Andy Whitcroft <apw@canonical.com> +Acked-by: Matthew Garrett <mjg@redhat.com> +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index b7c9a32..6e5f367 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -866,7 +866,7 @@ static void efivarfs_hex_to_guid(const char *str, efi_guid_t *guid) + static int efivarfs_create(struct inode *dir, struct dentry *dentry, + umode_t mode, bool excl) + { +- struct inode *inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0); ++ struct inode *inode; + struct efivars *efivars = &__efivars; + struct efivar_entry *var; + int namelen, i = 0, err = 0; +@@ -874,13 +874,15 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, + if (dentry->d_name.len < 38) + return -EINVAL; + ++ inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0); + if (!inode) + return -ENOSPC; + + var = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL); +- +- if (!var) +- return -ENOMEM; ++ if (!var) { ++ err = -ENOMEM; ++ goto out; ++ } + + namelen = dentry->d_name.len - GUID_LEN; + +@@ -908,8 +910,10 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, + d_instantiate(dentry, inode); + dget(dentry); + out: +- if (err) ++ if (err) { + kfree(var); ++ iput(inode); ++ } + return err; + } + +-- +1.7.12.1 + + +From 1a19268e8a4bae43c1feb3f71ee468c6bc70aca6 Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft <apw@canonical.com> +Date: Thu, 11 Oct 2012 11:32:19 +0100 +Subject: [PATCH 07/17] efivarfs: efivarfs_fill_super() fix inode reference + counts + +When d_make_root() fails it will automatically drop the reference +on the root inode. We should not be doing so as well. + +Signed-off-by: Andy Whitcroft <apw@canonical.com> +Acked-by: Matthew Garrett <mjg@redhat.com> +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 6e5f367..adfc486 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -948,7 +948,6 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + struct dentry *root; + struct efivar_entry *entry, *n; + struct efivars *efivars = &__efivars; +- int err; + + efivarfs_sb = sb; + +@@ -960,18 +959,14 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + sb->s_time_gran = 1; + + inode = efivarfs_get_inode(sb, NULL, S_IFDIR | 0755, 0); +- if (!inode) { +- err = -ENOMEM; +- goto fail; +- } ++ if (!inode) ++ return -ENOMEM; + inode->i_op = &efivarfs_dir_inode_operations; + + root = d_make_root(inode); + sb->s_root = root; +- if (!root) { +- err = -ENOMEM; +- goto fail; +- } ++ if (!root) ++ return -ENOMEM; + + list_for_each_entry_safe(entry, n, &efivars->list, list) { + struct inode *inode; +@@ -1012,9 +1007,6 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + } + + return 0; +-fail: +- iput(inode); +- return err; + } + + static struct dentry *efivarfs_mount(struct file_system_type *fs_type, +-- +1.7.12.1 + + +From f0d90a4024493aed6fc77ce5cd3b93f278fed9c0 Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft <apw@canonical.com> +Date: Thu, 11 Oct 2012 11:32:20 +0100 +Subject: [PATCH 08/17] efivarfs: efivarfs_fill_super() ensure we free our + temporary name + +d_alloc_name() copies the passed name to new storage, once complete we +no longer need our name. + +Signed-off-by: Andy Whitcroft <apw@canonical.com> +Acked-by: Matthew Garrett <mjg@redhat.com> +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index adfc486..36b3dd6 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -992,6 +992,8 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + inode = efivarfs_get_inode(efivarfs_sb, root->d_inode, + S_IFREG | 0644, 0); + dentry = d_alloc_name(root, name); ++ /* copied by the above to local storage in the dentry. */ ++ kfree(name); + + efivars->ops->get_variable(entry->var.VariableName, + &entry->var.VendorGuid, +-- +1.7.12.1 + + +From c4cf244c318218153200d0011d8ef0ebcf3146ea Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft <apw@canonical.com> +Date: Thu, 11 Oct 2012 11:32:21 +0100 +Subject: [PATCH 09/17] efivarfs: efivarfs_fill_super() ensure we clean up + correctly on error + +Ensure we free both the name and inode on error when building the +individual variables. + +Signed-off-by: Andy Whitcroft <apw@canonical.com> +Acked-by: Matthew Garrett <mjg@redhat.com> +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 36b3dd6..216086d 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -948,6 +948,7 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + struct dentry *root; + struct efivar_entry *entry, *n; + struct efivars *efivars = &__efivars; ++ char *name; + + efivarfs_sb = sb; + +@@ -969,16 +970,18 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + return -ENOMEM; + + list_for_each_entry_safe(entry, n, &efivars->list, list) { +- struct inode *inode; + struct dentry *dentry, *root = efivarfs_sb->s_root; +- char *name; + unsigned long size = 0; + int len, i; + ++ inode = NULL; ++ + len = utf16_strlen(entry->var.VariableName); + + /* GUID plus trailing NULL */ + name = kmalloc(len + 38, GFP_ATOMIC); ++ if (!name) ++ goto fail; + + for (i = 0; i < len; i++) + name[i] = entry->var.VariableName[i] & 0xFF; +@@ -991,7 +994,13 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + + inode = efivarfs_get_inode(efivarfs_sb, root->d_inode, + S_IFREG | 0644, 0); ++ if (!inode) ++ goto fail_name; ++ + dentry = d_alloc_name(root, name); ++ if (!dentry) ++ goto fail_inode; ++ + /* copied by the above to local storage in the dentry. */ + kfree(name); + +@@ -1009,6 +1018,13 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + } + + return 0; ++ ++fail_inode: ++ iput(inode); ++fail_name: ++ kfree(name); ++fail: ++ return -ENOMEM; + } + + static struct dentry *efivarfs_mount(struct file_system_type *fs_type, +-- +1.7.12.1 + + +From d3b7165568bcb50e4526c3dadda59e43f6681bc0 Mon Sep 17 00:00:00 2001 +From: Jeremy Kerr <jeremy.kerr@canonical.com> +Date: Thu, 11 Oct 2012 21:19:11 +0800 +Subject: [PATCH 10/17] efivarfs: Implement exclusive access for + {get,set}_variable + +Currently, efivarfs does not enforce exclusion over the get_variable and +set_variable operations. Section 7.1 of UEFI requires us to only allow a +single processor to enter {get,set}_variable services at once. + +This change acquires the efivars->lock over calls to these operations +from the efivarfs paths. + +Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 68 +++++++++++++++++++++++++++++----------------- + 1 file changed, 43 insertions(+), 25 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 216086d..d478c56 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -690,35 +690,45 @@ static ssize_t efivarfs_file_write(struct file *file, + goto out; + } + ++ /* ++ * The lock here protects the get_variable call, the conditional ++ * set_variable call, and removal of the variable from the efivars ++ * list (in the case of an authenticated delete). ++ */ ++ spin_lock(&efivars->lock); ++ + status = efivars->ops->set_variable(var->var.VariableName, + &var->var.VendorGuid, + attributes, datasize, + data); + +- switch (status) { +- case EFI_SUCCESS: +- break; +- case EFI_INVALID_PARAMETER: +- count = -EINVAL; +- goto out; +- case EFI_OUT_OF_RESOURCES: +- count = -ENOSPC; +- goto out; +- case EFI_DEVICE_ERROR: +- count = -EIO; +- goto out; +- case EFI_WRITE_PROTECTED: +- count = -EROFS; +- goto out; +- case EFI_SECURITY_VIOLATION: +- count = -EACCES; +- goto out; +- case EFI_NOT_FOUND: +- count = -ENOENT; +- goto out; +- default: +- count = -EINVAL; +- goto out; ++ if (status != EFI_SUCCESS) { ++ spin_unlock(&efivars->lock); ++ kfree(data); ++ ++ switch (status) { ++ case EFI_INVALID_PARAMETER: ++ count = -EINVAL; ++ break; ++ case EFI_OUT_OF_RESOURCES: ++ count = -ENOSPC; ++ break; ++ case EFI_DEVICE_ERROR: ++ count = -EIO; ++ break; ++ case EFI_WRITE_PROTECTED: ++ count = -EROFS; ++ break; ++ case EFI_SECURITY_VIOLATION: ++ count = -EACCES; ++ break; ++ case EFI_NOT_FOUND: ++ count = -ENOENT; ++ break; ++ default: ++ count = -EINVAL; ++ } ++ return count; + } + + /* +@@ -734,12 +744,12 @@ static ssize_t efivarfs_file_write(struct file *file, + NULL); + + if (status == EFI_BUFFER_TOO_SMALL) { ++ spin_unlock(&efivars->lock); + mutex_lock(&inode->i_mutex); + i_size_write(inode, newdatasize + sizeof(attributes)); + mutex_unlock(&inode->i_mutex); + + } else if (status == EFI_NOT_FOUND) { +- spin_lock(&efivars->lock); + list_del(&var->list); + spin_unlock(&efivars->lock); + efivar_unregister(var); +@@ -747,6 +757,7 @@ static ssize_t efivarfs_file_write(struct file *file, + dput(file->f_dentry); + + } else { ++ spin_unlock(&efivars->lock); + pr_warn("efivarfs: inconsistent EFI variable implementation? " + "status = %lx\n", status); + } +@@ -768,9 +779,11 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + void *data; + ssize_t size = 0; + ++ spin_lock(&efivars->lock); + status = efivars->ops->get_variable(var->var.VariableName, + &var->var.VendorGuid, + &attributes, &datasize, NULL); ++ spin_unlock(&efivars->lock); + + if (status != EFI_BUFFER_TOO_SMALL) + return 0; +@@ -780,10 +793,13 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + if (!data) + return 0; + ++ spin_lock(&efivars->lock); + status = efivars->ops->get_variable(var->var.VariableName, + &var->var.VendorGuid, + &attributes, &datasize, + (data + 4)); ++ spin_unlock(&efivars->lock); ++ + if (status != EFI_SUCCESS) + goto out_free; + +@@ -1004,11 +1020,13 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + /* copied by the above to local storage in the dentry. */ + kfree(name); + ++ spin_lock(&efivars->lock); + efivars->ops->get_variable(entry->var.VariableName, + &entry->var.VendorGuid, + &entry->var.Attributes, + &size, + NULL); ++ spin_unlock(&efivars->lock); + + mutex_lock(&inode->i_mutex); + inode->i_private = entry; +-- +1.7.12.1 + + +From 90a462e9cf439a1987e0f9434d1f615addcc1970 Mon Sep 17 00:00:00 2001 +From: Jeremy Kerr <jeremy.kerr@canonical.com> +Date: Fri, 19 Oct 2012 15:16:45 +0800 +Subject: [PATCH 11/17] efi: Clarify GUID length calculations + +At present, the handling of GUIDs in efivar file names isn't consistent. +We use GUID_LEN in some places, and 38 in others (GUID_LEN plus +separator), and implicitly use the presence of the trailing NUL. + +This change removes the trailing NUL from GUID_LEN, so that we're +explicitly adding it when required. We also replace magic numbers +with GUID_LEN, and clarify the comments where appropriate. + +We also fix the allocation size in efivar_create_sysfs_entry, where +we're allocating one byte too much, due to counting the trailing NUL +twice - once when calculating short_name_size, and once in the kzalloc. + +Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 33 +++++++++++++++++++++++++-------- + 1 file changed, 25 insertions(+), 8 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index d478c56..a93e401 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -95,7 +95,12 @@ MODULE_LICENSE("GPL"); + MODULE_VERSION(EFIVARS_VERSION); + + #define DUMP_NAME_LEN 52 +-#define GUID_LEN 37 ++ ++/* ++ * Length of a GUID string (strlen("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")) ++ * not including trailing NUL ++ */ ++#define GUID_LEN 36 + + /* + * The maximum size of VariableName + Data = 1024 +@@ -887,7 +892,11 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, + struct efivar_entry *var; + int namelen, i = 0, err = 0; + +- if (dentry->d_name.len < 38) ++ /* ++ * We need a GUID, plus at least one letter for the variable name, ++ * plus the '-' separator ++ */ ++ if (dentry->d_name.len < GUID_LEN + 2) + return -EINVAL; + + inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0); +@@ -900,7 +909,8 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, + goto out; + } + +- namelen = dentry->d_name.len - GUID_LEN; ++ /* length of the variable name itself: remove GUID and separator */ ++ namelen = dentry->d_name.len - GUID_LEN - 1; + + efivarfs_hex_to_guid(dentry->d_name.name + namelen + 1, + &var->var.VendorGuid); +@@ -994,8 +1004,8 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + + len = utf16_strlen(entry->var.VariableName); + +- /* GUID plus trailing NULL */ +- name = kmalloc(len + 38, GFP_ATOMIC); ++ /* name, plus '-', plus GUID, plus NUL*/ ++ name = kmalloc(len + 1 + GUID_LEN + 1, GFP_ATOMIC); + if (!name) + goto fail; + +@@ -1006,7 +1016,7 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + + efi_guid_unparse(&entry->var.VendorGuid, name + len + 1); + +- name[len+GUID_LEN] = '\0'; ++ name[len+GUID_LEN+1] = '\0'; + + inode = efivarfs_get_inode(efivarfs_sb, root->d_inode, + S_IFREG | 0644, 0); +@@ -1435,11 +1445,18 @@ efivar_create_sysfs_entry(struct efivars *efivars, + efi_char16_t *variable_name, + efi_guid_t *vendor_guid) + { +- int i, short_name_size = variable_name_size / sizeof(efi_char16_t) + 38; ++ int i, short_name_size; + char *short_name; + struct efivar_entry *new_efivar; + +- short_name = kzalloc(short_name_size + 1, GFP_KERNEL); ++ /* ++ * Length of the variable bytes in ASCII, plus the '-' separator, ++ * plus the GUID, plus trailing NUL ++ */ ++ short_name_size = variable_name_size / sizeof(efi_char16_t) ++ + 1 + GUID_LEN + 1; ++ ++ short_name = kzalloc(short_name_size, GFP_KERNEL); + new_efivar = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL); + + if (!short_name || !new_efivar) { +-- +1.7.12.1 + + +From ecbf90823d85ebb41e68e6be01f476862d184825 Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Tue, 16 Oct 2012 15:58:07 +0100 +Subject: [PATCH 12/17] efivarfs: Return an error if we fail to read a + variable + +Instead of always returning 0 in efivarfs_file_read(), even when we +fail to successfully read the variable, convert the EFI status to +something meaningful and return that to the caller. This way the user +will have some hint as to why the read failed. + +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 62 +++++++++++++++++++++++++++------------------- + 1 file changed, 36 insertions(+), 26 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index a93e401..277e426 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -653,6 +653,36 @@ static int efivarfs_file_open(struct inode *inode, struct file *file) + return 0; + } + ++static int efi_status_to_err(efi_status_t status) ++{ ++ int err; ++ ++ switch (status) { ++ case EFI_INVALID_PARAMETER: ++ err = -EINVAL; ++ break; ++ case EFI_OUT_OF_RESOURCES: ++ err = -ENOSPC; ++ break; ++ case EFI_DEVICE_ERROR: ++ err = -EIO; ++ break; ++ case EFI_WRITE_PROTECTED: ++ err = -EROFS; ++ break; ++ case EFI_SECURITY_VIOLATION: ++ err = -EACCES; ++ break; ++ case EFI_NOT_FOUND: ++ err = -ENOENT; ++ break; ++ default: ++ err = -EINVAL; ++ } ++ ++ return err; ++} ++ + static ssize_t efivarfs_file_write(struct file *file, + const char __user *userbuf, size_t count, loff_t *ppos) + { +@@ -711,29 +741,7 @@ static ssize_t efivarfs_file_write(struct file *file, + spin_unlock(&efivars->lock); + kfree(data); + +- switch (status) { +- case EFI_INVALID_PARAMETER: +- count = -EINVAL; +- break; +- case EFI_OUT_OF_RESOURCES: +- count = -ENOSPC; +- break; +- case EFI_DEVICE_ERROR: +- count = -EIO; +- break; +- case EFI_WRITE_PROTECTED: +- count = -EROFS; +- break; +- case EFI_SECURITY_VIOLATION: +- count = -EACCES; +- break; +- case EFI_NOT_FOUND: +- count = -ENOENT; +- break; +- default: +- count = -EINVAL; +- } +- return count; ++ return efi_status_to_err(status); + } + + /* +@@ -791,12 +799,12 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + spin_unlock(&efivars->lock); + + if (status != EFI_BUFFER_TOO_SMALL) +- return 0; ++ return efi_status_to_err(status); + + data = kmalloc(datasize + 4, GFP_KERNEL); + + if (!data) +- return 0; ++ return -ENOMEM; + + spin_lock(&efivars->lock); + status = efivars->ops->get_variable(var->var.VariableName, +@@ -805,8 +813,10 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + (data + 4)); + spin_unlock(&efivars->lock); + +- if (status != EFI_SUCCESS) ++ if (status != EFI_SUCCESS) { ++ size = efi_status_to_err(status); + goto out_free; ++ } + + memcpy(data, &attributes, 4); + size = simple_read_from_buffer(userbuf, count, ppos, +-- +1.7.12.1 + + +From 39210330739b943856ff21b29b4a0804f4e8349f Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Mon, 22 Oct 2012 15:23:29 +0100 +Subject: [PATCH 13/17] efivarfs: Replace magic number with sizeof(attributes) + +Seeing "+ 4" littered throughout the functions gets a bit +confusing. Use "sizeof(attributes)" which clearly explains what +quantity we're adding. + +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 277e426..2c04434 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -801,7 +801,7 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + if (status != EFI_BUFFER_TOO_SMALL) + return efi_status_to_err(status); + +- data = kmalloc(datasize + 4, GFP_KERNEL); ++ data = kmalloc(datasize + sizeof(attributes), GFP_KERNEL); + + if (!data) + return -ENOMEM; +@@ -810,7 +810,7 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + status = efivars->ops->get_variable(var->var.VariableName, + &var->var.VendorGuid, + &attributes, &datasize, +- (data + 4)); ++ (data + sizeof(attributes))); + spin_unlock(&efivars->lock); + + if (status != EFI_SUCCESS) { +@@ -818,9 +818,9 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, + goto out_free; + } + +- memcpy(data, &attributes, 4); ++ memcpy(data, &attributes, sizeof(attributes)); + size = simple_read_from_buffer(userbuf, count, ppos, +- data, datasize + 4); ++ data, datasize + sizeof(attributes)); + out_free: + kfree(data); + +-- +1.7.12.1 + + +From 5555f0af6294b3675a95a06da23101150644936d Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Mon, 22 Oct 2012 15:51:45 +0100 +Subject: [PATCH 14/17] efivarfs: Add unique magic number + +Using pstore's superblock magic number is no doubt going to cause +problems in the future. Give efivarfs its own magic number. + +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 2 +- + include/uapi/linux/magic.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 2c04434..3b0cf9a 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -991,7 +991,7 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent) + sb->s_maxbytes = MAX_LFS_FILESIZE; + sb->s_blocksize = PAGE_CACHE_SIZE; + sb->s_blocksize_bits = PAGE_CACHE_SHIFT; +- sb->s_magic = PSTOREFS_MAGIC; ++ sb->s_magic = EFIVARFS_MAGIC; + sb->s_op = &efivarfs_ops; + sb->s_time_gran = 1; + +diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h +index e15192c..12f68c7 100644 +--- a/include/uapi/linux/magic.h ++++ b/include/uapi/linux/magic.h +@@ -27,6 +27,7 @@ + #define ISOFS_SUPER_MAGIC 0x9660 + #define JFFS2_SUPER_MAGIC 0x72b6 + #define PSTOREFS_MAGIC 0x6165676C ++#define EFIVARFS_MAGIC 0xde5e81e4 + + #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ + #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ +-- +1.7.12.1 + + +From a42845c67f2386b164d0c5d8220838d7faf5a409 Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Tue, 23 Oct 2012 12:35:43 +0100 +Subject: [PATCH 15/17] efivarfs: Make 'datasize' unsigned long + +There's no reason to declare 'datasize' as an int, since the majority +of the functions it's passed to expect an unsigned long anyway. Plus, +this way we avoid any sign problems during arithmetic. + +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 3b0cf9a..6a858d1 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -692,7 +692,7 @@ static ssize_t efivarfs_file_write(struct file *file, + void *data; + u32 attributes; + struct inode *inode = file->f_mapping->host; +- int datasize = count - sizeof(attributes); ++ unsigned long datasize = count - sizeof(attributes); + unsigned long newdatasize; + + if (count < sizeof(attributes)) +-- +1.7.12.1 + + +From a268bdf6d7ce623ea4bdfcf39aa52ed3fbfdfd65 Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Tue, 23 Oct 2012 12:41:03 +0100 +Subject: [PATCH 16/17] efivarfs: Return a consistent error when + efivarfs_get_inode() fails + +Instead of returning -ENOSPC if efivarfs_get_inode() fails we should +be returning -ENOMEM, since running out of memory is the only reason +it can fail. Furthermore, that's the error value used everywhere else +in this file. It's also less likely to confuse users that hit this +error case. + +Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 6a858d1..58cec62 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -911,7 +911,7 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, + + inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0); + if (!inode) +- return -ENOSPC; ++ return -ENOMEM; + + var = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL); + if (!var) { +-- +1.7.12.1 + + +From 9c3136c987175b179c0aa725d76cda156894f918 Mon Sep 17 00:00:00 2001 +From: Matt Fleming <matt.fleming@intel.com> +Date: Fri, 26 Oct 2012 12:18:53 +0100 +Subject: [PATCH 17/17] efivarfs: Fix return value of efivarfs_file_write() + +We're stuffing a variable of type size_t (unsigned) into a ssize_t +(signed) which, even though both types should be the same number of +bits, it's just asking for sign issues to be introduced. + +Cc: Jeremy Kerr <jeremy.kerr@canonical.com> +Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> +--- + drivers/firmware/efivars.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index 58cec62..9ac9340 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -694,6 +694,7 @@ static ssize_t efivarfs_file_write(struct file *file, + struct inode *inode = file->f_mapping->host; + unsigned long datasize = count - sizeof(attributes); + unsigned long newdatasize; ++ ssize_t bytes = 0; + + if (count < sizeof(attributes)) + return -EINVAL; +@@ -706,22 +707,22 @@ static ssize_t efivarfs_file_write(struct file *file, + efivars = var->efivars; + + if (copy_from_user(&attributes, userbuf, sizeof(attributes))) { +- count = -EFAULT; ++ bytes = -EFAULT; + goto out; + } + + if (attributes & ~(EFI_VARIABLE_MASK)) { +- count = -EINVAL; ++ bytes = -EINVAL; + goto out; + } + + if (copy_from_user(data, userbuf + sizeof(attributes), datasize)) { +- count = -EFAULT; ++ bytes = -EFAULT; + goto out; + } + + if (validate_var(&var->var, data, datasize) == false) { +- count = -EINVAL; ++ bytes = -EINVAL; + goto out; + } + +@@ -744,6 +745,8 @@ static ssize_t efivarfs_file_write(struct file *file, + return efi_status_to_err(status); + } + ++ bytes = count; ++ + /* + * Writing to the variable may have caused a change in size (which + * could either be an append or an overwrite), or the variable to be +@@ -778,7 +781,7 @@ static ssize_t efivarfs_file_write(struct file *file, + out: + kfree(data); + +- return count; ++ return bytes; + } + + static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, +-- +1.7.12.1 + diff --git a/freed-ora/current/master/fix_xen_guest_on_old_EC2.patch b/freed-ora/current/master/fix_xen_guest_on_old_EC2.patch deleted file mode 100644 index e86200295..000000000 --- a/freed-ora/current/master/fix_xen_guest_on_old_EC2.patch +++ /dev/null @@ -1,34 +0,0 @@ - -Legacy hypervisors (RHEL 5.0 and RHEL 5.1) do not handle guest writes to -cr4 gracefully. If a guest attempts to write a bit of cr4 that is -unsupported, then the HV is so offended it crashes the domain. While -later guest kernels (such as RHEL6) don't assume the HV supports all -features, they do expect nicer responses. That assumption introduced -code that probes whether or not xsave is supported early in the boot. So -now when attempting to boot a RHEL6 guest on RHEL5.0 or RHEL5.1 an early -crash will occur. - -This patch is quite obviously an undesirable hack. The real fix for this -problem should be in the HV, and is, in later HVs. However, to support -running on old HVs, RHEL6 can take this small change. No impact will -occur for running on any RHEL HV (not even RHEL 5.5 supports xsave). -There is only potential for guest performance loss on upstream Xen. - ---- - arch/x86/xen/enlighten.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c -index 52f8e19..6db3d67 100644 ---- a/arch/x86/xen/enlighten.c -+++ b/arch/x86/xen/enlighten.c -@@ -802,6 +802,7 @@ static void xen_write_cr4(unsigned long cr4) - { - cr4 &= ~X86_CR4_PGE; - cr4 &= ~X86_CR4_PSE; -+ cr4 &= ~X86_CR4_OSXSAVE; - - native_write_cr4(cr4); - } --- -1.6.6.1 diff --git a/freed-ora/current/master/genkey b/freed-ora/current/master/genkey deleted file mode 100644 index fdb7d1f64..000000000 --- a/freed-ora/current/master/genkey +++ /dev/null @@ -1,10 +0,0 @@ -%pubring modsign.pub -%secring modsign.sec -%no-protection: yes -%transient-key: yes -Key-Type: RSA -Key-Length: 2048 -Name-Real: Fedora Project -Name-Comment: Kernel Module GPG key -%commit - diff --git a/freed-ora/current/master/handle-efi-roms.patch b/freed-ora/current/master/handle-efi-roms.patch new file mode 100644 index 000000000..bc080542b --- /dev/null +++ b/freed-ora/current/master/handle-efi-roms.patch @@ -0,0 +1,388 @@ +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/boot/compressed/eboot.c ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/boot/compressed/eboot.c +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/boot/compressed/eboot.c 2012-08-22 15:26:32.485522068 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/boot/compressed/eboot.c 2012-08-22 15:25:40.529244868 -0400 +@@ -8,6 +8,7 @@ + * ----------------------------------------------------------------------- */ + + #include <linux/efi.h> ++#include <linux/pci.h> + #include <asm/efi.h> + #include <asm/setup.h> + #include <asm/desc.h> +@@ -243,6 +244,121 @@ + *size = len; + } + ++static efi_status_t setup_efi_pci(struct boot_params *params) ++{ ++ efi_pci_io_protocol *pci; ++ efi_status_t status; ++ void **pci_handle; ++ efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID; ++ unsigned long nr_pci, size = 0; ++ int i; ++ struct setup_data *data; ++ ++ data = (struct setup_data *)params->hdr.setup_data; ++ ++ while (data && data->next) ++ data = (struct setup_data *)data->next; ++ ++ status = efi_call_phys5(sys_table->boottime->locate_handle, ++ EFI_LOCATE_BY_PROTOCOL, &pci_proto, ++ NULL, &size, pci_handle); ++ ++ if (status == EFI_BUFFER_TOO_SMALL) { ++ status = efi_call_phys3(sys_table->boottime->allocate_pool, ++ EFI_LOADER_DATA, size, &pci_handle); ++ ++ if (status != EFI_SUCCESS) ++ return status; ++ ++ status = efi_call_phys5(sys_table->boottime->locate_handle, ++ EFI_LOCATE_BY_PROTOCOL, &pci_proto, ++ NULL, &size, pci_handle); ++ } ++ ++ if (status != EFI_SUCCESS) ++ goto free_handle; ++ ++ nr_pci = size / sizeof(void *); ++ for (i = 0; i < nr_pci; i++) { ++ void *h = pci_handle[i]; ++ uint64_t attributes; ++ struct pci_setup_rom *rom; ++ ++ status = efi_call_phys3(sys_table->boottime->handle_protocol, ++ h, &pci_proto, &pci); ++ ++ if (status != EFI_SUCCESS) ++ continue; ++ ++ if (!pci) ++ continue; ++ ++ status = efi_call_phys4(pci->attributes, pci, ++ EfiPciIoAttributeOperationGet, 0, ++ &attributes); ++ ++ if (status != EFI_SUCCESS) ++ continue; ++ ++ if (!attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM) ++ continue; ++ ++ if (!pci->romimage || !pci->romsize) ++ continue; ++ ++ size = pci->romsize + sizeof(*rom); ++ ++ status = efi_call_phys3(sys_table->boottime->allocate_pool, ++ EFI_LOADER_DATA, size, &rom); ++ ++ if (status != EFI_SUCCESS) ++ continue; ++ ++ rom->data.type = SETUP_PCI; ++ rom->data.len = size - sizeof(struct setup_data); ++ rom->data.next = NULL; ++ rom->pcilen = pci->romsize; ++ ++ status = efi_call_phys5(pci->pci.read, pci, ++ EfiPciIoWidthUint16, PCI_VENDOR_ID, ++ 1, &(rom->vendor)); ++ ++ if (status != EFI_SUCCESS) ++ goto free_struct; ++ ++ status = efi_call_phys5(pci->pci.read, pci, ++ EfiPciIoWidthUint16, PCI_DEVICE_ID, ++ 1, &(rom->devid)); ++ ++ if (status != EFI_SUCCESS) ++ goto free_struct; ++ ++ status = efi_call_phys5(pci->get_location, pci, ++ &(rom->segment), &(rom->bus), ++ &(rom->device), &(rom->function)); ++ ++ if (status != EFI_SUCCESS) ++ goto free_struct; ++ ++ memcpy(rom->romdata, pci->romimage, pci->romsize); ++ ++ if (data) ++ data->next = (uint64_t)rom; ++ else ++ params->hdr.setup_data = (uint64_t)rom; ++ ++ data = (struct setup_data *)rom; ++ ++ continue; ++ free_struct: ++ efi_call_phys1(sys_table->boottime->free_pool, rom); ++ } ++ ++free_handle: ++ efi_call_phys1(sys_table->boottime->free_pool, pci_handle); ++ return status; ++} ++ + /* + * See if we have Graphics Output Protocol + */ +@@ -1052,6 +1171,8 @@ + + setup_graphics(boot_params); + ++ setup_efi_pci(boot_params); ++ + status = efi_call_phys3(sys_table->boottime->allocate_pool, + EFI_LOADER_DATA, sizeof(*gdt), + (void **)&gdt); +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/bootparam.h ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/bootparam.h +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/bootparam.h 2012-08-22 15:26:32.485522068 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/bootparam.h 2012-08-22 15:25:40.530244882 -0400 +@@ -13,6 +13,7 @@ + #define SETUP_NONE 0 + #define SETUP_E820_EXT 1 + #define SETUP_DTB 2 ++#define SETUP_PCI 3 + + /* extensible setup data list node */ + struct setup_data { +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/pci.h ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/pci.h +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/pci.h 2012-07-21 16:58:29.000000000 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/include/asm/pci.h 2012-08-22 15:25:40.530244882 -0400 +@@ -171,4 +171,16 @@ + } + #endif + ++struct pci_setup_rom { ++ struct setup_data data; ++ uint16_t vendor; ++ uint16_t devid; ++ uint64_t pcilen; ++ unsigned long segment; ++ unsigned long bus; ++ unsigned long device; ++ unsigned long function; ++ uint8_t romdata[0]; ++}; ++ + #endif /* _ASM_X86_PCI_H */ +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/pci/common.c ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/pci/common.c +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/pci/common.c 2012-08-22 15:24:45.477951182 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/arch/x86/pci/common.c 2012-08-22 15:25:40.530244882 -0400 +@@ -17,6 +17,7 @@ + #include <asm/io.h> + #include <asm/smp.h> + #include <asm/pci_x86.h> ++#include <asm/setup.h> + + unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | + PCI_PROBE_MMCONF; +@@ -608,6 +609,38 @@ + return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0; + } + ++int pcibios_add_device(struct pci_dev *dev) ++{ ++ struct setup_data *data; ++ struct pci_setup_rom *rom; ++ u64 pa_data; ++ ++ if (boot_params.hdr.version < 0x0209) ++ return 0; ++ ++ pa_data = boot_params.hdr.setup_data; ++ while (pa_data) { ++ data = phys_to_virt(pa_data); ++ ++ if (data->type == SETUP_PCI) { ++ rom = (struct pci_setup_rom *)data; ++ ++ if ((pci_domain_nr(dev->bus) == rom->segment) && ++ (dev->bus->number == rom->bus) && ++ (PCI_SLOT(dev->devfn) == rom->device) && ++ (PCI_FUNC(dev->devfn) == rom->function) && ++ (dev->vendor == rom->vendor) && ++ (dev->device == rom->devid)) { ++ dev->rom = (void *)(pa_data + ++ offsetof(struct pci_setup_rom, romdata)); ++ dev->romlen = rom->pcilen; ++ } ++ } ++ pa_data = data->next; ++ } ++ return 0; ++} ++ + int pcibios_enable_device(struct pci_dev *dev, int mask) + { + int err; +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/bus.c ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/bus.c +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/bus.c 2012-08-22 15:24:47.425961575 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/bus.c 2012-08-22 15:26:20.147456241 -0400 +@@ -166,6 +166,11 @@ + int retval; + + pci_fixup_device(pci_fixup_final, dev); ++ ++ retval = pcibios_add_device(dev); ++ if (retval) ++ return retval; ++ + retval = device_add(&dev->dev); + if (retval) + return retval; +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/pci.c ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/pci.c +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/pci.c 2012-08-22 15:24:47.432961612 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/pci.c 2012-08-22 15:25:40.531244893 -0400 +@@ -1385,6 +1385,19 @@ + dr->pinned = 1; + } + ++/* ++ * pcibios_add_device - provide arch specific hooks when adding device dev ++ * @dev: the PCI device being added ++ * ++ * Permits the platform to provide architecture specific functionality when ++ * devices are added. This is the default implementation. Architecture ++ * implementations can override this. ++ */ ++int __attribute__ ((weak)) pcibios_add_device (struct pci_dev *dev) ++{ ++ return 0; ++} ++ + /** + * pcibios_disable_device - disable arch specific PCI resources for device dev + * @dev: the PCI device to disable +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/rom.c ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/rom.c +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/rom.c 2012-07-21 16:58:29.000000000 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/drivers/pci/rom.c 2012-08-22 15:25:40.531244893 -0400 +@@ -126,6 +126,12 @@ + /* primary video rom always starts here */ + start = (loff_t)0xC0000; + *size = 0x20000; /* cover C000:0 through E000:0 */ ++ /* ++ * Some devices may provide ROMs via a source other than the BAR ++ */ ++ } else if (pdev->rom && pdev->romlen) { ++ *size = pdev->romlen; ++ return phys_to_virt(pdev->rom); + } else { + if (res->flags & + (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) { +@@ -219,7 +225,8 @@ + if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) + return; + +- iounmap(rom); ++ if (!pdev->rom || !pdev->romlen) ++ iounmap(rom); + + /* Disable again before continuing, leave enabled if pci=rom */ + if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/efi.h ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/efi.h +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/efi.h 2012-08-22 15:24:49.550972911 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/efi.h 2012-08-22 15:25:40.533244906 -0400 +@@ -196,6 +196,77 @@ + void *create_event_ex; + } efi_boot_services_t; + ++typedef enum { ++ EfiPciIoWidthUint8, ++ EfiPciIoWidthUint16, ++ EfiPciIoWidthUint32, ++ EfiPciIoWidthUint64, ++ EfiPciIoWidthFifoUint8, ++ EfiPciIoWidthFifoUint16, ++ EfiPciIoWidthFifoUint32, ++ EfiPciIoWidthFifoUint64, ++ EfiPciIoWidthFillUint8, ++ EfiPciIoWidthFillUint16, ++ EfiPciIoWidthFillUint32, ++ EfiPciIoWidthFillUint64, ++ EfiPciIoWidthMaximum ++} EFI_PCI_IO_PROTOCOL_WIDTH; ++ ++typedef enum { ++ EfiPciIoAttributeOperationGet, ++ EfiPciIoAttributeOperationSet, ++ EfiPciIoAttributeOperationEnable, ++ EfiPciIoAttributeOperationDisable, ++ EfiPciIoAttributeOperationSupported, ++ EfiPciIoAttributeOperationMaximum ++} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; ++ ++ ++typedef struct { ++ void *read; ++ void *write; ++} efi_pci_io_protocol_access_t; ++ ++typedef struct { ++ void *poll_mem; ++ void *poll_io; ++ efi_pci_io_protocol_access_t mem; ++ efi_pci_io_protocol_access_t io; ++ efi_pci_io_protocol_access_t pci; ++ void *copy_mem; ++ void *map; ++ void *unmap; ++ void *allocate_buffer; ++ void *free_buffer; ++ void *flush; ++ void *get_location; ++ void *attributes; ++ void *get_bar_attributes; ++ void *set_bar_attributes; ++ uint64_t romsize; ++ void *romimage; ++} efi_pci_io_protocol; ++ ++#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 ++#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ++#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ++#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ++#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ++#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ++#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ++#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ++#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ++#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 ++ + /* + * Types and defines for EFI ResetSystem + */ +diff -ur linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/pci.h ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/pci.h +--- linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/pci.h 2012-08-22 15:24:48.703968392 -0400 ++++ ../kernel-3.5.fc18.bak/linux-3.6.0-0.rc2.git2.1.fc18.x86_64/include/linux/pci.h 2012-08-22 15:25:40.534244910 -0400 +@@ -355,6 +355,8 @@ + }; + struct pci_ats *ats; /* Address Translation Service */ + #endif ++ void *rom; /* Physical pointer to ROM if it's not from the BAR */ ++ size_t romlen; /* Length of ROM if it's not from the BAR */ + }; + + static inline struct pci_dev *pci_physfn(struct pci_dev *dev) +@@ -1582,6 +1584,7 @@ + void pcibios_set_master(struct pci_dev *dev); + int pcibios_set_pcie_reset_state(struct pci_dev *dev, + enum pcie_reset_state state); ++int pcibios_add_device(struct pci_dev *dev); + + #ifdef CONFIG_PCI_MMCONFIG + extern void __init pci_mmcfg_early_init(void); diff --git a/freed-ora/current/master/highbank-export-clock-functions.patch b/freed-ora/current/master/highbank-export-clock-functions.patch deleted file mode 100644 index f66754d2e..000000000 --- a/freed-ora/current/master/highbank-export-clock-functions.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 81a06eed2491273b7d6d274ae4be1d333c100ab0 Mon Sep 17 00:00:00 2001 -From: Mark Langsdorf <mark.langsdorf@calxeda.com> -Date: Mon, 12 Mar 2012 06:28:19 -0400 -Subject: [PATCH] highbank: export clock functions - -Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> ---- - arch/arm/mach-highbank/clock.c | 4 ++++ - 1 files changed, 4 insertions(+), 0 deletions(-) - -diff --git diff -up linux-3.2-rc4.orig/arch/arm/mach-highbank/clock.c diff -up linux-3.2-rc4/arch/arm/mach-highbank/clock.c -index c25a2ae..cdbc575 100644 ---- a/arch/arm/mach-highbank/clock.c -+++ b/arch/arm/mach-highbank/clock.c -@@ -27,14 +27,17 @@ int clk_enable(struct clk *clk) - { - return 0; - } -+EXPORT_SYMBOL_GPL(clk_enable); - - void clk_disable(struct clk *clk) - {} -+EXPORT_SYMBOL_GPL(clk_disable); - - unsigned long clk_get_rate(struct clk *clk) - { - return clk->rate; - } -+EXPORT_SYMBOL_GPL(clk_get_rate); - - long clk_round_rate(struct clk *clk, unsigned long rate) - { -@@ -45,6 +48,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) - { - return 0; - } -+EXPORT_SYMBOL_GPL(clk_set_rate); - - static struct clk eclk = { .rate = 200000000 }; - static struct clk pclk = { .rate = 150000000 }; --- -1.7.9.1 - diff --git a/freed-ora/current/master/i82975x-edac-fix.patch b/freed-ora/current/master/i82975x-edac-fix.patch new file mode 100644 index 000000000..f44ac7791 --- /dev/null +++ b/freed-ora/current/master/i82975x-edac-fix.patch @@ -0,0 +1,855 @@ +commit 9370a8d717720f6b17221490fea8d798396d9f2f +Author: Mauro Carvalho Chehab <mchehab@redhat.com> +Date: Mon Oct 15 21:49:35 2012 -0300 + + i82975x_edac: Use the edac standard debug macro + + Instead of declaring its own debug macro, that requires + to uncomment part of the code, use the edac standard macro + to add the debug code, and the edac debug level to print it, + just like any other EDAC driver. + + Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> + +diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c +index a980204..f998d2c 100644 +--- a/drivers/edac/i82975x_edac.c ++++ b/drivers/edac/i82975x_edac.c +@@ -435,11 +435,9 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci, + } + } + +-/* #define i82975x_DEBUG_IOMEM */ +- +-#ifdef i82975x_DEBUG_IOMEM +-static void i82975x_print_dram_timings(void __iomem *mch_window) ++static void i82975x_print_dram_config(void __iomem *mch_window, u32 mchbar, u32 *drc) + { ++#ifdef CONFIG_EDAC_DEBUG + /* + * The register meanings are from Intel specs; + * (shows 13-5-5-5 for 800-DDR2) +@@ -448,26 +446,63 @@ static void i82975x_print_dram_timings(void __iomem *mch_window) + */ + static const int caslats[4] = { 5, 4, 3, 6 }; + u32 dtreg[2]; ++ u8 c0drb[4]; ++ u8 c1drb[4]; ++ ++ if (!edac_debug_level) ++ return; ++ ++ i82975x_printk(KERN_INFO, "MCHBAR real = %0x, remapped = %p\n", ++ mchbar, mch_window); ++ ++ c0drb[0] = readb(mch_window + I82975X_DRB_CH0R0); ++ c0drb[1] = readb(mch_window + I82975X_DRB_CH0R1); ++ c0drb[2] = readb(mch_window + I82975X_DRB_CH0R2); ++ c0drb[3] = readb(mch_window + I82975X_DRB_CH0R3); ++ c1drb[0] = readb(mch_window + I82975X_DRB_CH1R0); ++ c1drb[1] = readb(mch_window + I82975X_DRB_CH1R1); ++ c1drb[2] = readb(mch_window + I82975X_DRB_CH1R2); ++ c1drb[3] = readb(mch_window + I82975X_DRB_CH1R3); ++ i82975x_printk(KERN_INFO, "DRBCH0R0 = 0x%02x\n", c0drb[0]); ++ i82975x_printk(KERN_INFO, "DRBCH0R1 = 0x%02x\n", c0drb[1]); ++ i82975x_printk(KERN_INFO, "DRBCH0R2 = 0x%02x\n", c0drb[2]); ++ i82975x_printk(KERN_INFO, "DRBCH0R3 = 0x%02x\n", c0drb[3]); ++ i82975x_printk(KERN_INFO, "DRBCH1R0 = 0x%02x\n", c1drb[0]); ++ i82975x_printk(KERN_INFO, "DRBCH1R1 = 0x%02x\n", c1drb[1]); ++ i82975x_printk(KERN_INFO, "DRBCH1R2 = 0x%02x\n", c1drb[2]); ++ i82975x_printk(KERN_INFO, "DRBCH1R3 = 0x%02x\n", c1drb[3]); ++ ++ i82975x_printk(KERN_INFO, "DRC_CH0 = %0x, %s\n", drc[0], ++ ((drc[0] >> 21) & 3) == 1 ? ++ "ECC enabled" : "ECC disabled"); ++ i82975x_printk(KERN_INFO, "DRC_CH1 = %0x, %s\n", drc[1], ++ ((drc[1] >> 21) & 3) == 1 ? ++ "ECC enabled" : "ECC disabled"); ++ ++ i82975x_printk(KERN_INFO, "C0 BNKARC = %0x\n", ++ readw(mch_window + I82975X_C0BNKARC)); ++ i82975x_printk(KERN_INFO, "C1 BNKARC = %0x\n", ++ readw(mch_window + I82975X_C1BNKARC)); + + dtreg[0] = readl(mch_window + 0x114); + dtreg[1] = readl(mch_window + 0x194); +- i82975x_printk(KERN_INFO, "DRAM Timings : Ch0 Ch1\n" ++ i82975x_printk(KERN_INFO, ++ "DRAM Timings : Ch0 Ch1\n" + " RAS Active Min = %d %d\n" + " CAS latency = %d %d\n" + " RAS to CAS = %d %d\n" + " RAS precharge = %d %d\n", + (dtreg[0] >> 19 ) & 0x0f, +- (dtreg[1] >> 19) & 0x0f, ++ (dtreg[1] >> 19) & 0x0f, + caslats[(dtreg[0] >> 8) & 0x03], +- caslats[(dtreg[1] >> 8) & 0x03], ++ caslats[(dtreg[1] >> 8) & 0x03], + ((dtreg[0] >> 4) & 0x07) + 2, +- ((dtreg[1] >> 4) & 0x07) + 2, ++ ((dtreg[1] >> 4) & 0x07) + 2, + (dtreg[0] & 0x07) + 2, +- (dtreg[1] & 0x07) + 2 ++ (dtreg[1] & 0x07) + 2 + ); +- +-} + #endif ++} + + static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + { +@@ -480,10 +515,6 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + u32 drc[2]; + struct i82975x_error_info discard; + int chans; +-#ifdef i82975x_DEBUG_IOMEM +- u8 c0drb[4]; +- u8 c1drb[4]; +-#endif + + edac_dbg(0, "\n"); + +@@ -495,45 +526,11 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + mchbar &= 0xffffc000; /* bits 31:14 used for 16K window */ + mch_window = ioremap_nocache(mchbar, 0x1000); + +-#ifdef i82975x_DEBUG_IOMEM +- i82975x_printk(KERN_INFO, "MCHBAR real = %0x, remapped = %p\n", +- mchbar, mch_window); +- +- c0drb[0] = readb(mch_window + I82975X_DRB_CH0R0); +- c0drb[1] = readb(mch_window + I82975X_DRB_CH0R1); +- c0drb[2] = readb(mch_window + I82975X_DRB_CH0R2); +- c0drb[3] = readb(mch_window + I82975X_DRB_CH0R3); +- c1drb[0] = readb(mch_window + I82975X_DRB_CH1R0); +- c1drb[1] = readb(mch_window + I82975X_DRB_CH1R1); +- c1drb[2] = readb(mch_window + I82975X_DRB_CH1R2); +- c1drb[3] = readb(mch_window + I82975X_DRB_CH1R3); +- i82975x_printk(KERN_INFO, "DRBCH0R0 = 0x%02x\n", c0drb[0]); +- i82975x_printk(KERN_INFO, "DRBCH0R1 = 0x%02x\n", c0drb[1]); +- i82975x_printk(KERN_INFO, "DRBCH0R2 = 0x%02x\n", c0drb[2]); +- i82975x_printk(KERN_INFO, "DRBCH0R3 = 0x%02x\n", c0drb[3]); +- i82975x_printk(KERN_INFO, "DRBCH1R0 = 0x%02x\n", c1drb[0]); +- i82975x_printk(KERN_INFO, "DRBCH1R1 = 0x%02x\n", c1drb[1]); +- i82975x_printk(KERN_INFO, "DRBCH1R2 = 0x%02x\n", c1drb[2]); +- i82975x_printk(KERN_INFO, "DRBCH1R3 = 0x%02x\n", c1drb[3]); +-#endif +- + drc[0] = readl(mch_window + I82975X_DRC_CH0M0); + drc[1] = readl(mch_window + I82975X_DRC_CH1M0); +-#ifdef i82975x_DEBUG_IOMEM +- i82975x_printk(KERN_INFO, "DRC_CH0 = %0x, %s\n", drc[0], +- ((drc[0] >> 21) & 3) == 1 ? +- "ECC enabled" : "ECC disabled"); +- i82975x_printk(KERN_INFO, "DRC_CH1 = %0x, %s\n", drc[1], +- ((drc[1] >> 21) & 3) == 1 ? +- "ECC enabled" : "ECC disabled"); + +- i82975x_printk(KERN_INFO, "C0 BNKARC = %0x\n", +- readw(mch_window + I82975X_C0BNKARC)); +- i82975x_printk(KERN_INFO, "C1 BNKARC = %0x\n", +- readw(mch_window + I82975X_C1BNKARC)); +- i82975x_print_dram_timings(mch_window); +- goto fail1; +-#endif ++ i82975x_print_dram_config(mch_window, mchbar, drc); ++ + if (!(((drc[0] >> 21) & 3) == 1 || ((drc[1] >> 21) & 3) == 1)) { + i82975x_printk(KERN_INFO, "ECC disabled on both channels.\n"); + goto fail1; + +commit 8992ed2f4295eab137e1713fa16be5546a759373 +Author: Mauro Carvalho Chehab <mchehab@redhat.com> +Date: Mon Oct 15 21:48:48 2012 -0300 + + i82975x_edac: Fix dimm label initialization + + The driver has only 4 hardcoded labels, but allows much more memory. + Fix it by removing the hardcoded logic, using snprintf() instead. + + [ 19.833972] general protection fault: 0000 [#1] SMP + [ 19.837733] Modules linked in: i82975x_edac(+) edac_core firewire_ohci firewire_core crc_itu_t nouveau mxm_wmi wmi video i2c_algo_bit drm_kms_helper ttm drm i2c_core + [ 19.837733] CPU 0 + [ 19.837733] Pid: 390, comm: udevd Not tainted 3.6.1-1.fc17.x86_64.debug #1 Dell Inc. Precision WorkStation 390 /0MY510 + [ 19.837733] RIP: 0010:[<ffffffff813463a8>] [<ffffffff813463a8>] strncpy+0x18/0x30 + [ 19.837733] RSP: 0018:ffff880078535b68 EFLAGS: 00010202 + [ 19.837733] RAX: ffff880069fa9708 RBX: ffff880078588000 RCX: ffff880069fa9708 + [ 19.837733] RDX: 000000000000001f RSI: 5f706f5f63616465 RDI: ffff880069fa9708 + [ 19.837733] RBP: ffff880078535b68 R08: ffff880069fa9727 R09: 000000000000fffe + [ 19.837733] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003 + [ 19.837733] R13: 0000000000000000 R14: ffff880069fa9290 R15: ffff880079624a80 + [ 19.837733] FS: 00007f3de01ee840(0000) GS:ffff88007c400000(0000) knlGS:0000000000000000 + [ 19.837733] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + [ 19.837733] CR2: 00007f3de00b9000 CR3: 0000000078dbc000 CR4: 00000000000007f0 + [ 19.837733] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + [ 19.837733] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 + [ 19.837733] Process udevd (pid: 390, threadinfo ffff880078534000, task ffff880079642450) + [ 19.837733] Stack: + [ 19.837733] ffff880078535c18 ffffffffa017c6b8 00040000816d627f ffff880079624a88 + [ 19.837733] ffffc90004cd6000 ffff880079624520 ffff88007ac21148 0000000000000000 + [ 19.837733] 0000000000000000 0004000000000000 feda000078535bc8 ffffffff810d696d + [ 19.837733] Call Trace: + [ 19.837733] [<ffffffffa017c6b8>] i82975x_init_one+0x2e6/0x3e6 [i82975x_edac] + ... + + Fix bug reported at: + https://bugzilla.redhat.com/show_bug.cgi?id=848149 + And, very likely: + https://bbs.archlinux.org/viewtopic.php?id=148033 + https://bugzilla.kernel.org/show_bug.cgi?id=47171 + + Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> + Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> + +diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c +index 069e26c..a980204 100644 +--- a/drivers/edac/i82975x_edac.c ++++ b/drivers/edac/i82975x_edac.c +@@ -370,10 +370,6 @@ static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank) + static void i82975x_init_csrows(struct mem_ctl_info *mci, + struct pci_dev *pdev, void __iomem *mch_window) + { +- static const char *labels[4] = { +- "DIMM A1", "DIMM A2", +- "DIMM B1", "DIMM B2" +- }; + struct csrow_info *csrow; + unsigned long last_cumul_size; + u8 value; +@@ -423,9 +419,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci, + dimm = mci->csrows[index]->channels[chan]->dimm; + + dimm->nr_pages = nr_pages / csrow->nr_channels; +- strncpy(csrow->channels[chan]->dimm->label, +- labels[(index >> 1) + (chan * 2)], +- EDAC_MC_LABEL_LEN); ++ ++ snprintf(csrow->channels[chan]->dimm->label, EDAC_MC_LABEL_LEN, "DIMM %c%d", ++ (chan == 0) ? 'A' : 'B', ++ index); + dimm->grain = 1 << 7; /* 128Byte cache-line resolution */ + dimm->dtype = i82975x_dram_type(mch_window, index); + dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */ +commit 6e7636c972951ba0c6c640758b1dcc7667cb2415 +Author: Mauro Carvalho Chehab <mchehab@redhat.com> +Date: Tue Oct 16 15:30:23 2012 -0300 + + i82975x_edac: rewrite the entire fill/report logic + + There are so many bugs at the fill/error report logic that + the code ended by being re-written. + + Issues solved: + + - DIMM labels were "randomly" filled: they won't + match the memory layout, due to a series of bugs on it; + + - The memory controller supports 3 different modes: + single, dual interleaved and dual async. The logic there were + written considering the dual interleaved one (yet, some + single mode support was there); + + - The boundary limit to decide on each channel the error happens, + at dual interleaved mode, is given by bit 6 of the error address, + and not bit 1. The practical effect is that Corrected errors + will have a 50% of chance of pointing to the right DIMM. Only + the DIMM pair logic were OK; + + - The asymetric mode weren't properly supported. The driver would + handle an asymetric mode as 'single mode', with doesn't actually + match it, creating some weird real/virtual DIMM mappings. + + - Some other random bugs got fixed. + + Tested on a Dell Precision N390, on dual interleaved mode. + + Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> + +diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c +index f998d2c..082e91e 100644 +--- a/drivers/edac/i82975x_edac.c ++++ b/drivers/edac/i82975x_edac.c +@@ -6,7 +6,17 @@ + * GNU General Public License. + * + * Written by Arvind R. +- * Copied from i82875p_edac.c source: ++ * Copied from i82875p_edac.c source, ++ * ++ * (c) 2012 Mauro Carvalho Chehab <mchehab@redhat.com> ++ * Driver re-written in order to fix lots of issues on it: ++ * - Fix Single Mode; ++ * - Add support for Asymetrical mode ++ * - Fix several issues with Interleaved mode ++ * - Fix memory label logic ++ * ++ * Intel datasheet: Intel(R) 975X Express Chipset Datasheet ++ * http://www.intel.com/assets/pdf/datasheet/310158.pdf + */ + + #include <linux/module.h> +@@ -29,8 +39,8 @@ + #define PCI_DEVICE_ID_INTEL_82975_0 0x277c + #endif /* PCI_DEVICE_ID_INTEL_82975_0 */ + +-#define I82975X_NR_DIMMS 8 +-#define I82975X_NR_CSROWS(nr_chans) (I82975X_NR_DIMMS / (nr_chans)) ++#define DIMMS_PER_CHANNEL 4 ++#define NUM_CHANNELS 2 + + /* Intel 82975X register addresses - device 0 function 0 - DRAM Controller */ + #define I82975X_EAP 0x58 /* Dram Error Address Pointer (32b) +@@ -112,7 +122,7 @@ NOTE: Only ONE of the three must be enabled + /* NOTE: Following addresses have to indexed using MCHBAR offset (44h, 32b) */ + /* Intel 82975x memory mapped register space */ + +-#define I82975X_DRB_SHIFT 25 /* fixed 32MiB grain */ ++#define I82975X_DRB_SHIFT 25 /* fixed 2^25 = 32 MiB grain */ + + #define I82975X_DRB 0x100 /* DRAM Row Boundary (8b x 8) + * +@@ -152,6 +162,10 @@ NOTE: Only ONE of the three must be enabled + #define I82975X_DRA_CH1R01 0x188 + #define I82975X_DRA_CH1R23 0x189 + ++/* Channels 0/1 DRAM Timing Register 1 */ ++#define I82975X_C0DRT1 0x114 ++#define I82975X_C1DRT1 0x194 ++ + + #define I82975X_BNKARC 0x10e /* Type of device in each rank - Bank Arch (16b) + * +@@ -206,8 +220,16 @@ enum i82975x_chips { + I82975X = 0, + }; + ++struct mem_range { ++ u32 start, end; ++}; ++ + struct i82975x_pvt { +- void __iomem *mch_window; ++ void __iomem *mch_window; ++ int num_channels; ++ bool is_symetric; ++ u8 drb[DIMMS_PER_CHANNEL][NUM_CHANNELS]; ++ struct mem_range page[DIMMS_PER_CHANNEL][NUM_CHANNELS]; + }; + + struct i82975x_dev_info { +@@ -278,8 +300,10 @@ static void i82975x_get_error_info(struct mem_ctl_info *mci, + static int i82975x_process_error_info(struct mem_ctl_info *mci, + struct i82975x_error_info *info, int handle_errors) + { +- int row, chan; +- unsigned long offst, page; ++ struct i82975x_pvt *pvt = mci->pvt_info; ++ struct mem_range *range; ++ unsigned int row, chan, grain; ++ unsigned long offst, page; + + if (!(info->errsts2 & 0x0003)) + return 0; +@@ -293,36 +317,70 @@ static int i82975x_process_error_info(struct mem_ctl_info *mci, + info->errsts = info->errsts2; + } + ++ /* Calculate page and offset of the error */ ++ + page = (unsigned long) info->eap; + page >>= 1; ++ + if (info->xeap & 1) + page |= 0x80000000; + page >>= (PAGE_SHIFT - 1); +- row = edac_mc_find_csrow_by_page(mci, page); +- +- if (row == -1) { +- i82975x_mc_printk(mci, KERN_ERR, "error processing EAP:\n" +- "\tXEAP=%u\n" +- "\t EAP=0x%08x\n" +- "\tPAGE=0x%08x\n", +- (info->xeap & 1) ? 1 : 0, info->eap, (unsigned int) page); +- return 0; ++ ++ if (pvt->is_symetric) ++ grain = 1 << 7; ++ else ++ grain = 1 << 6; ++ ++ offst = info->eap & ((1 << PAGE_SHIFT) - (1 << grain)); ++ ++ /* ++ * Search for the DIMM chip that match the error page. ++ * ++ * On Symmetric mode, this will always return channel = 0, as ++ * both channel A and B ranges are identical. ++ * A latter logic will determinte the channel on symetric mode ++ * ++ * On asymetric mode or single mode, there will be just one match, ++ * that will point to the csrow with the error. ++ */ ++ for (chan = 0; chan < pvt->num_channels; chan++) { ++ for (row = 0; row < DIMMS_PER_CHANNEL; row++) { ++ range = &pvt->page[row][chan]; ++ ++ if (page >= range->start && page <= range->end) ++ goto found; ++ } + } +- chan = (mci->csrows[row]->nr_channels == 1) ? 0 : info->eap & 1; +- offst = info->eap +- & ((1 << PAGE_SHIFT) - +- (1 << mci->csrows[row]->channels[chan]->dimm->grain)); ++ chan = -1; ++ row = -1; + +- if (info->errsts & 0x0002) ++found: ++ if (info->errsts & 0x0002) { ++ /* ++ * On uncorrected error, ECC doesn't allow do determine the ++ * channel where the error has occurred. ++ */ + edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, + page, offst, 0, + row, -1, -1, + "i82975x UE", ""); +- else +- edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, +- page, offst, info->derrsyn, +- row, chan ? chan : 0, -1, +- "i82975x CE", ""); ++ return 1; ++ } ++ ++ if (pvt->is_symetric && row >= 0) { ++ /* ++ * On Symetric mode, the memory switch happens after each ++ * cache line (64 byte boundary). Channel 0 goes first. ++ */ ++ if (info->eap & (1 << 6)) ++ chan = 1; ++ else ++ chan = 0; ++ } ++ edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, ++ page, offst, info->derrsyn, ++ row, chan, -1, ++ "i82975x CE", ""); + + return 1; + } +@@ -331,111 +389,143 @@ static void i82975x_check(struct mem_ctl_info *mci) + { + struct i82975x_error_info info; + +- edac_dbg(1, "MC%d\n", mci->mc_idx); ++ edac_dbg(4, "MC%d\n", mci->mc_idx); + i82975x_get_error_info(mci, &info); + i82975x_process_error_info(mci, &info, 1); + } + +-/* Return 1 if dual channel mode is active. Else return 0. */ +-static int dual_channel_active(void __iomem *mch_window) ++/** ++ * detect_memory_style - Detect on what mode the memory controller is programmed ++ * ++ * @pvt: pointer to the private structure ++ * ++ * This function detects how many channels are in use, and if the memory ++ * controller is in symetric (interleaved) or asymetric mode. There's no ++ * need to distinguish between asymetric and single mode, as the routines ++ * that fill the csrows data and handle error are written in order to handle ++ * both at the same way. ++ */ ++static void detect_memory_style(struct i82975x_pvt *pvt) + { +- /* +- * We treat interleaved-symmetric configuration as dual-channel - EAP's +- * bit-0 giving the channel of the error location. +- * +- * All other configurations are treated as single channel - the EAP's +- * bit-0 will resolve ok in symmetric area of mixed +- * (symmetric/asymmetric) configurations +- */ +- u8 drb[4][2]; + int row; +- int dualch; ++ bool has_chan_a = false; ++ bool has_chan_b = false; ++ ++ pvt->is_symetric = true; ++ pvt->num_channels = 0; ++ ++ for (row = 0; row < DIMMS_PER_CHANNEL; row++) { ++ pvt->drb[row][0] = readb(pvt->mch_window + I82975X_DRB + row); ++ pvt->drb[row][1] = readb(pvt->mch_window + I82975X_DRB + row + 0x80); ++ ++ /* On symetric mode, both channels have the same boundaries */ ++ if (pvt->drb[row][0] != pvt->drb[row][1]) ++ pvt->is_symetric = false; + +- for (dualch = 1, row = 0; dualch && (row < 4); row++) { +- drb[row][0] = readb(mch_window + I82975X_DRB + row); +- drb[row][1] = readb(mch_window + I82975X_DRB + row + 0x80); +- dualch = dualch && (drb[row][0] == drb[row][1]); ++ if (pvt->drb[row][0]) ++ has_chan_a = true; ++ if (pvt->drb[row][1]) ++ has_chan_b = true; + } +- return dualch; +-} + +-static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank) +-{ +- /* +- * ECC is possible on i92975x ONLY with DEV_X8 +- */ +- return DEV_X8; ++ if (has_chan_a) ++ pvt->num_channels++; ++ ++ if (has_chan_b) ++ pvt->num_channels++; + } + + static void i82975x_init_csrows(struct mem_ctl_info *mci, +- struct pci_dev *pdev, void __iomem *mch_window) ++ struct i82975x_pvt *pvt, ++ struct pci_dev *pdev) + { +- struct csrow_info *csrow; +- unsigned long last_cumul_size; +- u8 value; +- u32 cumul_size, nr_pages; +- int index, chan; +- struct dimm_info *dimm; +- enum dev_type dtype; +- +- last_cumul_size = 0; ++ struct dimm_info *dimm; ++ struct mem_range *range; ++ u8 boundary; ++ u32 initial_page = 0, last_page; ++ int row, chan; + + /* +- * 82875 comment: +- * The dram row boundary (DRB) reg values are boundary address +- * for each DRAM row with a granularity of 32 or 64MB (single/dual +- * channel operation). DRB regs are cumulative; therefore DRB7 will +- * contain the total memory contained in all rows. +- * ++ * This chipset provides 3 address modes: ++ * Single channel - either Channel A or channel B is filled ++ * Dual channel, interleaved: Memory is organized in pairs, ++ * where channel A gets the lower address for each pair ++ * Dual channel, asymmetric: Channel A memory goes first. ++ * In order to cover all modes, we need to start describing ++ * memories considering the dual channel, asymmetric one. + */ + +- for (index = 0; index < mci->nr_csrows; index++) { +- csrow = mci->csrows[index]; +- +- value = readb(mch_window + I82975X_DRB + index + +- ((index >= 4) ? 0x80 : 0)); +- cumul_size = value; +- cumul_size <<= (I82975X_DRB_SHIFT - PAGE_SHIFT); +- /* +- * Adjust cumul_size w.r.t number of channels +- * +- */ +- if (csrow->nr_channels > 1) +- cumul_size <<= 1; +- edac_dbg(3, "(%d) cumul_size 0x%x\n", index, cumul_size); +- +- nr_pages = cumul_size - last_cumul_size; +- if (!nr_pages) +- continue; +- ++ for (chan = 0; chan < pvt->num_channels; chan++) { + /* +- * Initialise dram labels +- * index values: +- * [0-7] for single-channel; i.e. csrow->nr_channels = 1 +- * [0-3] for dual-channel; i.e. csrow->nr_channels = 2 ++ * On symetric mode, both channels start from address 0 + */ +- dtype = i82975x_dram_type(mch_window, index); +- for (chan = 0; chan < csrow->nr_channels; chan++) { +- dimm = mci->csrows[index]->channels[chan]->dimm; +- +- dimm->nr_pages = nr_pages / csrow->nr_channels; +- +- snprintf(csrow->channels[chan]->dimm->label, EDAC_MC_LABEL_LEN, "DIMM %c%d", +- (chan == 0) ? 'A' : 'B', +- index); +- dimm->grain = 1 << 7; /* 128Byte cache-line resolution */ +- dimm->dtype = i82975x_dram_type(mch_window, index); ++ if (pvt->is_symetric) ++ initial_page = 0; ++ ++ for (row = 0; row < DIMMS_PER_CHANNEL; row++) { ++ boundary = pvt->drb[row][chan]; ++ dimm = mci->csrows[row]->channels[chan]->dimm; ++ ++ last_page = boundary << (I82975X_DRB_SHIFT - PAGE_SHIFT); ++ dimm->nr_pages = last_page - initial_page; ++ if (!dimm->nr_pages) ++ continue; ++ ++ range = &pvt->page[row][chan]; ++ range->start = initial_page; ++ range->end = range->start + dimm->nr_pages - 1; ++ ++ /* ++ * Grain is one cache-line: ++ * On dual symetric mode, it is 128 Bytes; ++ * On single mode or asymetric, it is 64 bytes. ++ */ ++ if (pvt->is_symetric) { ++ dimm->grain = 1 << 7; ++ ++ /* ++ * In dual interleaved mode, the addresses ++ * need to be multiplied by 2, as both ++ * channels are interlaced, and the boundary ++ * limit there actually match each DIMM size ++ */ ++ range->start <<= 1; ++ range->end <<= 1; ++ } else { ++ dimm->grain = 1 << 6; ++ } ++ ++ snprintf(dimm->label, ++ EDAC_MC_LABEL_LEN, "DIMM %c%d", ++ (chan == 0) ? 'A' : 'B', row); + dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */ + dimm->edac_mode = EDAC_SECDED; /* only supported */ +- } + +- csrow->first_page = last_cumul_size; +- csrow->last_page = cumul_size - 1; +- last_cumul_size = cumul_size; ++ /* ++ * This chipset supports both x8 and x16 memories, ++ * but datasheet doesn't describe how to distinguish ++ * between them. ++ * ++ * Also, the "Rank" comment at initial_page 17 says that ++ * ECC is only available with x8 memories. As this ++ * driver doesn't even initialize without ECC, better ++ * to assume that everything is x8. This is not ++ * actually true, on a mixed ECC/non-ECC scenario. ++ */ ++ dimm->dtype = DEV_X8; ++ ++ edac_dbg(1, ++ "%s: from page 0x%08x to 0x%08x (size: 0x%08x pages)\n", ++ dimm->label, ++ range->start, range->end, ++ dimm->nr_pages); ++ initial_page = last_page; ++ } + } + } + +-static void i82975x_print_dram_config(void __iomem *mch_window, u32 mchbar, u32 *drc) ++static void i82975x_print_dram_config(struct i82975x_pvt *pvt, ++ u32 mchbar, u32 *drc) + { + #ifdef CONFIG_EDAC_DEBUG + /* +@@ -444,63 +534,57 @@ static void i82975x_print_dram_config(void __iomem *mch_window, u32 mchbar, u32 + * Asus P5W Bios reports 15-5-4-4 + * What's your religion? + */ +- static const int caslats[4] = { 5, 4, 3, 6 }; +- u32 dtreg[2]; +- u8 c0drb[4]; +- u8 c1drb[4]; ++ static const int caslats[4] = { 5, 4, 3, 6 }; ++ u32 dtreg[2]; ++ int row; + ++ /* Show memory config if debug level is 1 or upper */ + if (!edac_debug_level) + return; + + i82975x_printk(KERN_INFO, "MCHBAR real = %0x, remapped = %p\n", +- mchbar, mch_window); +- +- c0drb[0] = readb(mch_window + I82975X_DRB_CH0R0); +- c0drb[1] = readb(mch_window + I82975X_DRB_CH0R1); +- c0drb[2] = readb(mch_window + I82975X_DRB_CH0R2); +- c0drb[3] = readb(mch_window + I82975X_DRB_CH0R3); +- c1drb[0] = readb(mch_window + I82975X_DRB_CH1R0); +- c1drb[1] = readb(mch_window + I82975X_DRB_CH1R1); +- c1drb[2] = readb(mch_window + I82975X_DRB_CH1R2); +- c1drb[3] = readb(mch_window + I82975X_DRB_CH1R3); +- i82975x_printk(KERN_INFO, "DRBCH0R0 = 0x%02x\n", c0drb[0]); +- i82975x_printk(KERN_INFO, "DRBCH0R1 = 0x%02x\n", c0drb[1]); +- i82975x_printk(KERN_INFO, "DRBCH0R2 = 0x%02x\n", c0drb[2]); +- i82975x_printk(KERN_INFO, "DRBCH0R3 = 0x%02x\n", c0drb[3]); +- i82975x_printk(KERN_INFO, "DRBCH1R0 = 0x%02x\n", c1drb[0]); +- i82975x_printk(KERN_INFO, "DRBCH1R1 = 0x%02x\n", c1drb[1]); +- i82975x_printk(KERN_INFO, "DRBCH1R2 = 0x%02x\n", c1drb[2]); +- i82975x_printk(KERN_INFO, "DRBCH1R3 = 0x%02x\n", c1drb[3]); +- +- i82975x_printk(KERN_INFO, "DRC_CH0 = %0x, %s\n", drc[0], ++ mchbar, pvt->mch_window); ++ ++ for (row = 0; row < DIMMS_PER_CHANNEL; row++) { ++ if (row) ++ /* Only show if at least one bank is filled */ ++ if ((pvt->drb[row][0] == pvt->drb[row-1][0]) && ++ (pvt->drb[row][1] == pvt->drb[row-1][1])) ++ continue; ++ ++ i82975x_printk(KERN_INFO, ++ "DRAM%i Rank Boundary Address: Channel A: 0x%08x; Channel B: 0x%08x\n", ++ row, ++ pvt->drb[row][0], ++ pvt->drb[row][1]); ++ } ++ ++ i82975x_printk(KERN_INFO, "DRAM Controller mode Channel A: = 0x%08x (%s); Channel B: 0x%08x (%s)\n", ++ drc[0], + ((drc[0] >> 21) & 3) == 1 ? +- "ECC enabled" : "ECC disabled"); +- i82975x_printk(KERN_INFO, "DRC_CH1 = %0x, %s\n", drc[1], ++ "ECC enabled" : "ECC disabled", ++ drc[1], + ((drc[1] >> 21) & 3) == 1 ? + "ECC enabled" : "ECC disabled"); + +- i82975x_printk(KERN_INFO, "C0 BNKARC = %0x\n", +- readw(mch_window + I82975X_C0BNKARC)); +- i82975x_printk(KERN_INFO, "C1 BNKARC = %0x\n", +- readw(mch_window + I82975X_C1BNKARC)); +- +- dtreg[0] = readl(mch_window + 0x114); +- dtreg[1] = readl(mch_window + 0x194); +- i82975x_printk(KERN_INFO, +- "DRAM Timings : Ch0 Ch1\n" +- " RAS Active Min = %d %d\n" +- " CAS latency = %d %d\n" +- " RAS to CAS = %d %d\n" +- " RAS precharge = %d %d\n", +- (dtreg[0] >> 19 ) & 0x0f, +- (dtreg[1] >> 19) & 0x0f, +- caslats[(dtreg[0] >> 8) & 0x03], +- caslats[(dtreg[1] >> 8) & 0x03], +- ((dtreg[0] >> 4) & 0x07) + 2, +- ((dtreg[1] >> 4) & 0x07) + 2, ++ i82975x_printk(KERN_INFO, "Bank Architecture Channel A: 0x%08x, Channel B: 0x%08x\n", ++ readw(pvt->mch_window + I82975X_C0BNKARC), ++ readw(pvt->mch_window + I82975X_C1BNKARC)); ++ ++ dtreg[0] = readl(pvt->mch_window + I82975X_C0DRT1); ++ dtreg[1] = readl(pvt->mch_window + I82975X_C1DRT1); ++ i82975x_printk(KERN_INFO, "DRAM Timings : ChA ChB\n"); ++ i82975x_printk(KERN_INFO, " RAS Active Min = %2d %2d\n", ++ (dtreg[0] >> 19 ) & 0x0f,(dtreg[1] >> 19) & 0x0f); ++ i82975x_printk(KERN_INFO, " CAS latency = %2d %2d\n", ++ caslats[(dtreg[0] >> 8) & 0x03], ++ caslats[(dtreg[1] >> 8) & 0x03]); ++ i82975x_printk(KERN_INFO, " RAS to CAS = %2d %2d\n", ++ ((dtreg[0] >> 4) & 0x07) + 2, ++ ((dtreg[1] >> 4) & 0x07) + 2); ++ i82975x_printk(KERN_INFO, " RAS precharge = %2d %2d\n", + (dtreg[0] & 0x07) + 2, +- (dtreg[1] & 0x07) + 2 +- ); ++ (dtreg[1] & 0x07) + 2); + #endif + } + +@@ -509,12 +593,10 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + int rc = -ENODEV; + struct mem_ctl_info *mci; + struct edac_mc_layer layers[2]; +- struct i82975x_pvt *pvt; +- void __iomem *mch_window; ++ struct i82975x_pvt tmp_pvt, *pvt; + u32 mchbar; + u32 drc[2]; + struct i82975x_error_info discard; +- int chans; + + edac_dbg(0, "\n"); + +@@ -524,26 +606,35 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + goto fail0; + } + mchbar &= 0xffffc000; /* bits 31:14 used for 16K window */ +- mch_window = ioremap_nocache(mchbar, 0x1000); ++ tmp_pvt.mch_window = ioremap_nocache(mchbar, 0x1000); ++ if (!tmp_pvt.mch_window) { ++ i82975x_printk(KERN_ERR, "Couldn't map MCHBAR registers.\n"); ++ rc = -ENOMEM; ++ goto fail0; ++ } + +- drc[0] = readl(mch_window + I82975X_DRC_CH0M0); +- drc[1] = readl(mch_window + I82975X_DRC_CH1M0); ++ drc[0] = readl(tmp_pvt.mch_window + I82975X_DRC_CH0M0); ++ drc[1] = readl(tmp_pvt.mch_window + I82975X_DRC_CH1M0); ++ ++ detect_memory_style(&tmp_pvt); ++ if (!tmp_pvt.num_channels) { ++ edac_dbg(3, "No memories installed? This shouldn't be running!\n"); ++ goto fail0; ++ } + +- i82975x_print_dram_config(mch_window, mchbar, drc); ++ i82975x_print_dram_config(&tmp_pvt, mchbar, drc); + + if (!(((drc[0] >> 21) & 3) == 1 || ((drc[1] >> 21) & 3) == 1)) { + i82975x_printk(KERN_INFO, "ECC disabled on both channels.\n"); + goto fail1; + } + +- chans = dual_channel_active(mch_window) + 1; +- + /* assuming only one controller, index thus is 0 */ + layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; +- layers[0].size = I82975X_NR_DIMMS; ++ layers[0].size = DIMMS_PER_CHANNEL; + layers[0].is_virt_csrow = true; + layers[1].type = EDAC_MC_LAYER_CHANNEL; +- layers[1].size = I82975X_NR_CSROWS(chans); ++ layers[1].size = tmp_pvt.num_channels; + layers[1].is_virt_csrow = false; + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt)); + if (!mci) { +@@ -562,10 +653,12 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) + mci->dev_name = pci_name(pdev); + mci->edac_check = i82975x_check; + mci->ctl_page_to_phys = NULL; ++ + edac_dbg(3, "init pvt\n"); + pvt = (struct i82975x_pvt *) mci->pvt_info; +- pvt->mch_window = mch_window; +- i82975x_init_csrows(mci, pdev, mch_window); ++ *pvt = tmp_pvt; ++ ++ i82975x_init_csrows(mci, pvt, pdev); + mci->scrub_mode = SCRUB_HW_SRC; + i82975x_get_error_info(mci, &discard); /* clear counters */ + +@@ -583,7 +676,7 @@ fail2: + edac_mc_free(mci); + + fail1: +- iounmap(mch_window); ++ iounmap(tmp_pvt.mch_window); + fail0: + return rc; + } diff --git a/freed-ora/current/master/irqnr-build.patch b/freed-ora/current/master/irqnr-build.patch new file mode 100644 index 000000000..b6797b4e3 --- /dev/null +++ b/freed-ora/current/master/irqnr-build.patch @@ -0,0 +1,43 @@ +uapi/linux/irqnr.h was emitted by the UAPI disintegration script as an empty +file because the parent linux/irqnr.h had no UAPI stuff in it, despite being +marked with "header-y". + +Unfortunately, it patch deletes the empty file when applying a kernel patch. + +It's not clear why this file is part of the UAPI at all. Looking in: + + /usr/include/linux/irqnr.h + +there's nothing there but a header reinclusion guard and a comment. + +So just stick a comment in there as a placeholder. + +Without this, if the kernel is fabricated from, say, a tarball and a patch, you +can get this error when building x86_64 or usermode Linux (and probably +others): + +include/linux/irqnr.h:4:30: fatal error: uapi/linux/irqnr.h: No such file or directory + +Signed-off-by: David Howells <dhowells@redhat.com> +cc: Randy Dunlap <rdunlap@xenotime.net> +cc: Alessandro Suardi <alessandro.suardi@gmail.com> +--- + + include/uapi/linux/irqnr.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/uapi/linux/irqnr.h b/include/uapi/linux/irqnr.h +index e69de29..ae5704f 100644 +--- a/include/uapi/linux/irqnr.h ++++ b/include/uapi/linux/irqnr.h +@@ -0,0 +1,4 @@ ++/* ++ * There isn't anything here anymore, but the file must not be empty or patch ++ * will delete it. ++ */ + +-- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/ diff --git a/freed-ora/current/master/kernel.spec b/freed-ora/current/master/kernel.spec index 3023718b2..b5b246654 100644 --- a/freed-ora/current/master/kernel.spec +++ b/freed-ora/current/master/kernel.spec @@ -6,7 +6,7 @@ Summary: The Linux kernel # For a stable, released kernel, released_kernel should be 1. For rawhide # and/or a kernel built from an rc or git snapshot, released_kernel should # be 0. -%global released_kernel 1 +%global released_kernel 0 # Sign modules on x86. Make sure the config files match this setting if more # architectures are added. @@ -68,7 +68,7 @@ Summary: The Linux kernel # base_sublevel is the kernel version we're starting with and patching # on top of -- for example, 3.1-rc7-git1 starts with a 3.0 base, # which yields a base_sublevel of 0. -%define base_sublevel 5 +%define base_sublevel 6 # librev starts empty, then 1, etc, as the linux-libre tarball # changes. This is only used to determine which tarball to use. @@ -78,9 +78,9 @@ Summary: The Linux kernel %define basegnu -gnu%{?librev} # To be inserted between "patch" and "-2.6.". -#define stablelibre -3.5%{?stablegnux} -#define rcrevlibre -3.5%{?rcrevgnux} -#define gitrevlibre -3.5%{?gitrevgnux} +#define stablelibre -3.7%{?stablegnux} +%define rcrevlibre -3.6%{?rcrevgnux} +#define gitrevlibre -3.7%{?gitrevgnux} %if 0%{?stablelibre:1} %define stablegnu -gnu%{?librev} @@ -131,9 +131,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 0 +%define rcrev 6 # The git snapshot level -%define gitrev 0 +%define gitrev 4 # Set rpm version accordingly %define rpmversion 3.%{upstream_sublevel}.0 %endif @@ -203,7 +203,7 @@ Summary: The Linux kernel # Set debugbuildsenabled to 1 for production (build separate debug kernels) # and 0 for rawhide (all kernels are debug kernels). # See also 'make debug' and 'make release'. -%define debugbuildsenabled 1 +%define debugbuildsenabled 0 # Want to build a vanilla kernel build without any non-upstream patches? %define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0} @@ -216,7 +216,7 @@ Summary: The Linux kernel %define doc_build_fail true %endif -%define rawhide_skip_docs 0 +%define rawhide_skip_docs 1 %if 0%{?rawhide_skip_docs} %define with_doc 0 %define doc_build_fail true @@ -299,10 +299,10 @@ Summary: The Linux kernel # kernel up (versatile express), tegra, omap, imx and highbank are only built on armv7 hfp/sfp %ifnarch armv7hl armv7l %define with_imx 0 -%define with_highbank 0 %define with_omap 0 %define with_tegra 0 %endif +%define with_highbank 0 # kernel-kirkwood is only built for armv5 %ifnarch armv5tel @@ -346,7 +346,7 @@ Summary: The Linux kernel %if %{with_vdso_install} # These arches install vdso/ directories. -%define vdso_arches %{all_x86} x86_64 ppc ppc64 s390 s390x +%define vdso_arches %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x %endif # Overrides for generic default options @@ -377,12 +377,12 @@ Summary: The Linux kernel %endif # bootwrapper is only on ppc -%ifnarch ppc ppc64 +%ifnarch ppc ppc64 ppc64p7 %define with_bootwrapper 0 %endif # sparse blows up on ppc64 and sparc64 -%ifarch ppc64 ppc sparc64 +%ifarch ppc64 ppc sparc64 ppc64p7 %define with_sparse 0 %endif @@ -403,7 +403,7 @@ Summary: The Linux kernel %define kernel_image arch/x86/boot/bzImage %endif -%ifarch ppc64 +%ifarch ppc64 ppc64p7 %define asmarch powerpc %define hdrarch powerpc %define all_arch_configs kernel-%{version}-ppc64*.config @@ -463,6 +463,8 @@ Summary: The Linux kernel %define with_perf 0 %define with_tools 0 %endif +# TEMPORARY until perf build fixed on ARM to get a new 3.7rc kernel +%define with_perf 0 %endif # To temporarily exclude an architecture from being built, add it to @@ -490,7 +492,7 @@ Summary: The Linux kernel %endif # Architectures we build tools/cpupower on -%define cpupowerarchs %{ix86} x86_64 ppc ppc64 %{arm} +%define cpupowerarchs %{ix86} x86_64 ppc ppc64 ppc64p7 %{arm} # # Three sets of minimum package version requirements in the form of Conflicts: @@ -568,7 +570,7 @@ Version: %{rpmversion} Release: %{pkg_release} # DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD. # SET %%nobuildarches (ABOVE) INSTEAD -ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 %{sparc} s390 s390x %{arm} +ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ppc64p7 %{sparc} s390 s390x %{arm} ExclusiveOS: Linux %kernel_reqprovconf @@ -586,6 +588,10 @@ BuildRequires: sparse >= 0.4.1 %endif %if %{with_perf} BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison +BuildRequires: audit-libs-devel +%ifnarch s390 s390x +BuildRequires: libunwind-devel +%endif %endif %if %{with_tools} BuildRequires: pciutils-devel gettext @@ -601,7 +607,8 @@ BuildRequires: rpm-build >= 4.9.0-1, elfutils >= elfutils-0.153-1 %endif %if %{signmodules} -BuildRequires: gnupg +BuildRequires: openssl +BuildRequires: pesign >= 0.10-4 %endif Source0: http://linux-libre.fsfla.org/pub/linux-libre/freed-ora/src/linux%{?baselibre}-%{kversion}%{basegnu}.tar.xz @@ -610,14 +617,16 @@ Source0: http://linux-libre.fsfla.org/pub/linux-libre/freed-ora/src/linux%{?base Source3: deblob-main Source4: deblob-check Source5: deblob-%{kversion} -# Source6: deblob-3.%{upstream_sublevel} +Source6: deblob-3.%{upstream_sublevel} %if %{signmodules} -Source11: genkey +Source11: x509.genkey %endif Source15: merge.pl Source16: mod-extra.list +Source17: mod-extra.sh +Source18: mod-extra-sign.sh Source19: Makefile.release Source20: Makefile.config @@ -635,12 +644,17 @@ Source50: config-powerpc-generic Source51: config-powerpc32-generic Source52: config-powerpc32-smp Source53: config-powerpc64 +Source54: config-powerpc64p7 Source70: config-s390x Source90: config-sparc64-generic -Source100: config-arm-generic +# Unified ARM kernels +Source100: config-armv7 + +# Legacy ARM kernels +Source105: config-arm-generic Source110: config-arm-omap Source111: config-arm-tegra Source112: config-arm-kirkwood @@ -696,6 +710,8 @@ Patch04: linux-2.6-compile-fixes.patch # build tweak for build ID magic, even for -vanilla Patch05: linux-2.6-makefile-after_link.patch +Patch06: power-x86-destdir.patch + Patch07: freedo.patch %if !%{nopatches} @@ -709,6 +725,8 @@ Patch09: linux-2.6-upstream-reverts.patch Patch100: taint-vbox.patch +Patch110: vmbugon-warnon.patch + Patch390: linux-2.6-defaults-acpi-video.patch Patch391: linux-2.6-acpi-video-dos.patch Patch394: linux-2.6-acpi-debug-infinite-loop.patch @@ -730,14 +748,20 @@ Patch700: linux-2.6-e1000-ich9-montevina.patch Patch800: linux-2.6-crash-driver.patch # crypto/ -Patch900: modsign-20120718.patch +Patch900: modsign-post-KS-jwb.patch + +# secure boot +Patch1000: secure-boot-20121105.patch +Patch1001: efivarfs-3.7.patch + +# Improve PCI support on UEFI +Patch1100: handle-efi-roms.patch # virt + ksm patches -Patch1555: fix_xen_guest_on_old_EC2.patch # DRM #atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch -Patch1800: drm-vgem.patch +#Patch1800: drm-vgem.patch # nouveau + drm fixes # intel drm is all merged upstream @@ -770,13 +794,15 @@ Patch14000: hibernate-freeze-filesystems.patch Patch14010: lis3-improve-handling-of-null-rate.patch -Patch14015: team-update-from-net-next.patch - -Patch20000: uprobes-3.5-tip.patch +Patch19001: i82975x-edac-fix.patch # ARM +Patch21000: arm-export-read_current_timer.patch +Patch21001: arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch + # OMAP +Patch21003: arm-omapdrm-fixinc.patch # ARM tegra Patch21004: arm-tegra-nvec-kconfig.patch @@ -784,27 +810,26 @@ Patch21005: arm-tegra-usb-no-reset-linux33.patch Patch21006: arm-tegra-sdhci-module-fix.patch # ARM highbank patches -# Highbank clock functions need to be EXPORT for module builds -Patch21010: highbank-export-clock-functions.patch - -Patch21094: power-x86-destdir.patch #rhbz 754518 Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -Patch21400: unhandled-irqs-switch-to-polling.patch - Patch22000: weird-root-dentry-name-debug.patch #selinux ptrace child permissions Patch22001: selinux-apply-different-permission-to-ptrace-child.patch -#Fix FIPS for aesni hardare -Patch22050: crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch -Patch22051: crypto-aesni-intel-fix-wrong-kfree-pointer.patch +# Build patch, should go away +Patch22070: irqnr-build.patch +Patch22071: uapi-prefix-fix.patch + +Patch22073: perf-uapi-fixes2.patch + +#rhbz 874791 +Patch22125: Bluetooth-Add-support-for-BCM20702A0.patch -#rhbz 772730 -Patch22058: ACPI-AC-check-the-return-value-of-power_supply_register.patch +#rhbz 859485 +Patch21226: vt-Drop-K_OFF-for-VC_MUTE.patch # END OF PATCH DEFINITIONS @@ -935,19 +960,31 @@ Provides: cpufrequtils = 1:009-0.6.p1 Obsoletes: cpufreq-utils < 1:009-0.6.p1 Obsoletes: cpufrequtils < 1:009-0.6.p1 Obsoletes: cpuspeed < 1:1.5-16 +Requires: kernel-libre-tools-libs = %{version}-%{release} %description -n kernel-libre-tools This package contains the tools/ directory from the kernel source and the supporting documentation. -%package -n kernel-libre-tools-devel -Provides: kernel-tools-devel = %{rpmversion}-%{pkg_release} +%package -n kernel-libre-tools-libs +Summary: Libraries for the kernels-tools +Group: Development/System +License: GPLv2 +Provides: kernel-tools-libs = %{rpmversion}-%{pkg_release} +%description -n kernel-libre-tools-libs +This package contains the libraries built from the tools/ directory +from the kernel source. + +%package -n kernel-libre-tools-libs-devel Summary: Assortment of tools for the Linux kernel Group: Development/System License: GPLv2 Requires: kernel-libre-tools = %{version}-%{release} Provides: cpupowerutils-devel = 1:009-0.6.p1 Obsoletes: cpupowerutils-devel < 1:009-0.6.p1 -%description -n kernel-libre-tools-devel +Requires: kernel-libre-tools-libs = %{version}-%{release} +Provides: kernel-libre-tools-devel +Provides: kernel-tools-devel +%description -n kernel-libre-tools-libs-devel This package contains the development files for the tools/ directory from the kernel source. @@ -1409,6 +1446,8 @@ ApplyPatch linux-2.6-makefile-after_link.patch # ApplyOptionalPatch linux-2.6-compile-fixes.patch +ApplyPatch power-x86-destdir.patch + # Freedo logo. ApplyPatch freedo.patch @@ -1417,15 +1456,19 @@ ApplyPatch freedo.patch # revert patches from upstream that conflict or that we get via other means ApplyOptionalPatch linux-2.6-upstream-reverts.patch -R - ApplyPatch taint-vbox.patch +ApplyPatch vmbugon-warnon.patch + # Architecture patches # x86(-64) # # ARM # +ApplyPatch arm-export-read_current_timer.patch +ApplyPatch arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch +ApplyPatch arm-omapdrm-fixinc.patch ApplyPatch arm-tegra-nvec-kconfig.patch ApplyPatch arm-tegra-usb-no-reset-linux33.patch ApplyPatch arm-tegra-sdhci-module-fix.patch @@ -1496,14 +1539,20 @@ ApplyPatch linux-2.6-crash-driver.patch ApplyPatch linux-2.6-e1000-ich9-montevina.patch # crypto/ -ApplyPatch modsign-20120718.patch +ApplyPatch modsign-post-KS-jwb.patch + +# secure boot +ApplyPatch efivarfs-3.7.patch +ApplyPatch secure-boot-20121105.patch + +# Improved PCI support for UEFI +ApplyPatch handle-efi-roms.patch # Assorted Virt Fixes -ApplyPatch fix_xen_guest_on_old_EC2.patch # DRM core #ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch -ApplyPatch drm-vgem.patch +#ApplyPatch drm-vgem.patch # Nouveau DRM @@ -1536,31 +1585,27 @@ ApplyPatch efi-dont-map-boot-services-on-32bit.patch ApplyPatch lis3-improve-handling-of-null-rate.patch -ApplyPatch team-update-from-net-next.patch - -ApplyPatch uprobes-3.5-tip.patch - -ApplyPatch power-x86-destdir.patch +ApplyPatch i82975x-edac-fix.patch #rhbz 754518 ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -ApplyPatch unhandled-irqs-switch-to-polling.patch - ApplyPatch weird-root-dentry-name-debug.patch #selinux ptrace child permissions ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch -#Highbank clock functions -ApplyPatch highbank-export-clock-functions.patch +#Build patch, should go away +ApplyPatch irqnr-build.patch +ApplyPatch uapi-prefix-fix.patch + +ApplyPatch perf-uapi-fixes2.patch -#Fix FIPS for aesni hardare -ApplyPatch crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch -ApplyPatch crypto-aesni-intel-fix-wrong-kfree-pointer.patch +#rhbz 874791 +ApplyPatch Bluetooth-Add-support-for-BCM20702A0.patch -#rhbz 772730 -ApplyPatch ACPI-AC-check-the-return-value-of-power_supply_register.patch +#rhbz 859485 +ApplyPatch vt-Drop-K_OFF-for-VC_MUTE.patch # END OF PATCH APPLICATIONS @@ -1609,10 +1654,6 @@ find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null # remove unnecessary SCM files find . -name .gitignore -exec rm -f {} \; >/dev/null -%if %{signmodules} -cp %{SOURCE11} . -%endif - cd .. ### @@ -1682,6 +1723,12 @@ BuildKernel() { make -s mrproper cp configs/$Config .config + %if %{signmodules} + cp %{SOURCE11} . + %endif + + chmod +x scripts/sign-file + Arch=`head -1 .config | cut -b 3-` echo USING ARCH=$Arch @@ -1710,6 +1757,11 @@ BuildKernel() { if [ -f arch/$Arch/boot/zImage.stub ]; then cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || : fi + %if %{signmodules} + # Sign the image if we're using EFI + %pesign -s -i $KernelImage -o vmlinuz.signed + mv vmlinuz.signed $KernelImage + %endif $CopyKernel $KernelImage \ $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer chmod 755 $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer @@ -1724,13 +1776,6 @@ BuildKernel() { # we'll get it from the linux-firmware package and we don't want conflicts make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= -%if %{signmodules} - if [ -z "$(readelf -n $(find fs/ -name \*.ko | head -n 1) | grep module.sig)" ]; then - echo "ERROR: modules are NOT signed" >&2; - exit 1; - fi -%endif - %ifarch %{vdso_arches} make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer if [ ! -s ldconfig-kernel.conf ]; then @@ -1776,7 +1821,7 @@ BuildKernel() { fi rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*.o rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*/*.o -%ifarch ppc ppc64 +%ifarch ppc ppc64 ppc64p7 cp -a --parents arch/powerpc/lib/crtsavres.[So] $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ %endif if [ -d arch/%{asmarch}/include ]; then @@ -1792,8 +1837,8 @@ BuildKernel() { # Make sure the Makefile and version.h have a matching timestamp so that # external modules can be built - touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/version.h - touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/autoconf.h + touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/generated/uapi/linux/version.h + # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf @@ -1851,66 +1896,18 @@ BuildKernel() { rm -f modinfo modnames - pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/ - rm -rf modnames - find . -name "*.ko" -type f > modnames - # Look through all of the modules, and throw any that have a dependency in - # our list into the list as well. - rm -rf dep.list dep2.list - rm -rf req.list req2.list - touch dep.list req.list - cp %{SOURCE16} . - for dep in `cat modnames` - do - depends=`modinfo $dep | grep depends| cut -f2 -d":" | sed -e 's/^[ \t]*//'` - [ -z "$depends" ] && continue; - for mod in `echo $depends | sed -e 's/,/ /g'` - do - match=`grep "^$mod.ko" mod-extra.list` ||: - if [ -z "$match" ] - then - continue - else - # check if the module we're looking at is in mod-extra too. if so - # we don't need to mark the dep as required - mod2=`basename $dep` - match2=`grep "^$mod2" mod-extra.list` ||: - if [ -n "$match2" ] - then - continue - #echo $mod2 >> notreq.list - else - echo $mod.ko >> req.list - fi - fi - done - done - - sort -u req.list > req2.list - sort -u mod-extra.list > mod-extra2.list - join -v 1 mod-extra2.list req2.list > mod-extra3.list + # Call the modules-extra script to move things around + %{SOURCE17} $RPM_BUILD_ROOT/lib/modules/$KernelVer %{SOURCE16} - for mod in `cat mod-extra3.list` - do - # get the path for the module - modpath=`grep /$mod modnames` ||: - [ -z "$modpath" ] && continue; - echo $modpath >> dep.list - done - - sort -u dep.list > dep2.list - - # now move the modules into the extra/ directory - for mod in `cat dep2.list` - do - newpath=`dirname $mod | sed -e 's/kernel\//extra\//'` - mkdir -p $newpath - mv $mod $newpath - done - - rm modnames dep.list dep2.list req.list req2.list - rm mod-extra.list mod-extra2.list mod-extra3.list - popd +%if %{signmodules} + # Save off the .tmp_versions/ directory. We'll use it in the + # __debug_install_post macro below to sign the right things + # Also save the signing keys so we actually sign the modules with the + # right key. + cp -r .tmp_versions .tmp_versions.sign${Flavour:+.${Flavour}} + cp signing_key.priv signing_key.priv.sign${Flavour:+.${Flavour}} + cp signing_key.x509 signing_key.x509.sign${Flavour:+.${Flavour}} +%endif # remove files that will be auto generated by depmod at rpm -i time for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap devname softdep @@ -2034,9 +2031,64 @@ find Documentation -type d | xargs chmod u+w # This macro is used by %%install, so we must redefine it before that. %define debug_package %{nil} +# In the modsign case, we do 3 things. 1) We check the "flavour" and hard +# code the value in the following invocations. This is somewhat sub-optimal +# but we're doing this inside of an RPM macro and it isn't as easy as it +# could be because of that. 2) We restore the .tmp_versions/ directory from +# the one we saved off in BuildKernel above. This is to make sure we're +# signing the modules we actually built/installed in that flavour. 3) We +# grab the arch and invoke 'make modules_sign' and the mod-extra-sign.sh +# commands to actually sign the modules. +# +# We have to do all of those things _after_ find-debuginfo runs, otherwise +# that will strip the signature off of the modules. + %if %{with_debuginfo} %define __debug_install_post \ /usr/lib/rpm/find-debuginfo.sh %{debuginfo_args} %{_builddir}/%{?buildsubdir}\ + if [ "%{signmodules}" == "1" ]; \ + then \ + if [ "%{with_pae}" != "0" ]; \ + then \ + Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-PAE.config | cut -b 3-` \ + rm -rf .tmp_versions \ + mv .tmp_versions.sign.PAE .tmp_versions \ + mv signing_key.priv.sign.PAE signing_key.priv \ + mv signing_key.x509.sign.PAE signing_key.x509 \ + make -s ARCH=$Arch V=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_sign KERNELRELEASE=%{KVERREL}.PAE \ + %{SOURCE18} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/extra/ \ + fi \ + if [ "%{with_debug}" != "0" ]; \ + then \ + Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-debug.config | cut -b 3-` \ + rm -rf .tmp_versions \ + mv .tmp_versions.sign.debug .tmp_versions \ + mv signing_key.priv.sign.debug signing_key.priv \ + mv signing_key.x509.sign.debug signing_key.x509 \ + make -s ARCH=$Arch V=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_sign KERNELRELEASE=%{KVERREL}.debug \ + %{SOURCE18} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/extra/ \ + fi \ + if [ "%{with_pae_debug}" != "0" ]; \ + then \ + Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}-PAEdebug.config | cut -b 3-` \ + rm -rf .tmp_versions \ + mv .tmp_versions.sign.PAEdebug .tmp_versions \ + mv signing_key.priv.sign.PAEdebug signing_key.priv \ + mv signing_key.x509.sign.PAEdebug signing_key.x509 \ + make -s ARCH=$Arch V=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_sign KERNELRELEASE=%{KVERREL}.PAEdebug \ + %{SOURCE18} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/extra/ \ + fi \ + if [ "%{with_up}" != "0" ]; \ + then \ + Arch=`head -1 configs/kernel-%{version}-%{_target_cpu}.config | cut -b 3-` \ + rm -rf .tmp_versions \ + mv .tmp_versions.sign .tmp_versions \ + mv signing_key.priv.sign signing_key.priv \ + mv signing_key.x509.sign signing_key.x509 \ + make -s ARCH=$Arch V=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_sign KERNELRELEASE=%{KVERREL} \ + %{SOURCE18} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/extra/ \ + fi \ + fi \ %{nil} %ifnarch noarch @@ -2313,6 +2365,7 @@ fi %dir %{_libexecdir}/perf-core %{_libexecdir}/perf-core/* %{_mandir}/man[1-8]/perf* +%{_sysconfdir}/bash_completion.d/perf %doc linux-%{KVERREL}/tools/perf/Documentation/examples.txt %files -n python-perf-libre @@ -2337,8 +2390,6 @@ fi %{_bindir}/centrino-decode %{_bindir}/powernow-k8-decode %endif -%{_libdir}/libcpupower.so.0 -%{_libdir}/libcpupower.so.0.0.0 %{_unitdir}/cpupower.service %{_mandir}/man[1-8]/cpupower* %config(noreplace) %{_sysconfdir}/sysconfig/cpupower @@ -2356,7 +2407,11 @@ fi %endif %ifarch %{cpupowerarchs} -%files -n kernel-libre-tools-devel +%files -n kernel-libre-tools-libs +%{_libdir}/libcpupower.so.0 +%{_libdir}/libcpupower.so.0.0.0 + +%files -n kernel-libre-tools-libs-devel %{_libdir}/libcpupower.so %{_includedir}/cpufreq.h %endif @@ -2421,8 +2476,8 @@ fi # and build. # ___________________________________________________________ -# / This branch is for Fedora 18. You probably want to commit \ -# \ to the F-17 branch instead, or in addition to this one. / +# / This branch is for Fedora 19. You probably want to commit \ +# \ to the F-18 branch instead, or in addition to this one. / # ----------------------------------------------------------- # \ ^__^ # \ (@@)\_______ @@ -2430,6 +2485,463 @@ fi # ||----w | # || || %changelog +* Mon Nov 26 2012 Alexandre Oliva <lxoliva@fsfla.org> -libre +- GNU Linux-libre 3.7-rc6-gnu + +* Sun Nov 25 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc6.git4.1 +- Linux v3.7-rc6-209-g194d983 + +* Fri Nov 23 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc6.git3.1 +- Linux v3.7-rc6-109-g26d29d0 + +* Wed Nov 21 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc6.git2.1 +- Linux v3.7-rc6-41-g99b6e1e + +* Tue Nov 20 2012 Josh Boyer <jwboyer@redhat.com> +- Add VC_MUTE ioctl (rhbz 859485) +- Add support for BCM20702A0 (rhbz 874791) + +* Tue Nov 20 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Change the minimum mmap address back to 32768 on ARM systems (thanks to Jon Masters) +- Add patch to fix unified kernel build failure + +* Mon Nov 19 2012 Josh Boyer <jwboyer@redhat.com> +- Add various patches to fix perf build on non-x86 arches + +* Mon Nov 19 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc6.git1.1 +- Linux v3.7-rc6-21-g3587b1b +- Reenable debugging options. + +* Sat Nov 17 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc6.git0.1 +- Linux v3.7-rc6 +- Disable debugging options. + +* Fri Nov 16 2012 Josh Boyer <jwboyer@redhat.com> +- Add patch to enable CONFIG_CIFS_SMB2 + +* Fri Nov 16 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc5.git2.1 +- Linux v3.7-rc5-68-gc5e35d6 + +* Wed Nov 14 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc5.git1.3 +- Fix module signing of kernel flavours + +* Tue Nov 13 2012 Josh Boyer <jwboyer@redhat.com> +- Add patch from David Howells to fix header guards on installed kernel headers + +* Tue Nov 13 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc5.git1.1 +- Linux v3.7-rc5-14-g9924a19 +- Reenable debugging options. + +* Sun Nov 11 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM unified config updates + +* Sun Nov 11 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc5.git0.1 +- Linux v3.7-rc5 +- Disable debugging options. + +* Sat Nov 10 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc4.git3.1 +- Linux v3.7-rc4-136-gaffd9a8 + +* Fri Nov 09 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc4.git2.1 +- Linux v3.7-rc4-72-ga186d25 + +* Wed Nov 7 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Update ARM unified config + +* Wed Nov 07 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc4.git1.1 +- Linux v3.7-rc4-20-g0e4a43e +- Reenable debugging options. +- Add patch to not break modules_install for external module builds + +* Mon Nov 05 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc4.git0.1 +- Linux v3.7-rc4 +- Disable debugging options. +- Fix build break without CONFIG_EFI set (reported by Peter W. Bowey) + +* Fri Nov 02 2012 Josh Boyer <jwboyer@redhat.com> +- Backport efivarfs from efi/next for moktools + +* Thu Nov 01 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc3.git4.1 +- Linux v3.7-rc3-77-g8c23f40 + +* Thu Nov 1 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Update non unified kernels to build for 3.7 (always OMAP) +- Remove old ARM patches, add new to fix 3.7 build +- Disable perf on ARM temporarily as the uapi / asm-generic changes break it + +* Thu Nov 01 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc3.git3.1 +- Linux v3.7-rc3-75-g1e207eb + +* Wed Oct 31 2012 Josh Boyer <jwboyer@redhat.com> +- Fix sign-file permissions and invocation after switching from bash to perl + +* Wed Oct 31 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc3.git2.1 +- Linux v3.7-rc3-44-g08f05c4 + +* Wed Oct 31 2012 Josh Boyer <jwboyer@redhat.com> +- Update secure boot hibernate patch to include swsusp + +* Tue Oct 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc3.git1.1 +- Linux v3.7-rc3-8-g35fd3dc +- Reenable debugging options. + +* Tue Oct 30 2012 Josh Boyer <jwboyer@redhat.com> +- Update config options for 3.7 +- Fix module blacklist patch to not leak a reference to the blacklist keyring + +* Tue Oct 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.7.0-0.rc3.git0.1 +- Disable debugging options. +- Linux v3.7-rc3 +- enable CONFIG_MEDIA_{USB,PCI}_SUPPORT (rhbz 870457) + +* Sat Oct 27 2012 Josh Boyer <jwboyer@redhat.com> +- Update secure boot support for UEFI cert importing + +* Fri Oct 26 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- The initial ARM unified kernel support (vexpress, highbank, mvebu to begin). WOO HOO!!! + +* Fri Oct 26 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc2.git4.1 +- Linux v3.7-rc2-191-g2ab3f29 + +* Thu Oct 25 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc2.git3.1 +- Linux v3.7-rc2-145-g4864ccb +- Move power-x86-destdir.patch to apply on vanilla kernels (thanks knurd) +- Deal with uapi move of version.h + +* Wed Oct 24 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc2.git2.1 +- Linux v3.7-rc2-119-g0e9e3e3 + +* Wed Oct 24 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc2.git1.3 +- Reenable debugging options. + +* Tue Oct 23 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc2.git1.1 +- Linux v3.7-rc2-53-g2d1f4c8 + +* Sun Oct 21 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc1.git3.2 +- Disable debugging options. + +* Fri Oct 19 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc1.git3.1 +- Linux v3.7-rc1-154-gc9623de + +* Thu Oct 18 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc1.git2.1 +- Linux v3.7-rc1-102-g43c422e +- Reenable debugging options. + +* Thu Oct 18 2012 Josh Boyer <jwboyer@redhat.com> +- Enable VFIO (rhbz 867152) + +* Wed Oct 17 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc1.git1.1 +- Linux v3.7-rc1-78-g8d2b6b3 + +* Tue Oct 16 2012 Mauro Carvalho Chehab <mchehab@redhat.com> +- Fix i82975x_edac OOPS + +* Mon Oct 15 2012 Justin M. Forbes <jforbes@redhat.com> - 3.7.0-0.rc1.git0.1 +- Linux 3.7-rc1 +- Disable debugging options. + +* Fri Oct 12 2012 Justin M. Forbes <jforbes@redhat.com> +- Add perf build fix back, changed to work with upstream + +* Fri Oct 12 2012 Justin M. Forbes <jforbes@redhat.com> +- v3.6-10630-gccff9b1 + +* Wed Oct 10 2012 Justin M. Forbes <jforbes@redhat.com> +- v3.6-9849-g2474542 + +* Tue Oct 09 2012 Justin M. Forbes <jforbes@redhat.com> +- v3.6-9228-g547b1e8 + +* Tue Oct 09 2012 Josh Boyer <jwboyer@redhat.com> +- Drop unhandled irq polling patch + +* Mon Oct 08 2012 Justin M. Forbes <jforbes@redhat.com> +- v3.6-8559-ge9eca4d + +* Sat Oct 06 2012 Josh Boyer <jwboyer@redhat.com> +- secure boot modsign depends on CONFIG_MODULE_SIG not CONFIG_MODULES + +* Fri Oct 05 2012 Josh Boyer <jwboyer@redhat.com> +- Adjust secure boot modsign patch + +* Fri Oct 05 2012 Justin M. Forbes <jforbes@redhat.com> +- Fix handle-efi-roms.patch + +* Fri Oct 05 2012 Justin M. Forbes <jforbes@redhat.com> +- v3.6-6670-gecefbd9 +- Reenable debugging options. + +* Fri Oct 5 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Build MMC in on OMAP and Tegra until we work out why modules don't work + +* Wed Oct 03 2012 Adam Jackson <ajax@redhat.com> +- Drop vgem patches, not doing anything yet. + +* Wed Oct 03 2012 Josh Boyer <jwboyer@redhat.com> +- Make sure kernel-tools-libs-devel provides kernel-tools-devel + +* Tue Oct 02 2012 Josh Boyer <jwboyer@redhat.com> +- Patch from David Howells to fix overflow on 32-bit X.509 certs (rhbz 861322) + +* Tue Oct 2 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Update ARM configs for 3.6 final +- Add highbank SATA driver for stability +- Build in OMAP MMC and DMA drivers to fix borkage for now + +* Mon Oct 01 2012 Justin M. Forbes <jforbes@redhat.com> - 3.6.0-1 +- Linux 3.6.0 +- Disable debugging options. + +* Fri Sep 28 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git3.1 +- Linux v3.6-rc7-103-g6672d90 + +* Fri Sep 28 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git2.2 +- Split out kernel-tools-libs (rhbz 859943) + +* Fri Sep 28 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git2.1 +- Linux v3.6-rc7-71-g6399413 + +* Tue Sep 25 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git1.4 +- Move the modules-extra processing to a script +- Prep mod-extra.sh for signed modules +- Switch to using modsign-post-KS upstream with x509 certs + +* Tue Sep 25 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git1.2 +- Update team driver from net-next from Jiri Pirko + +* Tue Sep 25 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git1.1 +- Linux v3.6-rc7-10-g56d27ad + +* Tue Sep 25 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git0.2 +- Reenable debugging options. + +* Mon Sep 24 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc7.git1.1 +- Linux v3.6-rc7 +- Disable debugging options. + +* Thu Sep 20 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc6.git2.1 +- Linux v3.6-rc6-52-gc46de22 + +* Tue Sep 18 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc6.git1.1 +- Linux v3.6-rc6-25-g4651afb +- Enable POWER7+ crypto modules (rhbz 857971) + +* Mon Sep 17 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc6.git0.2 +- Reenable debugging options. + +* Mon Sep 17 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc6.git0.1 +- Linux v3.6-rc6 +- Disable debugging options. + +* Sun Sep 16 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc5.git3.1 +- Linux v3.6-rc5-315-g3f0c3c8 + +* Fri Sep 14 2012 Dave Jones <davej@redhat.com> +- Enable CONFIG_DRM_LOAD_EDID_FIRMWARE (rhbz 857511) + +* Fri Sep 14 2012 Dave Jones <davej@redhat.com> +- Reenable UBIFS (rhbz 823238) + +* Fri Sep 14 2012 Dave Jones <davej@redhat.com> +- Fix license tag. (rhbz 450492) + +* Wed Sep 12 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc5.git2.1 +- Linux v3.6-rc5-44-g0bd1189 + +* Tue Sep 11 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc5.git1.2 +- Drop old Xen EC2 patch. It is no longer needed per Matt Wilson + +* Tue Sep 11 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc5.git1.1 +- Linux v3.6-rc5-32-g1a95620 +- Reenable debugging options. + +* Tue Sep 11 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc5.git0.1 +- Linux v3.6-rc5 +- Disable debugging options. + +* Fri Sep 07 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc4.git2.2 +- Re-enable BTRFS on ppc. Brent Baude says it works now. + +* Fri Sep 07 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc4.git2.1 +- Linux v3.6-rc4-128-geeea3ac + +* Wed Sep 05 2012 Dave Jones <davej@redhat.com> +- Don't create empty include/linux/autoconf.h in kernel-devel (rhbz 854689) + +* Wed Sep 05 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc4.git1.1 +- Linux v3.6-rc4-53-g5b716ac +- Add patch to fix ibmveth issue from Santiago Leon (rhbz 852842) + +* Wed Sep 05 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc4.git0.2 +- Reenable debugging options. + +* Tue Sep 4 2012 Matthew Garrett <mjg@redhat.com> +- handle-efi-roms.patch: Improve PCI support on UEFI systems + +* Tue Sep 4 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Tweak OMAP options + +* Mon Sep 03 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc4.git0.1 +- Linux v3.6-rc4 +- Disable debugging options. + +* Thu Aug 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git4.1 +- Linux v3.6-rc3-230-g155e36d + +* Wed Aug 29 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git3.2 +- Add patch to fix USB audio regression (rhbz 851619) + +* Wed Aug 29 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git3.1 +- Linux v3.6-rc3-207-g318e151 + +* Tue Aug 28 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Add patches to fix OMAP drm, radio shark +- Tweak ARM config + +* Mon Aug 27 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git2.1 +- Linux v3.6-rc3-177-gc182ae4 + +* Sat Aug 25 2012 Peter Robinson <pbrobinson@fedoraproject.org> +- Add patch to fix build on ARM +- Enable USB ULPI driver to fix some USB ports + +* Fri Aug 24 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git1.1 +- Linux v3.6-rc3-37-g2d809dc + +* Thu Aug 23 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git0.2 +- Reenable debugging options. + +* Wed Aug 22 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc3.git0.1 +- Linux v3.6-rc3 +- Disable debugging options. + +* Wed Aug 22 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc2.git2.1 +- Linux v3.6-rc2-400-g23dcfa6 +- CVE-2012-3520: af_netlink: invalid handling of SCM_CREDENTIALS passing + +* Tue Aug 21 2012 Josh Boyer <jwboyer@redhat.com> +- Add patch from Dave Jones to fix suspicious RCU usage in SELinux (rhbz 846037) +- Add patch from Richard W.M. Jones to fix virtio scsi oops (rhbz 847548) +- Add patch from Dave Airlie to fix fb cursor vs grub2 gfxterm hang + +* Mon Aug 20 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc2.git1.1 +- Linux v3.6-rc2-206-g10c63c9 + +* Mon Aug 20 2012 Dave Jones <davej@redhat.com> +- Reenable W1 drivers. (rhbz 849430) + +* Fri Aug 17 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc2.git0.2 +- Reenable debugging options. + +* Thu Aug 16 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc2.git0.1 +- Linux v3.6-rc2 +- Disable debugging options. + +* Tue Aug 14 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git6.1 +- Linux v3.6-rc1-355-gddf343f + +* Mon Aug 13 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git5.2 +- Fix VFS file creation bugs (rhbz 844485) + +* Mon Aug 13 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git5.1 +- Linux v3.6-rc1-312-g3bf671a + +* Sun Aug 12 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git4.1 +- Linux v3.6-rc1-268-g21d2f8d + +* Fri Aug 10 2012 Dennis Gilmore <dennis@ausil.us> +- disable some options on highbank at calxeda's request +- enable the PL011 serial console on highbank +- enable ARM architected timer on all arm arches + +* Thu Aug 09 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git3.2 +- Update secure-boot patch to pass correct CFLAGS to EFI stub + +* Thu Aug 09 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git3.1 +- Linux v3.6-rc1-207-gf4ba394 + +* Wed Aug 08 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git2.2 +- Update team driver from net-next from Jiri Pirko + +* Tue Aug 07 2012 Josh Boyer <jwboyer@redhat.com> +- Add support for ppc64p7 subarch + +* Mon Aug 06 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git2.1 +- Linux v3.6-rc1-133-g42a579a + +* Sat Aug 04 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git1.2 +- Reenable debugging options. + +* Sat Aug 04 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git1.1 +- Linux v3.6-rc1-112-ge7882d6 + +* Fri Aug 03 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git0.2 +- CVE-2012-3412 sfc: potential rDOS through TCP MSS option (rhbz 844714 845558) + +* Fri Aug 03 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc1.git0.1 +- Linux v3.6-rc1 +- Disable debugging options. + +* Thu Aug 02 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git9.3 +- Update modsign and secure-boot patch sets + +* Thu Aug 02 2012 Josh Boyer <jwboyer@redhat.com> +- Reenable cgroups memory controller (rhbz 845285) +- Add two patches from Seth Forshee to fix brcmsmac backtrace + +* Thu Aug 02 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git9.1 +- Linux v3.5-9139-g1a9b499 + +* Wed Aug 01 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git8.1 +- Linux v3.5-8833-g2d53492 + +* Wed Aug 01 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git7.1 +- Linux v3.5-8367-g08843b7 + +* Tue Jul 31 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git6.1 +- Linux v3.5-8197-g2e3ee61 + +* Wed Jul 31 2012 John W. Linville <linville@redhat.com> +- Enable batman-adv and add it to the list of "extra" modules + +* Tue Jul 31 2012 Dave Jones <davej@redhat.com> +- Change VM_BUG_ON's to be WARN_ONs instead. + +* Tue Jul 31 2012 Josh Boyer <jwboyer@redhat.com> +- Move modules needed by Shorewall back to main kernel package (rhbz 844436) + +* Mon Jul 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git5.2 +- Update config options + +* Mon Jul 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git5.1 +- Linux v3.5-7815-g37cd960 + +* Mon Jul 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.6.0-0.rc0.git4.1 +- Linux v3.5-7078-gf7da9cd + +* Mon Jul 30 2012 Josh Boyer <jwboyer@redhat.com> +- Fixup patches + +* Fri Jul 27 2012 Justin M. Forbes <jforbes@redhat.com> - 3.6.0-0.rc0.git3.1 +- Linux v3.5-6982-gb387e41 + +* Thu Jul 26 2012 Josh Boyer <jwboyer@redhat.com> +- Apply patch to fix uvcvideo crash (rhbz 836742) +- Enable Intel MEI driver (rhbz 842444) + +* Wed Jul 25 2012 Justin M. Forbes <jforbes@redhat.com> - 3.6.0-0.rc0.git2.1 +- Linux v3.5-4773-gbdc0077 + +* Tue Jul 24 2012 Josh Boyer <jwboyer@redhat.com> +- Update modsign patch to latest upstream +- Add initial UEFI Secure Boot patchset. Work in progress. + +* Tue Jul 24 2012 Justin M. Forbes <jforbes@redhat.com> - 3.6.0-0.rc0.git1.1 +- Linux v3.5-1643-gf0a08fc + +* Mon Jul 23 2012 Justin M. Forbes <jforbes@redhat.com> - 3.5.0-2 +- Reenable debugging options. + * Mon Jul 23 2012 Alexandre Oliva <lxoliva@fsfla.org> -libre - GNU Linux-libre 3.5-gnu diff --git a/freed-ora/current/master/linux-2.6-serial-460800.patch b/freed-ora/current/master/linux-2.6-serial-460800.patch index 979b248d5..0e68378e7 100644 --- a/freed-ora/current/master/linux-2.6-serial-460800.patch +++ b/freed-ora/current/master/linux-2.6-serial-460800.patch @@ -28,14 +28,14 @@ index 2209620..659c1bb 100644 quot = uart_get_divisor(port, baud); @@ -2240,7 +2251,7 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, - struct uart_8250_port *up = (struct uart_8250_port *)port; + container_of(port, struct uart_8250_port, port); unsigned char cval, fcr = 0; unsigned long flags; - unsigned int baud, quot; + unsigned int baud, quot, max_baud; + int fifo_bug = 0; switch (termios->c_cflag & CSIZE) { - case CS5: @@ -2272,9 +2283,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, /* * Ask the core to calculate the divisor for us. diff --git a/freed-ora/current/master/linux-libre-3.5-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.5-gnu.tar.xz.sign deleted file mode 100644 index c59a0f785..000000000 --- a/freed-ora/current/master/linux-libre-3.5-gnu.tar.xz.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.18 (GNU/Linux) - -iEYEABECAAYFAlALW6kACgkQvLfPh359R6fKtwCcDlV8/s318KUrQV+Xy0K7WM5y -SMAAn2EyD/ElncHwcjZjfOTK8qoZTxJb -=351I ------END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz Binary files differdeleted file mode 100644 index e52b7056a..000000000 --- a/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz +++ /dev/null diff --git a/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz.sign deleted file mode 100644 index b6b483420..000000000 --- a/freed-ora/current/master/linux-libre-3.5-gnu.xdelta.xz.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.18 (GNU/Linux) - -iEYEABECAAYFAlALW6wACgkQvLfPh359R6fBXQCdGESE7tZL28WDZ4ksvB1YDxqQ -vNEAnjORJE8J9Mh6vXSgD4E7i8u8l2lZ -=nCzM ------END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz b/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz Binary files differnew file mode 100644 index 000000000..563973200 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz diff --git a/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz.sign new file mode 100644 index 000000000..dbdf5e6d0 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.6-gnu.tar.xz.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iEYEABECAAYFAlBo9TQACgkQvLfPh359R6c5GACgkzXtyZfBtqJqbVGOvIoSvtHh +RQEAn3ZxxgMk1RVT75ywYpP3gbz7QZjV +=VOuw +-----END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz Binary files differnew file mode 100644 index 000000000..4f3f73070 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz diff --git a/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz.sign new file mode 100644 index 000000000..295579272 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.6-gnu.xdelta.xz.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iEYEABECAAYFAlBo9TUACgkQvLfPh359R6cCLACfcy8Pd21g94qq7+3hYtLaowT4 +J7wAoJDOcfwOJHwN8SkxfmkEonO8V0Bm +=A8ay +-----END PGP SIGNATURE----- diff --git a/freed-ora/current/master/lis3-improve-handling-of-null-rate.patch b/freed-ora/current/master/lis3-improve-handling-of-null-rate.patch index 98512564a..30ed26d80 100644 --- a/freed-ora/current/master/lis3-improve-handling-of-null-rate.patch +++ b/freed-ora/current/master/lis3-improve-handling-of-null-rate.patch @@ -28,9 +28,9 @@ index 35c67e0..42dce2a 100644 -static int lis3_3dc_rates[16] = {0, 1, 10, 25, 50, 100, 200, 400, 1600, 5000}; +/* LIS3DC: 0 = power off, above 9 = undefined */ +static int lis3_3dc_rates[16] = {0, 1, 10, 25, 50, 100, 200, 400, 1600, 5000, -1, -1, -1, -1, -1, -1}; + static int lis3_3dlh_rates[4] = {50, 100, 400, 1000}; /* ODR is Output Data Rate */ - static int lis3lv02d_get_odr(struct lis3lv02d *lis3) @@ -202,12 +203,11 @@ static int lis3lv02d_get_odr(struct lis3lv02d *lis3) return lis3->odrs[(ctrl >> shift)]; } diff --git a/freed-ora/current/master/mod-extra-sign.sh b/freed-ora/current/master/mod-extra-sign.sh new file mode 100755 index 000000000..9b24a4098 --- /dev/null +++ b/freed-ora/current/master/mod-extra-sign.sh @@ -0,0 +1,28 @@ +#! /bin/bash + +# We need to sign modules we've moved from <path>/kernel/ to <path>/extra/ +# during mod-extra processing by hand. The 'modules_sign' Kbuild target can +# "handle" out-of-tree modules, but it does that by not signing them. Plus, +# the modules we've moved aren't actually out-of-tree. We've just shifted +# them to a different location behind Kbuild's back because we are mean. + +# This essentially duplicates the 'modules_sign' Kbuild target and runs the +# same commands for those modules. + +moddir=$1 + +modules=`find $moddir -name *.ko` + +MODSECKEY="./signing_key.priv" +MODPUBKEY="./signing_key.x509" + +for mod in $modules +do + dir=`dirname $mod` + file=`basename $mod` + + ./scripts/sign-file ${MODSECKEY} ${MODPUBKEY} ${dir}/${file} \ + ${dir}/${file}.signed + mv ${dir}/${file}.signed ${dir}/${file} + rm -f ${dir}/${file}.{sig,dig} +done diff --git a/freed-ora/current/master/mod-extra.list b/freed-ora/current/master/mod-extra.list index b046afffe..124d74ef2 100644 --- a/freed-ora/current/master/mod-extra.list +++ b/freed-ora/current/master/mod-extra.list @@ -45,17 +45,12 @@ sch_choke.ko sch_drr.ko sch_dsmark.ko sch_gred.ko -sch_hfsc.ko -sch_ingress.ko sch_mqprio.ko sch_multiq.ko sch_netem.ko -sch_prio.ko sch_qfq.ko sch_red.ko sch_sfb.ko -sch_sfq.ko -sch_tbf.ko sch_teql.ko ax25.ko netrom.ko @@ -176,3 +171,20 @@ tpm_nsc.ko tpm_tis.ko slip.ko nilfs2.ko +batman-adv.ko +wire.ko +ds1wm.ko +ds2490.ko +ds2482.ko +w1_ds2780.ko +w1_therm.ko +w1_ds2433.ko +w1_ds2760.ko +w1_ds28e04.ko +w1_ds2408.ko +w1_ds2781.ko +w1_smem.ko +w1_ds2431.ko +w1_ds2423.ko +w1_bq27000.ko +ubifs.ko diff --git a/freed-ora/current/master/mod-extra.sh b/freed-ora/current/master/mod-extra.sh new file mode 100755 index 000000000..d121bd0b1 --- /dev/null +++ b/freed-ora/current/master/mod-extra.sh @@ -0,0 +1,80 @@ +#! /bin/bash + +Dir=$1 +List=$2 + +pushd $Dir +rm -rf modnames +find . -name "*.ko" -type f > modnames +# Look through all of the modules, and throw any that have a dependency in +# our list into the list as well. +rm -rf dep.list dep2.list +rm -rf req.list req2.list +touch dep.list req.list +cp $2 . + +for dep in `cat modnames` +do + depends=`modinfo $dep | grep depends| cut -f2 -d":" | sed -e 's/^[ \t]*//'` + [ -z "$depends" ] && continue; + for mod in `echo $depends | sed -e 's/,/ /g'` + do + match=`grep "^$mod.ko" mod-extra.list` ||: + if [ -z "$match" ] + then + continue + else + # check if the module we're looking at is in mod-extra too. if so + # we don't need to mark the dep as required + mod2=`basename $dep` + match2=`grep "^$mod2" mod-extra.list` ||: + if [ -n "$match2" ] + then + continue + #echo $mod2 >> notreq.list + else + echo $mod.ko >> req.list + fi + fi + done +done + +sort -u req.list > req2.list +sort -u mod-extra.list > mod-extra2.list +join -v 1 mod-extra2.list req2.list > mod-extra3.list + +for mod in `cat mod-extra3.list` +do + # get the path for the module + modpath=`grep /$mod modnames` ||: + [ -z "$modpath" ] && continue; + echo $modpath >> dep.list +done + +sort -u dep.list > dep2.list + +# now move the modules into the extra/ directory +for mod in `cat dep2.list` +do + newpath=`dirname $mod | sed -e 's/kernel\//extra\//'` + mkdir -p $newpath + mv $mod $newpath +done + +popd + +# If we're signing modules, we can't leave the .mod files for the .ko files +# we've moved in .tmp_versions/. Remove them so the Kbuild 'modules_sign' +# target doesn't try to sign a non-existent file. This is kinda ugly, but +# so is modules-extra. + +for mod in `cat ${Dir}/dep2.list` +do + modfile=`basename $mod | sed -e 's/.ko/.mod/'` + rm .tmp_versions/$modfile +done + +pushd $Dir +rm modnames dep.list dep2.list req.list req2.list +rm mod-extra.list mod-extra2.list mod-extra3.list +popd diff --git a/freed-ora/current/master/modsign-20120718.patch b/freed-ora/current/master/modsign-20120718.patch deleted file mode 100644 index 0630014db..000000000 --- a/freed-ora/current/master/modsign-20120718.patch +++ /dev/null @@ -1,8664 +0,0 @@ -From d1ff3781d12ad616073b4f1f3b04cef22d8c7c21 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 13:12:20 +0100 -Subject: [PATCH 01/27] MPILIB: Provide count_leading/trailing_zeros() based - on arch functions - -Provide count_leading/trailing_zeros() macros based on extant arch bit scanning -functions rather than reimplementing from scratch in MPILIB. - -Whilst we're at it, turn count_foo_zeros(n, x) into n = count_foo_zeros(x). - -Also move the definition to asm-generic as other people may be interested in -using it. - -Signed-off-by: David Howells <dhowells@redhat.com> -Cc: David S. Miller <davem@davemloft.net> -Cc: Dmitry Kasatkin <dmitry.kasatkin@intel.com> -Cc: Arnd Bergmann <arnd@arndb.com> ---- - include/asm-generic/bitops/count_zeros.h | 57 ++++++++++++ - lib/mpi/longlong.h | 138 +----------------------------- - lib/mpi/mpi-bit.c | 2 +- - lib/mpi/mpi-div.c | 2 +- - lib/mpi/mpi-pow.c | 4 +- - lib/mpi/mpi-scan.c | 2 +- - lib/mpi/mpih-div.c | 8 +- - 7 files changed, 68 insertions(+), 145 deletions(-) - create mode 100644 include/asm-generic/bitops/count_zeros.h - -diff --git a/include/asm-generic/bitops/count_zeros.h b/include/asm-generic/bitops/count_zeros.h -new file mode 100644 -index 0000000..97520d2 ---- /dev/null -+++ b/include/asm-generic/bitops/count_zeros.h -@@ -0,0 +1,57 @@ -+/* Count leading and trailing zeros functions -+ * -+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifndef _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_ -+#define _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_ -+ -+#include <asm/bitops.h> -+ -+/** -+ * count_leading_zeros - Count the number of zeros from the MSB back -+ * @x: The value -+ * -+ * Count the number of leading zeros from the MSB going towards the LSB in @x. -+ * -+ * If the MSB of @x is set, the result is 0. -+ * If only the LSB of @x is set, then the result is BITS_PER_LONG-1. -+ * If @x is 0 then the result is COUNT_LEADING_ZEROS_0. -+ */ -+static inline int count_leading_zeros(unsigned long x) -+{ -+ if (sizeof(x) == 4) -+ return BITS_PER_LONG - fls(x); -+ else -+ return BITS_PER_LONG - fls64(x); -+} -+ -+#define COUNT_LEADING_ZEROS_0 BITS_PER_LONG -+ -+/** -+ * count_trailing_zeros - Count the number of zeros from the LSB forwards -+ * @x: The value -+ * -+ * Count the number of trailing zeros from the LSB going towards the MSB in @x. -+ * -+ * If the LSB of @x is set, the result is 0. -+ * If only the MSB of @x is set, then the result is BITS_PER_LONG-1. -+ * If @x is 0 then the result is COUNT_TRAILING_ZEROS_0. -+ */ -+static inline int count_trailing_zeros(unsigned long x) -+{ -+#define COUNT_TRAILING_ZEROS_0 (-1) -+ -+ if (sizeof(x) == 4) -+ return ffs(x); -+ else -+ return (x != 0) ? __ffs(x) : COUNT_TRAILING_ZEROS_0; -+} -+ -+#endif /* _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_ */ -diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h -index 29f9862..678ce4f 100644 ---- a/lib/mpi/longlong.h -+++ b/lib/mpi/longlong.h -@@ -19,6 +19,8 @@ - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. */ - -+#include <asm-generic/bitops/count_zeros.h> -+ - /* You have to define the following before including this file: - * - * UWtype -- An unsigned type, default type for operations (typically a "word") -@@ -146,12 +148,6 @@ do { \ - : "1" ((USItype)(n1)), \ - "r" ((USItype)(n0)), \ - "r" ((USItype)(d))) -- --#define count_leading_zeros(count, x) \ -- __asm__ ("clz %0,%1" \ -- : "=r" ((USItype)(count)) \ -- : "r" ((USItype)(x))) --#define COUNT_LEADING_ZEROS_0 32 - #endif /* __a29k__ */ - - #if defined(__alpha) && W_TYPE_SIZE == 64 -@@ -298,11 +294,6 @@ extern UDItype __udiv_qrnnd(); - : "1" ((USItype)(nh)), \ - "0" ((USItype)(nl)), \ - "g" ((USItype)(d))) --#define count_leading_zeros(count, x) \ -- __asm__ ("bsch/1 %1,%0" \ -- : "=g" (count) \ -- : "g" ((USItype)(x)), \ -- "0" ((USItype)0)) - #endif - - /*************************************** -@@ -354,27 +345,6 @@ do { USItype __r; \ - } while (0) - extern USItype __udiv_qrnnd(); - #endif /* LONGLONG_STANDALONE */ --#define count_leading_zeros(count, x) \ --do { \ -- USItype __tmp; \ -- __asm__ ( \ -- "ldi 1,%0\n" \ -- "extru,= %1,15,16,%%r0 ; Bits 31..16 zero?\n" \ -- "extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \ -- "ldo 16(%0),%0 ; Yes. Perform add.\n" \ -- "extru,= %1,23,8,%%r0 ; Bits 15..8 zero?\n" \ -- "extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \ -- "ldo 8(%0),%0 ; Yes. Perform add.\n" \ -- "extru,= %1,27,4,%%r0 ; Bits 7..4 zero?\n" \ -- "extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \ -- "ldo 4(%0),%0 ; Yes. Perform add.\n" \ -- "extru,= %1,29,2,%%r0 ; Bits 3..2 zero?\n" \ -- "extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \ -- "ldo 2(%0),%0 ; Yes. Perform add.\n" \ -- "extru %1,30,1,%1 ; Extract bit 1.\n" \ -- "sub %0,%1,%0 ; Subtract it. " \ -- : "=r" (count), "=r" (__tmp) : "1" (x)); \ --} while (0) - #endif /* hppa */ - - /*************************************** -@@ -457,15 +427,6 @@ do { \ - : "0" ((USItype)(n0)), \ - "1" ((USItype)(n1)), \ - "rm" ((USItype)(d))) --#define count_leading_zeros(count, x) \ --do { \ -- USItype __cbtmp; \ -- __asm__ ("bsrl %1,%0" \ -- : "=r" (__cbtmp) : "rm" ((USItype)(x))); \ -- (count) = __cbtmp ^ 31; \ --} while (0) --#define count_trailing_zeros(count, x) \ -- __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x))) - #ifndef UMUL_TIME - #define UMUL_TIME 40 - #endif -@@ -536,15 +497,6 @@ do { \ - "dI" ((USItype)(d))); \ - (r) = __rq.__i.__l; (q) = __rq.__i.__h; \ - } while (0) --#define count_leading_zeros(count, x) \ --do { \ -- USItype __cbtmp; \ -- __asm__ ("scanbit %1,%0" \ -- : "=r" (__cbtmp) \ -- : "r" ((USItype)(x))); \ -- (count) = __cbtmp ^ 31; \ --} while (0) --#define COUNT_LEADING_ZEROS_0 (-32) /* sic */ - #if defined(__i960mx) /* what is the proper symbol to test??? */ - #define rshift_rhlc(r, h, l, c) \ - do { \ -@@ -603,11 +555,6 @@ do { \ - : "0" ((USItype)(n0)), \ - "1" ((USItype)(n1)), \ - "dmi" ((USItype)(d))) --#define count_leading_zeros(count, x) \ -- __asm__ ("bfffo %1{%b2:%b2},%0" \ -- : "=d" ((USItype)(count)) \ -- : "od" ((USItype)(x)), "n" (0)) --#define COUNT_LEADING_ZEROS_0 32 - #else /* not mc68020 */ - #define umul_ppmm(xh, xl, a, b) \ - do { USItype __umul_tmp1, __umul_tmp2; \ -@@ -664,15 +611,6 @@ do { USItype __umul_tmp1, __umul_tmp2; \ - "rJ" ((USItype)(bh)), \ - "rJ" ((USItype)(al)), \ - "rJ" ((USItype)(bl))) --#define count_leading_zeros(count, x) \ --do { \ -- USItype __cbtmp; \ -- __asm__ ("ff1 %0,%1" \ -- : "=r" (__cbtmp) \ -- : "r" ((USItype)(x))); \ -- (count) = __cbtmp ^ 31; \ --} while (0) --#define COUNT_LEADING_ZEROS_0 63 /* sic */ - #if defined(__m88110__) - #define umul_ppmm(wh, wl, u, v) \ - do { \ -@@ -779,12 +717,6 @@ do { \ - : "0" (__xx.__ll), \ - "g" ((USItype)(d))); \ - (r) = __xx.__i.__l; (q) = __xx.__i.__h; }) --#define count_trailing_zeros(count, x) \ --do { \ -- __asm__("ffsd %2,%0" \ -- : "=r"((USItype) (count)) \ -- : "0"((USItype) 0), "r"((USItype) (x))); \ -- } while (0) - #endif /* __ns32000__ */ - - /*************************************** -@@ -855,11 +787,6 @@ do { \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ - } while (0) --#define count_leading_zeros(count, x) \ -- __asm__ ("{cntlz|cntlzw} %0,%1" \ -- : "=r" ((USItype)(count)) \ -- : "r" ((USItype)(x))) --#define COUNT_LEADING_ZEROS_0 32 - #if defined(_ARCH_PPC) - #define umul_ppmm(ph, pl, m0, m1) \ - do { \ -@@ -1001,19 +928,6 @@ do { \ - } while (0) - #define UMUL_TIME 20 - #define UDIV_TIME 200 --#define count_leading_zeros(count, x) \ --do { \ -- if ((x) >= 0x10000) \ -- __asm__ ("clz %0,%1" \ -- : "=r" ((USItype)(count)) \ -- : "r" ((USItype)(x) >> 16)); \ -- else { \ -- __asm__ ("clz %0,%1" \ -- : "=r" ((USItype)(count)) \ -- : "r" ((USItype)(x))); \ -- (count) += 16; \ -- } \ --} while (0) - #endif /* RT/ROMP */ - - /*************************************** -@@ -1142,13 +1056,6 @@ do { \ - "rI" ((USItype)(d)) \ - : "%g1" __AND_CLOBBER_CC) - #define UDIV_TIME 37 --#define count_leading_zeros(count, x) \ -- __asm__ ("scan %1,0,%0" \ -- : "=r" ((USItype)(x)) \ -- : "r" ((USItype)(count))) --/* Early sparclites return 63 for an argument of 0, but they warn that future -- implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0 -- undefined. */ - #endif /* __sparclite__ */ - #endif /* __sparc_v8__ */ - /* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */ -@@ -1454,47 +1361,6 @@ do { \ - #define udiv_qrnnd __udiv_qrnnd_c - #endif - --#undef count_leading_zeros --#if !defined(count_leading_zeros) -- extern --#ifdef __STDC__ -- const --#endif -- unsigned char __clz_tab[]; --#define count_leading_zeros(count, x) \ --do { \ -- UWtype __xr = (x); \ -- UWtype __a; \ -- \ -- if (W_TYPE_SIZE <= 32) { \ -- __a = __xr < ((UWtype) 1 << 2*__BITS4) \ -- ? (__xr < ((UWtype) 1 << __BITS4) ? 0 : __BITS4) \ -- : (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \ -- } \ -- else { \ -- for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \ -- if (((__xr >> __a) & 0xff) != 0) \ -- break; \ -- } \ -- \ -- (count) = W_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \ --} while (0) -- /* This version gives a well-defined value for zero. */ --#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE --#endif -- --#if !defined(count_trailing_zeros) --/* Define count_trailing_zeros using count_leading_zeros. The latter might be -- defined in asm, but if it is not, the C version above is good enough. */ --#define count_trailing_zeros(count, x) \ --do { \ -- UWtype __ctz_x = (x); \ -- UWtype __ctz_c; \ -- count_leading_zeros(__ctz_c, __ctz_x & -__ctz_x); \ -- (count) = W_TYPE_SIZE - 1 - __ctz_c; \ --} while (0) --#endif -- - #ifndef UDIV_NEEDS_NORMALIZATION - #define UDIV_NEEDS_NORMALIZATION 0 - #endif -diff --git a/lib/mpi/mpi-bit.c b/lib/mpi/mpi-bit.c -index 0c50536..3fc00bf 100644 ---- a/lib/mpi/mpi-bit.c -+++ b/lib/mpi/mpi-bit.c -@@ -45,7 +45,7 @@ unsigned mpi_get_nbits(MPI a) - if (a->nlimbs) { - mpi_limb_t alimb = a->d[a->nlimbs - 1]; - if (alimb) -- count_leading_zeros(n, alimb); -+ n = count_leading_zeros(alimb); - else - n = BITS_PER_MPI_LIMB; - n = BITS_PER_MPI_LIMB - n + (a->nlimbs - 1) * BITS_PER_MPI_LIMB; -diff --git a/lib/mpi/mpi-div.c b/lib/mpi/mpi-div.c -index f68cbbb..51f105c 100644 ---- a/lib/mpi/mpi-div.c -+++ b/lib/mpi/mpi-div.c -@@ -217,7 +217,7 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den) - } else /* Put quotient at top of remainder. */ - qp = rp + dsize; - -- count_leading_zeros(normalization_steps, dp[dsize - 1]); -+ normalization_steps = count_leading_zeros(dp[dsize - 1]); - - /* Normalize the denominator, i.e. make its most significant bit set by - * shifting it NORMALIZATION_STEPS bits to the left. Also shift the -diff --git a/lib/mpi/mpi-pow.c b/lib/mpi/mpi-pow.c -index 67f3e79..5464c87 100644 ---- a/lib/mpi/mpi-pow.c -+++ b/lib/mpi/mpi-pow.c -@@ -77,7 +77,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) - mp = mp_marker = mpi_alloc_limb_space(msize); - if (!mp) - goto enomem; -- count_leading_zeros(mod_shift_cnt, mod->d[msize - 1]); -+ mod_shift_cnt = count_leading_zeros(mod->d[msize - 1]); - if (mod_shift_cnt) - mpihelp_lshift(mp, mod->d, msize, mod_shift_cnt); - else -@@ -169,7 +169,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) - - i = esize - 1; - e = ep[i]; -- count_leading_zeros(c, e); -+ c = count_leading_zeros(e); - e = (e << c) << 1; /* shift the exp bits to the left, lose msb */ - c = BITS_PER_MPI_LIMB - 1 - c; - -diff --git a/lib/mpi/mpi-scan.c b/lib/mpi/mpi-scan.c -index b2da5ad..58556b5 100644 ---- a/lib/mpi/mpi-scan.c -+++ b/lib/mpi/mpi-scan.c -@@ -125,7 +125,7 @@ unsigned mpi_trailing_zeros(const MPI a) - unsigned nn; - mpi_limb_t alimb = a->d[n]; - -- count_trailing_zeros(nn, alimb); -+ nn = count_trailing_zeros(alimb); - count += nn; - break; - } -diff --git a/lib/mpi/mpih-div.c b/lib/mpi/mpih-div.c -index cde1aae..d6483792 100644 ---- a/lib/mpi/mpih-div.c -+++ b/lib/mpi/mpih-div.c -@@ -65,7 +65,7 @@ mpihelp_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, - && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME) { - int normalization_steps; - -- count_leading_zeros(normalization_steps, divisor_limb); -+ normalization_steps = count_leading_zeros(divisor_limb); - if (normalization_steps) { - mpi_limb_t divisor_limb_inverted; - -@@ -142,7 +142,7 @@ mpihelp_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, - if (UDIV_NEEDS_NORMALIZATION) { - int normalization_steps; - -- count_leading_zeros(normalization_steps, divisor_limb); -+ normalization_steps = count_leading_zeros(divisor_limb); - if (normalization_steps) { - divisor_limb <<= normalization_steps; - -@@ -421,7 +421,7 @@ mpihelp_divmod_1(mpi_ptr_t quot_ptr, - && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME) { - int normalization_steps; - -- count_leading_zeros(normalization_steps, divisor_limb); -+ normalization_steps = count_leading_zeros(divisor_limb); - if (normalization_steps) { - mpi_limb_t divisor_limb_inverted; - -@@ -496,7 +496,7 @@ mpihelp_divmod_1(mpi_ptr_t quot_ptr, - if (UDIV_NEEDS_NORMALIZATION) { - int normalization_steps; - -- count_leading_zeros(normalization_steps, divisor_limb); -+ normalization_steps = count_leading_zeros(divisor_limb); - if (normalization_steps) { - divisor_limb <<= normalization_steps; - --- -1.7.10.4 - - -From 7611bb8e543cb2255c69bfb5edd85ed0d2cdb9e9 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 13:12:20 +0100 -Subject: [PATCH 02/27] KEYS: Create a key type that can be used for general - cryptographic operations - -Create a key type that can be used for general cryptographic operations, such -as encryption, decryption, signature generation and signature verification. - -The key type is "crypto" and can provide access to a variety of cryptographic -algorithms. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - Documentation/security/keys-crypto.txt | 181 +++++++++++++++++++++++++ - include/keys/crypto-subtype.h | 56 ++++++++ - include/keys/crypto-type.h | 25 ++++ - security/keys/Kconfig | 2 + - security/keys/Makefile | 1 + - security/keys/crypto/Kconfig | 7 + - security/keys/crypto/Makefile | 7 + - security/keys/crypto/crypto_keys.h | 28 ++++ - security/keys/crypto/crypto_type.c | 228 ++++++++++++++++++++++++++++++++ - 9 files changed, 535 insertions(+) - create mode 100644 Documentation/security/keys-crypto.txt - create mode 100644 include/keys/crypto-subtype.h - create mode 100644 include/keys/crypto-type.h - create mode 100644 security/keys/crypto/Kconfig - create mode 100644 security/keys/crypto/Makefile - create mode 100644 security/keys/crypto/crypto_keys.h - create mode 100644 security/keys/crypto/crypto_type.c - -diff --git a/Documentation/security/keys-crypto.txt b/Documentation/security/keys-crypto.txt -new file mode 100644 -index 0000000..97dee80 ---- /dev/null -+++ b/Documentation/security/keys-crypto.txt -@@ -0,0 +1,181 @@ -+ ====================== -+ CRYPTOGRAPHIC KEY TYPE -+ ====================== -+ -+Contents: -+ -+ - Overview. -+ - Key identification. -+ - Accessing crypto keys. -+ - Implementing crypto parsers. -+ - Implementing crypto subtypes. -+ -+ -+======== -+OVERVIEW -+======== -+ -+The "crypto" key type is designed to be a container for cryptographic keys, -+without imposing any particular restrictions on the form of the cryptography or -+the key. -+ -+The crypto key is given a subtype that defines what sort of data is associated -+with the key and provides operations to describe and destroy it. However, no -+requirement is made that the key data actually be loaded into the key. -+ -+The crypto key also has a number of data parsers registered with it. The data -+parsers are responsible for extracing information the blobs of data passed to -+the instantiator function. The first data parser that recognises the blob gets -+to set the subtype of the key and define the operations that can be done on -+that key. -+ -+Completely in-kernel key retention and operation subtypes and parsers can be -+defined, but it would also be possible to provide access to cryptographic -+hardware (such as a TPM) that might be used to both retain the relevant key and -+perform operations using that key. In such a case, the crypto key would then -+merely be an interface to the TPM driver. -+ -+ -+================== -+KEY IDENTIFICATION -+================== -+ -+Because the identity of a key is not necessarily known and may not be easily -+calculated when a crypto key is allocated, it may not be a simple matter to set -+a key description to something that's useful for determining whether this is -+the key you're looking for. Furthermore, it may be necessary to perform a -+partial match upon the key identity. -+ -+To help with this, when a key is loaded, the parser calculates the key -+fingerprint and stores a copy in the key structure. -+ -+The crypto key type's key matching function then performs more checks than just -+the straightforward comparison of the description with the criterion string: -+ -+ (1) If the criterion string is of the form "id:<hexdigits>" then the match -+ function will examine a key's fingerprint to see if the hex digits given -+ after the "id:" match the tail. For instance: -+ -+ keyctl search @s crypto id:5acc2142 -+ -+ will match a key with fingerprint: -+ -+ 1A00 2040 7601 7889 DE11 882C 3823 04AD 5ACC 2142 -+ -+ (2) If the criterion string is of the form "<subtype>:<hexdigits>" then the -+ match will match the ID as in (1), but with the added restriction that -+ only keys of the specified subtype (e.g. dsa or rsa) will be matched. For -+ instance: -+ -+ keyctl search @s crypto dsa:5acc2142 -+ -+Looking in /proc/keys, the last 8 hex digits of the key fingerprint are -+displayed, along with the subtype: -+ -+ 1a39e171 I----- 1 perm 3f010000 0 0 crypto modsign.0: DSA 5acc2142 [] -+ -+ -+===================== -+ACCESSING CRYPTO KEYS -+===================== -+ -+To access crypto keys from within the kernel, the following inclusion is -+required: -+ -+ #include <keys/crypto-type.h> -+ -+This gives access to the key type: -+ -+ struct key_type key_type_crypto; -+ -+ -+=========================== -+IMPLEMENTING CRYPTO PARSERS -+=========================== -+ -+The crypto key type keeps a list of registered data parsers. An example of -+such a parser is one that parses OpenPGP packet formatted data [RFC 4880]. -+ -+During key instantiation each parser in the list is tried until one doesn't -+return -EBADMSG. -+ -+The parser definition structure looks like the following: -+ -+ struct crypto_key_parser { -+ struct module *owner; -+ const char *name; -+ -+ int (*instantiate)(struct key *key, -+ const void *data, size_t datalen); -+ }; -+ -+The owner and name fields should be set to the owning module and the name of -+the parser. -+ -+There are a number of operations defined by the parser. They are all optional, -+but it is expected that at least one will be defined. -+ -+ (1) instantiate(). -+ -+ The arguments are the same as for the instantiate function in the key -+ type. 'key' is the crypto key being instantiated; data and datalen are -+ the instantiation data, presumably containing cryptographic key data, and -+ the length of that data. -+ -+ If the data format is not recognised, -EBADMSG should be returned. If it -+ is recognised, but the key cannot for some reason be set up, some other -+ negative error code should be returned. -+ -+ If the key can be successfully set up, then key->payload should be set to -+ point to the retained data, key->type_data.p[0] should be set to point to -+ the subtype chosen and key->type_data.p[1] should be set to point to a -+ copy of the key's identity string and 0 should be returned. -+ -+ The key's identity string may be partially matched upon. For a public-key -+ algorithm such as RSA and DSA this will likely be a printable hex version -+ of the key's fingerprint. -+ -+Functions are provided to register and unregister parsers: -+ -+ int register_crypto_key_parser(struct crypto_key_parser *parser); -+ void unregister_crypto_key_parser(struct crypto_key_parser *subtype); -+ -+Parsers may not have the same name. The names are only used for displaying in -+debugging messages. -+ -+ -+============================ -+IMPLEMENTING CRYPTO SUBTYPES -+============================ -+ -+The parser selects the appropriate subtype directly and sets it on the key; the -+crypto key then retains a reference on the subtype module (which means the -+parser can be removed thereafter). -+ -+The subtype definition structure looks like the following: -+ -+ struct crypto_key_subtype { -+ struct module *owner; -+ const char *name; -+ -+ void (*describe)(const struct key *key, struct seq_file *m); -+ void (*destroy)(void *payload); -+ }; -+ -+The owner and name fields should be set to the owning module and the name of -+the subtype. -+ -+There are a number of operations defined by the subtype: -+ -+ (1) describe(). -+ -+ Mandatory. This allows the subtype to display something in /proc/keys -+ against the key. For instance the name of the public key algorithm type -+ could be displayed. The key type will display the tail of the key -+ identity string after this. -+ -+ (2) destroy(). -+ -+ Mandatory. This should free the memory associated with the key. The -+ crypto key will look after freeing the fingerprint and releasing the -+ reference on the subtype module. -diff --git a/include/keys/crypto-subtype.h b/include/keys/crypto-subtype.h -new file mode 100644 -index 0000000..fa87555 ---- /dev/null -+++ b/include/keys/crypto-subtype.h -@@ -0,0 +1,56 @@ -+/* Cryptographic key subtype -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ * -+ * See Documentation/security/keys-crypto.txt -+ */ -+ -+#ifndef _KEYS_CRYPTO_SUBTYPE_H -+#define _KEYS_CRYPTO_SUBTYPE_H -+ -+#include <linux/seq_file.h> -+#include <keys/crypto-type.h> -+ -+extern struct key_type key_type_crypto; -+ -+/* -+ * Keys of this type declare a subtype that indicates the handlers and -+ * capabilities. -+ */ -+struct crypto_key_subtype { -+ struct module *owner; -+ const char *name; -+ unsigned short name_len; /* length of name */ -+ -+ void (*describe)(const struct key *key, struct seq_file *m); -+ -+ void (*destroy)(void *payload); -+}; -+ -+/* -+ * Data parser. Called during instantiation and signature verification -+ * initiation. -+ */ -+struct crypto_key_parser { -+ struct list_head link; -+ struct module *owner; -+ const char *name; -+ -+ /* Attempt to instantiate a key from the data blob passed to add_key() -+ * or keyctl_instantiate(). -+ * -+ * Return EBADMSG if not recognised. -+ */ -+ int (*instantiate)(struct key *key, const void *data, size_t datalen); -+}; -+ -+extern int register_crypto_key_parser(struct crypto_key_parser *); -+extern void unregister_crypto_key_parser(struct crypto_key_parser *); -+ -+#endif /* _KEYS_CRYPTO_SUBTYPE_H */ -diff --git a/include/keys/crypto-type.h b/include/keys/crypto-type.h -new file mode 100644 -index 0000000..47c00c7 ---- /dev/null -+++ b/include/keys/crypto-type.h -@@ -0,0 +1,25 @@ -+/* Cryptographic key type interface -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ * -+ * See Documentation/security/keys-crypto.txt -+ */ -+ -+#ifndef _KEYS_CRYPTO_TYPE_H -+#define _KEYS_CRYPTO_TYPE_H -+ -+#include <linux/key-type.h> -+ -+extern struct key_type key_type_crypto; -+ -+/* -+ * The payload is at the discretion of the subtype. -+ */ -+ -+#endif /* _KEYS_CRYPTO_TYPE_H */ -diff --git a/security/keys/Kconfig b/security/keys/Kconfig -index a90d6d3..992fe52 100644 ---- a/security/keys/Kconfig -+++ b/security/keys/Kconfig -@@ -69,3 +69,5 @@ config KEYS_DEBUG_PROC_KEYS - the resulting table. - - If you are unsure as to whether this is required, answer N. -+ -+source security/keys/crypto/Kconfig -diff --git a/security/keys/Makefile b/security/keys/Makefile -index 504aaa0..67dae73 100644 ---- a/security/keys/Makefile -+++ b/security/keys/Makefile -@@ -24,3 +24,4 @@ obj-$(CONFIG_SYSCTL) += sysctl.o - # - obj-$(CONFIG_TRUSTED_KEYS) += trusted.o - obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted-keys/ -+obj-$(CONFIG_CRYPTO_KEY_TYPE) += crypto/ -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -new file mode 100644 -index 0000000..3d15710 ---- /dev/null -+++ b/security/keys/crypto/Kconfig -@@ -0,0 +1,7 @@ -+config CRYPTO_KEY_TYPE -+ tristate "Cryptographic key type" -+ depends on KEYS -+ help -+ This option provides support for a type of key that holds the keys -+ required for cryptographic operations such as encryption, decryption, -+ signature generation and signature verification. -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -new file mode 100644 -index 0000000..36db1d5 ---- /dev/null -+++ b/security/keys/crypto/Makefile -@@ -0,0 +1,7 @@ -+# -+# Makefile for cryptographic keys -+# -+ -+obj-$(CONFIG_CRYPTO_KEY_TYPE) += crypto_keys.o -+ -+crypto_keys-y := crypto_type.o -diff --git a/security/keys/crypto/crypto_keys.h b/security/keys/crypto/crypto_keys.h -new file mode 100644 -index 0000000..a339ce0 ---- /dev/null -+++ b/security/keys/crypto/crypto_keys.h -@@ -0,0 +1,28 @@ -+/* Internal crypto type stuff -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+static inline -+struct crypto_key_subtype *crypto_key_subtype(const struct key *key) -+{ -+ return key->type_data.p[0]; -+} -+ -+static inline char *crypto_key_id(const struct key *key) -+{ -+ return key->type_data.p[1]; -+} -+ -+ -+/* -+ * crypto_type.c -+ */ -+extern struct list_head crypto_key_parsers; -+extern struct rw_semaphore crypto_key_parsers_sem; -diff --git a/security/keys/crypto/crypto_type.c b/security/keys/crypto/crypto_type.c -new file mode 100644 -index 0000000..33d279b ---- /dev/null -+++ b/security/keys/crypto/crypto_type.c -@@ -0,0 +1,228 @@ -+/* Cryptographic key type -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ * -+ * See Documentation/security/keys-crypto.txt -+ */ -+#include <keys/crypto-subtype.h> -+#include <linux/seq_file.h> -+#include <linux/module.h> -+#include <linux/slab.h> -+#include "crypto_keys.h" -+ -+MODULE_LICENSE("GPL"); -+ -+LIST_HEAD(crypto_key_parsers); -+DECLARE_RWSEM(crypto_key_parsers_sem); -+ -+/* -+ * Match crypto_keys on (part of) their name -+ * We have some shorthand methods for matching keys. We allow: -+ * -+ * "<desc>" - request a key by description -+ * "id:<id>" - request a key matching the ID -+ * "<subtype>:<id>" - request a key of a subtype -+ */ -+static int crypto_key_match(const struct key *key, const void *description) -+{ -+ const struct crypto_key_subtype *subtype = crypto_key_subtype(key); -+ const char *spec = description; -+ const char *id, *kid; -+ ptrdiff_t speclen; -+ size_t idlen, kidlen; -+ -+ if (!subtype || !spec || !*spec) -+ return 0; -+ -+ /* See if the full key description matches as is */ -+ if (key->description && strcmp(key->description, description) == 0) -+ return 1; -+ -+ /* All tests from here on break the criterion description into a -+ * specifier, a colon and then an identifier. -+ */ -+ id = strchr(spec, ':'); -+ if (!id) -+ return 0; -+ -+ speclen = id - spec; -+ id++; -+ -+ /* Anything after here requires a partial match on the ID string */ -+ kid = crypto_key_id(key); -+ if (!kid) -+ return 0; -+ -+ idlen = strlen(id); -+ kidlen = strlen(kid); -+ if (idlen > kidlen) -+ return 0; -+ -+ kid += kidlen - idlen; -+ if (strcasecmp(id, kid) != 0) -+ return 0; -+ -+ if (speclen == 2 && -+ memcmp(spec, "id", 2) == 0) -+ return 1; -+ -+ if (speclen == subtype->name_len && -+ memcmp(spec, subtype->name, speclen) == 0) -+ return 1; -+ -+ return 0; -+} -+ -+/* -+ * Describe the crypto key -+ */ -+static void crypto_key_describe(const struct key *key, struct seq_file *m) -+{ -+ const struct crypto_key_subtype *subtype = crypto_key_subtype(key); -+ const char *kid = crypto_key_id(key); -+ size_t n; -+ -+ seq_puts(m, key->description); -+ -+ if (subtype) { -+ seq_puts(m, ": "); -+ subtype->describe(key, m); -+ -+ if (kid) { -+ seq_putc(m, ' '); -+ n = strlen(kid); -+ if (n <= 8) -+ seq_puts(m, kid); -+ else -+ seq_puts(m, kid + n - 8); -+ } -+ -+ seq_puts(m, " ["); -+ /* put something here to indicate the key's capabilities */ -+ seq_putc(m, ']'); -+ } -+} -+ -+/* -+ * Instantiate a crypto_key defined key -+ */ -+static int crypto_key_instantiate(struct key *key, -+ const void *data, size_t datalen) -+{ -+ struct crypto_key_parser *parser; -+ int ret; -+ -+ pr_devel("==>%s()\n", __func__); -+ -+ if (datalen == 0) -+ return -EINVAL; -+ -+ down_read(&crypto_key_parsers_sem); -+ -+ ret = -EBADMSG; -+ list_for_each_entry(parser, &crypto_key_parsers, link) { -+ pr_debug("Trying parser '%s'\n", parser->name); -+ -+ ret = parser->instantiate(key, data, datalen); -+ if (ret != -EBADMSG) { -+ pr_debug("Parser recognised the format (ret %d)\n", -+ ret); -+ break; -+ } -+ } -+ -+ up_read(&crypto_key_parsers_sem); -+ pr_devel("<==%s() = %d\n", __func__, ret); -+ return ret; -+} -+ -+/* -+ * dispose of the data dangling from the corpse of a crypto key -+ */ -+static void crypto_key_destroy(struct key *key) -+{ -+ struct crypto_key_subtype *subtype = crypto_key_subtype(key); -+ if (subtype) { -+ subtype->destroy(key->payload.data); -+ module_put(subtype->owner); -+ key->type_data.p[0] = NULL; -+ } -+ kfree(key->type_data.p[1]); -+ key->type_data.p[1] = NULL; -+} -+ -+struct key_type key_type_crypto = { -+ .name = "crypto", -+ .instantiate = crypto_key_instantiate, -+ .match = crypto_key_match, -+ .destroy = crypto_key_destroy, -+ .describe = crypto_key_describe, -+}; -+EXPORT_SYMBOL_GPL(key_type_crypto); -+ -+/** -+ * register_crypto_key_parser - Register a crypto key blob parser -+ * @parser: The parser to register -+ */ -+int register_crypto_key_parser(struct crypto_key_parser *parser) -+{ -+ struct crypto_key_parser *cursor; -+ int ret; -+ -+ down_write(&crypto_key_parsers_sem); -+ -+ list_for_each_entry(cursor, &crypto_key_parsers, link) { -+ if (strcmp(cursor->name, parser->name) == 0) { -+ pr_err("Crypto key parser '%s' already registered\n", -+ parser->name); -+ ret = -EEXIST; -+ goto out; -+ } -+ } -+ -+ list_add_tail(&parser->link, &crypto_key_parsers); -+ -+ pr_notice("Crypto key parser '%s' registered\n", parser->name); -+ ret = 0; -+ -+out: -+ up_write(&crypto_key_parsers_sem); -+ return ret; -+} -+EXPORT_SYMBOL_GPL(register_crypto_key_parser); -+ -+/** -+ * unregister_crypto_key_parser - Unregister a crypto key blob parser -+ * @parser: The parser to unregister -+ */ -+void unregister_crypto_key_parser(struct crypto_key_parser *parser) -+{ -+ down_write(&crypto_key_parsers_sem); -+ list_del(&parser->link); -+ up_write(&crypto_key_parsers_sem); -+ -+ pr_notice("Crypto key parser '%s' unregistered\n", parser->name); -+} -+EXPORT_SYMBOL_GPL(unregister_crypto_key_parser); -+ -+/* -+ * Module stuff -+ */ -+static int __init crypto_key_init(void) -+{ -+ return register_key_type(&key_type_crypto); -+} -+ -+static void __exit crypto_key_cleanup(void) -+{ -+ unregister_key_type(&key_type_crypto); -+} -+ -+module_init(crypto_key_init); -+module_exit(crypto_key_cleanup); --- -1.7.10.4 - - -From 23d7c6d8927420846af94823a90de1c24120bfea Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 13:12:20 +0100 -Subject: [PATCH 03/27] KEYS: Add signature verification facility - -Add a facility whereby a key subtype may be asked to verify a signature against -the data it is purported to have signed. - -This adds four routines: - - (1) struct crypto_key_verify_context * - verify_sig_begin(struct key *keyring, const void *sig, size_t siglen); - - This sets up a verification context for the given signature using - information in that signature to select a key from the specified keyring - and to request a hash algorithm from the crypto layer. - - (2) int verify_sig_add_data(struct crypto_key_verify_context *ctx, - const void *data, size_t datalen); - - Incrementally supply data to be signed. May be called multiple times. - - (3) int verify_sig_end(struct crypto_key_verify_context *ctx, - const void *sig, size_t siglen); - - Complete the verification process and return the result. -EKEYREJECTED - will indicate that the verification failed and 0 will indicate success. - Other errors are also possible. - - (4) void verify_sig_cancel(struct crypto_key_verify_context *ctx); - - Cancel the verification process. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - Documentation/security/keys-crypto.txt | 101 ++++++++++++++++++++++++++++ - include/keys/crypto-subtype.h | 21 ++++++ - include/keys/crypto-type.h | 9 +++ - security/keys/crypto/Makefile | 2 +- - security/keys/crypto/crypto_verify.c | 112 ++++++++++++++++++++++++++++++++ - 5 files changed, 244 insertions(+), 1 deletion(-) - create mode 100644 security/keys/crypto/crypto_verify.c - -diff --git a/Documentation/security/keys-crypto.txt b/Documentation/security/keys-crypto.txt -index 97dee80..a964717 100644 ---- a/Documentation/security/keys-crypto.txt -+++ b/Documentation/security/keys-crypto.txt -@@ -7,6 +7,7 @@ Contents: - - Overview. - - Key identification. - - Accessing crypto keys. -+ - Signature verification. - - Implementing crypto parsers. - - Implementing crypto subtypes. - -@@ -89,6 +90,65 @@ This gives access to the key type: - struct key_type key_type_crypto; - - -+SIGNATURE VERIFICATION -+---------------------- -+ -+The four operations that can perform cryptographic signature verification, -+using one of a set of keys to provide the public key: -+ -+ (1) Begin verification procedure. -+ -+ struct crypto_key_verify_context * -+ verify_sig_begin(struct key *keyring, const void *sig, size_t siglen); -+ -+ This function sets up a verification context from the information in the -+ signature and looks for a suitable key in the keyring. The signature blob -+ must be presented again at the end of the procedure. The keys will be -+ checked against parameters in the signature, and if the matching one is -+ not found then -ENOKEY will be returned. -+ -+ The hashing algorithm, if such a thing applies, will be determined from -+ information in the signature and the appropriate crypto module will be -+ used. -ENOPKG will be returned if the hash algorithm is unavailable. -+ -+ The return value is an opaque pointer to be passed to the other functions, -+ or a negative error code. -+ -+ (2) Indicate data to be verified. -+ -+ int verify_sig_add_data(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen); -+ -+ This function is used to shovel data to the verification procedure so that -+ it can load it into the hash, pass it to hardware or whatever is -+ appropriate for the algorithm being employed. -+ -+ The data is not canonicalised for the document type specified in the -+ signature. The caller must do that. -+ -+ It will return 0 if successful and a negative error code if not. -+ -+ (3) Complete the verification process. -+ -+ int verify_sig_end(struct crypto_key_verify_context *ctx, -+ const void *sig, size_t siglen); -+ -+ This function performs the actual signature verification step and cleans -+ up the resources allocated at the beginning. The signature must be -+ presented again as some of the data therein may need to be added to the -+ internal hash. -+ -+ It will return -EKEYREJECTED if the signature didn't match, 0 if -+ successful and may return other errors as appropriate. -+ -+ (4) Cancel the verification process. -+ -+ void verify_sig_cancel(struct crypto_key_verify_context *ctx); -+ -+ This function cleans up the resources allocated at the beginning. This is -+ not necessary if verify_sig_end() was called. -+ -+ - =========================== - IMPLEMENTING CRYPTO PARSERS - =========================== -@@ -96,6 +156,7 @@ IMPLEMENTING CRYPTO PARSERS - The crypto key type keeps a list of registered data parsers. An example of - such a parser is one that parses OpenPGP packet formatted data [RFC 4880]. - -+ - During key instantiation each parser in the list is tried until one doesn't - return -EBADMSG. - -@@ -107,6 +168,8 @@ The parser definition structure looks like the following: - - int (*instantiate)(struct key *key, - const void *data, size_t datalen); -+ struct crypto_key_verify_context *(*verify_sig_begin)( -+ struct key *keyring, const u8 *sig, size_t siglen); - }; - - The owner and name fields should be set to the owning module and the name of -@@ -135,6 +198,44 @@ but it is expected that at least one will be defined. - algorithm such as RSA and DSA this will likely be a printable hex version - of the key's fingerprint. - -+ (2) verify_sig_begin(). -+ -+ This is similar in concept to the instantiate() function, except that it -+ is given a signature blob to parse rather than a key data blob. -+ -+ If the data format is not recognised, -EBADMSG should be returned. If it -+ is recognised, but the signature verification process cannot for some -+ reason be set up, some other negative error code should be returned. -+ -ENOKEY should be used to indicate that no matching key is available and -+ -ENOPKG should be returned if the hash algorithm or the verification -+ algorithm are unavailable. -+ -+ If successful, the parser should allocate a verification context and embed -+ the following struct in it: -+ -+ struct crypto_key_verify_context { -+ struct key *key; -+ int (*add_data)(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen); -+ int (*end)(struct crypto_key_verify_context *ctx, -+ const u8 *sig, size_t siglen); -+ void (*cancel)(struct crypto_key_verify_context *ctx); -+ }; -+ -+ and return a pointer to this to the caller, who will then pass it to the -+ verification operation wrappers described in the "Signature Verification" -+ section. The three operation pointers here correspond exactly to those -+ wrappers and are all mandatory. container_of() should be used to retrieve -+ the actual context. -+ -+ Note that the crypto key type retains a reference on the parser module for -+ the lifetime of this context, though the operation pointers need not point -+ into this module. -+ -+ The parser should also record a pointer to the key selected and take a -+ reference on that key with key_get(). -+ -+ - Functions are provided to register and unregister parsers: - - int register_crypto_key_parser(struct crypto_key_parser *parser); -diff --git a/include/keys/crypto-subtype.h b/include/keys/crypto-subtype.h -index fa87555..f2b927a 100644 ---- a/include/keys/crypto-subtype.h -+++ b/include/keys/crypto-subtype.h -@@ -20,6 +20,20 @@ - extern struct key_type key_type_crypto; - - /* -+ * Context base for signature verification methods. Allocated by the subtype -+ * and presumably embedded in something appropriate. -+ */ -+struct crypto_key_verify_context { -+ struct key *key; -+ struct crypto_key_parser *parser; -+ int (*add_data)(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen); -+ int (*end)(struct crypto_key_verify_context *ctx, -+ const u8 *sig, size_t siglen); -+ void (*cancel)(struct crypto_key_verify_context *ctx); -+}; -+ -+/* - * Keys of this type declare a subtype that indicates the handlers and - * capabilities. - */ -@@ -48,6 +62,13 @@ struct crypto_key_parser { - * Return EBADMSG if not recognised. - */ - int (*instantiate)(struct key *key, const void *data, size_t datalen); -+ -+ /* Attempt to recognise a signature blob and find a matching key. -+ * -+ * Return EBADMSG if not recognised. -+ */ -+ struct crypto_key_verify_context *(*verify_sig_begin)( -+ struct key *keyring, const u8 *sig, size_t siglen); - }; - - extern int register_crypto_key_parser(struct crypto_key_parser *); -diff --git a/include/keys/crypto-type.h b/include/keys/crypto-type.h -index 47c00c7..6b93366 100644 ---- a/include/keys/crypto-type.h -+++ b/include/keys/crypto-type.h -@@ -18,6 +18,15 @@ - - extern struct key_type key_type_crypto; - -+struct crypto_key_verify_context; -+extern struct crypto_key_verify_context *verify_sig_begin( -+ struct key *key, const void *sig, size_t siglen); -+extern int verify_sig_add_data(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen); -+extern int verify_sig_end(struct crypto_key_verify_context *ctx, -+ const void *sig, size_t siglen); -+extern void verify_sig_cancel(struct crypto_key_verify_context *ctx); -+ - /* - * The payload is at the discretion of the subtype. - */ -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 36db1d5..67001bc 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -4,4 +4,4 @@ - - obj-$(CONFIG_CRYPTO_KEY_TYPE) += crypto_keys.o - --crypto_keys-y := crypto_type.o -+crypto_keys-y := crypto_type.o crypto_verify.o -diff --git a/security/keys/crypto/crypto_verify.c b/security/keys/crypto/crypto_verify.c -new file mode 100644 -index 0000000..3f2964b ---- /dev/null -+++ b/security/keys/crypto/crypto_verify.c -@@ -0,0 +1,112 @@ -+/* Signature verification with a crypto key -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ * -+ * See Documentation/security/keys-crypto.txt -+ */ -+ -+#include <keys/crypto-subtype.h> -+#include <linux/module.h> -+#include <linux/err.h> -+#include "crypto_keys.h" -+ -+/** -+ * verify_sig_begin - Initiate the use of a crypto key to verify a signature -+ * @keyring: The public keys to verify against -+ * @sig: The signature data -+ * @siglen: The signature length -+ * -+ * Returns a context or an error. -+ */ -+struct crypto_key_verify_context *verify_sig_begin( -+ struct key *keyring, const void *sig, size_t siglen) -+{ -+ struct crypto_key_verify_context *ret; -+ struct crypto_key_parser *parser; -+ -+ pr_devel("==>%s()\n", __func__); -+ -+ if (siglen == 0 || !sig) -+ return ERR_PTR(-EINVAL); -+ -+ down_read(&crypto_key_parsers_sem); -+ -+ ret = ERR_PTR(-EBADMSG); -+ list_for_each_entry(parser, &crypto_key_parsers, link) { -+ if (parser->verify_sig_begin) { -+ if (!try_module_get(parser->owner)) -+ continue; -+ -+ pr_debug("Trying parser '%s'\n", parser->name); -+ -+ ret = parser->verify_sig_begin(keyring, sig, siglen); -+ if (IS_ERR(ret)) -+ module_put(parser->owner); -+ else -+ ret->parser = parser; -+ if (ret != ERR_PTR(-EBADMSG)) { -+ pr_debug("Parser recognised the format" -+ " (ret %ld)\n", -+ PTR_ERR(ret)); -+ break; -+ } -+ } -+ } -+ -+ up_read(&crypto_key_parsers_sem); -+ pr_devel("<==%s() = %p\n", __func__, ret); -+ return ret; -+} -+EXPORT_SYMBOL_GPL(verify_sig_begin); -+ -+/** -+ * verify_sig_add_data - Incrementally provide data to be verified -+ * @ctx: The context from verify_sig_begin() -+ * @data: Data -+ * @datalen: The amount of @data -+ * -+ * This may be called multiple times. -+ */ -+int verify_sig_add_data(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen) -+{ -+ return ctx->add_data(ctx, data, datalen); -+} -+EXPORT_SYMBOL_GPL(verify_sig_add_data); -+ -+/** -+ * verify_sig_end - Finalise signature verification and return result -+ * @ctx: The context from verify_sig_begin() -+ * @sig: The signature data -+ * @siglen: The signature length -+ */ -+int verify_sig_end(struct crypto_key_verify_context *ctx, -+ const void *sig, size_t siglen) -+{ -+ struct crypto_key_parser *parser = ctx->parser; -+ int ret; -+ -+ ret = ctx->end(ctx, sig, siglen); -+ module_put(parser->owner); -+ return ret; -+} -+EXPORT_SYMBOL_GPL(verify_sig_end); -+ -+/** -+ * verify_sig_end - Cancel signature verification -+ * @ctx: The context from verify_sig_begin() -+ */ -+void verify_sig_cancel(struct crypto_key_verify_context *ctx) -+{ -+ struct crypto_key_parser *parser = ctx->parser; -+ -+ ctx->cancel(ctx); -+ module_put(parser->owner); -+} -+EXPORT_SYMBOL_GPL(verify_sig_cancel); --- -1.7.10.4 - - -From 2fd136dec4682c1fa2609a7a94cf0353c334615c Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 13:12:20 +0100 -Subject: [PATCH 04/27] KEYS: Asymmetric public-key algorithm crypto key - subtype - -Add a subtype for supporting asymmetric public-key encryption algorithms such -as DSA (FIPS-186) and RSA (PKCS#1 / RFC1337). - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/Kconfig | 10 ++++ - security/keys/crypto/Makefile | 3 +- - security/keys/crypto/public_key.c | 55 +++++++++++++++++++ - security/keys/crypto/public_key.h | 106 +++++++++++++++++++++++++++++++++++++ - 4 files changed, 173 insertions(+), 1 deletion(-) - create mode 100644 security/keys/crypto/public_key.c - create mode 100644 security/keys/crypto/public_key.h - -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -index 3d15710..5f2b8ac 100644 ---- a/security/keys/crypto/Kconfig -+++ b/security/keys/crypto/Kconfig -@@ -5,3 +5,13 @@ config CRYPTO_KEY_TYPE - This option provides support for a type of key that holds the keys - required for cryptographic operations such as encryption, decryption, - signature generation and signature verification. -+ -+config CRYPTO_KEY_PUBLIC_KEY_SUBTYPE -+ tristate "Asymmetric public-key crypto algorithm subtype" -+ depends on CRYPTO_KEY_TYPE -+ select MPILIB -+ help -+ This option provides support for asymmetric public key type handling. -+ If signature generation and/or verification are to be used, -+ appropriate hash algorithms (such as SHA-1) must be available. -+ ENOPKG will be reported if the requisite algorithm is unavailable. -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 67001bc..6384306 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -3,5 +3,6 @@ - # - - obj-$(CONFIG_CRYPTO_KEY_TYPE) += crypto_keys.o -- - crypto_keys-y := crypto_type.o crypto_verify.o -+ -+obj-$(CONFIG_CRYPTO_KEY_PUBLIC_KEY_SUBTYPE) += public_key.o -diff --git a/security/keys/crypto/public_key.c b/security/keys/crypto/public_key.c -new file mode 100644 -index 0000000..c00ddac ---- /dev/null -+++ b/security/keys/crypto/public_key.c -@@ -0,0 +1,55 @@ -+/* Asymmetric public key crypto subtype -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "PKEY: "fmt -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include "public_key.h" -+ -+MODULE_LICENSE("GPL"); -+ -+/* -+ * Provide a part of a description of the key for /proc/keys. -+ */ -+static void public_key_describe(const struct key *crypto_key, -+ struct seq_file *m) -+{ -+ struct public_key *key = crypto_key->payload.data; -+ -+ if (key) -+ seq_puts(m, key->algo->name); -+} -+ -+/* -+ * Destroy a public key algorithm key -+ */ -+static void public_key_destroy(void *payload) -+{ -+ struct public_key *key = payload; -+ int i; -+ -+ if (key) { -+ for (i = 0; i < ARRAY_SIZE(key->mpi); i++) -+ mpi_free(key->mpi[i]); -+ kfree(key); -+ } -+} -+ -+/* -+ * Public key algorithm crypto key subtype -+ */ -+struct crypto_key_subtype public_key_crypto_key_subtype = { -+ .owner = THIS_MODULE, -+ .name = "public_key", -+ .describe = public_key_describe, -+ .destroy = public_key_destroy, -+}; -+EXPORT_SYMBOL_GPL(public_key_crypto_key_subtype); -diff --git a/security/keys/crypto/public_key.h b/security/keys/crypto/public_key.h -new file mode 100644 -index 0000000..81ed603 ---- /dev/null -+++ b/security/keys/crypto/public_key.h -@@ -0,0 +1,106 @@ -+/* Asymmetric public-key algorithm definitions -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifndef _LINUX_PUBLIC_KEY_H -+#define _LINUX_PUBLIC_KEY_H -+ -+#include <linux/mpi.h> -+#include <crypto/hash.h> -+#include <keys/crypto-subtype.h> -+ -+struct public_key; -+struct public_key_signature; -+ -+enum pkey_hash_algo { -+ PKEY_HASH_MD5, -+ PKEY_HASH_SHA1, -+ PKEY_HASH_RIPE_MD_160, -+ PKEY_HASH_SHA256, -+ PKEY_HASH_SHA384, -+ PKEY_HASH_SHA512, -+ PKEY_HASH_SHA224, -+ PKEY_HASH__LAST -+}; -+ -+/* -+ * Public key type definition -+ */ -+struct public_key_algorithm { -+ const char *name; -+ u8 n_pub_mpi; /* Number of MPIs in public key */ -+ u8 n_sec_mpi; /* Number of MPIs in secret key */ -+ u8 n_sig_mpi; /* Number of MPIs in a signature */ -+ int (*verify)(const struct public_key *key, -+ const struct public_key_signature *sig); -+}; -+ -+/* -+ * Asymmetric public key data -+ */ -+struct public_key { -+ const struct public_key_algorithm *algo; -+ u8 capabilities; -+#define PKEY_CAN_ENCRYPT 0x01 -+#define PKEY_CAN_DECRYPT 0x02 -+#define PKEY_CAN_ENCDEC (PKEY_CAN_ENCRYPT | PKEY_CAN_DECRYPT) -+#define PKEY_CAN_SIGN 0x04 -+#define PKEY_CAN_VERIFY 0x08 -+#define PKEY_CAN_SIGVER (PKEY_CAN_SIGN | PKEY_CAN_VERIFY) -+ union { -+ MPI mpi[5]; -+ struct { -+ MPI p; /* DSA prime */ -+ MPI q; /* DSA group order */ -+ MPI g; /* DSA group generator */ -+ MPI y; /* DSA public-key value = g^x mod p */ -+ MPI x; /* DSA secret exponent (if present) */ -+ } dsa; -+ struct { -+ MPI n; /* RSA public modulus */ -+ MPI e; /* RSA public encryption exponent */ -+ MPI d; /* RSA secret encryption exponent (if present) */ -+ MPI p; /* RSA secret prime (if present) */ -+ MPI q; /* RSA secret prime (if present) */ -+ } rsa; -+ }; -+ -+ u8 key_id[8]; /* ID of this key pair */ -+ u8 key_id_size; /* Number of bytes in key_id */ -+}; -+ -+/* -+ * Asymmetric public key algorithm signature data -+ */ -+struct public_key_signature { -+ struct crypto_key_verify_context base; -+ u8 *digest; -+ enum pkey_hash_algo pkey_hash_algo : 8; -+ u8 signed_hash_msw[2]; -+ u8 digest_size; /* Number of bytes in digest */ -+ union { -+ MPI mpi[2]; -+ struct { -+ MPI s; /* m^d mod n */ -+ } rsa; -+ struct { -+ MPI r; -+ MPI s; -+ } dsa; -+ }; -+ struct shash_desc hash; /* This must go last! */ -+}; -+ -+extern struct crypto_key_verify_context *pgp_pkey_verify_sig_begin( -+ struct key *crypto_key, const u8 *sigdata, size_t siglen); -+ -+extern struct crypto_key_subtype public_key_crypto_key_subtype; -+ -+#endif /* _LINUX_PUBLIC_KEY_H */ --- -1.7.10.4 - - -From ba785b97c90fc4403b2124dc2cecc842ba49be54 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 13:12:21 +0100 -Subject: [PATCH 05/27] KEYS: RSA: Add exports from MPILIB - -Export mpi_cmp() and mpi_cmp_ui() from the MPI library for use by RSA. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - lib/mpi/mpi-cmp.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c -index 914bc42..1871e7b 100644 ---- a/lib/mpi/mpi-cmp.c -+++ b/lib/mpi/mpi-cmp.c -@@ -39,6 +39,7 @@ int mpi_cmp_ui(MPI u, unsigned long v) - else - return -1; - } -+EXPORT_SYMBOL_GPL(mpi_cmp_ui); - - int mpi_cmp(MPI u, MPI v) - { -@@ -66,3 +67,4 @@ int mpi_cmp(MPI u, MPI v) - return 1; - return -1; - } -+EXPORT_SYMBOL_GPL(mpi_cmp); --- -1.7.10.4 - - -From 650edd748b92eea0622ecb26a5ee81c7b582d04c Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:15:36 +0100 -Subject: [PATCH 06/27] KEYS: RSA: Implement signature verification algorithm - [PKCS#1 / RFC3447] - -Implement RSA public key cryptography [PKCS#1 / RFC3447]. At this time, only -the signature verification algorithm is supported. This uses the asymmetric -public key subtype to hold its key data. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/Kconfig | 7 + - security/keys/crypto/Makefile | 1 + - security/keys/crypto/crypto_rsa.c | 264 +++++++++++++++++++++++++++++++++++++ - security/keys/crypto/public_key.h | 2 + - 4 files changed, 274 insertions(+) - create mode 100644 security/keys/crypto/crypto_rsa.c - -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -index 5f2b8ac..4e3777e 100644 ---- a/security/keys/crypto/Kconfig -+++ b/security/keys/crypto/Kconfig -@@ -15,3 +15,10 @@ config CRYPTO_KEY_PUBLIC_KEY_SUBTYPE - If signature generation and/or verification are to be used, - appropriate hash algorithms (such as SHA-1) must be available. - ENOPKG will be reported if the requisite algorithm is unavailable. -+ -+config CRYPTO_KEY_PKEY_ALGO_RSA -+ tristate "RSA public-key algorithm" -+ depends on CRYPTO_KEY_PUBLIC_KEY_SUBTYPE -+ select MPILIB_EXTRA -+ help -+ This option enables support for the RSA algorithm (PKCS#1, RFC3447). -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 6384306..b6b1a5a 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -6,3 +6,4 @@ obj-$(CONFIG_CRYPTO_KEY_TYPE) += crypto_keys.o - crypto_keys-y := crypto_type.o crypto_verify.o - - obj-$(CONFIG_CRYPTO_KEY_PUBLIC_KEY_SUBTYPE) += public_key.o -+obj-$(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA) += crypto_rsa.o -diff --git a/security/keys/crypto/crypto_rsa.c b/security/keys/crypto/crypto_rsa.c -new file mode 100644 -index 0000000..845285c ---- /dev/null -+++ b/security/keys/crypto/crypto_rsa.c -@@ -0,0 +1,264 @@ -+/* RSA asymmetric public-key algorithm [RFC3447] -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "RSA: "fmt -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include "public_key.h" -+ -+MODULE_LICENSE("GPL"); -+ -+#define kenter(FMT, ...) \ -+ pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__) -+#define kleave(FMT, ...) \ -+ pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__) -+ -+/* -+ * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2]. -+ */ -+static const u8 RSA_digest_info_MD5[] = { -+ 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, -+ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, /* OID */ -+ 0x05, 0x00, 0x04, 0x10 -+}; -+ -+static const u8 RSA_digest_info_SHA1[] = { -+ 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, -+ 0x2B, 0x0E, 0x03, 0x02, 0x1A, -+ 0x05, 0x00, 0x04, 0x14 -+}; -+ -+static const u8 RSA_digest_info_RIPE_MD_160[] = { -+ 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, -+ 0x2B, 0x24, 0x03, 0x02, 0x01, -+ 0x05, 0x00, 0x04, 0x14 -+}; -+ -+static const u8 RSA_digest_info_SHA224[] = { -+ 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, -+ 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, -+ 0x05, 0x00, 0x04, 0x1C -+}; -+ -+static const u8 RSA_digest_info_SHA256[] = { -+ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, -+ 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, -+ 0x05, 0x00, 0x04, 0x20 -+}; -+ -+static const u8 RSA_digest_info_SHA384[] = { -+ 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, -+ 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, -+ 0x05, 0x00, 0x04, 0x30 -+}; -+ -+static const u8 RSA_digest_info_SHA512[] = { -+ 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, -+ 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, -+ 0x05, 0x00, 0x04, 0x40 -+}; -+ -+static const struct { -+ const u8 *data; -+ size_t size; -+} RSA_ASN1_templates[PKEY_HASH__LAST] = { -+#define _(X) { RSA_digest_info_##X, sizeof(RSA_digest_info_##X) } -+ [PKEY_HASH_MD5] = _(MD5), -+ [PKEY_HASH_SHA1] = _(SHA1), -+ [PKEY_HASH_RIPE_MD_160] = _(RIPE_MD_160), -+ [PKEY_HASH_SHA256] = _(SHA256), -+ [PKEY_HASH_SHA384] = _(SHA384), -+ [PKEY_HASH_SHA512] = _(SHA512), -+ [PKEY_HASH_SHA224] = _(SHA224), -+#undef _ -+}; -+ -+/* -+ * RSAVP1() function [RFC3447 sec 5.2.2] -+ */ -+static int RSAVP1(const struct public_key *key, MPI s, MPI *_m) -+{ -+ MPI m; -+ int ret; -+ -+ /* (1) Validate 0 <= s < n */ -+ if (mpi_cmp_ui(s, 0) < 0) { -+ kleave(" = -EBADMSG [s < 0]"); -+ return -EBADMSG; -+ } -+ if (mpi_cmp(s, key->rsa.n) >= 0) { -+ kleave(" = -EBADMSG [s >= n]"); -+ return -EBADMSG; -+ } -+ -+ m = mpi_alloc(0); -+ if (!m) -+ return -ENOMEM; -+ -+ /* (2) m = s^e mod n */ -+ ret = mpi_powm(m, s, key->rsa.e, key->rsa.n); -+ if (ret < 0) { -+ mpi_free(m); -+ return ret; -+ } -+ -+ *_m = m; -+ return 0; -+} -+ -+/* -+ * Integer to Octet String conversion [RFC3447 sec 4.1] -+ */ -+static int RSA_I2OSP(MPI x, size_t xLen, u8 **_X) -+{ -+ unsigned X_size, x_size; -+ int X_sign; -+ u8 *X; -+ -+ /* Make sure the string is the right length. The number should begin -+ * with { 0x00, 0x01, ... } so we have to account for 15 leading zero -+ * bits not being reported by MPI. -+ */ -+ x_size = mpi_get_nbits(x); -+ pr_devel("size(x)=%u xLen*8=%zu\n", x_size, xLen * 8); -+ if (x_size != xLen * 8 - 15) -+ return -ERANGE; -+ -+ X = mpi_get_buffer(x, &X_size, &X_sign); -+ if (!X) -+ return -ENOMEM; -+ if (X_sign < 0) { -+ kfree(X); -+ return -EBADMSG; -+ } -+ if (X_size != xLen - 1) { -+ kfree(X); -+ return -EBADMSG; -+ } -+ -+ *_X = X; -+ return 0; -+} -+ -+/* -+ * Perform the RSA signature verification. -+ * @H: Value of hash of data and metadata -+ * @EM: The computed signature value -+ * @k: The size of EM (EM[0] is an invalid location but should hold 0x00) -+ * @hash_size: The size of H -+ * @asn1_template: The DigestInfo ASN.1 template -+ * @asn1_size: Size of asm1_template[] -+ */ -+static int RSA_verify(const u8 *H, const u8 *EM, size_t k, size_t hash_size, -+ const u8 *asn1_template, size_t asn1_size) -+{ -+ unsigned PS_end, T_offset, i; -+ -+ kenter(",,%zu,%zu,%zu", k, hash_size, asn1_size); -+ -+ if (k < 2 + 1 + asn1_size + hash_size) -+ return -EBADMSG; -+ -+ /* Decode the EMSA-PKCS1-v1_5 */ -+ if (EM[1] != 0x01) { -+ kleave(" = -EBADMSG [EM[1] == %02u]", EM[1]); -+ return -EBADMSG; -+ } -+ -+ T_offset = k - (asn1_size + hash_size); -+ PS_end = T_offset - 1; -+ if (EM[PS_end] != 0x00) { -+ kleave(" = -EBADMSG [EM[T-1] == %02u]", EM[PS_end]); -+ return -EBADMSG; -+ } -+ -+ for (i = 2; i < PS_end; i++) { -+ if (EM[i] != 0xff) { -+ kleave(" = -EBADMSG [EM[PS%x] == %02u]", i - 2, EM[i]); -+ return -EBADMSG; -+ } -+ } -+ -+ if (memcmp(asn1_template, EM + T_offset, asn1_size) != 0) { -+ kleave(" = -EBADMSG [EM[T] ASN.1 mismatch]"); -+ return -EBADMSG; -+ } -+ -+ if (memcmp(H, EM + T_offset + asn1_size, hash_size) != 0) { -+ kleave(" = -EKEYREJECTED [EM[T] hash mismatch]"); -+ return -EKEYREJECTED; -+ } -+ -+ kleave(" = 0"); -+ return 0; -+} -+ -+/* -+ * Perform the verification step [RFC3447 sec 8.2.2]. -+ */ -+static int RSA_verify_signature(const struct public_key *key, -+ const struct public_key_signature *sig) -+{ -+ size_t tsize; -+ int ret; -+ -+ /* Variables as per RFC3447 sec 8.2.2 */ -+ const u8 *H = sig->digest; -+ u8 *EM = NULL; -+ MPI m = NULL; -+ size_t k; -+ -+ kenter(""); -+ -+ /* (1) Check the signature size against the public key modulus size */ -+ k = (mpi_get_nbits(key->rsa.n) + 7) / 8; -+ -+ tsize = (mpi_get_nbits(sig->rsa.s) + 7) / 8; -+ pr_devel("step 1: k=%zu size(S)=%zu\n", k, tsize); -+ if (tsize != k) { -+ ret = -EBADMSG; -+ goto error; -+ } -+ -+ /* (2b) Apply the RSAVP1 verification primitive to the public key */ -+ ret = RSAVP1(key, sig->rsa.s, &m); -+ if (ret < 0) -+ goto error; -+ -+ /* (2c) Convert the message representative (m) to an encoded message -+ * (EM) of length k octets. -+ * -+ * NOTE! The leading zero byte is suppressed by MPI, so we pass a -+ * pointer to the _preceding_ byte to RSA_verify()! -+ */ -+ ret = RSA_I2OSP(m, k, &EM); -+ if (ret < 0) -+ goto error; -+ -+ ret = RSA_verify(H, EM - 1, k, sig->digest_size, -+ RSA_ASN1_templates[sig->pkey_hash_algo].data, -+ RSA_ASN1_templates[sig->pkey_hash_algo].size); -+ -+error: -+ kfree(EM); -+ mpi_free(m); -+ kleave(" = %d", ret); -+ return ret; -+} -+ -+const struct public_key_algorithm RSA_public_key_algorithm = { -+ .name = "RSA", -+ .n_pub_mpi = 2, -+ .n_sec_mpi = 3, -+ .n_sig_mpi = 1, -+ .verify = RSA_verify_signature, -+}; -+EXPORT_SYMBOL_GPL(RSA_public_key_algorithm); -diff --git a/security/keys/crypto/public_key.h b/security/keys/crypto/public_key.h -index 81ed603..7913615 100644 ---- a/security/keys/crypto/public_key.h -+++ b/security/keys/crypto/public_key.h -@@ -42,6 +42,8 @@ struct public_key_algorithm { - const struct public_key_signature *sig); - }; - -+extern const struct public_key_algorithm RSA_public_key_algorithm; -+ - /* - * Asymmetric public key data - */ --- -1.7.10.4 - - -From 7da10c257377762e1a6ac747b48791cf610ba4c5 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:15:39 +0100 -Subject: [PATCH 07/27] KEYS: RSA: Fix signature verification for shorter - signatures - -gpg can produce a signature file where length of signature is less than the -modulus size because the amount of space an MPI takes up is kept as low as -possible by discarding leading zeros. This regularly happens for several -modules during the build. - -Fix it by relaxing check in RSA verification code. - -Thanks to Tomas Mraz and Miloslav Trmac for help. - -Signed-off-by: Milan Broz <mbroz@redhat.com> -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/crypto_rsa.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/security/keys/crypto/crypto_rsa.c b/security/keys/crypto/crypto_rsa.c -index 845285c..a4a63be 100644 ---- a/security/keys/crypto/crypto_rsa.c -+++ b/security/keys/crypto/crypto_rsa.c -@@ -219,15 +219,23 @@ static int RSA_verify_signature(const struct public_key *key, - kenter(""); - - /* (1) Check the signature size against the public key modulus size */ -- k = (mpi_get_nbits(key->rsa.n) + 7) / 8; -+ k = mpi_get_nbits(key->rsa.n); -+ tsize = mpi_get_nbits(sig->rsa.s); - -- tsize = (mpi_get_nbits(sig->rsa.s) + 7) / 8; -+ /* According to RFC 4880 sec 3.2, length of MPI is computed starting -+ * from most significant bit. So the RFC 3447 sec 8.2.2 size check -+ * must be relaxed to conform with shorter signatures - so we fail here -+ * only if signature length is longer than modulus size. -+ */ - pr_devel("step 1: k=%zu size(S)=%zu\n", k, tsize); -- if (tsize != k) { -+ if (k < tsize) { - ret = -EBADMSG; - goto error; - } - -+ /* Round up and convert to octets */ -+ k = (k + 7) / 8; -+ - /* (2b) Apply the RSAVP1 verification primitive to the public key */ - ret = RSAVP1(key, sig->rsa.s, &m); - if (ret < 0) --- -1.7.10.4 - - -From 4366c59a624398d1aba4d6651191ba880da9e694 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:15:52 +0100 -Subject: [PATCH 08/27] PGPLIB: PGP definitions (RFC 4880) - -Provide some useful PGP definitions from RFC 4880. These describe details of -public key crypto as used by crypto keys for things like signature -verification. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - include/linux/pgp.h | 206 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 206 insertions(+) - create mode 100644 include/linux/pgp.h - -diff --git a/include/linux/pgp.h b/include/linux/pgp.h -new file mode 100644 -index 0000000..1359f64 ---- /dev/null -+++ b/include/linux/pgp.h -@@ -0,0 +1,206 @@ -+/* PGP definitions (RFC 4880) -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifndef _LINUX_PGP_H -+#define _LINUX_PGP_H -+ -+#include <linux/types.h> -+ -+struct pgp_key_ID { -+ u8 id[8]; -+}; -+ -+struct pgp_time { -+ u8 time[4]; -+}; -+ -+/* -+ * PGP public-key algorithm identifiers [RFC4880: 9.1] -+ */ -+enum pgp_pubkey_algo { -+ PGP_PUBKEY_RSA_ENC_OR_SIG = 1, -+ PGP_PUBKEY_RSA_ENC_ONLY = 2, -+ PGP_PUBKEY_RSA_SIG_ONLY = 3, -+ PGP_PUBKEY_ELGAMAL = 16, -+ PGP_PUBKEY_DSA = 17, -+ PGP_PUBKEY__LAST -+}; -+ -+/* -+ * PGP symmetric-key algorithm identifiers [RFC4880: 9.2] -+ */ -+enum pgp_symkey_algo { -+ PGP_SYMKEY_PLAINTEXT = 0, -+ PGP_SYMKEY_IDEA = 1, -+ PGP_SYMKEY_3DES = 2, -+ PGP_SYMKEY_CAST5 = 3, -+ PGP_SYMKEY_BLOWFISH = 4, -+ PGP_SYMKEY_AES_128KEY = 7, -+ PGP_SYMKEY_AES_192KEY = 8, -+ PGP_SYMKEY_AES_256KEY = 9, -+ PGP_SYMKEY_TWOFISH_256KEY = 10, -+}; -+ -+/* -+ * PGP compression algorithm identifiers [RFC4880: 9.3] -+ */ -+enum pgp_compr_algo { -+ PGP_COMPR_UNCOMPRESSED = 0, -+ PGP_COMPR_ZIP = 1, -+ PGP_COMPR_ZLIB = 2, -+ PGP_COMPR_BZIP2 = 3, -+}; -+ -+/* -+ * PGP hash algorithm identifiers [RFC4880: 9.4] -+ */ -+enum pgp_hash_algo { -+ PGP_HASH_MD5 = 1, -+ PGP_HASH_SHA1 = 2, -+ PGP_HASH_RIPE_MD_160 = 3, -+ PGP_HASH_SHA256 = 8, -+ PGP_HASH_SHA384 = 9, -+ PGP_HASH_SHA512 = 10, -+ PGP_HASH_SHA224 = 11, -+ PGP_HASH__LAST -+}; -+ -+extern const char *const pgp_hash_algorithms[PGP_HASH__LAST]; -+ -+/* -+ * PGP packet type tags [RFC4880: 4.3]. -+ */ -+enum pgp_packet_tag { -+ PGP_PKT_RESERVED = 0, -+ PGP_PKT_PUBKEY_ENC_SESSION_KEY = 1, -+ PGP_PKT_SIGNATURE = 2, -+ PGP_PKT_SYMKEY_ENC_SESSION_KEY = 3, -+ PGP_PKT_ONEPASS_SIGNATURE = 4, -+ PGP_PKT_SECRET_KEY = 5, -+ PGP_PKT_PUBLIC_KEY = 6, -+ PGP_PKT_SECRET_SUBKEY = 7, -+ PGP_PKT_COMPRESSED_DATA = 8, -+ PGP_PKT_SYM_ENC_DATA = 9, -+ PGP_PKT_MARKER = 10, -+ PGP_PKT_LITERAL_DATA = 11, -+ PGP_PKT_TRUST = 12, -+ PGP_PKT_USER_ID = 13, -+ PGP_PKT_PUBLIC_SUBKEY = 14, -+ PGP_PKT_USER_ATTRIBUTE = 17, -+ PGP_PKT_SYM_ENC_AND_INTEG_DATA = 18, -+ PGP_PKT_MODIFY_DETECT_CODE = 19, -+ PGP_PKT_PRIVATE_0 = 60, -+ PGP_PKT_PRIVATE_3 = 63, -+ PGP_PKT__HIGHEST = 63 -+}; -+ -+/* -+ * Signature (tag 2) packet [RFC4880: 5.2]. -+ */ -+enum pgp_signature_version { -+ PGP_SIG_VERSION_3 = 3, -+ PGP_SIG_VERSION_4 = 4, -+}; -+ -+enum pgp_signature_type { -+ PGP_SIG_BINARY_DOCUMENT_SIG = 0x00, -+ PGP_SIG_CANONICAL_TEXT_DOCUMENT_SIG = 0x01, -+ PGP_SIG_STANDALONE_SIG = 0x02, -+ PGP_SIG_GENERAL_CERT_OF_UID_PUBKEY = 0x10, -+ PGP_SIG_PERSONAL_CERT_OF_UID_PUBKEY = 0x11, -+ PGP_SIG_CASUAL_CERT_OF_UID_PUBKEY = 0x12, -+ PGP_SIG_POSTITIVE_CERT_OF_UID_PUBKEY = 0x13, -+ PGP_SIG_SUBKEY_BINDING_SIG = 0x18, -+ PGP_SIG_PRIMARY_KEY_BINDING_SIG = 0x19, -+ PGP_SIG_DIRECTLY_ON_KEY = 0x1F, -+ PGP_SIG_KEY_REVOCATION_SIG = 0x20, -+ PGP_SIG_SUBKEY_REVOCATION_SIG = 0x28, -+ PGP_SIG_CERT_REVOCATION_SIG = 0x30, -+ PGP_SIG_TIMESTAMP_SIG = 0x40, -+ PGP_SIG_THIRD_PARTY_CONFIRM_SIG = 0x50, -+}; -+ -+struct pgp_signature_v3_packet { -+ enum pgp_signature_version version : 8; /* == PGP_SIG_VERSION_3 */ -+ u8 length_of_hashed; /* == 5 */ -+ struct { -+ enum pgp_signature_type signature_type : 8; -+ struct pgp_time creation_time; -+ } hashed; -+ struct pgp_key_ID issuer; -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ enum pgp_hash_algo hash_algo : 8; -+} __packed; -+ -+struct pgp_signature_v4_packet { -+ enum pgp_signature_version version : 8; /* == PGP_SIG_VERSION_4 */ -+ enum pgp_signature_type signature_type : 8; -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ enum pgp_hash_algo hash_algo : 8; -+} __packed; -+ -+/* -+ * V4 signature subpacket types [RFC4880: 5.2.3.1]. -+ */ -+enum pgp_sig_subpkt_type { -+ PGP_SIG_CREATION_TIME = 2, -+ PGP_SIG_EXPIRATION_TIME = 3, -+ PGP_SIG_EXPORTABLE_CERT = 4, -+ PGP_SIG_TRUST_SIG = 5, -+ PGP_SIG_REGEXP = 6, -+ PGP_SIG_REVOCABLE = 7, -+ PGP_SIG_KEY_EXPIRATION_TIME = 9, -+ PGP_SIG_PREF_SYM_ALGO = 11, -+ PGP_SIG_REVOCATION_KEY = 12, -+ PGP_SIG_ISSUER = 16, -+ PGP_SIG_NOTATION_DATA = 20, -+ PGP_SIG_PREF_HASH_ALGO = 21, -+ PGP_SIG_PREF_COMPR_ALGO = 22, -+ PGP_SIG_KEY_SERVER_PREFS = 23, -+ PGP_SIG_PREF_KEY_SERVER = 24, -+ PGP_SIG_PRIMARY_USER_ID = 25, -+ PGP_SIG_POLICY_URI = 26, -+ PGP_SIG_KEY_FLAGS = 27, -+ PGP_SIG_SIGNERS_USER_ID = 28, -+ PGP_SIG_REASON_FOR_REVOCATION = 29, -+ PGP_SIG_FEATURES = 30, -+ PGP_SIG_TARGET = 31, -+ PGP_SIG_EMBEDDED_SIG = 32, -+ PGP_SIG__LAST -+}; -+ -+#define PGP_SIG_SUBPKT_TYPE_CRITICAL_MASK 0x80 -+ -+/* -+ * Key (tag 5, 6, 7 and 14) packet -+ */ -+enum pgp_key_version { -+ PGP_KEY_VERSION_2 = 2, -+ PGP_KEY_VERSION_3 = 3, -+ PGP_KEY_VERSION_4 = 4, -+}; -+ -+struct pgp_key_v3_packet { -+ enum pgp_key_version version : 8; -+ struct pgp_time creation_time; -+ u8 expiry[2]; /* 0 or time in days till expiry */ -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ u8 key_material[0]; -+} __packed; -+ -+struct pgp_key_v4_packet { -+ enum pgp_key_version version : 8; -+ struct pgp_time creation_time; -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ u8 key_material[0]; -+} __packed; -+ -+#endif /* _LINUX_PGP_H */ --- -1.7.10.4 - - -From 0409a338e01de5025cec2a1b291442651163aafd Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:17:46 +0100 -Subject: [PATCH 09/27] PGPLIB: Basic packet parser - -Provide a simple parser that extracts the packets from a PGP packet blob and -passes the desirous ones to the given processor function: - - struct pgp_parse_context { - u64 types_of_interest; - int (*process_packet)(struct pgp_parse_context *context, - enum pgp_packet_tag type, - u8 headerlen, - const u8 *data, - size_t datalen); - }; - - int pgp_parse_packets(const u8 *data, size_t datalen, - struct pgp_parse_context *ctx); - -This is configured on with CONFIG_PGP_LIBRARY. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - include/linux/pgplib.h | 47 +++++++ - security/keys/crypto/Kconfig | 6 + - security/keys/crypto/Makefile | 1 + - security/keys/crypto/pgp_library.c | 268 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 322 insertions(+) - create mode 100644 include/linux/pgplib.h - create mode 100644 security/keys/crypto/pgp_library.c - -diff --git a/include/linux/pgplib.h b/include/linux/pgplib.h -new file mode 100644 -index 0000000..a045b3a ---- /dev/null -+++ b/include/linux/pgplib.h -@@ -0,0 +1,47 @@ -+/* PGP library definitions (RFC 4880) -+ * -+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifndef _LINUX_PGPLIB_H -+#define _LINUX_PGPLIB_H -+ -+#if defined(CONFIG_PGP_LIBRARY) || defined(CONFIG_PGP_LIBRARY_MODULE) -+ -+#include <linux/pgp.h> -+ -+/* -+ * PGP library packet parser -+ */ -+struct pgp_parse_context { -+ u64 types_of_interest; -+ int (*process_packet)(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, -+ u8 headerlen, -+ const u8 *data, -+ size_t datalen); -+}; -+ -+extern int pgp_parse_packets(const u8 *data, size_t datalen, -+ struct pgp_parse_context *ctx); -+ -+struct pgp_parse_pubkey { -+ enum pgp_key_version version : 8; -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ time_t creation_time; -+ time_t expires_at; -+}; -+ -+extern int pgp_parse_public_key(const u8 **_data, size_t *_datalen, -+ struct pgp_parse_pubkey *pk); -+ -+ -+#endif /* CONFIG_PGP_LIBRARY */ -+ -+#endif /* _LINUX_PGPLIB_H */ -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -index 4e3777e..88ce0e2 100644 ---- a/security/keys/crypto/Kconfig -+++ b/security/keys/crypto/Kconfig -@@ -22,3 +22,9 @@ config CRYPTO_KEY_PKEY_ALGO_RSA - select MPILIB_EXTRA - help - This option enables support for the RSA algorithm (PKCS#1, RFC3447). -+ -+config PGP_LIBRARY -+ tristate "PGP parsing library" -+ help -+ This option enables a library that provides a number of simple -+ utility functions for parsing PGP (RFC 4880) packet-based messages. -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index b6b1a5a..5fbe54e 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -7,3 +7,4 @@ crypto_keys-y := crypto_type.o crypto_verify.o - - obj-$(CONFIG_CRYPTO_KEY_PUBLIC_KEY_SUBTYPE) += public_key.o - obj-$(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA) += crypto_rsa.o -+obj-$(CONFIG_PGP_LIBRARY) += pgp_library.o -diff --git a/security/keys/crypto/pgp_library.c b/security/keys/crypto/pgp_library.c -new file mode 100644 -index 0000000..af396d6 ---- /dev/null -+++ b/security/keys/crypto/pgp_library.c -@@ -0,0 +1,268 @@ -+/* PGP packet parser (RFC 4880) -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+#define pr_fmt(fmt) "PGP: "fmt -+#include <linux/pgplib.h> -+#include <linux/errno.h> -+#include <linux/kernel.h> -+#include <linux/module.h> -+ -+MODULE_LICENSE("GPL"); -+ -+const char *const pgp_hash_algorithms[PGP_HASH__LAST] = { -+ [PGP_HASH_MD5] = "md5", -+ [PGP_HASH_SHA1] = "sha1", -+ [PGP_HASH_RIPE_MD_160] = "rmd160", -+ [PGP_HASH_SHA256] = "sha256", -+ [PGP_HASH_SHA384] = "sha384", -+ [PGP_HASH_SHA512] = "sha512", -+ [PGP_HASH_SHA224] = "sha224", -+}; -+EXPORT_SYMBOL_GPL(pgp_hash_algorithms); -+ -+/** -+ * pgp_parse_packet_header - Parse a PGP packet header -+ * @_data: Start of the PGP packet (updated to PGP packet data) -+ * @_datalen: Amount of data remaining in buffer (decreased) -+ * @_type: Where the packet type will be returned -+ * @_headerlen: Where the header length will be returned -+ * -+ * Parse a set of PGP packet header [RFC 4880: 4.2]. -+ * -+ * Returns packet data size on success; non-zero on error. If successful, -+ * *_data and *_datalen will have been updated and *_headerlen will be set to -+ * hold the length of the packet header. -+ */ -+static ssize_t pgp_parse_packet_header(const u8 **_data, size_t *_datalen, -+ enum pgp_packet_tag *_type, -+ u8 *_headerlen) -+{ -+ enum pgp_packet_tag type; -+ const u8 *data = *_data; -+ size_t size, datalen = *_datalen; -+ -+ pr_devel("-->pgp_parse_packet_header(,%zu,,)", datalen); -+ -+ if (datalen < 2) -+ goto short_packet; -+ -+ pr_devel("pkthdr %02x, %02x\n", data[0], data[1]); -+ -+ type = *data++; -+ datalen--; -+ if (!(type & 0x80)) { -+ pr_debug("Packet type does not have MSB set\n"); -+ return -EBADMSG; -+ } -+ type &= ~0x80; -+ -+ if (type & 0x40) { -+ /* New packet length format */ -+ type &= ~0x40; -+ pr_devel("new format: t=%u\n", type); -+ switch (data[0]) { -+ case 0x00 ... 0xbf: -+ /* One-byte length */ -+ size = data[0]; -+ data++; -+ datalen--; -+ *_headerlen = 2; -+ break; -+ case 0xc0 ... 0xdf: -+ /* Two-byte length */ -+ if (datalen < 2) -+ goto short_packet; -+ size = (data[0] - 192) * 256; -+ size += data[1] + 192; -+ data += 2; -+ datalen -= 2; -+ *_headerlen = 3; -+ break; -+ case 0xff: -+ /* Five-byte length */ -+ if (datalen < 5) -+ goto short_packet; -+ size = data[1] << 24; -+ size |= data[2] << 16; -+ size |= data[3] << 8; -+ size |= data[4]; -+ data += 5; -+ datalen -= 5; -+ *_headerlen = 6; -+ break; -+ default: -+ pr_debug("Partial body length packet not supported\n"); -+ return -EBADMSG; -+ } -+ } else { -+ /* Old packet length format */ -+ u8 length_type = type & 0x03; -+ type >>= 2; -+ pr_devel("old format: t=%u lt=%u\n", type, length_type); -+ -+ switch (length_type) { -+ case 0: -+ /* One-byte length */ -+ size = data[0]; -+ data++; -+ datalen--; -+ *_headerlen = 2; -+ break; -+ case 1: -+ /* Two-byte length */ -+ if (datalen < 2) -+ goto short_packet; -+ size = data[0] << 8; -+ size |= data[1]; -+ data += 2; -+ datalen -= 2; -+ *_headerlen = 3; -+ break; -+ case 2: -+ /* Four-byte length */ -+ if (datalen < 4) -+ goto short_packet; -+ size = data[0] << 24; -+ size |= data[1] << 16; -+ size |= data[2] << 8; -+ size |= data[3]; -+ data += 4; -+ datalen -= 4; -+ *_headerlen = 5; -+ break; -+ default: -+ pr_debug("Indefinite length packet not supported\n"); -+ return -EBADMSG; -+ } -+ } -+ -+ pr_devel("datalen=%zu size=%zu", datalen, size); -+ if (datalen < size) -+ goto short_packet; -+ if ((int)size < 0) -+ goto too_big; -+ -+ *_data = data; -+ *_datalen = datalen; -+ *_type = type; -+ pr_devel("Found packet type=%u size=%zd\n", type, size); -+ return size; -+ -+short_packet: -+ pr_debug("Attempt to parse short packet\n"); -+ return -EBADMSG; -+too_big: -+ pr_debug("Signature subpacket size >2G\n"); -+ return -EMSGSIZE; -+} -+ -+/** -+ * pgp_parse_packets - Parse a set of PGP packets -+ * @_data: Data to be parsed (updated) -+ * @_datalen: Amount of data (updated) -+ * @ctx: Parsing context -+ * -+ * Parse a set of PGP packets [RFC 4880: 4]. -+ */ -+int pgp_parse_packets(const u8 *data, size_t datalen, -+ struct pgp_parse_context *ctx) -+{ -+ enum pgp_packet_tag type; -+ ssize_t pktlen; -+ u8 headerlen; -+ int ret; -+ -+ while (datalen > 2) { -+ pktlen = pgp_parse_packet_header(&data, &datalen, &type, -+ &headerlen); -+ if (pktlen < 0) -+ return pktlen; -+ -+ if ((ctx->types_of_interest >> type) & 1) { -+ ret = ctx->process_packet(ctx, type, headerlen, -+ data, pktlen); -+ if (ret < 0) -+ return ret; -+ } -+ data += pktlen; -+ datalen -= pktlen; -+ } -+ -+ if (datalen != 0) { -+ pr_debug("Excess octets in packet stream\n"); -+ return -EBADMSG; -+ } -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pgp_parse_packets); -+ -+/** -+ * pgp_parse_public_key - Parse the common part of a PGP pubkey packet -+ * @_data: Content of packet (updated) -+ * @_datalen: Length of packet remaining (updated) -+ * @pk: Public key data -+ * -+ * Parse the common data struct for a PGP pubkey packet [RFC 4880: 5.5.2]. -+ */ -+int pgp_parse_public_key(const u8 **_data, size_t *_datalen, -+ struct pgp_parse_pubkey *pk) -+{ -+ const u8 *data = *_data; -+ size_t datalen = *_datalen; -+ __be32 tmp; -+ -+ if (datalen < 12) { -+ pr_debug("Public key packet too short\n"); -+ return -EBADMSG; -+ } -+ -+ pk->version = *data++; -+ switch (pk->version) { -+ case PGP_KEY_VERSION_2: -+ case PGP_KEY_VERSION_3: -+ case PGP_KEY_VERSION_4: -+ break; -+ default: -+ pr_debug("Public key packet with unhandled version %d\n", -+ pk->version); -+ return -EBADMSG; -+ } -+ -+ tmp = *data++ << 24; -+ tmp |= *data++ << 16; -+ tmp |= *data++ << 8; -+ tmp |= *data++; -+ pk->creation_time = tmp; -+ if (pk->version == PGP_KEY_VERSION_4) { -+ pk->expires_at = 0; /* Have to get it from the selfsignature */ -+ } else { -+ unsigned short ndays; -+ ndays = *data++ << 8; -+ ndays |= *data++; -+ if (ndays) -+ pk->expires_at = pk->creation_time + ndays * 86400UL; -+ else -+ pk->expires_at = 0; -+ datalen -= 2; -+ } -+ -+ pk->pubkey_algo = *data++; -+ datalen -= 6; -+ -+ pr_devel("%x,%x,%lx,%lx", -+ pk->version, pk->pubkey_algo, pk->creation_time, -+ pk->expires_at); -+ -+ *_data = data; -+ *_datalen = datalen; -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pgp_parse_public_key); --- -1.7.10.4 - - -From 2a76433139dbdc6d57d38da6ceb79ce05ab603a4 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:21:24 +0100 -Subject: [PATCH 10/27] PGPLIB: Signature parser - -Provide some PGP signature parsing helpers: - - (1) A function to parse V4 signature subpackets and pass the desired ones to - a processor function: - - int pgp_parse_sig_subpkts(const u8 *data, size_t datalen, - struct pgp_parse_sig_context *ctx); - - (2) A function to parse out basic signature parameters from any PGP signature - such that the algorithms and public key can be selected: - - int pgp_parse_sig_params(const u8 **_data, size_t *_datalen, - struct pgp_sig_parameters *p); - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - include/linux/pgplib.h | 25 ++++ - security/keys/crypto/pgp_library.c | 280 ++++++++++++++++++++++++++++++++++++ - 2 files changed, 305 insertions(+) - -diff --git a/include/linux/pgplib.h b/include/linux/pgplib.h -index a045b3a..34594a9 100644 ---- a/include/linux/pgplib.h -+++ b/include/linux/pgplib.h -@@ -41,6 +41,31 @@ struct pgp_parse_pubkey { - extern int pgp_parse_public_key(const u8 **_data, size_t *_datalen, - struct pgp_parse_pubkey *pk); - -+struct pgp_parse_sig_context { -+ unsigned long types_of_interest[128 / BITS_PER_LONG]; -+ int (*process_packet)(struct pgp_parse_sig_context *context, -+ enum pgp_sig_subpkt_type type, -+ const u8 *data, -+ size_t datalen); -+}; -+ -+extern int pgp_parse_sig_packets(const u8 *data, size_t datalen, -+ struct pgp_parse_sig_context *ctx); -+ -+struct pgp_sig_parameters { -+ enum pgp_signature_version version : 8; -+ enum pgp_signature_type signature_type : 8; -+ enum pgp_pubkey_algo pubkey_algo : 8; -+ enum pgp_hash_algo hash_algo : 8; -+ union { -+ struct pgp_key_ID issuer; -+ __be32 issuer32[2]; -+ }; -+}; -+ -+extern int pgp_parse_sig_params(const u8 **_data, size_t *_datalen, -+ struct pgp_sig_parameters *p); -+ - - #endif /* CONFIG_PGP_LIBRARY */ - -diff --git a/security/keys/crypto/pgp_library.c b/security/keys/crypto/pgp_library.c -index af396d6..c9218df 100644 ---- a/security/keys/crypto/pgp_library.c -+++ b/security/keys/crypto/pgp_library.c -@@ -266,3 +266,283 @@ int pgp_parse_public_key(const u8 **_data, size_t *_datalen, - return 0; - } - EXPORT_SYMBOL_GPL(pgp_parse_public_key); -+ -+/** -+ * pgp_parse_sig_subpkt_header - Parse a PGP V4 signature subpacket header -+ * @_data: Start of the subpacket (updated to subpacket data) -+ * @_datalen: Amount of data remaining in buffer (decreased) -+ * @_type: Where the subpacket type will be returned -+ * -+ * Parse a PGP V4 signature subpacket header [RFC 4880: 5.2.3.1]. -+ * -+ * Returns packet data size on success; non-zero on error. If successful, -+ * *_data and *_datalen will have been updated and *_headerlen will be set to -+ * hold the length of the packet header. -+ */ -+static ssize_t pgp_parse_sig_subpkt_header(const u8 **_data, size_t *_datalen, -+ enum pgp_sig_subpkt_type *_type) -+{ -+ enum pgp_sig_subpkt_type type; -+ const u8 *data = *_data; -+ size_t size, datalen = *_datalen; -+ -+ pr_devel("-->pgp_parse_sig_subpkt_header(,%zu,,)", datalen); -+ -+ if (datalen < 2) -+ goto short_subpacket; -+ -+ pr_devel("subpkt hdr %02x, %02x\n", data[0], data[1]); -+ -+ switch (data[0]) { -+ case 0x00 ... 0xbf: -+ /* One-byte length */ -+ size = data[0]; -+ data++; -+ datalen--; -+ break; -+ case 0xc0 ... 0xfe: -+ /* Two-byte length */ -+ if (datalen < 3) -+ goto short_subpacket; -+ size = (data[0] - 192) * 256; -+ size += data[1] + 192; -+ data += 2; -+ datalen -= 2; -+ break; -+ case 0xff: -+ if (datalen < 6) -+ goto short_subpacket; -+ size = data[1] << 24; -+ size |= data[2] << 16; -+ size |= data[3] << 8; -+ size |= data[4]; -+ data += 5; -+ datalen -= 5; -+ break; -+ } -+ -+ /* The type octet is included in the size */ -+ pr_devel("datalen=%zu size=%zu", datalen, size); -+ if (datalen < size) -+ goto short_subpacket; -+ if (size == 0) -+ goto very_short_subpacket; -+ if ((int)size < 0) -+ goto too_big; -+ -+ type = *data++ & ~PGP_SIG_SUBPKT_TYPE_CRITICAL_MASK; -+ datalen--; -+ size--; -+ -+ *_data = data; -+ *_datalen = datalen; -+ *_type = type; -+ pr_devel("Found subpkt type=%u size=%zd\n", type, size); -+ return size; -+ -+very_short_subpacket: -+ pr_debug("Signature subpacket size can't be zero\n"); -+ return -EBADMSG; -+short_subpacket: -+ pr_debug("Attempt to parse short signature subpacket\n"); -+ return -EBADMSG; -+too_big: -+ pr_debug("Signature subpacket size >2G\n"); -+ return -EMSGSIZE; -+} -+ -+/** -+ * pgp_parse_sig_subpkts - Parse a set of PGP V4 signatute subpackets -+ * @_data: Data to be parsed (updated) -+ * @_datalen: Amount of data (updated) -+ * @ctx: Parsing context -+ * -+ * Parse a set of PGP signature subpackets [RFC 4880: 5.2.3]. -+ */ -+static int pgp_parse_sig_subpkts(const u8 *data, size_t datalen, -+ struct pgp_parse_sig_context *ctx) -+{ -+ enum pgp_sig_subpkt_type type; -+ ssize_t pktlen; -+ int ret; -+ -+ pr_devel("-->pgp_parse_sig_subpkts(,%zu,,)", datalen); -+ -+ while (datalen > 2) { -+ pktlen = pgp_parse_sig_subpkt_header(&data, &datalen, &type); -+ if (pktlen < 0) -+ return pktlen; -+ if (test_bit(type, ctx->types_of_interest)) { -+ ret = ctx->process_packet(ctx, type, data, pktlen); -+ if (ret < 0) -+ return ret; -+ } -+ data += pktlen; -+ datalen -= pktlen; -+ } -+ -+ if (datalen != 0) { -+ pr_debug("Excess octets in signature subpacket stream\n"); -+ return -EBADMSG; -+ } -+ -+ return 0; -+} -+ -+struct pgp_parse_sig_params_ctx { -+ struct pgp_parse_sig_context base; -+ struct pgp_sig_parameters *params; -+ bool got_the_issuer; -+}; -+ -+/* -+ * Process a V4 signature subpacket. -+ */ -+static int pgp_process_sig_params_subpkt(struct pgp_parse_sig_context *context, -+ enum pgp_sig_subpkt_type type, -+ const u8 *data, -+ size_t datalen) -+{ -+ struct pgp_parse_sig_params_ctx *ctx = -+ container_of(context, struct pgp_parse_sig_params_ctx, base); -+ -+ if (ctx->got_the_issuer) { -+ pr_debug("V4 signature packet has multiple issuers\n"); -+ return -EBADMSG; -+ } -+ -+ if (datalen != 8) { -+ pr_debug("V4 signature issuer subpkt not 8 long (%zu)\n", -+ datalen); -+ return -EBADMSG; -+ } -+ -+ memcpy(&ctx->params->issuer, data, 8); -+ ctx->got_the_issuer = true; -+ return 0; -+} -+ -+/** -+ * pgp_parse_sig_params - Parse basic parameters from a PGP signature packet -+ * @_data: Content of packet (updated) -+ * @_datalen: Length of packet remaining (updated) -+ * @p: The basic parameters -+ * -+ * Parse the basic parameters from a PGP signature packet [RFC 4880: 5.2] that -+ * are needed to start off a signature verification operation. The only ones -+ * actually necessary are the signature type (which affects how the data is -+ * transformed) and the hash algorithm. -+ * -+ * We also extract the public key algorithm and the issuer's key ID as we'll -+ * need those to determine if we actually have the public key available. If -+ * not, then we can't verify the signature anyway. -+ * -+ * Returns 0 if successful or a negative error code. *_data and *_datalen are -+ * updated to point to the 16-bit subset of the hash value and the set of MPIs. -+ */ -+int pgp_parse_sig_params(const u8 **_data, size_t *_datalen, -+ struct pgp_sig_parameters *p) -+{ -+ const u8 *data = *_data; -+ size_t datalen = *_datalen; -+ int ret; -+ -+ pr_devel("-->pgp_parse_sig_params(,%zu,,)", datalen); -+ -+ if (datalen < 1) -+ return -EBADMSG; -+ p->version = *data; -+ -+ if (p->version == PGP_SIG_VERSION_3) { -+ const struct pgp_signature_v3_packet *v3 = (const void *)data; -+ -+ if (datalen < sizeof(*v3)) { -+ pr_debug("Short V3 signature packet\n"); -+ return -EBADMSG; -+ } -+ datalen -= sizeof(*v3); -+ data += sizeof(*v3); -+ -+ /* V3 has everything we need in the header */ -+ p->signature_type = v3->hashed.signature_type; -+ p->issuer = v3->issuer; -+ p->pubkey_algo = v3->pubkey_algo; -+ p->hash_algo = v3->hash_algo; -+ -+ } else if (p->version == PGP_SIG_VERSION_4) { -+ const struct pgp_signature_v4_packet *v4 = (const void *)data; -+ struct pgp_parse_sig_params_ctx ctx = { -+ .base.process_packet = pgp_process_sig_params_subpkt, -+ .params = p, -+ .got_the_issuer = false, -+ }; -+ size_t subdatalen; -+ -+ if (datalen < sizeof(*v4) + 2 + 2 + 2) { -+ pr_debug("Short V4 signature packet\n"); -+ return -EBADMSG; -+ } -+ datalen -= sizeof(*v4); -+ data += sizeof(*v4); -+ -+ /* V4 has most things in the header... */ -+ p->signature_type = v4->signature_type; -+ p->pubkey_algo = v4->pubkey_algo; -+ p->hash_algo = v4->hash_algo; -+ -+ /* ... but we have to get the key ID from the subpackets, of -+ * which there are two sets. */ -+ __set_bit(PGP_SIG_ISSUER, ctx.base.types_of_interest); -+ -+ subdatalen = *data++ << 8; -+ subdatalen |= *data++; -+ datalen -= 2; -+ if (subdatalen) { -+ /* Hashed subpackets */ -+ pr_devel("hashed data: %zu (after %zu)\n", -+ subdatalen, sizeof(*v4)); -+ if (subdatalen > datalen + 2 + 2) { -+ pr_debug("Short V4 signature packet [hdata]\n"); -+ return -EBADMSG; -+ } -+ ret = pgp_parse_sig_subpkts(data, subdatalen, -+ &ctx.base); -+ if (ret < 0) -+ return ret; -+ data += subdatalen; -+ datalen -= subdatalen; -+ } -+ -+ subdatalen = *data++ << 8; -+ subdatalen |= *data++; -+ datalen -= 2; -+ if (subdatalen) { -+ /* Unhashed subpackets */ -+ pr_devel("unhashed data: %zu\n", subdatalen); -+ if (subdatalen > datalen + 2) { -+ pr_debug("Short V4 signature packet [udata]\n"); -+ return -EBADMSG; -+ } -+ ret = pgp_parse_sig_subpkts(data, subdatalen, -+ &ctx.base); -+ if (ret < 0) -+ return ret; -+ data += subdatalen; -+ datalen -= subdatalen; -+ } -+ -+ if (!ctx.got_the_issuer) { -+ pr_debug("V4 signature packet lacks issuer\n"); -+ return -EBADMSG; -+ } -+ } else { -+ pr_debug("Signature packet with unhandled version %d\n", -+ p->version); -+ return -EBADMSG; -+ } -+ -+ *_data = data; -+ *_datalen = datalen; -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pgp_parse_sig_params); --- -1.7.10.4 - - -From 91a05bc308c1e177410882a119f388d3b6b53c22 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:21:26 +0100 -Subject: [PATCH 11/27] KEYS: PGP data parser - -Implement a PGP data parser for the crypto key type to use when instantiating a -key. - -This parser attempts to parse the instantiation data as a PGP packet sequence -(RFC 4880) and if it parses okay, attempts to extract a public-key algorithm -key or subkey from it. - -If it finds such a key, it will set up a public_key subtype payload with -appropriate handler routines (DSA or RSA) and attach it to the key. - -Thanks to Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> for pointing out -some errors. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/Kconfig | 12 ++ - security/keys/crypto/Makefile | 4 + - security/keys/crypto/pgp_parser.h | 23 +++ - security/keys/crypto/pgp_public_key.c | 348 +++++++++++++++++++++++++++++++++ - 4 files changed, 387 insertions(+) - create mode 100644 security/keys/crypto/pgp_parser.h - create mode 100644 security/keys/crypto/pgp_public_key.c - -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -index 88ce0e2..1c2ae55 100644 ---- a/security/keys/crypto/Kconfig -+++ b/security/keys/crypto/Kconfig -@@ -28,3 +28,15 @@ config PGP_LIBRARY - help - This option enables a library that provides a number of simple - utility functions for parsing PGP (RFC 4880) packet-based messages. -+ -+config CRYPTO_KEY_PGP_PARSER -+ tristate "PGP key blob parser" -+ depends on CRYPTO_KEY_TYPE -+ select CRYPTO_KEY_PUBLIC_KEY_SUBTYPE -+ select PGP_LIBRARY -+ select MD5 # V3 fingerprint generation -+ select SHA1 # V4 fingerprint generation -+ help -+ This option provides support for parsing PGP (RFC 4880) format blobs -+ for key data and provides the ability to instantiate a crypto key -+ from a public key packet found inside the blob. -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 5fbe54e..35733fc 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -8,3 +8,7 @@ crypto_keys-y := crypto_type.o crypto_verify.o - obj-$(CONFIG_CRYPTO_KEY_PUBLIC_KEY_SUBTYPE) += public_key.o - obj-$(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA) += crypto_rsa.o - obj-$(CONFIG_PGP_LIBRARY) += pgp_library.o -+ -+obj-$(CONFIG_CRYPTO_KEY_PGP_PARSER) += pgp_key_parser.o -+pgp_key_parser-y := \ -+ pgp_public_key.o -diff --git a/security/keys/crypto/pgp_parser.h b/security/keys/crypto/pgp_parser.h -new file mode 100644 -index 0000000..1cda231 ---- /dev/null -+++ b/security/keys/crypto/pgp_parser.h -@@ -0,0 +1,23 @@ -+/* PGP crypto data parser internal definitions -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#include <linux/pgp.h> -+ -+#define kenter(FMT, ...) \ -+ pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__) -+#define kleave(FMT, ...) \ -+ pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__) -+ -+/* -+ * pgp_key_parser.c -+ */ -+extern const -+struct public_key_algorithm *pgp_public_key_algorithms[PGP_PUBKEY__LAST]; -diff --git a/security/keys/crypto/pgp_public_key.c b/security/keys/crypto/pgp_public_key.c -new file mode 100644 -index 0000000..8a8b7c0 ---- /dev/null -+++ b/security/keys/crypto/pgp_public_key.c -@@ -0,0 +1,348 @@ -+/* Instantiate a public key crypto key from PGP format data [RFC 4880] -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "PGP: "fmt -+#include <keys/crypto-subtype.h> -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/slab.h> -+#include <linux/mpi.h> -+#include <linux/pgplib.h> -+#include <crypto/hash.h> -+#include "public_key.h" -+#include "pgp_parser.h" -+ -+MODULE_LICENSE("GPL"); -+ -+const -+struct public_key_algorithm *pgp_public_key_algorithms[PGP_PUBKEY__LAST] = { -+#if defined(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA) || \ -+ defined(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA_MODULE) -+ [PGP_PUBKEY_RSA_ENC_OR_SIG] = &RSA_public_key_algorithm, -+ [PGP_PUBKEY_RSA_ENC_ONLY] = &RSA_public_key_algorithm, -+ [PGP_PUBKEY_RSA_SIG_ONLY] = &RSA_public_key_algorithm, -+#endif -+ [PGP_PUBKEY_ELGAMAL] = NULL, -+ [PGP_PUBKEY_DSA] = NULL, -+}; -+ -+static const u8 pgp_public_key_capabilities[PGP_PUBKEY__LAST] = { -+ [PGP_PUBKEY_RSA_ENC_OR_SIG] = PKEY_CAN_ENCDEC | PKEY_CAN_SIGVER, -+ [PGP_PUBKEY_RSA_ENC_ONLY] = PKEY_CAN_ENCDEC, -+ [PGP_PUBKEY_RSA_SIG_ONLY] = PKEY_CAN_SIGVER, -+ [PGP_PUBKEY_ELGAMAL] = 0, -+ [PGP_PUBKEY_DSA] = 0, -+}; -+ -+static inline void digest_putc(struct shash_desc *digest, uint8_t ch) -+{ -+ crypto_shash_update(digest, &ch, 1); -+} -+ -+struct pgp_key_data_parse_context { -+ struct pgp_parse_context pgp; -+ struct crypto_key_subtype *subtype; -+ char *fingerprint; -+ void *payload; -+}; -+ -+/* -+ * Calculate the public key ID (RFC4880 12.2) -+ */ -+static int pgp_calc_pkey_keyid(struct shash_desc *digest, -+ struct pgp_parse_pubkey *pgp, -+ struct public_key *key) -+{ -+ unsigned nb[ARRAY_SIZE(key->mpi)]; -+ unsigned nn[ARRAY_SIZE(key->mpi)]; -+ unsigned n; -+ u8 *pp[ARRAY_SIZE(key->mpi)]; -+ u32 a32; -+ int npkey = key->algo->n_pub_mpi; -+ int i, ret = -ENOMEM; -+ -+ kenter(""); -+ -+ for (i = 0; i < ARRAY_SIZE(pp); i++) -+ pp[i] = NULL; -+ -+ n = (pgp->version < PGP_KEY_VERSION_4) ? 8 : 6; -+ for (i = 0; i < npkey; i++) { -+ nb[i] = mpi_get_nbits(key->mpi[i]); -+ pp[i] = mpi_get_buffer(key->mpi[i], nn + i, NULL); -+ if (!pp[i]) -+ goto error; -+ n += 2 + nn[i]; -+ } -+ -+ digest_putc(digest, 0x99); /* ctb */ -+ digest_putc(digest, n >> 8); /* 16-bit header length */ -+ digest_putc(digest, n); -+ digest_putc(digest, pgp->version); -+ -+ a32 = pgp->creation_time; -+ digest_putc(digest, a32 >> 24); -+ digest_putc(digest, a32 >> 16); -+ digest_putc(digest, a32 >> 8); -+ digest_putc(digest, a32 >> 0); -+ -+ if (pgp->version < PGP_KEY_VERSION_4) { -+ u16 a16; -+ -+ if (pgp->expires_at) -+ a16 = (pgp->expires_at - pgp->creation_time) / 86400UL; -+ else -+ a16 = 0; -+ digest_putc(digest, a16 >> 8); -+ digest_putc(digest, a16 >> 0); -+ } -+ -+ digest_putc(digest, pgp->pubkey_algo); -+ -+ for (i = 0; i < npkey; i++) { -+ digest_putc(digest, nb[i] >> 8); -+ digest_putc(digest, nb[i]); -+ crypto_shash_update(digest, pp[i], nn[i]); -+ } -+ ret = 0; -+ -+error: -+ for (i = 0; i < npkey; i++) -+ kfree(pp[i]); -+ kleave(" = %d", ret); -+ return ret; -+} -+ -+/* -+ * Calculate the public key ID fingerprint -+ */ -+static int pgp_generate_fingerprint(struct pgp_key_data_parse_context *ctx, -+ struct pgp_parse_pubkey *pgp, -+ struct public_key *key) -+{ -+ struct crypto_shash *tfm; -+ struct shash_desc *digest; -+ char *fingerprint; -+ u8 *raw_fingerprint; -+ int digest_size, offset; -+ int ret, i; -+ -+ ret = -ENOMEM; -+ tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ? -+ "md5" : "sha1", 0, 0); -+ if (!tfm) -+ goto cleanup; -+ -+ digest = kmalloc(sizeof(*digest) + crypto_shash_descsize(tfm), -+ GFP_KERNEL); -+ if (!digest) -+ goto cleanup_tfm; -+ -+ digest->tfm = tfm; -+ digest->flags = CRYPTO_TFM_REQ_MAY_SLEEP; -+ ret = crypto_shash_init(digest); -+ if (ret < 0) -+ goto cleanup_hash; -+ -+ ret = pgp_calc_pkey_keyid(digest, pgp, key); -+ if (ret < 0) -+ goto cleanup_hash; -+ -+ digest_size = crypto_shash_digestsize(tfm); -+ -+ raw_fingerprint = kmalloc(digest_size, GFP_KERNEL); -+ if (!raw_fingerprint) -+ goto cleanup_hash; -+ -+ ret = crypto_shash_final(digest, raw_fingerprint); -+ if (ret < 0) -+ goto cleanup_raw_fingerprint; -+ -+ fingerprint = kmalloc(digest_size * 2 + 1, GFP_KERNEL); -+ if (!fingerprint) -+ goto cleanup_raw_fingerprint; -+ -+ offset = digest_size - 8; -+ pr_debug("offset %u/%u\n", offset, digest_size); -+ -+ for (i = 0; i < digest_size; i++) -+ sprintf(fingerprint + i * 2, "%02x", raw_fingerprint[i]); -+ pr_debug("fingerprint %s\n", fingerprint); -+ -+ memcpy(&key->key_id, raw_fingerprint + offset, 8); -+ key->key_id_size = 8; -+ -+ ctx->fingerprint = fingerprint; -+ ret = 0; -+cleanup_raw_fingerprint: -+ kfree(raw_fingerprint); -+cleanup_hash: -+ kfree(digest); -+cleanup_tfm: -+ crypto_free_shash(tfm); -+cleanup: -+ kleave(" = %d", ret); -+ return ret; -+} -+ -+/* -+ * Extract a public key or public subkey from the PGP stream. -+ */ -+static int pgp_process_public_key(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, -+ u8 headerlen, -+ const u8 *data, -+ size_t datalen) -+{ -+ const struct public_key_algorithm *algo; -+ struct pgp_key_data_parse_context *ctx = -+ container_of(context, struct pgp_key_data_parse_context, pgp); -+ struct pgp_parse_pubkey pgp; -+ struct public_key *key; -+ int i, ret; -+ -+ kenter(",%u,%u,,%zu", type, headerlen, datalen); -+ -+ if (ctx->subtype) { -+ kleave(" = -ENOKEY [already]"); -+ return -EBADMSG; -+ } -+ -+ key = kzalloc(sizeof(struct public_key), GFP_KERNEL); -+ if (!key) -+ return -ENOMEM; -+ -+ ret = pgp_parse_public_key(&data, &datalen, &pgp); -+ if (ret < 0) -+ goto cleanup; -+ -+ if (pgp.pubkey_algo >= PGP_PUBKEY__LAST || -+ !pgp_public_key_algorithms[pgp.pubkey_algo]) { -+ pr_debug("Unsupported public key algorithm %u\n", -+ pgp.pubkey_algo); -+ ret = -ENOPKG; -+ goto cleanup; -+ } -+ -+ algo = key->algo = pgp_public_key_algorithms[pgp.pubkey_algo]; -+ -+ /* It's a public key, so that only gives us encrypt and verify -+ * capabilities. -+ */ -+ key->capabilities = pgp_public_key_capabilities[pgp.pubkey_algo] & -+ (PKEY_CAN_ENCRYPT | PKEY_CAN_VERIFY); -+ -+ for (i = 0; i < algo->n_pub_mpi; i++) { -+ unsigned int remaining = datalen; -+ if (remaining == 0) { -+ pr_debug("short %zu mpi %d\n", datalen, i); -+ goto cleanup_badmsg; -+ } -+ key->mpi[i] = mpi_read_from_buffer(data, &remaining); -+ if (!key->mpi[i]) -+ goto cleanup_nomem; -+ data += remaining; -+ datalen -= remaining; -+ } -+ -+ if (datalen != 0) { -+ pr_debug("excess %zu\n", datalen); -+ goto cleanup_badmsg; -+ } -+ -+ ret = pgp_generate_fingerprint(ctx, &pgp, key); -+ if (ret < 0) -+ goto cleanup; -+ -+ /* We're pinning the module by being linked against it */ -+ __module_get(public_key_crypto_key_subtype.owner); -+ ctx->subtype = &public_key_crypto_key_subtype; -+ ctx->payload = key; -+ kleave(" = 0 [use]"); -+ return 0; -+ -+cleanup_nomem: -+ ret = -ENOMEM; -+ goto cleanup; -+cleanup_badmsg: -+ ret = -EBADMSG; -+cleanup: -+ pr_devel("cleanup"); -+ if (key) { -+ for (i = 0; i < ARRAY_SIZE(key->mpi); i++) -+ mpi_free(key->mpi[i]); -+ kfree(key); -+ } -+ kleave(" = %d", ret); -+ return ret; -+} -+ -+/* -+ * Attempt to parse the instantiation data blob for a key as a PGP packet -+ * message holding a key. -+ */ -+static int pgp_key_instantiate(struct key *key, -+ const void *data, size_t datalen) -+{ -+ struct pgp_key_data_parse_context ctx; -+ int ret; -+ -+ kenter(""); -+ -+ ret = key_payload_reserve(key, datalen); -+ if (ret < 0) -+ return ret; -+ -+ ctx.pgp.types_of_interest = -+ (1 << PGP_PKT_PUBLIC_KEY) | (1 << PGP_PKT_PUBLIC_SUBKEY); -+ ctx.pgp.process_packet = pgp_process_public_key; -+ ctx.subtype = NULL; -+ ctx.fingerprint = NULL; -+ ctx.payload = NULL; -+ -+ ret = pgp_parse_packets(data, datalen, &ctx.pgp); -+ if (ret < 0) { -+ if (ctx.payload) -+ ctx.subtype->destroy(ctx.payload); -+ if (ctx.subtype) -+ module_put(ctx.subtype->owner); -+ kfree(ctx.fingerprint); -+ key_payload_reserve(key, 0); -+ return ret; -+ } -+ -+ key->type_data.p[0] = ctx.subtype; -+ key->type_data.p[1] = ctx.fingerprint; -+ key->payload.data = ctx.payload; -+ return 0; -+} -+ -+static struct crypto_key_parser pgp_key_parser = { -+ .owner = THIS_MODULE, -+ .name = "pgp", -+ .instantiate = pgp_key_instantiate, -+}; -+ -+/* -+ * Module stuff -+ */ -+static int __init pgp_key_init(void) -+{ -+ return register_crypto_key_parser(&pgp_key_parser); -+} -+ -+static void __exit pgp_key_exit(void) -+{ -+ unregister_crypto_key_parser(&pgp_key_parser); -+} -+ -+module_init(pgp_key_init); -+module_exit(pgp_key_exit); --- -1.7.10.4 - - -From 14191eaae2f9ccba2563a4bf9c30ffcbf153f521 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:22:19 +0100 -Subject: [PATCH 12/27] KEYS: PGP-based public key signature verification - -Provide handlers for PGP-based public-key algorithm signature verification. -This does most of the work involved in signature verification as most of it is -public-key algorithm agnostic. The public-key verification algorithm itself -is just the last little bit and is supplied the complete hash data to process. - -This requires glue logic putting on top to make use of it - something the next -patch provides. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/Makefile | 3 +- - security/keys/crypto/pgp_parser.h | 6 + - security/keys/crypto/pgp_sig_verify.c | 325 +++++++++++++++++++++++++++++++++ - 3 files changed, 333 insertions(+), 1 deletion(-) - create mode 100644 security/keys/crypto/pgp_sig_verify.c - -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 35733fc..0c8b8a1 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -11,4 +11,5 @@ obj-$(CONFIG_PGP_LIBRARY) += pgp_library.o - - obj-$(CONFIG_CRYPTO_KEY_PGP_PARSER) += pgp_key_parser.o - pgp_key_parser-y := \ -- pgp_public_key.o -+ pgp_public_key.o \ -+ pgp_sig_verify.o -diff --git a/security/keys/crypto/pgp_parser.h b/security/keys/crypto/pgp_parser.h -index 1cda231..a6192ce 100644 ---- a/security/keys/crypto/pgp_parser.h -+++ b/security/keys/crypto/pgp_parser.h -@@ -21,3 +21,9 @@ - */ - extern const - struct public_key_algorithm *pgp_public_key_algorithms[PGP_PUBKEY__LAST]; -+ -+/* -+ * pgp_pubkey_sig.c -+ */ -+extern struct crypto_key_verify_context *pgp_pkey_verify_sig_begin( -+ struct key *crypto_key, const u8 *sigdata, size_t siglen); -diff --git a/security/keys/crypto/pgp_sig_verify.c b/security/keys/crypto/pgp_sig_verify.c -new file mode 100644 -index 0000000..82c89da ---- /dev/null -+++ b/security/keys/crypto/pgp_sig_verify.c -@@ -0,0 +1,325 @@ -+/* PGP public key signature verification [RFC 4880] -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "PGPSIG: "fmt -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/slab.h> -+#include <linux/pgplib.h> -+#include <linux/err.h> -+#include "public_key.h" -+#include "pgp_parser.h" -+ -+static const struct { -+ enum pkey_hash_algo algo : 8; -+} pgp_pubkey_hash[PGP_HASH__LAST] = { -+ [PGP_HASH_MD5].algo = PKEY_HASH_MD5, -+ [PGP_HASH_SHA1].algo = PKEY_HASH_SHA1, -+ [PGP_HASH_RIPE_MD_160].algo = PKEY_HASH_RIPE_MD_160, -+ [PGP_HASH_SHA256].algo = PKEY_HASH_SHA256, -+ [PGP_HASH_SHA384].algo = PKEY_HASH_SHA384, -+ [PGP_HASH_SHA512].algo = PKEY_HASH_SHA512, -+ [PGP_HASH_SHA224].algo = PKEY_HASH_SHA224, -+}; -+ -+static int pgp_pkey_verify_sig_add_data(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen); -+static int pgp_pkey_verify_sig_end(struct crypto_key_verify_context *ctx, -+ const u8 *sig, size_t siglen); -+static void pgp_pkey_verify_sig_cancel(struct crypto_key_verify_context *ctx); -+ -+struct pgp_pkey_sig_parse_context { -+ struct pgp_parse_context pgp; -+ struct pgp_sig_parameters params; -+}; -+ -+static int pgp_pkey_parse_signature(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, -+ u8 headerlen, -+ const u8 *data, -+ size_t datalen) -+{ -+ struct pgp_pkey_sig_parse_context *ctx = -+ container_of(context, struct pgp_pkey_sig_parse_context, pgp); -+ -+ return pgp_parse_sig_params(&data, &datalen, &ctx->params); -+} -+ -+/* -+ * Begin the process of verifying a DSA signature. -+ * -+ * This involves allocating the hash into which first the data and then the -+ * metadata will be put, and parsing the signature to check that it matches the -+ * key. -+ */ -+struct crypto_key_verify_context *pgp_pkey_verify_sig_begin( -+ struct key *crypto_key, const u8 *sigdata, size_t siglen) -+{ -+ struct pgp_pkey_sig_parse_context p; -+ struct public_key_signature *sig; -+ struct crypto_shash *tfm; -+ const struct public_key *key = crypto_key->payload.data; -+ size_t digest_size, desc_size; -+ int ret; -+ -+ kenter("{%d},,%zu", key_serial(crypto_key), siglen); -+ -+ if (!key) { -+ kleave(" = -ENOKEY [no public key]"); -+ return ERR_PTR(-ENOKEY); -+ } -+ -+ p.pgp.types_of_interest = (1 << PGP_PKT_SIGNATURE); -+ p.pgp.process_packet = pgp_pkey_parse_signature; -+ ret = pgp_parse_packets(sigdata, siglen, &p.pgp); -+ if (ret < 0) -+ return ERR_PTR(ret); -+ -+ if (p.params.pubkey_algo >= PGP_PUBKEY__LAST || -+ !pgp_public_key_algorithms[p.params.pubkey_algo]) { -+ pr_debug("Unsupported public key algorithm %u\n", -+ p.params.pubkey_algo); -+ return ERR_PTR(-ENOPKG); -+ } -+ -+ if (pgp_public_key_algorithms[p.params.pubkey_algo] != key->algo) { -+ kleave(" = -EKEYREJECTED [wrong pk algo]"); -+ return ERR_PTR(-EKEYREJECTED); -+ } -+ -+ if (!(key->capabilities & PKEY_CAN_VERIFY)) { -+ kleave(" = -EKEYREJECTED [key can't verify]"); -+ return ERR_PTR(-EKEYREJECTED); -+ } -+ -+ if (p.params.hash_algo >= PGP_HASH__LAST || -+ !pgp_hash_algorithms[p.params.hash_algo]) { -+ pr_debug("Unsupported hash algorithm %u\n", -+ p.params.hash_algo); -+ return ERR_PTR(-ENOPKG); -+ } -+ -+ pr_debug("Signature generated with %s hash\n", -+ pgp_hash_algorithms[p.params.hash_algo]); -+ -+ if (memcmp(&p.params.issuer, key->key_id, 8) != 0) { -+ kleave(" = -ENOKEY [wrong key ID]"); -+ return ERR_PTR(-ENOKEY); -+ } -+ -+ if (p.params.signature_type != PGP_SIG_BINARY_DOCUMENT_SIG && -+ p.params.signature_type != PGP_SIG_STANDALONE_SIG) { -+ /* We don't want to canonicalise */ -+ kleave(" = -EOPNOTSUPP [canon]"); -+ return ERR_PTR(-EOPNOTSUPP); -+ } -+ -+ /* Allocate the hashing algorithm we're going to need and find out how -+ * big the hash operational data will be. -+ */ -+ tfm = crypto_alloc_shash(pgp_hash_algorithms[p.params.hash_algo], 0, 0); -+ if (IS_ERR(tfm)) -+ return PTR_ERR(tfm) == -ENOENT ? -+ ERR_PTR(-ENOPKG) : ERR_CAST(tfm); -+ -+ desc_size = crypto_shash_descsize(tfm); -+ digest_size = crypto_shash_digestsize(tfm); -+ -+ /* We allocate the hash operational data storage on the end of our -+ * context data. -+ */ -+ sig = kzalloc(sizeof(*sig) + desc_size + digest_size, GFP_KERNEL); -+ if (!sig) { -+ crypto_free_shash(tfm); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ sig->base.key = crypto_key; -+ sig->base.add_data = pgp_pkey_verify_sig_add_data; -+ sig->base.end = pgp_pkey_verify_sig_end; -+ sig->base.cancel = pgp_pkey_verify_sig_cancel; -+ sig->pkey_hash_algo = pgp_pubkey_hash[p.params.hash_algo].algo; -+ sig->digest = (u8 *)sig + sizeof(*sig) + desc_size; -+ sig->digest_size = digest_size; -+ sig->hash.tfm = tfm; -+ sig->hash.flags = CRYPTO_TFM_REQ_MAY_SLEEP; -+ -+ ret = crypto_shash_init(&sig->hash); -+ if (ret < 0) { -+ crypto_free_shash(sig->hash.tfm); -+ kfree(sig); -+ return ERR_PTR(ret); -+ } -+ -+ key_get(sig->base.key); -+ kleave(" = %p", sig); -+ return &sig->base; -+} -+ -+/* -+ * Load data into the hash -+ */ -+static int pgp_pkey_verify_sig_add_data(struct crypto_key_verify_context *ctx, -+ const void *data, size_t datalen) -+{ -+ struct public_key_signature *sig = -+ container_of(ctx, struct public_key_signature, base); -+ -+ return crypto_shash_update(&sig->hash, data, datalen); -+} -+ -+struct pgp_pkey_sig_digest_context { -+ struct pgp_parse_context pgp; -+ const struct public_key *key; -+ struct public_key_signature *sig; -+}; -+ -+/* -+ * Extract required metadata from the signature packet and add what we need to -+ * to the hash. -+ */ -+static int pgp_pkey_digest_signature(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, -+ u8 headerlen, -+ const u8 *data, -+ size_t datalen) -+{ -+ struct pgp_pkey_sig_digest_context *ctx = -+ container_of(context, struct pgp_pkey_sig_digest_context, pgp); -+ enum pgp_signature_version version; -+ int i; -+ -+ kenter(",%u,%u,,%zu", type, headerlen, datalen); -+ -+ version = *data; -+ if (version == PGP_SIG_VERSION_3) { -+ /* We just include an excerpt of the metadata from a V3 -+ * signature. -+ */ -+ crypto_shash_update(&ctx->sig->hash, data + 1, 5); -+ data += sizeof(struct pgp_signature_v3_packet); -+ datalen -= sizeof(struct pgp_signature_v3_packet); -+ } else if (version == PGP_SIG_VERSION_4) { -+ /* We add the whole metadata header and some of the hashed data -+ * for a V4 signature, plus a trailer. -+ */ -+ size_t hashedsz, unhashedsz; -+ u8 trailer[6]; -+ -+ hashedsz = 4 + 2 + (data[4] << 8) + data[5]; -+ crypto_shash_update(&ctx->sig->hash, data, hashedsz); -+ -+ trailer[0] = version; -+ trailer[1] = 0xffU; -+ trailer[2] = hashedsz >> 24; -+ trailer[3] = hashedsz >> 16; -+ trailer[4] = hashedsz >> 8; -+ trailer[5] = hashedsz; -+ -+ crypto_shash_update(&ctx->sig->hash, trailer, 6); -+ data += hashedsz; -+ datalen -= hashedsz; -+ -+ unhashedsz = 2 + (data[0] << 8) + data[1]; -+ data += unhashedsz; -+ datalen -= unhashedsz; -+ } -+ -+ if (datalen <= 2) { -+ kleave(" = -EBADMSG"); -+ return -EBADMSG; -+ } -+ -+ /* There's a quick check on the hash available. */ -+ ctx->sig->signed_hash_msw[0] = *data++; -+ ctx->sig->signed_hash_msw[1] = *data++; -+ datalen -= 2; -+ -+ /* And then the cryptographic data, which we'll need for the -+ * algorithm. -+ */ -+ for (i = 0; i < ctx->key->algo->n_sig_mpi; i++) { -+ unsigned int remaining = datalen; -+ if (remaining == 0) { -+ pr_debug("short %zu mpi %d\n", datalen, i); -+ return -EBADMSG; -+ } -+ ctx->sig->mpi[i] = mpi_read_from_buffer(data, &remaining); -+ if (!ctx->sig->mpi[i]) -+ return -ENOMEM; -+ data += remaining; -+ datalen -= remaining; -+ } -+ -+ if (datalen != 0) { -+ kleave(" = -EBADMSG [trailer %zu]", datalen); -+ return -EBADMSG; -+ } -+ -+ kleave(" = 0"); -+ return 0; -+} -+ -+/* -+ * The data is now all loaded into the hash; load the metadata, finalise the -+ * hash and perform the verification step. -+ */ -+static int pgp_pkey_verify_sig_end(struct crypto_key_verify_context *ctx, -+ const u8 *sigdata, size_t siglen) -+{ -+ struct public_key_signature *sig = -+ container_of(ctx, struct public_key_signature, base); -+ const struct public_key *key = sig->base.key->payload.data; -+ struct pgp_pkey_sig_digest_context p; -+ int ret; -+ -+ kenter(""); -+ -+ /* Firstly we add metadata, starting with some of the data from the -+ * signature packet */ -+ p.pgp.types_of_interest = (1 << PGP_PKT_SIGNATURE); -+ p.pgp.process_packet = pgp_pkey_digest_signature; -+ p.key = key; -+ p.sig = sig; -+ ret = pgp_parse_packets(sigdata, siglen, &p.pgp); -+ if (ret < 0) -+ goto error_free_ctx; -+ -+ crypto_shash_final(&sig->hash, sig->digest); -+ -+ ret = key->algo->verify(key, sig); -+ -+error_free_ctx: -+ pgp_pkey_verify_sig_cancel(ctx); -+ kleave(" = %d", ret); -+ return ret; -+} -+ -+/* -+ * Cancel an in-progress data loading -+ */ -+static void pgp_pkey_verify_sig_cancel(struct crypto_key_verify_context *ctx) -+{ -+ struct public_key_signature *sig = -+ container_of(ctx, struct public_key_signature, base); -+ int i; -+ -+ kenter(""); -+ -+ /* !!! Do we need to tell the crypto layer to cancel too? */ -+ crypto_free_shash(sig->hash.tfm); -+ key_put(sig->base.key); -+ for (i = 0; i < ARRAY_SIZE(sig->mpi); i++) -+ mpi_free(sig->mpi[i]); -+ kfree(sig); -+ -+ kleave(""); -+} --- -1.7.10.4 - - -From 3ca6d54c9bbd0633b7f8e1b033c7d8b2ebe85489 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:22:40 +0100 -Subject: [PATCH 13/27] KEYS: PGP format signature parser - -Implement a signature parser that will attempt to parse a signature blob as a -PGP packet format message. If it can, it will find an appropriate crypto key -and set the public-key algorithm according to the data in the signature. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - security/keys/crypto/Makefile | 1 + - security/keys/crypto/pgp_parser.h | 6 ++ - security/keys/crypto/pgp_public_key.c | 1 + - security/keys/crypto/pgp_sig_parser.c | 114 +++++++++++++++++++++++++++++++++ - 4 files changed, 122 insertions(+) - create mode 100644 security/keys/crypto/pgp_sig_parser.c - -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index 0c8b8a1..a9a34c6 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -12,4 +12,5 @@ obj-$(CONFIG_PGP_LIBRARY) += pgp_library.o - obj-$(CONFIG_CRYPTO_KEY_PGP_PARSER) += pgp_key_parser.o - pgp_key_parser-y := \ - pgp_public_key.o \ -+ pgp_sig_parser.o \ - pgp_sig_verify.o -diff --git a/security/keys/crypto/pgp_parser.h b/security/keys/crypto/pgp_parser.h -index a6192ce..73c900e 100644 ---- a/security/keys/crypto/pgp_parser.h -+++ b/security/keys/crypto/pgp_parser.h -@@ -23,6 +23,12 @@ extern const - struct public_key_algorithm *pgp_public_key_algorithms[PGP_PUBKEY__LAST]; - - /* -+ * pgp_sig_parser.c -+ */ -+extern struct crypto_key_verify_context *pgp_verify_sig_begin( -+ struct key *keyring, const u8 *sig, size_t siglen); -+ -+/* - * pgp_pubkey_sig.c - */ - extern struct crypto_key_verify_context *pgp_pkey_verify_sig_begin( -diff --git a/security/keys/crypto/pgp_public_key.c b/security/keys/crypto/pgp_public_key.c -index 8a8b7c0..5ab926d 100644 ---- a/security/keys/crypto/pgp_public_key.c -+++ b/security/keys/crypto/pgp_public_key.c -@@ -329,6 +329,7 @@ static struct crypto_key_parser pgp_key_parser = { - .owner = THIS_MODULE, - .name = "pgp", - .instantiate = pgp_key_instantiate, -+ .verify_sig_begin = pgp_verify_sig_begin, - }; - - /* -diff --git a/security/keys/crypto/pgp_sig_parser.c b/security/keys/crypto/pgp_sig_parser.c -new file mode 100644 -index 0000000..f5feb2b ---- /dev/null -+++ b/security/keys/crypto/pgp_sig_parser.c -@@ -0,0 +1,114 @@ -+/* Handling for PGP public key signature data [RFC 4880] -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "PGPSIG: "fmt -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/pgplib.h> -+#include <linux/err.h> -+#include "public_key.h" -+#include "pgp_parser.h" -+ -+struct PGP_sig_parse_context { -+ struct pgp_parse_context pgp; -+ struct pgp_sig_parameters params; -+ bool found_sig; -+}; -+ -+/* -+ * Look inside signature sections for a key ID -+ */ -+static int pgp_process_signature(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, -+ u8 headerlen, -+ const u8 *data, -+ size_t datalen) -+{ -+ struct PGP_sig_parse_context *ctx = -+ container_of(context, struct PGP_sig_parse_context, pgp); -+ -+ ctx->found_sig = true; -+ return pgp_parse_sig_params(&data, &datalen, &ctx->params); -+} -+ -+/* -+ * Attempt to find a key to use for PGP signature verification, starting off by -+ * looking in the supplied keyring. -+ * -+ * The function may also look for other key sources such as a TPM. If an -+ * alternative key is found it can be added to the keyring for future -+ * reference. -+ */ -+static struct key *find_key_for_pgp_sig(struct key *keyring, -+ const u8 *sig, size_t siglen) -+{ -+ struct PGP_sig_parse_context p; -+ key_ref_t key; -+ char criterion[3 + 8 * 2 + 1]; -+ int ret; -+ -+ if (!keyring) -+ return ERR_PTR(-ENOKEY); -+ -+ /* Need to find the key ID */ -+ p.pgp.types_of_interest = (1 << PGP_PKT_SIGNATURE); -+ p.pgp.process_packet = pgp_process_signature; -+ p.found_sig = false; -+ ret = pgp_parse_packets(sig, siglen, &p.pgp); -+ if (ret < 0) -+ return ERR_PTR(ret); -+ -+ if (!p.found_sig) -+ return ERR_PTR(-ENOMSG); -+ -+ sprintf(criterion, "id:%08x%08x", -+ be32_to_cpu(p.params.issuer32[0]), -+ be32_to_cpu(p.params.issuer32[1])); -+ -+ pr_debug("Look up: %s\n", criterion); -+ -+ key = keyring_search(make_key_ref(keyring, 1), -+ &key_type_crypto, criterion); -+ if (IS_ERR(key)) { -+ switch (PTR_ERR(key)) { -+ /* Hide some search errors */ -+ case -EACCES: -+ case -ENOTDIR: -+ case -EAGAIN: -+ return ERR_PTR(-ENOKEY); -+ default: -+ return ERR_CAST(key); -+ } -+ } -+ -+ pr_debug("Found key %x\n", key_serial(key_ref_to_ptr(key))); -+ return key_ref_to_ptr(key); -+} -+ -+/* -+ * Attempt to parse a signature as a PGP packet format blob and find a -+ * matching key. -+ */ -+struct crypto_key_verify_context *pgp_verify_sig_begin( -+ struct key *keyring, const u8 *sig, size_t siglen) -+{ -+ struct crypto_key_verify_context *ctx; -+ struct key *key; -+ -+ key = find_key_for_pgp_sig(keyring, sig, siglen); -+ if (IS_ERR(key)) -+ return ERR_CAST(key); -+ -+ /* We only handle in-kernel public key signatures for the moment */ -+ ctx = pgp_pkey_verify_sig_begin(key, sig, siglen); -+ key_put(key); -+ return ctx; -+} --- -1.7.10.4 - - -From 30a028f485bd476ef3ad73fbb042a55b4851c966 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:22:59 +0100 -Subject: [PATCH 14/27] KEYS: Provide a function to load keys from a PGP - keyring blob - -Provide a function to load keys from a PGP keyring blob for use in initialising -the module signing key keyring: - - int load_PGP_keys(const u8 *pgpdata, size_t pgpdatalen, - struct key *keyring, const char *descprefix); - -The keys are labelled with descprefix plus a number to uniquify them. The keys -will actually be identified by the ID calculated from the PGP data rather than -by the description, so this shouldn't be a problem. - -The keys are attached to the keyring supplied. - -Looking as root in /proc/keys after the module signing keyring has been loaded: - -24460d1c I----- 1 perm 3f010000 0 0 crypto modsign.0: dsa 5acc2142 [] -3ca85723 I----- 1 perm 1f010000 0 0 keyring .module_sign: 1/4 - -Thanks to Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> for some pointing -out some errors. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - Documentation/security/keys-crypto.txt | 20 +++++++ - include/keys/crypto-type.h | 3 + - security/keys/crypto/Kconfig | 9 +++ - security/keys/crypto/Makefile | 1 + - security/keys/crypto/pgp_preload.c | 96 ++++++++++++++++++++++++++++++++ - 5 files changed, 129 insertions(+) - create mode 100644 security/keys/crypto/pgp_preload.c - -diff --git a/Documentation/security/keys-crypto.txt b/Documentation/security/keys-crypto.txt -index a964717..ba2ab55 100644 ---- a/Documentation/security/keys-crypto.txt -+++ b/Documentation/security/keys-crypto.txt -@@ -10,6 +10,7 @@ Contents: - - Signature verification. - - Implementing crypto parsers. - - Implementing crypto subtypes. -+ - Initial PGP key preloading. - - - ======== -@@ -280,3 +281,22 @@ There are a number of operations defined by the subtype: - Mandatory. This should free the memory associated with the key. The - crypto key will look after freeing the fingerprint and releasing the - reference on the subtype module. -+ -+ -+======================= -+INITIAL PGP KEY LOADING -+======================= -+ -+A function is provided to perform an initial load of a set of public keys bound -+into a PGP packet format blob: -+ -+ int preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen, -+ struct key *keyring, const char *descprefix); -+ -+This takes the blob of data defined by pgpdata and pgpdatalen, extracts keys -+from them and adds them to the specified keyring. The keys are labelled with -+descprefix plus a simple uniquifier - it is not expected that the description -+will be used to identify the key. The description is required to prevent all -+but the last key being discarded when the keys are linked into the keyring. -+ -+This function is only available during initial kernel set up. -diff --git a/include/keys/crypto-type.h b/include/keys/crypto-type.h -index 6b93366..710e77f 100644 ---- a/include/keys/crypto-type.h -+++ b/include/keys/crypto-type.h -@@ -31,4 +31,7 @@ extern void verify_sig_cancel(struct crypto_key_verify_context *ctx); - * The payload is at the discretion of the subtype. - */ - -+extern __init int preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen, -+ struct key *keyring, const char *descprefix); -+ - #endif /* _KEYS_CRYPTO_TYPE_H */ -diff --git a/security/keys/crypto/Kconfig b/security/keys/crypto/Kconfig -index 1c2ae55..8af0155 100644 ---- a/security/keys/crypto/Kconfig -+++ b/security/keys/crypto/Kconfig -@@ -40,3 +40,12 @@ config CRYPTO_KEY_PGP_PARSER - This option provides support for parsing PGP (RFC 4880) format blobs - for key data and provides the ability to instantiate a crypto key - from a public key packet found inside the blob. -+ -+config PGP_PRELOAD -+ bool "PGP public key preloading facility" -+ select PGP_LIBRARY -+ select CRYPTO_KEY_PGP_PARSER -+ help -+ This option provides a facility for the kernel to preload PGP-wrapped -+ bundles of keys during boot. It is used by module signing to load -+ the module signing keys for example. -diff --git a/security/keys/crypto/Makefile b/security/keys/crypto/Makefile -index a9a34c6..c873674 100644 ---- a/security/keys/crypto/Makefile -+++ b/security/keys/crypto/Makefile -@@ -8,6 +8,7 @@ crypto_keys-y := crypto_type.o crypto_verify.o - obj-$(CONFIG_CRYPTO_KEY_PUBLIC_KEY_SUBTYPE) += public_key.o - obj-$(CONFIG_CRYPTO_KEY_PKEY_ALGO_RSA) += crypto_rsa.o - obj-$(CONFIG_PGP_LIBRARY) += pgp_library.o -+obj-$(CONFIG_PGP_PRELOAD) += pgp_preload.o - - obj-$(CONFIG_CRYPTO_KEY_PGP_PARSER) += pgp_key_parser.o - pgp_key_parser-y := \ -diff --git a/security/keys/crypto/pgp_preload.c b/security/keys/crypto/pgp_preload.c -new file mode 100644 -index 0000000..9028788 ---- /dev/null -+++ b/security/keys/crypto/pgp_preload.c -@@ -0,0 +1,96 @@ -+/* Cryptographic key request handling -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ * -+ * See Documentation/security/keys-crypto.txt -+ */ -+ -+#include <linux/module.h> -+#include <linux/key.h> -+#include <linux/pgplib.h> -+#include <linux/err.h> -+#include <keys/crypto-type.h> -+#include "crypto_keys.h" -+ -+struct preload_pgp_keys_context { -+ struct pgp_parse_context pgp; -+ key_ref_t keyring; -+ char descbuf[20]; -+ u8 key_n; -+ u8 dsize; -+}; -+ -+/* -+ * Extract a public key or subkey from the PGP stream. -+ */ -+static int __init found_pgp_key(struct pgp_parse_context *context, -+ enum pgp_packet_tag type, u8 headerlen, -+ const u8 *data, size_t datalen) -+{ -+ struct preload_pgp_keys_context *ctx = -+ container_of(context, struct preload_pgp_keys_context, pgp); -+ key_ref_t key; -+ -+ if (ctx->key_n >= 255) -+ return 0; /* Don't overrun descbuf */ -+ -+ sprintf(ctx->descbuf + ctx->dsize, "%d", ctx->key_n++); -+ -+ key = key_create_or_update(ctx->keyring, "crypto", ctx->descbuf, -+ data - headerlen, datalen + headerlen, -+ KEY_POS_ALL | KEY_USR_VIEW, -+ KEY_ALLOC_NOT_IN_QUOTA); -+ -+ if (IS_ERR(key)) -+ return PTR_ERR(key); -+ -+ pr_notice("Loaded %s key: %s\n", -+ key_ref_to_ptr(key)->description, -+ crypto_key_id(key_ref_to_ptr(key))); -+ -+ key_ref_put(key); -+ return 0; -+} -+ -+/** -+ * preload_pgp_keys - Load keys from a PGP keyring blob -+ * @pgpdata: The PGP keyring blob containing the keys. -+ * @pgpdatalen: The size of the @pgpdata blob. -+ * @keyring: The keyring to add the new keys to. -+ * @descprefix: The key description prefix. -+ * -+ * Preload a pack of keys from a PGP keyring blob. -+ * -+ * The keys are given description of @descprefix + the number of the key in the -+ * list. Since keys can be matched on their key IDs independently of the key -+ * description, the description is mostly irrelevant apart from the fact that -+ * keys of the same description displace one another from a keyring. -+ * -+ * The caller should override the current creds if they want the keys to be -+ * owned by someone other than the current process's owner. Keys will not be -+ * accounted towards the owner's quota. -+ * -+ * This function may only be called whilst the kernel is booting. -+ */ -+int __init preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen, -+ struct key *keyring, const char *descprefix) -+{ -+ struct preload_pgp_keys_context ctx; -+ -+ ctx.pgp.types_of_interest = -+ (1 << PGP_PKT_PUBLIC_KEY) | (1 << PGP_PKT_PUBLIC_SUBKEY); -+ ctx.pgp.process_packet = found_pgp_key; -+ ctx.keyring = make_key_ref(keyring, 1); -+ ctx.key_n = 0; -+ ctx.dsize = strlen(descprefix); -+ BUG_ON(ctx.dsize > sizeof(ctx.descbuf) - 4); -+ strcpy(ctx.descbuf, descprefix); -+ -+ return pgp_parse_packets(pgpdata, pgpdatalen, &ctx.pgp); -+} --- -1.7.10.4 - - -From 13b8bd0afb58d1000c74741f176862efb6d1bcc9 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:25:41 +0100 -Subject: [PATCH 15/27] Make most arch asm/module.h files use - asm-generic/module.h - -Use the mapping of Elf_[SPE]hdr, Elf_Addr, Elf_Sym, Elf_Dyn, Elf_Rel/Rela, -ELF_R_TYPE() and ELF_R_SYM() to either the 32-bit version or the 64-bit version -into asm-generic/module.h for all arches bar MIPS. - -Also, use the generic definition mod_arch_specific where possible. - -To this end, I've defined three new config bools: - - (*) HAVE_MOD_ARCH_SPECIFIC - - Arches define this if they don't want to use the empty generic - mod_arch_specific struct. - - (*) MODULES_USE_ELF_RELA - - Arches define this if their modules can contain RELA records. This causes - the Elf_Rela mapping to be emitted and allows apply_relocate_add() to be - defined by the arch rather than have the core emit an error message. - - (*) MODULES_USE_ELF_REL - - Arches define this if their modules can contain REL records. This causes - the Elf_Rel mapping to be emitted and allows apply_relocate() to be - defined by the arch rather than have the core emit an error message. - -Note that it is possible to allow both REL and RELA records: m68k and mips are -two arches that do this. - -With this, some arch asm/module.h files can be deleted entirely and replaced -with a generic-y marker in the arch Kbuild file. - -Additionally, I have removed the bits from m32r and score that handle the -unsupported type of relocation record as that's now handled centrally. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - arch/Kconfig | 19 +++++++++++++++++ - arch/alpha/Kconfig | 2 ++ - arch/alpha/include/asm/module.h | 10 ++------- - arch/arm/Kconfig | 2 ++ - arch/arm/include/asm/module.h | 8 ++------ - arch/avr32/Kconfig | 2 ++ - arch/avr32/include/asm/module.h | 6 ++---- - arch/blackfin/Kconfig | 2 ++ - arch/blackfin/include/asm/module.h | 4 +--- - arch/c6x/Kconfig | 1 + - arch/c6x/include/asm/module.h | 12 +---------- - arch/cris/Kconfig | 1 + - arch/cris/include/asm/Kbuild | 2 ++ - arch/cris/include/asm/module.h | 9 -------- - arch/frv/include/asm/module.h | 8 +------- - arch/h8300/Kconfig | 1 + - arch/h8300/include/asm/Kbuild | 2 ++ - arch/h8300/include/asm/module.h | 11 ---------- - arch/hexagon/Kconfig | 1 + - arch/ia64/Kconfig | 2 ++ - arch/ia64/include/asm/module.h | 6 ++---- - arch/m32r/Kconfig | 1 + - arch/m32r/include/asm/Kbuild | 2 ++ - arch/m32r/include/asm/module.h | 10 --------- - arch/m32r/kernel/module.c | 15 -------------- - arch/m68k/Kconfig | 3 +++ - arch/m68k/include/asm/module.h | 6 ++---- - arch/microblaze/Kconfig | 1 + - arch/mips/Kconfig | 3 +++ - arch/mips/include/asm/module.h | 10 +++++++-- - arch/mips/kernel/module.c | 2 ++ - arch/mn10300/Kconfig | 1 + - arch/mn10300/include/asm/module.h | 7 +------ - arch/openrisc/Kconfig | 1 + - arch/parisc/Kconfig | 2 ++ - arch/parisc/include/asm/module.h | 16 +++------------ - arch/powerpc/Kconfig | 2 ++ - arch/powerpc/include/asm/module.h | 7 +------ - arch/s390/Kconfig | 2 ++ - arch/s390/include/asm/module.h | 18 +++------------- - arch/score/Kconfig | 2 ++ - arch/score/include/asm/module.h | 6 +----- - arch/score/kernel/module.c | 10 --------- - arch/sh/Kconfig | 2 ++ - arch/sh/include/asm/module.h | 14 +++---------- - arch/sparc/Kconfig | 1 + - arch/sparc/include/asm/Kbuild | 1 + - arch/sparc/include/asm/module.h | 24 ---------------------- - arch/tile/Kconfig | 1 + - arch/unicore32/Kconfig | 1 + - arch/x86/Kconfig | 2 ++ - arch/xtensa/Kconfig | 1 + - arch/xtensa/include/asm/module.h | 9 +------- - include/asm-generic/module.h | 40 +++++++++++++++++++++++++++++------- - include/linux/moduleloader.h | 36 ++++++++++++++++++++++++++++---- - kernel/module.c | 20 ------------------ - 56 files changed, 167 insertions(+), 223 deletions(-) - delete mode 100644 arch/cris/include/asm/module.h - delete mode 100644 arch/h8300/include/asm/module.h - delete mode 100644 arch/m32r/include/asm/module.h - delete mode 100644 arch/sparc/include/asm/module.h - -diff --git a/arch/Kconfig b/arch/Kconfig -index 8c3d957..51acb02 100644 ---- a/arch/Kconfig -+++ b/arch/Kconfig -@@ -274,4 +274,23 @@ config SECCOMP_FILTER - - See Documentation/prctl/seccomp_filter.txt for details. - -+config HAVE_MOD_ARCH_SPECIFIC -+ bool -+ help -+ The arch uses struct mod_arch_specific to store data. Many arches -+ just need a simple module loader without arch specific data - those -+ should not enable this. -+ -+config MODULES_USE_ELF_RELA -+ bool -+ help -+ Modules only use ELF RELA relocations. Modules with ELF REL -+ relocations will give an error. -+ -+config MODULES_USE_ELF_REL -+ bool -+ help -+ Modules only use ELF REL relocations. Modules with ELF RELA -+ relocations will give an error. -+ - source "kernel/gcov/Kconfig" -diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig -index 3de74c9..6f580de 100644 ---- a/arch/alpha/Kconfig -+++ b/arch/alpha/Kconfig -@@ -17,6 +17,8 @@ config ALPHA - select ARCH_HAVE_NMI_SAFE_CMPXCHG - select GENERIC_SMP_IDLE_THREAD - select GENERIC_CMOS_UPDATE -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - help - The Alpha is a 64-bit general-purpose processor designed and - marketed by the Digital Equipment Corporation of blessed memory, -diff --git a/arch/alpha/include/asm/module.h b/arch/alpha/include/asm/module.h -index 7b63743..9cd13b5 100644 ---- a/arch/alpha/include/asm/module.h -+++ b/arch/alpha/include/asm/module.h -@@ -1,19 +1,13 @@ - #ifndef _ALPHA_MODULE_H - #define _ALPHA_MODULE_H - -+#include <asm-generic/module.h> -+ - struct mod_arch_specific - { - unsigned int gotsecindex; - }; - --#define Elf_Sym Elf64_Sym --#define Elf_Shdr Elf64_Shdr --#define Elf_Ehdr Elf64_Ehdr --#define Elf_Phdr Elf64_Phdr --#define Elf_Dyn Elf64_Dyn --#define Elf_Rel Elf64_Rel --#define Elf_Rela Elf64_Rela -- - #define ARCH_SHF_SMALL SHF_ALPHA_GPREL - - #ifdef MODULE -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index a91009c..af8bf36 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -45,6 +45,8 @@ config ARM - select GENERIC_SMP_IDLE_THREAD - select KTIME_SCALAR - select GENERIC_CLOCKEVENTS_BROADCAST if SMP -+ select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND -+ select MODULES_USE_ELF_REL - help - The ARM series is a line of low-power-consumption RISC chip designs - licensed by ARM Ltd and targeted at embedded applications and -diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h -index 6c6809f..0d3a28d 100644 ---- a/arch/arm/include/asm/module.h -+++ b/arch/arm/include/asm/module.h -@@ -1,9 +1,7 @@ - #ifndef _ASM_ARM_MODULE_H - #define _ASM_ARM_MODULE_H - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#include <asm-generic/module.h> - - struct unwind_table; - -@@ -16,13 +14,11 @@ enum { - ARM_SEC_DEVEXIT, - ARM_SEC_MAX, - }; --#endif - - struct mod_arch_specific { --#ifdef CONFIG_ARM_UNWIND - struct unwind_table *unwind[ARM_SEC_MAX]; --#endif - }; -+#endif - - /* - * Add the ARM architecture version to the version magic string -diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig -index 71d38c7..2779913 100644 ---- a/arch/avr32/Kconfig -+++ b/arch/avr32/Kconfig -@@ -14,6 +14,8 @@ config AVR32 - select ARCH_HAVE_CUSTOM_GPIO_H - select ARCH_HAVE_NMI_SAFE_CMPXCHG - select GENERIC_CLOCKEVENTS -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - help - AVR32 is a high-performance 32-bit RISC microprocessor core, - designed for cost-sensitive embedded applications, with particular -diff --git a/arch/avr32/include/asm/module.h b/arch/avr32/include/asm/module.h -index 4514445..3f083d3 100644 ---- a/arch/avr32/include/asm/module.h -+++ b/arch/avr32/include/asm/module.h -@@ -1,6 +1,8 @@ - #ifndef __ASM_AVR32_MODULE_H - #define __ASM_AVR32_MODULE_H - -+#include <asm-generic/module.h> -+ - struct mod_arch_syminfo { - unsigned long got_offset; - int got_initialized; -@@ -17,10 +19,6 @@ struct mod_arch_specific { - struct mod_arch_syminfo *syminfo; - }; - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -- - #define MODULE_PROC_FAMILY "AVR32v1" - - #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY -diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig -index fef96f4..b8a7bc9 100644 ---- a/arch/blackfin/Kconfig -+++ b/arch/blackfin/Kconfig -@@ -40,6 +40,8 @@ config BLACKFIN - select HAVE_NMI_WATCHDOG if NMI_WATCHDOG - select GENERIC_SMP_IDLE_THREAD - select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - - config GENERIC_CSUM - def_bool y -diff --git a/arch/blackfin/include/asm/module.h b/arch/blackfin/include/asm/module.h -index ed5689b..231a149 100644 ---- a/arch/blackfin/include/asm/module.h -+++ b/arch/blackfin/include/asm/module.h -@@ -7,9 +7,7 @@ - #ifndef _ASM_BFIN_MODULE_H - #define _ASM_BFIN_MODULE_H - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#include <asm-generic/module.h> - - struct mod_arch_specific { - Elf_Shdr *text_l1; -diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig -index 052f81a..8f3a304 100644 ---- a/arch/c6x/Kconfig -+++ b/arch/c6x/Kconfig -@@ -16,6 +16,7 @@ config C6X - select OF - select OF_EARLY_FLATTREE - select GENERIC_CLOCKEVENTS -+ select MODULES_USE_ELF_RELA - - config MMU - def_bool n -diff --git a/arch/c6x/include/asm/module.h b/arch/c6x/include/asm/module.h -index a453f97..5c7269c 100644 ---- a/arch/c6x/include/asm/module.h -+++ b/arch/c6x/include/asm/module.h -@@ -13,17 +13,7 @@ - #ifndef _ASM_C6X_MODULE_H - #define _ASM_C6X_MODULE_H - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr --#define Elf_Addr Elf32_Addr --#define Elf_Word Elf32_Word -- --/* -- * This file contains the C6x architecture specific module code. -- */ --struct mod_arch_specific { --}; -+#include <asm-generic/module.h> - - struct loaded_sections { - unsigned int new_vaddr; -diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig -index bb34465..45782c7 100644 ---- a/arch/cris/Kconfig -+++ b/arch/cris/Kconfig -@@ -46,6 +46,7 @@ config CRIS - select GENERIC_IOMAP - select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 - select GENERIC_CMOS_UPDATE -+ select MODULES_USE_ELF_RELA - - config HZ - int -diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild -index 04d02a5..28b690d 100644 ---- a/arch/cris/include/asm/Kbuild -+++ b/arch/cris/include/asm/Kbuild -@@ -7,3 +7,5 @@ header-y += ethernet.h - header-y += etraxgpio.h - header-y += rs485.h - header-y += sync_serial.h -+ -+generic-y += module.h -diff --git a/arch/cris/include/asm/module.h b/arch/cris/include/asm/module.h -deleted file mode 100644 -index 7ee7231..0000000 ---- a/arch/cris/include/asm/module.h -+++ /dev/null -@@ -1,9 +0,0 @@ --#ifndef _ASM_CRIS_MODULE_H --#define _ASM_CRIS_MODULE_H --/* cris is simple */ --struct mod_arch_specific { }; -- --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr --#endif /* _ASM_CRIS_MODULE_H */ -diff --git a/arch/frv/include/asm/module.h b/arch/frv/include/asm/module.h -index 3d5c636..a8848f0 100644 ---- a/arch/frv/include/asm/module.h -+++ b/arch/frv/include/asm/module.h -@@ -11,13 +11,7 @@ - #ifndef _ASM_MODULE_H - #define _ASM_MODULE_H - --struct mod_arch_specific --{ --}; -- --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#include <asm-generic/module.h> - - /* - * Include the architecture version. -diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig -index 56e890d..9eaefdd 100644 ---- a/arch/h8300/Kconfig -+++ b/arch/h8300/Kconfig -@@ -5,6 +5,7 @@ config H8300 - select HAVE_GENERIC_HARDIRQS - select GENERIC_IRQ_SHOW - select GENERIC_CPU_DEVICES -+ select MODULES_USE_ELF_RELA - - config SYMBOL_PREFIX - string -diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild -index c68e168..871382d 100644 ---- a/arch/h8300/include/asm/Kbuild -+++ b/arch/h8300/include/asm/Kbuild -@@ -1 +1,3 @@ - include include/asm-generic/Kbuild.asm -+ -+generic-y += module.h -diff --git a/arch/h8300/include/asm/module.h b/arch/h8300/include/asm/module.h -deleted file mode 100644 -index 8e46724..0000000 ---- a/arch/h8300/include/asm/module.h -+++ /dev/null -@@ -1,11 +0,0 @@ --#ifndef _ASM_H8300_MODULE_H --#define _ASM_H8300_MODULE_H --/* -- * This file contains the H8/300 architecture specific module code. -- */ --struct mod_arch_specific { }; --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -- --#endif /* _ASM_H8/300_MODULE_H */ -diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig -index b2fdfb7..0744f7d 100644 ---- a/arch/hexagon/Kconfig -+++ b/arch/hexagon/Kconfig -@@ -30,6 +30,7 @@ config HEXAGON - select KTIME_SCALAR - select GENERIC_CLOCKEVENTS - select GENERIC_CLOCKEVENTS_BROADCAST -+ select MODULES_USE_ELF_RELA - ---help--- - Qualcomm Hexagon is a processor architecture designed for high - performance and low power across a wide variety of applications. -diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig -index 8186ec5..6f1b7b1 100644 ---- a/arch/ia64/Kconfig -+++ b/arch/ia64/Kconfig -@@ -39,6 +39,8 @@ config IA64 - select ARCH_THREAD_INFO_ALLOCATOR - select ARCH_CLOCKSOURCE_DATA - select GENERIC_TIME_VSYSCALL -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - default y - help - The Itanium Processor Family is Intel's 64-bit successor to -diff --git a/arch/ia64/include/asm/module.h b/arch/ia64/include/asm/module.h -index 908eaef..dfba22a 100644 ---- a/arch/ia64/include/asm/module.h -+++ b/arch/ia64/include/asm/module.h -@@ -1,6 +1,8 @@ - #ifndef _ASM_IA64_MODULE_H - #define _ASM_IA64_MODULE_H - -+#include <asm-generic/module.h> -+ - /* - * IA-64-specific support for kernel module loader. - * -@@ -29,10 +31,6 @@ struct mod_arch_specific { - unsigned int next_got_entry; /* index of next available got entry */ - }; - --#define Elf_Shdr Elf64_Shdr --#define Elf_Sym Elf64_Sym --#define Elf_Ehdr Elf64_Ehdr -- - #define MODULE_PROC_FAMILY "ia64" - #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY \ - "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) -diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig -index b638d5b..a30478e 100644 ---- a/arch/m32r/Kconfig -+++ b/arch/m32r/Kconfig -@@ -12,6 +12,7 @@ config M32R - select GENERIC_IRQ_SHOW - select GENERIC_ATOMIC64 - select ARCH_USES_GETTIMEOFFSET -+ select MODULES_USE_ELF_RELA - - config SBUS - bool -diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild -index c68e168..871382d 100644 ---- a/arch/m32r/include/asm/Kbuild -+++ b/arch/m32r/include/asm/Kbuild -@@ -1 +1,3 @@ - include include/asm-generic/Kbuild.asm -+ -+generic-y += module.h -diff --git a/arch/m32r/include/asm/module.h b/arch/m32r/include/asm/module.h -deleted file mode 100644 -index eb73ee0..0000000 ---- a/arch/m32r/include/asm/module.h -+++ /dev/null -@@ -1,10 +0,0 @@ --#ifndef _ASM_M32R_MODULE_H --#define _ASM_M32R_MODULE_H -- --struct mod_arch_specific { }; -- --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -- --#endif /* _ASM_M32R_MODULE_H */ -diff --git a/arch/m32r/kernel/module.c b/arch/m32r/kernel/module.c -index 3071fe8..38233b6 100644 ---- a/arch/m32r/kernel/module.c -+++ b/arch/m32r/kernel/module.c -@@ -201,18 +201,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, - } - return 0; - } -- --int apply_relocate(Elf32_Shdr *sechdrs, -- const char *strtab, -- unsigned int symindex, -- unsigned int relsec, -- struct module *me) --{ --#if 0 -- printk(KERN_ERR "module %s: REL RELOCATION unsupported\n", -- me->name); -- return -ENOEXEC; --#endif -- return 0; -- --} -diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig -index 1471201..3694301 100644 ---- a/arch/m68k/Kconfig -+++ b/arch/m68k/Kconfig -@@ -11,6 +11,9 @@ config M68K - select GENERIC_STRNLEN_USER if MMU - select FPU if MMU - select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_REL -+ select MODULES_USE_ELF_RELA - - config RWSEM_GENERIC_SPINLOCK - bool -diff --git a/arch/m68k/include/asm/module.h b/arch/m68k/include/asm/module.h -index edffe66..8b58fce 100644 ---- a/arch/m68k/include/asm/module.h -+++ b/arch/m68k/include/asm/module.h -@@ -1,6 +1,8 @@ - #ifndef _ASM_M68K_MODULE_H - #define _ASM_M68K_MODULE_H - -+#include <asm-generic/module.h> -+ - enum m68k_fixup_type { - m68k_fixup_memoffset, - m68k_fixup_vnode_shift, -@@ -36,8 +38,4 @@ struct module; - extern void module_fixup(struct module *mod, struct m68k_fixup_info *start, - struct m68k_fixup_info *end); - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -- - #endif /* _ASM_M68K_MODULE_H */ -diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig -index 0bf4423..ee395d3 100644 ---- a/arch/microblaze/Kconfig -+++ b/arch/microblaze/Kconfig -@@ -23,6 +23,7 @@ config MICROBLAZE - select GENERIC_CPU_DEVICES - select GENERIC_ATOMIC64 - select GENERIC_CLOCKEVENTS -+ select MODULES_USE_ELF_RELA - - config SWAP - def_bool n -diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig -index 09ab87e..2901b41 100644 ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -34,6 +34,9 @@ config MIPS - select BUILDTIME_EXTABLE_SORT - select GENERIC_CLOCKEVENTS - select GENERIC_CMOS_UPDATE -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_REL -+ select MODULES_USE_ELF_RELA if 64BIT - - menu "Machine selection" - -diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h -index 5300080..2c6a4f21 100644 ---- a/arch/mips/include/asm/module.h -+++ b/arch/mips/include/asm/module.h -@@ -34,11 +34,14 @@ typedef struct { - } Elf64_Mips_Rela; - - #ifdef CONFIG_32BIT -- - #define Elf_Shdr Elf32_Shdr - #define Elf_Sym Elf32_Sym - #define Elf_Ehdr Elf32_Ehdr - #define Elf_Addr Elf32_Addr -+#define Elf_Rel Elf32_Rel -+#define Elf_Rela Elf32_Rela -+#define ELF_R_TYPE(X) ELF32_R_TYPE(X) -+#define ELF_R_SYM(X) ELF32_R_SYM(X) - - #define Elf_Mips_Rel Elf32_Rel - #define Elf_Mips_Rela Elf32_Rela -@@ -49,11 +52,14 @@ typedef struct { - #endif - - #ifdef CONFIG_64BIT -- - #define Elf_Shdr Elf64_Shdr - #define Elf_Sym Elf64_Sym - #define Elf_Ehdr Elf64_Ehdr - #define Elf_Addr Elf64_Addr -+#define Elf_Rel Elf64_Rel -+#define Elf_Rela Elf64_Rela -+#define ELF_R_TYPE(X) ELF64_R_TYPE(X) -+#define ELF_R_SYM(X) ELF64_R_SYM(X) - - #define Elf_Mips_Rel Elf64_Mips_Rel - #define Elf_Mips_Rela Elf64_Mips_Rela -diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c -index a5066b1..1500c80 100644 ---- a/arch/mips/kernel/module.c -+++ b/arch/mips/kernel/module.c -@@ -299,6 +299,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, - return 0; - } - -+#ifdef CONFIG_MODULES_USE_ELF_RELA - int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, - unsigned int symindex, unsigned int relsec, - struct module *me) -@@ -338,6 +339,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, - - return 0; - } -+#endif - - /* Given an address, look for it in the module exception tables. */ - const struct exception_table_entry *search_module_dbetables(unsigned long addr) -diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig -index 687f9b4..f8fec1c 100644 ---- a/arch/mn10300/Kconfig -+++ b/arch/mn10300/Kconfig -@@ -7,6 +7,7 @@ config MN10300 - select HAVE_ARCH_KGDB - select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER - select GENERIC_CLOCKEVENTS -+ select MODULES_USE_ELF_RELA - - config AM33_2 - def_bool n -diff --git a/arch/mn10300/include/asm/module.h b/arch/mn10300/include/asm/module.h -index 5d7057d..6571103 100644 ---- a/arch/mn10300/include/asm/module.h -+++ b/arch/mn10300/include/asm/module.h -@@ -12,12 +12,7 @@ - #ifndef _ASM_MODULE_H - #define _ASM_MODULE_H - --struct mod_arch_specific { --}; -- --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#include <asm-generic/module.h> - - /* - * Include the MN10300 architecture version. -diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig -index 49765b5..05f2ba4 100644 ---- a/arch/openrisc/Kconfig -+++ b/arch/openrisc/Kconfig -@@ -21,6 +21,7 @@ config OPENRISC - select GENERIC_CLOCKEVENTS - select GENERIC_STRNCPY_FROM_USER - select GENERIC_STRNLEN_USER -+ select MODULES_USE_ELF_RELA - - config MMU - def_bool y -diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig -index 3ff21b5..166d991 100644 ---- a/arch/parisc/Kconfig -+++ b/arch/parisc/Kconfig -@@ -19,6 +19,8 @@ config PARISC - select ARCH_HAVE_NMI_SAFE_CMPXCHG - select GENERIC_SMP_IDLE_THREAD - select GENERIC_STRNCPY_FROM_USER -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - - help - The PA-RISC microprocessor is designed by Hewlett-Packard and used -diff --git a/arch/parisc/include/asm/module.h b/arch/parisc/include/asm/module.h -index 1f41234..bab37e9 100644 ---- a/arch/parisc/include/asm/module.h -+++ b/arch/parisc/include/asm/module.h -@@ -1,21 +1,11 @@ - #ifndef _ASM_PARISC_MODULE_H - #define _ASM_PARISC_MODULE_H -+ -+#include <asm-generic/module.h> -+ - /* - * This file contains the parisc architecture specific module code. - */ --#ifdef CONFIG_64BIT --#define Elf_Shdr Elf64_Shdr --#define Elf_Sym Elf64_Sym --#define Elf_Ehdr Elf64_Ehdr --#define Elf_Addr Elf64_Addr --#define Elf_Rela Elf64_Rela --#else --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr --#define Elf_Addr Elf32_Addr --#define Elf_Rela Elf32_Rela --#endif - - struct unwind_table; - -diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index 050cb37..17d3267 100644 ---- a/arch/powerpc/Kconfig -+++ b/arch/powerpc/Kconfig -@@ -137,6 +137,8 @@ config PPC - select GENERIC_CLOCKEVENTS - select GENERIC_STRNCPY_FROM_USER - select GENERIC_STRNLEN_USER -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - - config EARLY_PRINTK - bool -diff --git a/arch/powerpc/include/asm/module.h b/arch/powerpc/include/asm/module.h -index 0192a4e..c1df590 100644 ---- a/arch/powerpc/include/asm/module.h -+++ b/arch/powerpc/include/asm/module.h -@@ -11,6 +11,7 @@ - - #include <linux/list.h> - #include <asm/bug.h> -+#include <asm-generic/module.h> - - - #ifndef __powerpc64__ -@@ -60,16 +61,10 @@ struct mod_arch_specific { - */ - - #ifdef __powerpc64__ --# define Elf_Shdr Elf64_Shdr --# define Elf_Sym Elf64_Sym --# define Elf_Ehdr Elf64_Ehdr - # ifdef MODULE - asm(".section .stubs,\"ax\",@nobits; .align 3; .previous"); - # endif - #else --# define Elf_Shdr Elf32_Shdr --# define Elf_Sym Elf32_Sym --# define Elf_Ehdr Elf32_Ehdr - # ifdef MODULE - asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); - asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); -diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig -index a39b469..7c16d31 100644 ---- a/arch/s390/Kconfig -+++ b/arch/s390/Kconfig -@@ -121,6 +121,8 @@ config S390 - select GENERIC_TIME_VSYSCALL - select GENERIC_CLOCKEVENTS - select KTIME_SCALAR if 32BIT -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_RELA - - config SCHED_OMIT_FRAME_POINTER - def_bool y -diff --git a/arch/s390/include/asm/module.h b/arch/s390/include/asm/module.h -index f0b6b26..df1f861 100644 ---- a/arch/s390/include/asm/module.h -+++ b/arch/s390/include/asm/module.h -@@ -1,5 +1,8 @@ - #ifndef _ASM_S390_MODULE_H - #define _ASM_S390_MODULE_H -+ -+#include <asm-generic/module.h> -+ - /* - * This file contains the s390 architecture specific module code. - */ -@@ -28,19 +31,4 @@ struct mod_arch_specific - struct mod_arch_syminfo *syminfo; - }; - --#ifdef CONFIG_64BIT --#define ElfW(x) Elf64_ ## x --#define ELFW(x) ELF64_ ## x --#else --#define ElfW(x) Elf32_ ## x --#define ELFW(x) ELF32_ ## x --#endif -- --#define Elf_Addr ElfW(Addr) --#define Elf_Rela ElfW(Rela) --#define Elf_Shdr ElfW(Shdr) --#define Elf_Sym ElfW(Sym) --#define Elf_Ehdr ElfW(Ehdr) --#define ELF_R_SYM ELFW(R_SYM) --#define ELF_R_TYPE ELFW(R_TYPE) - #endif /* _ASM_S390_MODULE_H */ -diff --git a/arch/score/Kconfig b/arch/score/Kconfig -index ba0f412..e2c8db4 100644 ---- a/arch/score/Kconfig -+++ b/arch/score/Kconfig -@@ -10,6 +10,8 @@ config SCORE - select ARCH_DISCARD_MEMBLOCK - select GENERIC_CPU_DEVICES - select GENERIC_CLOCKEVENTS -+ select HAVE_MOD_ARCH_SPECIFIC -+ select MODULES_USE_ELF_REL - - choice - prompt "System type" -diff --git a/arch/score/include/asm/module.h b/arch/score/include/asm/module.h -index f0b5dc0..abf395b 100644 ---- a/arch/score/include/asm/module.h -+++ b/arch/score/include/asm/module.h -@@ -3,6 +3,7 @@ - - #include <linux/list.h> - #include <asm/uaccess.h> -+#include <asm-generic/module.h> - - struct mod_arch_specific { - /* Data Bus Error exception tables */ -@@ -13,11 +14,6 @@ struct mod_arch_specific { - - typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr --#define Elf_Addr Elf32_Addr -- - /* Given an address, look for it in the exception tables. */ - #ifdef CONFIG_MODULES - const struct exception_table_entry *search_module_dbetables(unsigned long addr); -diff --git a/arch/score/kernel/module.c b/arch/score/kernel/module.c -index 469e3b6..1378d99 100644 ---- a/arch/score/kernel/module.c -+++ b/arch/score/kernel/module.c -@@ -125,16 +125,6 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, - return 0; - } - --int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, -- unsigned int symindex, unsigned int relsec, -- struct module *me) --{ -- /* Non-standard return value... most other arch's return -ENOEXEC -- * for an unsupported relocation variant -- */ -- return 0; --} -- - /* Given an address, look for it in the module exception tables. */ - const struct exception_table_entry *search_module_dbetables(unsigned long addr) - { -diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig -index 31d9db7..22c02bb 100644 ---- a/arch/sh/Kconfig -+++ b/arch/sh/Kconfig -@@ -34,6 +34,8 @@ config SUPERH - select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST - select GENERIC_STRNCPY_FROM_USER - select GENERIC_STRNLEN_USER -+ select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER -+ select MODULES_USE_ELF_RELA - help - The SuperH is a RISC processor targeted for use in embedded systems - and consumer electronics; it was also used in the Sega Dreamcast -diff --git a/arch/sh/include/asm/module.h b/arch/sh/include/asm/module.h -index b7927de..81300d8b 100644 ---- a/arch/sh/include/asm/module.h -+++ b/arch/sh/include/asm/module.h -@@ -1,21 +1,13 @@ - #ifndef _ASM_SH_MODULE_H - #define _ASM_SH_MODULE_H - --struct mod_arch_specific { -+#include <asm-generic/module.h> -+ - #ifdef CONFIG_DWARF_UNWINDER -+struct mod_arch_specific { - struct list_head fde_list; - struct list_head cie_list; --#endif - }; -- --#ifdef CONFIG_64BIT --#define Elf_Shdr Elf64_Shdr --#define Elf_Sym Elf64_Sym --#define Elf_Ehdr Elf64_Ehdr --#else --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr - #endif - - #ifdef CONFIG_CPU_LITTLE_ENDIAN -diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig -index e74ff13..acf5577 100644 ---- a/arch/sparc/Kconfig -+++ b/arch/sparc/Kconfig -@@ -36,6 +36,7 @@ config SPARC - select GENERIC_CLOCKEVENTS - select GENERIC_STRNCPY_FROM_USER - select GENERIC_STRNLEN_USER -+ select MODULES_USE_ELF_RELA - - config SPARC32 - def_bool !64BIT -diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild -index 67f83e0..fbe1cb5 100644 ---- a/arch/sparc/include/asm/Kbuild -+++ b/arch/sparc/include/asm/Kbuild -@@ -21,4 +21,5 @@ generic-y += div64.h - generic-y += local64.h - generic-y += irq_regs.h - generic-y += local.h -+generic-y += module.h - generic-y += word-at-a-time.h -diff --git a/arch/sparc/include/asm/module.h b/arch/sparc/include/asm/module.h -deleted file mode 100644 -index ff8e02d..0000000 ---- a/arch/sparc/include/asm/module.h -+++ /dev/null -@@ -1,24 +0,0 @@ --#ifndef __SPARC_MODULE_H --#define __SPARC_MODULE_H --struct mod_arch_specific { }; -- --/* -- * Use some preprocessor magic to define the correct symbol -- * for sparc32 and sparc64. -- * Elf_Addr becomes Elf32_Addr for sparc32 and Elf64_Addr for sparc64 -- */ --#define ___ELF(a, b, c) a##b##c --#define __ELF(a, b, c) ___ELF(a, b, c) --#define _Elf(t) __ELF(Elf, CONFIG_BITS, t) --#define _ELF(t) __ELF(ELF, CONFIG_BITS, t) -- --#define Elf_Shdr _Elf(_Shdr) --#define Elf_Sym _Elf(_Sym) --#define Elf_Ehdr _Elf(_Ehdr) --#define Elf_Rela _Elf(_Rela) --#define Elf_Addr _Elf(_Addr) -- --#define ELF_R_SYM _ELF(_R_SYM) --#define ELF_R_TYPE _ELF(_R_TYPE) -- --#endif /* __SPARC_MODULE_H */ -diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig -index fe12881..2d8bc27 100644 ---- a/arch/tile/Kconfig -+++ b/arch/tile/Kconfig -@@ -15,6 +15,7 @@ config TILE - select SYS_HYPERVISOR - select ARCH_HAVE_NMI_SAFE_CMPXCHG - select GENERIC_CLOCKEVENTS -+ select MODULES_USE_ELF_RELA - - # FIXME: investigate whether we need/want these options. - # select HAVE_IOREMAP_PROT -diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig -index 03c9ff8..942b553 100644 ---- a/arch/unicore32/Kconfig -+++ b/arch/unicore32/Kconfig -@@ -14,6 +14,7 @@ config UNICORE32 - select GENERIC_IRQ_SHOW - select ARCH_WANT_FRAME_POINTERS - select GENERIC_IOMAP -+ select MODULES_USE_ELF_REL - help - UniCore-32 is 32-bit Instruction Set Architecture, - including a series of low-power-consumption RISC chip -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index c70684f..c38a60e 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -95,6 +95,8 @@ config X86 - select KTIME_SCALAR if X86_32 - select GENERIC_STRNCPY_FROM_USER - select GENERIC_STRNLEN_USER -+ select MODULES_USE_ELF_REL if X86_32 -+ select MODULES_USE_ELF_RELA if X86_64 - - config INSTRUCTION_DECODER - def_bool (KPROBES || PERF_EVENTS || UPROBES) -diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig -index 8a3f835..516210a 100644 ---- a/arch/xtensa/Kconfig -+++ b/arch/xtensa/Kconfig -@@ -10,6 +10,7 @@ config XTENSA - select HAVE_GENERIC_HARDIRQS - select GENERIC_IRQ_SHOW - select GENERIC_CPU_DEVICES -+ select MODULES_USE_ELF_RELA - help - Xtensa processors are 32-bit RISC machines designed by Tensilica - primarily for embedded systems. These processors are both -diff --git a/arch/xtensa/include/asm/module.h b/arch/xtensa/include/asm/module.h -index d9b34be..488b40c 100644 ---- a/arch/xtensa/include/asm/module.h -+++ b/arch/xtensa/include/asm/module.h -@@ -13,15 +13,8 @@ - #ifndef _XTENSA_MODULE_H - #define _XTENSA_MODULE_H - --struct mod_arch_specific --{ -- /* No special elements, yet. */ --}; -- - #define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " " - --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#include <asm-generic/module.h> - - #endif /* _XTENSA_MODULE_H */ -diff --git a/include/asm-generic/module.h b/include/asm-generic/module.h -index ed5b44d..14dc41d 100644 ---- a/include/asm-generic/module.h -+++ b/include/asm-generic/module.h -@@ -5,18 +5,44 @@ - * Many architectures just need a simple module - * loader without arch specific data. - */ -+#ifndef CONFIG_HAVE_MOD_ARCH_SPECIFIC - struct mod_arch_specific - { - }; -+#endif - - #ifdef CONFIG_64BIT --#define Elf_Shdr Elf64_Shdr --#define Elf_Sym Elf64_Sym --#define Elf_Ehdr Elf64_Ehdr --#else --#define Elf_Shdr Elf32_Shdr --#define Elf_Sym Elf32_Sym --#define Elf_Ehdr Elf32_Ehdr -+#define Elf_Shdr Elf64_Shdr -+#define Elf_Phdr Elf64_Phdr -+#define Elf_Sym Elf64_Sym -+#define Elf_Dyn Elf64_Dyn -+#define Elf_Ehdr Elf64_Ehdr -+#define Elf_Addr Elf64_Addr -+#ifdef CONFIG_MODULES_USE_ELF_REL -+#define Elf_Rel Elf64_Rel -+#endif -+#ifdef CONFIG_MODULES_USE_ELF_RELA -+#define Elf_Rela Elf64_Rela -+#endif -+#define ELF_R_TYPE(X) ELF64_R_TYPE(X) -+#define ELF_R_SYM(X) ELF64_R_SYM(X) -+ -+#else /* CONFIG_64BIT */ -+ -+#define Elf_Shdr Elf32_Shdr -+#define Elf_Phdr Elf32_Phdr -+#define Elf_Sym Elf32_Sym -+#define Elf_Dyn Elf32_Dyn -+#define Elf_Ehdr Elf32_Ehdr -+#define Elf_Addr Elf32_Addr -+#ifdef CONFIG_MODULES_USE_ELF_REL -+#define Elf_Rel Elf32_Rel -+#endif -+#ifdef CONFIG_MODULES_USE_ELF_RELA -+#define Elf_Rela Elf32_Rela -+#endif -+#define ELF_R_TYPE(X) ELF32_R_TYPE(X) -+#define ELF_R_SYM(X) ELF32_R_SYM(X) - #endif - - #endif /* __ASM_GENERIC_MODULE_H */ -diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h -index b2be02e..b85dda8 100644 ---- a/include/linux/moduleloader.h -+++ b/include/linux/moduleloader.h -@@ -28,21 +28,49 @@ void *module_alloc(unsigned long size); - /* Free memory returned from module_alloc. */ - void module_free(struct module *mod, void *module_region); - --/* Apply the given relocation to the (simplified) ELF. Return -error -- or 0. */ -+/* -+ * Apply the given relocation to the (simplified) ELF. Return -error -+ * or 0. -+ */ -+#ifdef CONFIG_MODULES_USE_ELF_REL - int apply_relocate(Elf_Shdr *sechdrs, - const char *strtab, - unsigned int symindex, - unsigned int relsec, - struct module *mod); -+#else -+static inline int apply_relocate(Elf_Shdr *sechdrs, -+ const char *strtab, -+ unsigned int symindex, -+ unsigned int relsec, -+ struct module *me) -+{ -+ pr_err("module %s: REL relocation unsupported\n", me->name); -+ return -ENOEXEC; -+} -+#endif - --/* Apply the given add relocation to the (simplified) ELF. Return -- -error or 0 */ -+/* -+ * Apply the given add relocation to the (simplified) ELF. Return -+ * -error or 0 -+ */ -+#ifdef CONFIG_MODULES_USE_ELF_RELA - int apply_relocate_add(Elf_Shdr *sechdrs, - const char *strtab, - unsigned int symindex, - unsigned int relsec, - struct module *mod); -+#else -+static inline int apply_relocate_add(Elf_Shdr *sechdrs, -+ const char *strtab, -+ unsigned int symindex, -+ unsigned int relsec, -+ struct module *me) -+{ -+ pr_err("module %s: RELA relocation unsupported\n", me->name); -+ return -ENOEXEC; -+} -+#endif - - /* Any final processing of module before access. Return -error or 0. */ - int module_finalize(const Elf_Ehdr *hdr, -diff --git a/kernel/module.c b/kernel/module.c -index 4edbd9c..087aeed 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -1949,26 +1949,6 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) - return ret; - } - --int __weak apply_relocate(Elf_Shdr *sechdrs, -- const char *strtab, -- unsigned int symindex, -- unsigned int relsec, -- struct module *me) --{ -- pr_err("module %s: REL relocation unsupported\n", me->name); -- return -ENOEXEC; --} -- --int __weak apply_relocate_add(Elf_Shdr *sechdrs, -- const char *strtab, -- unsigned int symindex, -- unsigned int relsec, -- struct module *me) --{ -- pr_err("module %s: RELA relocation unsupported\n", me->name); -- return -ENOEXEC; --} -- - static int apply_relocations(struct module *mod, const struct load_info *info) - { - unsigned int i; --- -1.7.10.4 - - -From 69bdeeb86f28489efa7d5f414867bd07b9516c10 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:26:33 +0100 -Subject: [PATCH 16/27] Provide macros for forming the name of an ELF note and - its section - -Provide macros for stringifying the name of an ELF note and its section -appropriately so that the macro can be used in both C and assembly. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - include/linux/elfnote.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h -index 278e3ef..949d494 100644 ---- a/include/linux/elfnote.h -+++ b/include/linux/elfnote.h -@@ -58,6 +58,7 @@ - ELFNOTE_END - - #else /* !__ASSEMBLER__ */ -+#include <linux/stringify.h> - #include <linux/elf.h> - /* - * Use an anonymous structure which matches the shape of -@@ -93,6 +94,9 @@ - - #define ELFNOTE32(name, type, desc) ELFNOTE(32, name, type, desc) - #define ELFNOTE64(name, type, desc) ELFNOTE(64, name, type, desc) -+ -+#define ELFNOTE_NAME(name) __stringify(name) -+#define ELFNOTE_SECTION(name) ".note."ELFNOTE_NAME(name) - #endif /* __ASSEMBLER__ */ - - #endif /* _LINUX_ELFNOTE_H */ --- -1.7.10.4 - - -From 5191f0bcbe03426b90b0a53c9ea960fafba7c269 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:27:05 +0100 -Subject: [PATCH 17/27] MODSIGN: Provide gitignore and make clean rules for - extra files - -Provide gitignore and make clean rules for extra files to hide and clean up the -extra files produced by module signing stuff once it is added. Also add a -clean up rule for the module content extractor program used to extract the data -to be signed. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - .gitignore | 12 ++++++++++++ - Makefile | 1 + - scripts/mod/.gitignore | 1 + - 3 files changed, 14 insertions(+) - -diff --git a/.gitignore b/.gitignore -index 57af07c..7948eeb 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -14,6 +14,9 @@ - *.o.* - *.a - *.s -+*.ko.unsigned -+*.ko.digest -+*.ko.digest.sig - *.ko - *.so - *.so.dbg -@@ -84,3 +87,12 @@ GTAGS - *.orig - *~ - \#*# -+ -+# -+# GPG leavings from module signing -+# -+genkey -+modsign.pub -+modsign.sec -+random_seed -+trustdb.gpg -diff --git a/Makefile b/Makefile -index aa8e315..4a4a11f 100644 ---- a/Makefile -+++ b/Makefile -@@ -1239,6 +1239,7 @@ clean: $(clean-dirs) - $(call cmd,rmfiles) - @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ - \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -+ -o -name '*.ko.*' \ - -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ - -o -name '*.symtypes' -o -name 'modules.order' \ - -o -name modules.builtin -o -name '.tmp_*.o.*' \ -diff --git a/scripts/mod/.gitignore b/scripts/mod/.gitignore -index e9b7abe..223dfd6 100644 ---- a/scripts/mod/.gitignore -+++ b/scripts/mod/.gitignore -@@ -1,4 +1,5 @@ - elfconfig.h - mk_elfconfig - modpost -+mod-extract - --- -1.7.10.4 - - -From bf067003ae6304d90c278118b5d65d905be16e53 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:27:16 +0100 -Subject: [PATCH 18/27] MODSIGN: Provide Documentation and Kconfig options - -Provide documentation and kernel configuration options for module signing. - -The documentation can be found in: - - Documentation/module-signing.txt - -The following configuration options are added: - - (1) CONFIG_MODULE_SIG - - Enable module signing. This will both cause the build process to sign - modules and the kernel to check modules when they're loaded. - - (2) CONFIG_MODULE_SIG_SHA1 - CONFIG_MODULE_SIG_SHA224 - CONFIG_MODULE_SIG_SHA256 - CONFIG_MODULE_SIG_SHA384 - CONFIG_MODULE_SIG_SHA512 - - Select the cryptographic hash used to digest the data prior to signing. - Additionally, the crypto module selected will be built into the kernel as - it won't be possible to load it as a module without incurring a circular - dependency when the kernel tries to check its signature. - - (3) CONFIG_MODULE_SIG_FORCE - - Require that any module loaded must be signed with a key compiled into - the kernel. All other modules are rejected with EKEYREJECTED. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - Documentation/module-signing.txt | 194 ++++++++++++++++++++++++++++++++++++++ - include/linux/modsign.h | 27 ++++++ - init/Kconfig | 54 +++++++++++ - 3 files changed, 275 insertions(+) - create mode 100644 Documentation/module-signing.txt - create mode 100644 include/linux/modsign.h - -diff --git a/Documentation/module-signing.txt b/Documentation/module-signing.txt -new file mode 100644 -index 0000000..d75d473 ---- /dev/null -+++ b/Documentation/module-signing.txt -@@ -0,0 +1,194 @@ -+ ============================== -+ KERNEL MODULE SIGNING FACILITY -+ ============================== -+ -+The module signing facility applies cryptographic signature checking to modules -+on module load, checking the signature against a ring of public keys compiled -+into the kernel. GPG is used to do the cryptographic work and determines the -+format of the signature and key data. The facility uses GPG's MPI library to -+handle the huge numbers involved. -+ -+This facility is enabled through CONFIG_MODULE_SIG. Turning on signature -+checking will also force the module's ELF metadata to be verified before the -+signature is checked. -+ -+The signature checker in the kernel is capable of handling multiple keys of -+either DSA or RSA type, and can support any of MD5, RIPE-MD-160, SHA-1, -+SHA-224, SHA-256, SHA-384 and SHA-512 hashes - PROVIDED(!) the requisite -+algorithms are compiled into the kernel. -+ -+(!) NOTE: Modules may only be verified initially with algorithms compiled into -+the kernel. Further algorithm modules may be loaded and used - but these must -+first pass a verification step using already loaded/compiled-in algorithms. -+ -+ -+===================== -+SUPPLYING PUBLIC KEYS -+===================== -+ -+A set of public keys must be supplied at kernel image build time. This is done -+by taking a GPG public key file and placing it in the base of the kernel -+directory in a file called modsign.pub. -+ -+For example, a throwaway key could be generated automatically by something like -+the following: -+ -+ cat >genkey <<EOF -+ %pubring modsign.pub -+ %secring modsign.sec -+ Key-Type: RSA -+ Key-Length: 4096 -+ Name-Real: A. N. Other -+ Name-Comment: Kernel Module GPG key -+ %commit -+ EOF -+ gpg --homedir . --batch --gen-key genkey -+ -+The above generates fresh keys using /dev/random. If there's insufficient data -+in /dev/random, more can be provided using the rngd program if there's a -+hardware random number generator available. -+ -+Note that no GPG password is used in the above scriptlet. -+ -+The modsign.pub file is compiled into the kernel directly by the assembler by -+means of an ".incbin" directive in kernel/modsign-pubkey.c. -+ -+Once the kernel is running, the keys are visible to root as kernel crypto keys -+in /proc/keys in a keyring called .module_sign: -+ -+335ab517 I----- 1 perm 1f030000 0 0 keyring .module_sign: 2/4 -+38d7d169 I----- 1 perm 3f010000 0 0 crypto modsign.0: rsa 57532ca5 [] -+195fa736 I----- 1 perm 3f010000 0 0 crypto modsign.1: dsa 5acc2142 [] -+ -+This keyring can be listed with the keyctl program. See: -+ -+ Documentation/security/keys-crypto.txt -+ -+for more information of crypto keys. -+ -+ -+============================ -+SELECTING THE HASH ALGORITHM -+============================ -+ -+The hash algorithm to be used is selected by a multiple choice configuration -+item that enables one of the following variables: -+ -+ CONFIG_SIG_SHA1 -+ CONFIG_SIG_SHA224 -+ CONFIG_SIG_SHA256 -+ CONFIG_SIG_SHA384 -+ CONFIG_SIG_SHA512 -+ -+These cause an appropriate "--digest-algo=" parameter to be passed to gpg when -+signing a module and force the appropriate hash algorithm to be compiled -+directly into the kernel rather than being built as a module. -+ -+ -+============== -+MODULE SIGNING -+============== -+ -+Modules will then be signed automatically. The kernel make command line can -+include the following options: -+ -+ (*) MODSECKEY=<secret-key-ring-path> -+ -+ This indicates the whereabouts of the GPG keyring that is the source of -+ the secret key to be used. The default is "./modsign.sec". -+ -+ (*) MODPUBKEY=<public-key-ring-path> -+ -+ This indicates the whereabouts of the GPG keyring that is the source of -+ the public key to be used. The default is "./modsign.pub". -+ -+ (*) MODKEYNAME=<key-name> -+ -+ The name of the key pair to be used from the aforementioned keyrings. -+ This defaults to being unset, thus leaving the choice of default key to -+ gpg. -+ -+ (*) KEYFLAGS="gpg-options" -+ -+ Override the complete gpg command line, including the preceding three -+ options. The default options supplied to gpg are: -+ -+ --no-default-keyring -+ --secret-keyring $(MODSECKEY) -+ --keyring $(MODPUBKEY) -+ --no-default-keyring -+ --homedir . -+ --no-options -+ --no-auto-check-trustdb -+ --no-permission-warning -+ --digest-algo=<hash-algorithm> -+ -+ with: -+ -+ --default-key $(MODKEYNAME) -+ -+ being added if requested. -+ -+The resulting module.ko file will be the signed module. -+ -+ -+======================== -+STRIPPING SIGNED MODULES -+======================== -+ -+Signed modules may be safely stripped with any of the following: -+ -+ strip -x -+ strip -g -+ eu-strip -+ -+as the signature only covers those parts of the module the kernel actually uses -+and any ELF metadata required to deal with them. Any necessary ELF metadata -+that is affected by stripping is canonicalised by the sig generator and the sig -+checker to hide strip effects. -+ -+This permits the debuginfo to be detached from the module and placed in another -+spot so that gdb can find it when referring to that module without the need for -+multiple signed versions of the module. Such is done by rpmbuild when -+producing RPMs. -+ -+It also permits the module to be stripped as far as possible for when modules -+are being reduced prior to being included in an initial ramdisk composition. -+ -+Note that "strip" and "strip -s" may not be used on a module, signed or -+otherwise, as they remove the symbol table and render the relocation tables -+unusable. -+ -+ -+====================== -+LOADING SIGNED MODULES -+====================== -+ -+Modules are loaded with insmod, exactly as for unsigned modules. The signature -+is inserted into the module object file during the build process as an ELF note -+called "module.sig" in an ELF section called ".note.module.sig". The signature -+checker will detect it and apply signature checking. -+ -+ -+========================================= -+NON-VALID SIGNATURES AND UNSIGNED MODULES -+========================================= -+ -+If CONFIG_MODULE_SIG_FORCE is enabled or "enforcemodulesig=1" is supplied on -+the kernel command line, the kernel will _only_ load validly signed modules -+for which it has a public key. Otherwise, it will also load modules that are -+unsigned. Any module for which the kernel has a key, but which proves to have -+a signature mismatch will not be permitted to load (returning EKEYREJECTED). -+ -+This table indicates the behaviours of the various situations: -+ -+ MODULE STATE PERMISSIVE MODE ENFORCING MODE -+ ======================================= =============== =============== -+ Unsigned Ok EKEYREJECTED -+ Signed, no public key ENOKEY ENOKEY -+ Validly signed, public key Ok Ok -+ Invalidly signed, public key EKEYREJECTED EKEYREJECTED -+ Validly signed, expired key EKEYEXPIRED EKEYEXPIRED -+ Signed, hash algorithm unavailable ENOPKG ENOPKG -+ Corrupt signature EBADMSG EBADMSG -+ Corrupt ELF ELIBBAD ELIBBAD -diff --git a/include/linux/modsign.h b/include/linux/modsign.h -new file mode 100644 -index 0000000..c5ac87a ---- /dev/null -+++ b/include/linux/modsign.h -@@ -0,0 +1,27 @@ -+/* Module signing definitions -+ * -+ * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifndef _LINUX_MODSIGN_H -+#define _LINUX_MODSIGN_H -+ -+#ifdef CONFIG_MODULE_SIG -+ -+#include <linux/elfnote.h> -+ -+/* -+ * The parameters of the ELF note used to carry the signature -+ */ -+#define MODSIGN_NOTE_NAME module.sig -+#define MODSIGN_NOTE_TYPE 100 -+ -+#endif -+ -+#endif /* _LINUX_MODSIGN_H */ -diff --git a/init/Kconfig b/init/Kconfig -index d07dcf9..1d1a056 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1570,6 +1570,60 @@ config MODULE_SRCVERSION_ALL - the version). With this option, such a "srcversion" field - will be created for all modules. If unsure, say N. - -+config MODULE_SIG -+ bool "Module signature verification" -+ depends on MODULES -+ select KEYS -+ select CRYPTO_KEY_TYPE -+ select CRYPTO_KEY_PKEY_ALGO_DSA -+ select CRYPTO_KEY_PKEY_ALGO_RSA -+ select PGP_PARSER -+ select PGP_PRELOAD -+ help -+ Check modules for valid signatures upon load. For more information -+ see: -+ -+ Documentation/module-signing.txt -+ -+choice -+ prompt "Which hash algorithm should modules be signed with?" -+ depends on MODULE_SIG -+ help -+ This determines which sort of hashing algorithm will be used during -+ signature generation. This algorithm _must_ be built into the kernel -+ directly so that signature verification can take place. It is not -+ possible to load a signed module containing the algorithm to check -+ the signature on that module. -+ -+config MODULE_SIG_SHA1 -+ bool "Sign modules with SHA-1" -+ select CRYPTO_SHA1 -+ -+config MODULE_SIG_SHA224 -+ bool "Sign modules with SHA-224" -+ select CRYPTO_SHA224 -+ -+config MODULE_SIG_SHA256 -+ bool "Sign modules with SHA-256" -+ select CRYPTO_SHA256 -+ -+config MODULE_SIG_SHA384 -+ bool "Sign modules with SHA-384" -+ select CRYPTO_SHA384 -+ -+config MODULE_SIG_SHA512 -+ bool "Sign modules with SHA-512" -+ select CRYPTO_SHA512 -+ -+endchoice -+ -+config MODULE_SIG_FORCE -+ bool "Required modules to be validly signed (EXPERIMENTAL)" -+ depends on MODULE_SIG -+ help -+ Reject unsigned modules or signed modules for which we don't have a -+ key. -+ - endif # MODULES - - config INIT_ALL_POSSIBLE --- -1.7.10.4 - - -From 19c2fd74747b84e445b0a4eb7f7308a238267aec Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:27:38 +0100 -Subject: [PATCH 19/27] MODSIGN: Sign modules during the build process - -If CONFIG_MODULE_SIG is set, then this patch will cause the module to get a -signature installed. The following steps will occur: - - (1) The module will be linked to foo.ko.unsigned instead of foo.ko - - (2) The module's signable content will be extracted to foo.ko.digest by the - mod-extract program. - - (3) The signature will be generated on foo.ko.digest by gpg and placed in - foo.ko.digest.sig - - (4) The signature will be encapsulated into an ELF note and placed into a file - called foo.ko.note.o using the output from modsign-note.sh piped into the - assembler. - - (5) The unsigned module from (1) and the signature ELF note from (4) will be - linked together to produce foo.ko - -Step (3) requires private and public keys to be available. By default these -are expected to be found in PGP keyring files called modsign.sec (the secret -key) and modsign.pub (the public key) in the build root. - -If the secret key is not found then signing will be skipped and the unsigned -module from (1) will just be copied to foo.ko. - -If signing occurs, lines like the following will be seen: - - LD [M] fs/foo/foo.ko.unsigned - SIGN [M] fs/foo/foo.ko - -will appear in the build log. If it is skipped, the following will be seen: - - LD [M] fs/foo/foo.ko.unsigned - NO SIGN [M] fs/foo/foo.ko - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - scripts/Makefile.modpost | 87 ++++- - scripts/mod/Makefile | 2 +- - scripts/mod/mod-extract.c | 913 +++++++++++++++++++++++++++++++++++++++++++ - scripts/mod/modsign-note.sh | 16 + - 4 files changed, 1016 insertions(+), 2 deletions(-) - create mode 100644 scripts/mod/mod-extract.c - create mode 100644 scripts/mod/modsign-note.sh - -diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost -index 08dce14..17465d8 100644 ---- a/scripts/Makefile.modpost -+++ b/scripts/Makefile.modpost -@@ -14,7 +14,8 @@ - # 3) create one <module>.mod.c file pr. module - # 4) create one Module.symvers file with CRC for all exported symbols - # 5) compile all <module>.mod.c files --# 6) final link of the module to a <module.ko> file -+# 6) final link of the module to a <module.ko> (or <module.unsigned>) file -+# 7) signs the modules to a <module.ko> file - - # Step 3 is used to place certain information in the module's ELF - # section, including information such as: -@@ -32,6 +33,8 @@ - # Step 4 is solely used to allow module versioning in external modules, - # where the CRC of each module is retrieved from the Module.symvers file. - -+# Step 7 is dependent on CONFIG_MODULE_SIG being enabled. -+ - # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined - # symbols in the final module linking stage - # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. -@@ -116,6 +119,7 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE - targets += $(modules:.ko=.mod.o) - - # Step 6), final link of the modules -+ifneq ($(CONFIG_MODULE_SIG),y) - quiet_cmd_ld_ko_o = LD [M] $@ - cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ - $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ -@@ -125,7 +129,88 @@ $(modules): %.ko :%.o %.mod.o FORCE - $(call if_changed,ld_ko_o) - - targets += $(modules) -+else -+quiet_cmd_ld_ko_unsigned_o = LD [M] $@ -+ cmd_ld_ko_unsigned_o = \ -+ $(LD) -r $(LDFLAGS) \ -+ $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ -+ -o $@ $(filter-out FORCE,$^) \ -+ $(if $(AFTER_LINK),; $(AFTER_LINK)) -+ -+$(modules:.ko=.ko.unsigned): %.ko.unsigned :%.o %.mod.o FORCE -+ $(call if_changed,ld_ko_unsigned_o) -+ -+targets += $(modules:.ko=.ko.unsigned) -+ -+# Step 7), sign the modules -+MODSECKEY = ./modsign.sec -+MODPUBKEY = ./modsign.pub -+KEYFLAGS = --no-default-keyring --secret-keyring $(MODSECKEY) --keyring $(MODPUBKEY) --no-default-keyring --homedir . --no-options --no-auto-check-trustdb --no-permission-warning -+ -+ifdef CONFIG_MODULE_SIG_SHA1 -+KEYFLAGS += --digest-algo=SHA1 -+else -+ifdef CONFIG_MODULE_SIG_SHA224 -+KEYFLAGS += --digest-algo=SHA224 -+else -+ifdef CONFIG_MODULE_SIG_SHA256 -+KEYFLAGS += --digest-algo=SHA256 -+else -+ifdef CONFIG_MODULE_SIG_SHA384 -+KEYFLAGS += --digest-algo=SHA384 -+else -+ifdef CONFIG_MODULE_SIG_SHA512 -+KEYFLAGS += --digest-algo=SHA512 -+else -+endif -+endif -+endif -+endif -+endif -+ -+ifdef MODKEYNAME -+KEYFLAGS += --default-key $(MODKEYNAME) -+endif - -+ifeq ($(wildcard $(MODSECKEY))+$(wildcard $(MODPUBKEY)),$(MODSECKEY)+$(MODPUBKEY)) -+ifeq ($(KBUILD_SRC),) -+ # no O= is being used -+ SCRIPTS_DIR := scripts -+else -+ SCRIPTS_DIR := $(KBUILD_SRC)/scripts -+endif -+SIGN_MODULES := 1 -+else -+SIGN_MODULES := 0 -+endif -+ -+# only sign if it's an in-tree module -+ifneq ($(KBUILD_EXTMOD),) -+SIGN_MODULES := 0 -+endif -+ -+ifeq ($(SIGN_MODULES),1) -+KEYRING_DEP := modsign.sec modsign.pub -+quiet_cmd_sign_ko_ko_unsigned = SIGN [M] $@ -+ cmd_sign_ko_ko_unsigned = \ -+ scripts/mod/mod-extract $< $@.digest && \ -+ rm -f $@.digest.sig && \ -+ gpg --batch --no-greeting $(KEYFLAGS) -b $@.digest && \ -+ sh $(SCRIPTS_DIR)/mod/modsign-note.sh $@.digest.sig | \ -+ $(CC) -x assembler-with-cpp $(c_flags) $(CFLAGS_MODULE) -c -o $@.note.o - && \ -+ $(LD) -r $(LDFLAGS) -o $@ $< $@.note.o -+else -+KEYRING_DEP := -+quiet_cmd_sign_ko_ko_unsigned = NO SIGN [M] $@ -+ cmd_sign_ko_ko_unsigned = \ -+ cp $< $@ -+endif -+ -+$(modules): %.ko :%.ko.unsigned $(KEYRING_DEP) FORCE -+ $(call if_changed,sign_ko_ko_unsigned) -+ -+targets += $(modules) -+endif - - # Add FORCE to the prequisites of a target to force it to be always rebuilt. - # --------------------------------------------------------------------------- -diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile -index ff954f8..4654e3b 100644 ---- a/scripts/mod/Makefile -+++ b/scripts/mod/Makefile -@@ -1,4 +1,4 @@ --hostprogs-y := modpost mk_elfconfig -+hostprogs-y := modpost mk_elfconfig mod-extract - always := $(hostprogs-y) empty.o - - modpost-objs := modpost.o file2alias.o sumversion.o -diff --git a/scripts/mod/mod-extract.c b/scripts/mod/mod-extract.c -new file mode 100644 -index 0000000..0c0e3e3 ---- /dev/null -+++ b/scripts/mod/mod-extract.c -@@ -0,0 +1,913 @@ -+/* mod-extract.c: module extractor for signing -+ * -+ * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <stdint.h> -+#include <stdarg.h> -+#include <string.h> -+#include <unistd.h> -+#include <fcntl.h> -+#include <sys/mman.h> -+#include <sys/stat.h> -+#include <elf.h> -+#include <asm/byteorder.h> -+ -+static void extract_elf64(void *buffer, size_t size, Elf64_Ehdr *hdr); -+static void extract_elf32(void *buffer, size_t size, Elf32_Ehdr *hdr); -+ -+struct byteorder { -+ uint16_t (*get16)(const uint16_t *); -+ uint32_t (*get32)(const uint32_t *); -+ uint64_t (*get64)(const uint64_t *); -+ void (*set16)(uint16_t *, uint16_t); -+ void (*set32)(uint32_t *, uint32_t); -+ void (*set64)(uint64_t *, uint64_t); -+}; -+ -+static uint16_t get16_le(const uint16_t *p) { return __le16_to_cpu(*p); } -+static uint32_t get32_le(const uint32_t *p) { return __le32_to_cpu(*p); } -+static uint64_t get64_le(const uint64_t *p) { return __le64_to_cpu(*p); } -+static uint16_t get16_be(const uint16_t *p) { return __be16_to_cpu(*p); } -+static uint32_t get32_be(const uint32_t *p) { return __be32_to_cpu(*p); } -+static uint64_t get64_be(const uint64_t *p) { return __be64_to_cpu(*p); } -+ -+static void set16_le(uint16_t *p, uint16_t n) { *p = __cpu_to_le16(n); } -+static void set32_le(uint32_t *p, uint32_t n) { *p = __cpu_to_le32(n); } -+static void set64_le(uint64_t *p, uint64_t n) { *p = __cpu_to_le64(n); } -+static void set16_be(uint16_t *p, uint16_t n) { *p = __cpu_to_be16(n); } -+static void set32_be(uint32_t *p, uint32_t n) { *p = __cpu_to_be32(n); } -+static void set64_be(uint64_t *p, uint64_t n) { *p = __cpu_to_be64(n); } -+ -+static const struct byteorder byteorder_le = { -+ get16_le, get32_le, get64_le, -+ set16_le, set32_le, set64_le -+}; -+static const struct byteorder byteorder_be = { -+ get16_be, get32_be, get64_be, -+ set16_be, set32_be, set64_be -+}; -+static const struct byteorder *order; -+ -+static inline uint16_t get16(const uint16_t *p) { return order->get16(p); } -+static inline uint32_t get32(const uint32_t *p) { return order->get32(p); } -+static inline uint64_t get64(const uint64_t *p) { return order->get64(p); } -+static inline void set16(uint16_t *p, uint16_t n) { order->set16(p, n); } -+static inline void set32(uint32_t *p, uint32_t n) { order->set32(p, n); } -+static inline void set64(uint64_t *p, uint64_t n) { order->set64(p, n); } -+ -+static FILE *outfd; -+static uint8_t csum, xcsum; -+ -+static void write_out(const void *data, size_t size) -+{ -+ const uint8_t *p = data; -+ size_t loop; -+ -+ for (loop = 0; loop < size; loop++) { -+ csum += p[loop]; -+ xcsum += p[loop]; -+ } -+ -+ if (fwrite(data, 1, size, outfd) != size) { -+ perror("write"); -+ exit(1); -+ } -+} -+ -+#define write_out_val(VAL) write_out(&(VAL), sizeof(VAL)) -+ -+static int is_verbose; -+ -+static __attribute__((format(printf, 1, 2))) -+void verbose(const char *fmt, ...) -+{ -+ va_list va; -+ -+ if (is_verbose) { -+ va_start(va, fmt); -+ vprintf(fmt, va); -+ va_end(va); -+ } -+} -+ -+static __attribute__((noreturn)) -+void usage(void) -+{ -+ fprintf(stderr, "Usage: mod-extract [-v] <modulefile> <extractfile>\n"); -+ exit(2); -+} -+ -+/* -+ * -+ */ -+int main(int argc, char **argv) -+{ -+ struct stat st; -+ Elf32_Ehdr *hdr32; -+ Elf64_Ehdr *hdr64; -+ size_t len; -+ void *buffer; -+ int fd, be, b64; -+ -+ while (argc > 1 && strcmp("-v", argv[1]) == 0) { -+ argv++; -+ argc--; -+ is_verbose++; -+ } -+ -+ if (argc != 3) -+ usage(); -+ -+ /* map the module into memory */ -+ fd = open(argv[1], O_RDONLY); -+ if (fd < 0) { -+ perror("open input"); -+ exit(1); -+ } -+ -+ if (fstat(fd, &st) < 0) { -+ perror("fstat"); -+ exit(1); -+ } -+ -+ len = st.st_size; -+ -+ buffer = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); -+ if (buffer == MAP_FAILED) { -+ perror("mmap"); -+ exit(1); -+ } -+ -+ if (close(fd) < 0) { -+ perror("close input"); -+ exit(1); -+ } -+ -+ /* check it's an ELF object */ -+ hdr32 = buffer; -+ hdr64 = buffer; -+ -+ if (hdr32->e_ident[EI_MAG0] != ELFMAG0 || -+ hdr32->e_ident[EI_MAG1] != ELFMAG1 || -+ hdr32->e_ident[EI_MAG2] != ELFMAG2 || -+ hdr32->e_ident[EI_MAG3] != ELFMAG3 -+ ) { -+ fprintf(stderr, "Module does not appear to be ELF\n"); -+ exit(3); -+ } -+ -+ /* determine endianness and word size */ -+ b64 = (hdr32->e_ident[EI_CLASS] == ELFCLASS64); -+ be = (hdr32->e_ident[EI_DATA] == ELFDATA2MSB); -+ order = be ? &byteorder_be : &byteorder_le; -+ -+ verbose("Module is %s-bit %s-endian\n", -+ b64 ? "64" : "32", -+ be ? "big" : "little"); -+ -+ /* open the output file */ -+ outfd = fopen(argv[2], "w"); -+ if (!outfd) { -+ perror("open output"); -+ exit(1); -+ } -+ -+ /* perform the extraction */ -+ if (b64) -+ extract_elf64(buffer, len, hdr64); -+ else -+ extract_elf32(buffer, len, hdr32); -+ -+ /* done */ -+ if (fclose(outfd) == EOF) { -+ perror("close output"); -+ exit(1); -+ } -+ -+ return 0; -+} -+ -+/* -+ * extract a RELA table -+ * - need to canonicalise the entries in case section addition/removal has -+ * rearranged the symbol table and the section table -+ */ -+static void extract_elf64_rela(const void *buffer, int secix, int targetix, -+ const Elf64_Rela *relatab, size_t nrels, -+ const Elf64_Sym *symbols, size_t nsyms, -+ const Elf64_Shdr *sections, size_t nsects, int *canonmap, -+ const char *strings, size_t nstrings, -+ const char *sh_name) -+{ -+ struct { -+ uint64_t r_offset; -+ uint64_t r_addend; -+ uint64_t st_value; -+ uint64_t st_size; -+ uint32_t r_type; -+ uint16_t st_shndx; -+ uint8_t st_info; -+ uint8_t st_other; -+ -+ } __attribute__((packed)) relocation; -+ -+ const Elf64_Sym *symbol; -+ size_t loop; -+ -+ /* contribute the relevant bits from a join of { RELA, SYMBOL, SECTION } */ -+ for (loop = 0; loop < nrels; loop++) { -+ Elf64_Section st_shndx; -+ Elf64_Xword r_info; -+ -+ /* decode the relocation */ -+ r_info = get64(&relatab[loop].r_info); -+ relocation.r_offset = relatab[loop].r_offset; -+ relocation.r_addend = relatab[loop].r_addend; -+ set32(&relocation.r_type, ELF64_R_TYPE(r_info)); -+ -+ if (ELF64_R_SYM(r_info) >= nsyms) { -+ fprintf(stderr, "Invalid symbol ID %zx in relocation %zu\n", -+ (size_t)ELF64_R_SYM(r_info), loop); -+ exit(1); -+ } -+ -+ /* decode the symbol referenced by the relocation */ -+ symbol = &symbols[ELF64_R_SYM(r_info)]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = symbol->st_shndx; -+ st_shndx = get16(&symbol->st_shndx); -+ -+ /* canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < nsects) -+ set16(&relocation.st_shndx, canonmap[st_shndx]); -+ -+ write_out_val(relocation); -+ -+ /* undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + get32(&symbol->st_name); -+ write_out(name, strlen(name) + 1); -+ } -+ } -+ -+ verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); -+} -+ -+/* -+ * extract a REL table -+ * - need to canonicalise the entries in case section addition/removal has -+ * rearranged the symbol table and the section table -+ */ -+static void extract_elf64_rel(const void *buffer, int secix, int targetix, -+ const Elf64_Rel *relatab, size_t nrels, -+ const Elf64_Sym *symbols, size_t nsyms, -+ const Elf64_Shdr *sections, size_t nsects, int *canonmap, -+ const char *strings, size_t nstrings, -+ const char *sh_name) -+{ -+ struct { -+ uint64_t r_offset; -+ uint64_t st_value; -+ uint64_t st_size; -+ uint32_t r_type; -+ uint16_t st_shndx; -+ uint8_t st_info; -+ uint8_t st_other; -+ -+ } __attribute__((packed)) relocation; -+ -+ const Elf64_Sym *symbol; -+ size_t loop; -+ -+ /* contribute the relevant bits from a join of { RELA, SYMBOL, SECTION } */ -+ for (loop = 0; loop < nrels; loop++) { -+ Elf64_Section st_shndx; -+ Elf64_Xword r_info; -+ -+ /* decode the relocation */ -+ r_info = get64(&relatab[loop].r_info); -+ relocation.r_offset = relatab[loop].r_offset; -+ set32(&relocation.r_type, ELF64_R_TYPE(r_info)); -+ -+ if (ELF64_R_SYM(r_info) >= nsyms) { -+ fprintf(stderr, "Invalid symbol ID %zx in relocation %zu\n", -+ (size_t)ELF64_R_SYM(r_info), loop); -+ exit(1); -+ } -+ -+ /* decode the symbol referenced by the relocation */ -+ symbol = &symbols[ELF64_R_SYM(r_info)]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = symbol->st_shndx; -+ st_shndx = get16(&symbol->st_shndx); -+ -+ /* canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < nsects) -+ set16(&relocation.st_shndx, canonmap[st_shndx]); -+ -+ write_out_val(relocation); -+ -+ /* undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + get32(&symbol->st_name); -+ write_out(name, strlen(name) + 1); -+ } -+ } -+ -+ verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); -+} -+ -+/* -+ * extract the data from a 64-bit module -+ */ -+static void extract_elf64(void *buffer, size_t len, Elf64_Ehdr *hdr) -+{ -+ const Elf64_Sym *symbols; -+ Elf64_Shdr *sections; -+ const char *secstrings, *strings; -+ size_t nsyms, nstrings; -+ int loop, shnum, *canonlist, *canonmap, canon, changed, tmp; -+ -+ sections = buffer + get64(&hdr->e_shoff); -+ secstrings = buffer + get64(§ions[get16(&hdr->e_shstrndx)].sh_offset); -+ shnum = get16(&hdr->e_shnum); -+ -+ /* find the symbol table and the string table and produce a list of -+ * index numbers of sections that contribute to the kernel's module -+ * image -+ */ -+ canonlist = calloc(sizeof(int), shnum * 2); -+ if (!canonlist) { -+ perror("calloc"); -+ exit(1); -+ } -+ canonmap = canonlist + shnum; -+ canon = 0; -+ -+ symbols = NULL; -+ strings = NULL; -+ nstrings = 0; -+ nsyms = 0; -+ -+ for (loop = 1; loop < shnum; loop++) { -+ const char *sh_name = secstrings + get32(§ions[loop].sh_name); -+ Elf64_Word sh_type = get32(§ions[loop].sh_type); -+ Elf64_Xword sh_size = get64(§ions[loop].sh_size); -+ Elf64_Xword sh_flags = get64(§ions[loop].sh_flags); -+ Elf64_Word sh_info = get32(§ions[loop].sh_info); -+ Elf64_Off sh_offset = get64(§ions[loop].sh_offset); -+ void *data = buffer + sh_offset; -+ -+ /* quick sanity check */ -+ if (sh_type != SHT_NOBITS && len < sh_offset + sh_size) { -+ fprintf(stderr, "Section goes beyond EOF\n"); -+ exit(3); -+ } -+ -+ /* we only need to canonicalise allocatable sections */ -+ if (sh_flags & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ else if ((sh_type == SHT_REL || sh_type == SHT_RELA) && -+ get64(§ions[sh_info].sh_flags) & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ -+ /* keep track of certain special sections */ -+ switch (sh_type) { -+ case SHT_SYMTAB: -+ if (strcmp(sh_name, ".symtab") == 0) { -+ symbols = data; -+ nsyms = sh_size / sizeof(Elf64_Sym); -+ } -+ break; -+ -+ case SHT_STRTAB: -+ if (strcmp(sh_name, ".strtab") == 0) { -+ strings = data; -+ nstrings = sh_size; -+ } -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ if (!symbols) { -+ fprintf(stderr, "Couldn't locate symbol table\n"); -+ exit(3); -+ } -+ -+ if (!strings) { -+ fprintf(stderr, "Couldn't locate strings table\n"); -+ exit(3); -+ } -+ -+ /* canonicalise the index numbers of the contributing section */ -+ do { -+ changed = 0; -+ -+ for (loop = 0; loop < canon - 1; loop++) { -+ const char *x = secstrings + get32(§ions[canonlist[loop + 0]].sh_name); -+ const char *y = secstrings + get32(§ions[canonlist[loop + 1]].sh_name); -+ if (strcmp(x, y) > 0) { -+ tmp = canonlist[loop + 0]; -+ canonlist[loop + 0] = canonlist[loop + 1]; -+ canonlist[loop + 1] = tmp; -+ changed = 1; -+ } -+ } -+ -+ } while (changed); -+ -+ for (loop = 0; loop < canon; loop++) -+ canonmap[canonlist[loop]] = loop + 1; -+ -+ if (is_verbose > 1) { -+ printf("\nSection canonicalisation map:\n"); -+ for (loop = 1; loop < shnum; loop++) { -+ const char *x = secstrings + get32(§ions[loop].sh_name); -+ printf("%4d %s\n", canonmap[loop], x); -+ } -+ -+ printf("\nAllocated section list in canonical order:\n"); -+ for (loop = 0; loop < canon; loop++) { -+ const char *x = secstrings + get32(§ions[canonlist[loop]].sh_name); -+ printf("%4d %s\n", canonlist[loop], x); -+ } -+ } -+ -+ /* iterate through the section table looking for sections we want to -+ * contribute to the signature */ -+ verbose("\n"); -+ verbose("CAN FILE POS CS SECT NAME\n"); -+ verbose("=== ======== == ==== ==============================\n"); -+ -+ for (loop = 0; loop < canon; loop++) { -+ int sect = canonlist[loop]; -+ const char *sh_name = secstrings + get32(§ions[sect].sh_name); -+ Elf64_Word sh_type = get32(§ions[sect].sh_type); -+ Elf64_Xword sh_size = get64(§ions[sect].sh_size); -+ Elf64_Xword sh_flags = get64(§ions[sect].sh_flags); -+ Elf64_Word sh_info = get32(§ions[sect].sh_info); -+ Elf64_Off sh_offset = get64(§ions[sect].sh_offset); -+ void *data = buffer + sh_offset; -+ -+ csum = 0; -+ -+ /* include canonicalised relocation sections */ -+ if (sh_type == SHT_REL || sh_type == SHT_RELA) { -+ Elf32_Word canon_sh_info; -+ -+ if (sh_info <= 0 && sh_info >= hdr->e_shnum) { -+ fprintf(stderr, -+ "Invalid ELF - REL/RELA sh_info does" -+ " not refer to a valid section\n"); -+ exit(3); -+ } -+ -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ set32(&canon_sh_info, canonmap[sh_info]); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ write_out_val(canon_sh_info); -+ -+ if (sh_type == SHT_RELA) -+ extract_elf64_rela(buffer, sect, sh_info, -+ data, sh_size / sizeof(Elf64_Rela), -+ symbols, nsyms, -+ sections, shnum, canonmap, -+ strings, nstrings, -+ sh_name); -+ else -+ extract_elf64_rel(buffer, sect, sh_info, -+ data, sh_size / sizeof(Elf64_Rel), -+ symbols, nsyms, -+ sections, shnum, canonmap, -+ strings, nstrings, -+ sh_name); -+ continue; -+ } -+ -+ /* include the headers of BSS sections */ -+ if (sh_type == SHT_NOBITS && sh_flags & SHF_ALLOC) { -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ -+ verbose("%02x %4d %s\n", csum, sect, sh_name); -+ } -+ -+ /* include allocatable loadable sections */ -+ if (sh_type != SHT_NOBITS && sh_flags & SHF_ALLOC) -+ goto include_section; -+ -+ /* not this section */ -+ continue; -+ -+ include_section: -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ -+ /* write out the section data */ -+ write_out(data, sh_size); -+ -+ verbose("%02x %4d %s\n", csum, sect, sh_name); -+ } -+ -+ verbose("%08lx (%lu bytes csum 0x%02x)\n", -+ ftell(outfd), ftell(outfd), xcsum); -+} -+ -+/* -+ * extract a RELA table -+ * - need to canonicalise the entries in case section addition/removal has -+ * rearranged the symbol table and the section table -+ */ -+static void extract_elf32_rela(const void *buffer, int secix, int targetix, -+ const Elf32_Rela *relatab, size_t nrels, -+ const Elf32_Sym *symbols, size_t nsyms, -+ const Elf32_Shdr *sections, size_t nsects, -+ int *canonmap, -+ const char *strings, size_t nstrings, -+ const char *sh_name) -+{ -+ struct { -+ uint32_t r_offset; -+ uint32_t r_addend; -+ uint32_t st_value; -+ uint32_t st_size; -+ uint16_t st_shndx; -+ uint8_t r_type; -+ uint8_t st_info; -+ uint8_t st_other; -+ -+ } __attribute__((packed)) relocation; -+ -+ const Elf32_Sym *symbol; -+ size_t loop; -+ -+ /* contribute the relevant bits from a join of { RELA, SYMBOL, SECTION } */ -+ for (loop = 0; loop < nrels; loop++) { -+ Elf32_Section st_shndx; -+ Elf32_Word r_info; -+ -+ /* decode the relocation */ -+ r_info = get32(&relatab[loop].r_info); -+ relocation.r_offset = relatab[loop].r_offset; -+ relocation.r_addend = relatab[loop].r_addend; -+ relocation.r_type = ELF32_R_TYPE(r_info); -+ -+ if (ELF32_R_SYM(r_info) >= nsyms) { -+ fprintf(stderr, "Invalid symbol ID %x in relocation %zu\n", -+ ELF32_R_SYM(r_info), loop); -+ exit(1); -+ } -+ -+ /* decode the symbol referenced by the relocation */ -+ symbol = &symbols[ELF32_R_SYM(r_info)]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = symbol->st_shndx; -+ st_shndx = get16(&symbol->st_shndx); -+ -+ /* canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < nsects) -+ set16(&relocation.st_shndx, canonmap[st_shndx]); -+ -+ write_out_val(relocation); -+ -+ /* undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + get32(&symbol->st_name); -+ write_out(name, strlen(name) + 1); -+ } -+ } -+ -+ verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); -+} -+ -+/* -+ * extract a REL table -+ * - need to canonicalise the entries in case section addition/removal has -+ * rearranged the symbol table and the section table -+ */ -+static void extract_elf32_rel(const void *buffer, int secix, int targetix, -+ const Elf32_Rel *relatab, size_t nrels, -+ const Elf32_Sym *symbols, size_t nsyms, -+ const Elf32_Shdr *sections, size_t nsects, -+ int *canonmap, -+ const char *strings, size_t nstrings, -+ const char *sh_name) -+{ -+ struct { -+ uint32_t r_offset; -+ uint32_t st_value; -+ uint32_t st_size; -+ uint16_t st_shndx; -+ uint8_t r_type; -+ uint8_t st_info; -+ uint8_t st_other; -+ -+ } __attribute__((packed)) relocation; -+ -+ const Elf32_Sym *symbol; -+ size_t loop; -+ -+ /* contribute the relevant bits from a join of { RELA, SYMBOL, SECTION } */ -+ for (loop = 0; loop < nrels; loop++) { -+ Elf32_Section st_shndx; -+ Elf32_Word r_info; -+ -+ /* decode the relocation */ -+ r_info = get32(&relatab[loop].r_info); -+ relocation.r_offset = relatab[loop].r_offset; -+ relocation.r_type = ELF32_R_TYPE(r_info); -+ -+ if (ELF32_R_SYM(r_info) >= nsyms) { -+ fprintf(stderr, "Invalid symbol ID %x in relocation %zu\n", -+ ELF32_R_SYM(r_info), loop); -+ exit(1); -+ } -+ -+ /* decode the symbol referenced by the relocation */ -+ symbol = &symbols[ELF32_R_SYM(r_info)]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = symbol->st_shndx; -+ st_shndx = get16(&symbol->st_shndx); -+ -+ /* canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < nsects) -+ set16(&relocation.st_shndx, canonmap[st_shndx]); -+ -+ write_out_val(relocation); -+ -+ /* undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + get32(&symbol->st_name); -+ write_out(name, strlen(name) + 1); -+ } -+ } -+ -+ verbose("%02x %4d %s [canon]\n", csum, secix, sh_name); -+} -+ -+/* -+ * extract the data from a 32-bit module -+ */ -+static void extract_elf32(void *buffer, size_t len, Elf32_Ehdr *hdr) -+{ -+ const Elf32_Sym *symbols; -+ Elf32_Shdr *sections; -+ const char *secstrings, *strings; -+ size_t nsyms, nstrings; -+ int loop, shnum, *canonlist, *canonmap, canon, changed, tmp; -+ -+ sections = buffer + get32(&hdr->e_shoff); -+ secstrings = buffer + get32(§ions[get16(&hdr->e_shstrndx)].sh_offset); -+ shnum = get16(&hdr->e_shnum); -+ -+ /* find the symbol table and the string table and produce a list of -+ * index numbers of sections that contribute to the kernel's module -+ * image -+ */ -+ canonlist = calloc(sizeof(int), shnum * 2); -+ if (!canonlist) { -+ perror("calloc"); -+ exit(1); -+ } -+ canonmap = canonlist + shnum; -+ canon = 0; -+ -+ symbols = NULL; -+ strings = NULL; -+ nstrings = 0; -+ nsyms = 0; -+ -+ for (loop = 1; loop < shnum; loop++) { -+ const char *sh_name = secstrings + get32(§ions[loop].sh_name); -+ Elf32_Word sh_type = get32(§ions[loop].sh_type); -+ Elf32_Xword sh_size = get32(§ions[loop].sh_size); -+ Elf32_Xword sh_flags = get32(§ions[loop].sh_flags); -+ Elf64_Word sh_info = get32(§ions[loop].sh_info); -+ Elf32_Off sh_offset = get32(§ions[loop].sh_offset); -+ void *data = buffer + sh_offset; -+ -+ /* quick sanity check */ -+ if (sh_type != SHT_NOBITS && len < sh_offset + sh_size) { -+ fprintf(stderr, "Section goes beyond EOF\n"); -+ exit(3); -+ } -+ -+ /* we only need to canonicalise allocatable sections */ -+ if (sh_flags & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ else if ((sh_type == SHT_REL || sh_type == SHT_RELA) && -+ get32(§ions[sh_info].sh_flags) & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ -+ /* keep track of certain special sections */ -+ switch (sh_type) { -+ case SHT_SYMTAB: -+ if (strcmp(sh_name, ".symtab") == 0) { -+ symbols = data; -+ nsyms = sh_size / sizeof(Elf32_Sym); -+ } -+ break; -+ -+ case SHT_STRTAB: -+ if (strcmp(sh_name, ".strtab") == 0) { -+ strings = data; -+ nstrings = sh_size; -+ } -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ if (!symbols) { -+ fprintf(stderr, "Couldn't locate symbol table\n"); -+ exit(3); -+ } -+ -+ if (!strings) { -+ fprintf(stderr, "Couldn't locate strings table\n"); -+ exit(3); -+ } -+ -+ /* canonicalise the index numbers of the contributing section */ -+ do { -+ changed = 0; -+ -+ for (loop = 0; loop < canon - 1; loop++) { -+ const char *x = secstrings + get32(§ions[canonlist[loop + 0]].sh_name); -+ const char *y = secstrings + get32(§ions[canonlist[loop + 1]].sh_name); -+ if (strcmp(x, y) > 0) { -+ tmp = canonlist[loop + 0]; -+ canonlist[loop + 0] = canonlist[loop + 1]; -+ canonlist[loop + 1] = tmp; -+ changed = 1; -+ } -+ } -+ -+ } while (changed); -+ -+ for (loop = 0; loop < canon; loop++) -+ canonmap[canonlist[loop]] = loop + 1; -+ -+ if (is_verbose > 1) { -+ printf("\nSection canonicalisation map:\n"); -+ for (loop = 1; loop < shnum; loop++) { -+ const char *x = secstrings + get32(§ions[loop].sh_name); -+ printf("%4d %s\n", canonmap[loop], x); -+ } -+ -+ printf("\nAllocated section list in canonical order:\n"); -+ for (loop = 0; loop < canon; loop++) { -+ const char *x = secstrings + get32(§ions[canonlist[loop]].sh_name); -+ printf("%4d %s\n", canonlist[loop], x); -+ } -+ } -+ -+ /* iterate through the section table looking for sections we want to -+ * contribute to the signature */ -+ verbose("\n"); -+ verbose("CAN FILE POS CS SECT NAME\n"); -+ verbose("=== ======== == ==== ==============================\n"); -+ -+ for (loop = 0; loop < canon; loop++) { -+ int sect = canonlist[loop]; -+ const char *sh_name = secstrings + get32(§ions[sect].sh_name); -+ Elf32_Word sh_type = get32(§ions[sect].sh_type); -+ Elf32_Xword sh_size = get32(§ions[sect].sh_size); -+ Elf32_Xword sh_flags = get32(§ions[sect].sh_flags); -+ Elf32_Word sh_info = get32(§ions[sect].sh_info); -+ Elf32_Off sh_offset = get32(§ions[sect].sh_offset); -+ void *data = buffer + sh_offset; -+ -+ csum = 0; -+ -+ /* quick sanity check */ -+ if (sh_type != SHT_NOBITS && len < sh_offset + sh_size) { -+ fprintf(stderr, "section goes beyond EOF\n"); -+ exit(3); -+ } -+ -+ /* include canonicalised relocation sections */ -+ if (sh_type == SHT_REL || sh_type == SHT_RELA) { -+ Elf32_Word canon_sh_info; -+ -+ if (sh_info <= 0 && sh_info >= hdr->e_shnum) { -+ fprintf(stderr, -+ "Invalid ELF - REL/RELA sh_info does" -+ " not refer to a valid section\n"); -+ exit(3); -+ } -+ -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ set32(&canon_sh_info, canonmap[sh_info]); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ write_out_val(canon_sh_info); -+ -+ if (sh_type == SHT_RELA) -+ extract_elf32_rela(buffer, sect, sh_info, -+ data, sh_size / sizeof(Elf32_Rela), -+ symbols, nsyms, -+ sections, shnum, canonmap, -+ strings, nstrings, -+ sh_name); -+ else -+ extract_elf32_rel(buffer, sect, sh_info, -+ data, sh_size / sizeof(Elf32_Rel), -+ symbols, nsyms, -+ sections, shnum, canonmap, -+ strings, nstrings, -+ sh_name); -+ continue; -+ } -+ -+ /* include the headers of BSS sections */ -+ if (sh_type == SHT_NOBITS && sh_flags & SHF_ALLOC) { -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ -+ verbose("%02x %4d %s\n", csum, sect, sh_name); -+ } -+ -+ /* include allocatable loadable sections */ -+ if (sh_type != SHT_NOBITS && sh_flags & SHF_ALLOC) -+ goto include_section; -+ -+ /* not this section */ -+ continue; -+ -+ include_section: -+ verbose("%3u %08lx ", loop, ftell(outfd)); -+ -+ /* write out selected portions of the section header */ -+ write_out(sh_name, strlen(sh_name)); -+ write_out_val(sections[sect].sh_type); -+ write_out_val(sections[sect].sh_flags); -+ write_out_val(sections[sect].sh_size); -+ write_out_val(sections[sect].sh_addralign); -+ -+ /* write out the section data */ -+ write_out(data, sh_size); -+ -+ verbose("%02x %4d %s\n", csum, sect, sh_name); -+ } -+ -+ verbose("%08lx (%lu bytes csum 0x%02x)\n", -+ ftell(outfd), ftell(outfd), xcsum); -+} -diff --git a/scripts/mod/modsign-note.sh b/scripts/mod/modsign-note.sh -new file mode 100644 -index 0000000..bca67c0 ---- /dev/null -+++ b/scripts/mod/modsign-note.sh -@@ -0,0 +1,16 @@ -+#!/bin/sh -+# -+# Generate a module signature note source file -+# -+# mod-sign.sh <sig-file> ><note-src-file> -+# -+ -+SIG=$1 -+ -+cat <<EOF -+#include <linux/modsign.h> -+ -+ELFNOTE(MODSIGN_NOTE_NAME, MODSIGN_NOTE_TYPE, .incbin "$SIG") -+EOF -+ -+exit 0 --- -1.7.10.4 - - -From 05f68f1852611dd7f2f7d28c677b1205b66d4337 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:27:49 +0100 -Subject: [PATCH 20/27] MODSIGN: Module signature verification stub - -Create a stub for the module signature verifier and link it into module.c so -that it gets called. A field is added to struct module to record whether or -not a valid module signature was detected. - -The stub also implements the policy for handling unsigned modules and the -printing of error messages to indicate various problems with the module. - -If CONFIG_MODULE_SIG_FORCE is enabled or "enforcemodulesig=1" is supplied on -the kernel command line, the kernel will _only_ load validly signed modules -for which it has a public key. Otherwise, it will also load modules that are -unsigned. Any module for which the kernel has a key, but which proves to have -a signature mismatch will not be permitted to load. - -This table indicates the behaviours in the various situations: - - MODULE STATE PERMISSIVE MODE ENFORCING MODE - ======================================= =============== =============== - Unsigned Ok EKEYREJECTED - Signed, no public key ENOKEY ENOKEY - Validly signed, public key Ok Ok - Invalidly signed, public key EKEYREJECTED EKEYREJECTED - Validly signed, expired key EKEYEXPIRED EKEYEXPIRED - Signed, hash algorithm unavailable ENOPKG ENOPKG - Corrupt signature EBADMSG EBADMSG - Corrupt ELF ELIBBAD ELIBBAD - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - include/linux/module.h | 3 ++ - kernel/Makefile | 1 + - kernel/module-verify-defs.h | 77 ++++++++++++++++++++++++++++++ - kernel/module-verify.c | 110 +++++++++++++++++++++++++++++++++++++++++++ - kernel/module-verify.h | 20 ++++++++ - kernel/module.c | 26 ++++++++-- - 6 files changed, 232 insertions(+), 5 deletions(-) - create mode 100644 kernel/module-verify-defs.h - create mode 100644 kernel/module-verify.c - create mode 100644 kernel/module-verify.h - -diff --git a/include/linux/module.h b/include/linux/module.h -index fbcafe2..7391833 100644 ---- a/include/linux/module.h -+++ b/include/linux/module.h -@@ -227,6 +227,9 @@ struct module - /* Unique handle for this module */ - char name[MODULE_NAME_LEN]; - -+ /* Is this module GPG signed */ -+ bool gpgsig_ok; -+ - /* Sysfs stuff. */ - struct module_kobject mkobj; - struct module_attribute *modinfo_attrs; -diff --git a/kernel/Makefile b/kernel/Makefile -index c0cc67a..cec222a 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -55,6 +55,7 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o - obj-$(CONFIG_PROVE_LOCKING) += spinlock.o - obj-$(CONFIG_UID16) += uid16.o - obj-$(CONFIG_MODULES) += module.o -+obj-$(CONFIG_MODULE_SIG) += module-verify.o - obj-$(CONFIG_KALLSYMS) += kallsyms.o - obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o - obj-$(CONFIG_KEXEC) += kexec.o -diff --git a/kernel/module-verify-defs.h b/kernel/module-verify-defs.h -new file mode 100644 -index 0000000..141ddab ---- /dev/null -+++ b/kernel/module-verify-defs.h -@@ -0,0 +1,77 @@ -+/* Module verification internal definitions -+ * -+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#ifdef CONFIG_MODULE_SIG -+ -+/* -+ * Internal state -+ */ -+struct module_verify_data { -+ struct crypto_key_verify_context *mod_sig; /* Module signing context */ -+ union { -+ const void *buffer; /* module buffer */ -+ const Elf_Ehdr *hdr; /* ELF header */ -+ }; -+ const Elf_Shdr *sections; /* ELF section table */ -+ const char *secstrings; /* ELF section string table */ -+ const void *sig; /* Signature note content */ -+ size_t size; /* module object size */ -+ size_t nsects; /* number of sections */ -+ size_t sig_size; /* Size of signature */ -+ size_t signed_size; /* count of bytes contributed to digest */ -+ unsigned *canonlist; /* list of canonicalised sections */ -+ unsigned *canonmap; /* section canonicalisation map */ -+ unsigned ncanon; /* number of canonicalised sections */ -+ unsigned sig_index; /* module signature section index */ -+ uint8_t xcsum; /* checksum of bytes contributed to digest */ -+ uint8_t csum; /* checksum of bytes representing a section */ -+}; -+ -+/* -+ * Whether or not we support various types of ELF relocation record -+ */ -+#if defined(MODULE_HAS_ELF_REL_ONLY) -+#define is_elf_rel(sh_type) ((sh_type) == SHT_REL) -+#define is_elf_rela(sh_type) (0) -+#elif defined(MODULE_HAS_ELF_RELA_ONLY) -+#define is_elf_rel(sh_type) (0) -+#define is_elf_rela(sh_type) ((sh_type) == SHT_RELA) -+#else -+#define is_elf_rel(sh_type) ((sh_type) == SHT_REL) -+#define is_elf_rela(sh_type) ((sh_type) == SHT_RELA) -+#endif -+ -+/* -+ * Debugging. Define DEBUG to enable. -+ */ -+#define _debug(FMT, ...) \ -+ do { \ -+ if (unlikely(modsign_debug)) \ -+ pr_debug(FMT, ##__VA_ARGS__); \ -+ } while (0) -+ -+#ifdef DEBUG -+#define count_and_csum(C, __p, __n) \ -+ do { \ -+ int __loop; \ -+ for (__loop = 0; __loop < __n; __loop++) { \ -+ (C)->csum += __p[__loop]; \ -+ (C)->xcsum += __p[__loop]; \ -+ } \ -+ (C)->signed_size += __n; \ -+ } while (0) -+#else -+#define count_and_csum(C, __p, __n) \ -+ do { \ -+ } while (0) -+#endif -+ -+#endif /* CONFIG_MODULE_SIG */ -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -new file mode 100644 -index 0000000..4bf857e ---- /dev/null -+++ b/kernel/module-verify.c -@@ -0,0 +1,110 @@ -+/* Module signature verification -+ * -+ * The code in this file examines a signed kernel module and attempts to -+ * determine if the PGP signature inside the module matches a digest of the -+ * allocatable sections and the canonicalised relocation tables for those -+ * allocatable sections. -+ * -+ * The module signature is included in an ELF note within the ELF structure of -+ * the module blob. This, combined with the minimal canonicalisation performed -+ * here, permits the module to pass through "strip -x", "strip -g" and -+ * "eu-strip" without becoming corrupt. "strip" and "strip -s" will render a -+ * module unusable by removing the symbol table. -+ * -+ * Copyright (C) 2004, 2011, 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * - Derived from GregKH's RSA module signer -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+ -+#undef DEBUG -+#include <linux/kernel.h> -+#include <linux/module.h> -+#include <linux/slab.h> -+#include <linux/err.h> -+#include <linux/elf.h> -+#include <linux/elfnote.h> -+#include <linux/sched.h> -+#include <linux/cred.h> -+#include <linux/modsign.h> -+#include <linux/moduleparam.h> -+#include <keys/crypto-type.h> -+#include "module-verify.h" -+#include "module-verify-defs.h" -+ -+#ifdef DEBUG -+static int modsign_debug; -+core_param(modsign_debug, modsign_debug, int, 0644); -+#else -+#define modsign_debug false -+#endif -+ -+#ifdef CONFIG_MODULE_SIG_FORCE -+#define modsign_signedonly true -+#else -+static bool modsign_signedonly; -+#endif -+ -+static const char modsign_note_name[] = ELFNOTE_NAME(MODSIGN_NOTE_NAME); -+static const char modsign_note_section[] = ELFNOTE_SECTION(MODSIGN_NOTE_NAME); -+ -+/* -+ * Verify a module's integrity -+ */ -+int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) -+{ -+ struct module_verify_data mvdata; -+ int ret; -+ -+ memset(&mvdata, 0, sizeof(mvdata)); -+ mvdata.buffer = hdr; -+ mvdata.size = size; -+ -+ if (mvdata.sig_index <= 0) { -+ /* Deal with an unsigned module */ -+ if (modsign_signedonly) { -+ pr_err("An attempt to load unsigned module was rejected\n"); -+ return -EKEYREJECTED; -+ } else { -+ return 0; -+ } -+ goto out; -+ } -+ -+ ret = 0; -+ -+out: -+ switch (ret) { -+ case 0: /* Good signature */ -+ *_gpgsig_ok = true; -+ break; -+ case -ELIBBAD: -+ pr_err("Module format error encountered\n"); -+ break; -+ case -EBADMSG: -+ pr_err("Module signature error encountered\n"); -+ break; -+ case -EKEYREJECTED: /* Signature mismatch or number format error */ -+ pr_err("Module signature verification failed\n"); -+ break; -+ case -ENOKEY: /* Signed, but we don't have the public key */ -+ pr_err("Module signed with unknown public key\n"); -+ break; -+ default: /* Other error (probably ENOMEM) */ -+ break; -+ } -+ return ret; -+} -+ -+static int __init sign_setup(char *str) -+{ -+#ifndef CONFIG_MODULE_SIG_FORCE -+ modsign_signedonly = true; -+#endif -+ return 0; -+} -+__setup("enforcemodulesig", sign_setup); -diff --git a/kernel/module-verify.h b/kernel/module-verify.h -new file mode 100644 -index 0000000..c640634 ---- /dev/null -+++ b/kernel/module-verify.h -@@ -0,0 +1,20 @@ -+/* Module verification definitions -+ * -+ * Copyright (C) 2004, 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+ -+#ifdef CONFIG_MODULE_SIG -+extern int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok); -+#else -+static inline int module_verify(const Elf_Ehdr *hdr, size_t size, -+ bool *_gpgsig_ok) -+{ -+ return 0; -+} -+#endif -diff --git a/kernel/module.c b/kernel/module.c -index 087aeed..a59a9da 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -58,6 +58,7 @@ - #include <linux/jump_label.h> - #include <linux/pfn.h> - #include <linux/bsearch.h> -+#include "module-verify.h" - - #define CREATE_TRACE_POINTS - #include <trace/events/module.h> -@@ -2382,7 +2383,8 @@ static inline void kmemleak_load_module(const struct module *mod, - /* Sets info->hdr and info->len. */ - static int copy_and_check(struct load_info *info, - const void __user *umod, unsigned long len, -- const char __user *uargs) -+ const char __user *uargs, -+ bool *_gpgsig_ok) - { - int err; - Elf_Ehdr *hdr; -@@ -2415,6 +2417,12 @@ static int copy_and_check(struct load_info *info, - goto free_hdr; - } - -+ /* Verify the module's contents */ -+ *_gpgsig_ok = false; -+ err = module_verify(hdr, len, _gpgsig_ok); -+ if (err < 0) -+ goto free_hdr; -+ - info->hdr = hdr; - info->len = len; - return 0; -@@ -2757,7 +2765,8 @@ int __weak module_frob_arch_sections(Elf_Ehdr *hdr, - return 0; - } - --static struct module *layout_and_allocate(struct load_info *info) -+static struct module *layout_and_allocate(struct load_info *info, -+ bool gpgsig_ok) - { - /* Module within temporary copy. */ - struct module *mod; -@@ -2767,6 +2776,7 @@ static struct module *layout_and_allocate(struct load_info *info) - mod = setup_load_info(info); - if (IS_ERR(mod)) - return mod; -+ mod->gpgsig_ok = gpgsig_ok; - - err = check_modinfo(mod, info); - if (err) -@@ -2850,17 +2860,18 @@ static struct module *load_module(void __user *umod, - struct load_info info = { NULL, }; - struct module *mod; - long err; -+ bool gpgsig_ok; - - pr_debug("load_module: umod=%p, len=%lu, uargs=%p\n", - umod, len, uargs); - - /* Copy in the blobs from userspace, check they are vaguely sane. */ -- err = copy_and_check(&info, umod, len, uargs); -+ err = copy_and_check(&info, umod, len, uargs, &gpgsig_ok); - if (err) - return ERR_PTR(err); - - /* Figure out module layout, and allocate all the memory. */ -- mod = layout_and_allocate(&info); -+ mod = layout_and_allocate(&info, gpgsig_ok); - if (IS_ERR(mod)) { - err = PTR_ERR(mod); - goto free_copy; -@@ -3497,8 +3508,13 @@ void print_modules(void) - printk(KERN_DEFAULT "Modules linked in:"); - /* Most callers should already have preempt disabled, but make sure */ - preempt_disable(); -- list_for_each_entry_rcu(mod, &modules, list) -+ list_for_each_entry_rcu(mod, &modules, list) { - printk(" %s%s", mod->name, module_flags(mod, buf)); -+#ifdef CONFIG_MODULE_SIG -+ if (!mod->gpgsig_ok) -+ printk("(U)"); -+#endif -+ } - preempt_enable(); - if (last_unloaded_module[0]) - printk(" [last unloaded: %s]", last_unloaded_module); --- -1.7.10.4 - - -From a8622506bccd42aecd271d2735f6734e539125ac Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:28:33 +0100 -Subject: [PATCH 21/27] MODSIGN: Automatically generate module signing keys if - missing - -Automatically generate keys for module signing if they're absent so that -allyesconfig doesn't break. The builder should consider generating their own -keyrings, however, so that the keys are appropriately named and any extra keys -required get imported. - -Also change the names of the keyring files to modsign.pub and modsign.sec so -that they are then a more obvious what they're about and add a dependency for -the signing rules on the keyring files so that the signatures get regenerated -if the keyrings change. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 49 insertions(+) - -diff --git a/kernel/Makefile b/kernel/Makefile -index cec222a..28cd248 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -132,3 +132,52 @@ quiet_cmd_timeconst = TIMEC $@ - targets += timeconst.h - $(obj)/timeconst.h: $(src)/timeconst.pl FORCE - $(call if_changed,timeconst) -+ -+############################################################################### -+# -+# If module signing is requested, say by allyesconfig, but a key has not been -+# supplied, then one will need to be generated to make sure the build does not -+# fail and that the kernel may be used afterwards. -+# -+############################################################################### -+ifeq ($(CONFIG_MODULE_SIG),y) -+modsign.pub modsign.sec: genkey -+ @echo "###" -+ @echo "### Now generating a PGP key pair to be used for signing modules." -+ @echo "###" -+ @echo "### If this takes a long time, you might wish to run rngd in the" -+ @echo "### background to keep the supply of entropy topped up. It" -+ @echo "### needs to be run as root and should use a hardware random" -+ @echo "### number generator if one is available, eg:" -+ @echo "###" -+ @echo "### rngd -r /dev/hwrandom" -+ @echo "###" -+ gpg --homedir . --batch --gen-key genkey -+ @echo "###" -+ @echo "### Key pair generated." -+ @echo "###" -+ rm -f pubring.gpg secring.gpg trustdb.gpg -+ -+genkey: -+ @echo "###" >&2 -+ @echo "### Now generating a sample key generation script." >&2 -+ @echo "###" >&2 -+ @echo "### IT IS STRONGLY RECOMMENDED THAT YOU SUPPLY YOUR OWN" >&2 -+ @echo "### SCRIPT WITH APPROPRIATE NAME FIELDS FILLED IN." >&2 -+ @echo "###" >&2 -+ @echo "### If you have a hardware random number generator feeding" >&2 -+ @echo "### into /dev/random, you should drop the %no-protection" >&2 -+ @echo "### and %transient-key lines from the script." >&2 -+ @echo "###" >&2 -+ echo "%pubring modsign.pub" >genkey -+ echo "%secring modsign.sec" >>genkey -+ echo "%no-protection: yes" >> genkey -+ echo "%transient-key: yes" >>genkey -+ echo "Key-Type: RSA" >>genkey -+ echo "Key-Length: 4096" >>genkey -+ echo "Name-Real: Sample kernel key" >>genkey -+ echo "Name-Comment: Sample kernel module signing key" >>genkey -+ echo "%commit" >>genkey -+ -+endif -+CLEAN_FILES += modsign.pub modsign.sec genkey random_seed --- -1.7.10.4 - - -From 2bde4c453e0b5ec52fe95c3fb800af86fdc38546 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:28:41 +0100 -Subject: [PATCH 22/27] MODSIGN: Provide module signing public keys to the - kernel - -Include a PGP keyring containing the public keys required to perform module -verification in the kernel image during build and create a special keyring -during boot which is then populated with keys of crypto type holding the public -keys found in the PGP keyring. - -These can be seen by root: - -[root@andromeda ~]# cat /proc/keys -07ad4ee0 I----- 1 perm 3f010000 0 0 crypto modsign.0: RSA 87b9b3bd [] -15c7f8c3 I----- 1 perm 1f030000 0 0 keyring .module_sign: 1/4 -... - -It is probably worth permitting root to invalidate these keys, resulting in -their removal and preventing further modules from being loaded with that key. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/Makefile | 25 ++++++++------- - kernel/modsign-pubkey.c | 75 +++++++++++++++++++++++++++++++++++++++++++ - kernel/module-verify-defs.h | 4 +++ - kernel/module-verify.c | 2 -- - 4 files changed, 93 insertions(+), 13 deletions(-) - create mode 100644 kernel/modsign-pubkey.c - -diff --git a/kernel/Makefile b/kernel/Makefile -index 28cd248..1d20704 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -55,7 +55,8 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o - obj-$(CONFIG_PROVE_LOCKING) += spinlock.o - obj-$(CONFIG_UID16) += uid16.o - obj-$(CONFIG_MODULES) += module.o --obj-$(CONFIG_MODULE_SIG) += module-verify.o -+obj-$(CONFIG_MODULE_SIG) += module-verify.o modsign-pubkey.o -+kernel/modsign-pubkey.o: modsign.pub - obj-$(CONFIG_KALLSYMS) += kallsyms.o - obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o - obj-$(CONFIG_KEXEC) += kexec.o -@@ -159,16 +160,18 @@ modsign.pub modsign.sec: genkey - rm -f pubring.gpg secring.gpg trustdb.gpg - - genkey: -- @echo "###" >&2 -- @echo "### Now generating a sample key generation script." >&2 -- @echo "###" >&2 -- @echo "### IT IS STRONGLY RECOMMENDED THAT YOU SUPPLY YOUR OWN" >&2 -- @echo "### SCRIPT WITH APPROPRIATE NAME FIELDS FILLED IN." >&2 -- @echo "###" >&2 -- @echo "### If you have a hardware random number generator feeding" >&2 -- @echo "### into /dev/random, you should drop the %no-protection" >&2 -- @echo "### and %transient-key lines from the script." >&2 -- @echo "###" >&2 -+ @echo "kernel/Makefile:163: ###" >&2 -+ @echo "kernel/Makefile:163: ### CONFIG_MODULE_SIG is enabled so a public key is needed." >&2 -+ @echo "kernel/Makefile:163: ###" >&2 -+ @echo "kernel/Makefile:163: ### Now generating a sample key generation script." >&2 -+ @echo "kernel/Makefile:163: ###" >&2 -+ @echo "kernel/Makefile:163: ### IT IS STRONGLY RECOMMENDED THAT YOU SUPPLY YOUR OWN" >&2 -+ @echo "kernel/Makefile:163: ### SCRIPT WITH APPROPRIATE NAME FIELDS FILLED IN." >&2 -+ @echo "kernel/Makefile:163: ###" >&2 -+ @echo "kernel/Makefile:163: ### If you have a hardware random number generator feeding" >&2 -+ @echo "kernel/Makefile:163: ### into /dev/random, you should drop the %no-protection" >&2 -+ @echo "kernel/Makefile:163: ### and %transient-key lines from the script." >&2 -+ @echo "kernel/Makefile:163: ###" >&2 - echo "%pubring modsign.pub" >genkey - echo "%secring modsign.sec" >>genkey - echo "%no-protection: yes" >> genkey -diff --git a/kernel/modsign-pubkey.c b/kernel/modsign-pubkey.c -new file mode 100644 -index 0000000..17e02f5 ---- /dev/null -+++ b/kernel/modsign-pubkey.c -@@ -0,0 +1,75 @@ -+/* Public keys for module signature verification -+ * -+ * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/sched.h> -+#include <linux/cred.h> -+#include <linux/err.h> -+#include <keys/crypto-type.h> -+#include "module-verify-defs.h" -+ -+struct key *modsign_keyring; -+ -+extern __initdata const u8 modsign_public_keys[]; -+extern __initdata const u8 modsign_public_keys_end[]; -+asm(".section .init.data,\"aw\"\n" -+ "modsign_public_keys:\n" -+ ".incbin \"modsign.pub\"\n" -+ "modsign_public_keys_end:" -+ ); -+ -+/* -+ * We need to make sure ccache doesn't cache the .o file as it doesn't notice -+ * if modsign.pub changes. -+ */ -+static __initdata const char annoy_ccache[] = __TIME__ "foo"; -+ -+/* -+ * Load the compiled-in keys -+ */ -+static __init int module_verify_init(void) -+{ -+ pr_notice("Initialise module verification\n"); -+ -+ modsign_keyring = key_alloc(&key_type_keyring, ".module_sign", -+ 0, 0, current_cred(), -+ (KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ, -+ KEY_ALLOC_NOT_IN_QUOTA); -+ if (IS_ERR(modsign_keyring)) -+ panic("Can't allocate module signing keyring\n"); -+ -+ if (key_instantiate_and_link(modsign_keyring, NULL, 0, NULL, NULL) < 0) -+ panic("Can't instantiate module signing keyring\n"); -+ -+ return 0; -+} -+ -+/* -+ * Must be initialised before we try and load the keys into the keyring. -+ */ -+device_initcall(module_verify_init); -+ -+/* -+ * Load the compiled-in keys -+ */ -+static __init int modsign_pubkey_init(void) -+{ -+ pr_notice("Load module verification keys\n"); -+ -+ if (preload_pgp_keys(modsign_public_keys, -+ modsign_public_keys_end - modsign_public_keys, -+ modsign_keyring, "modsign.") < 0) -+ panic("Can't load module signing keys\n"); -+ -+ return 0; -+} -+late_initcall(modsign_pubkey_init); -diff --git a/kernel/module-verify-defs.h b/kernel/module-verify-defs.h -index 141ddab..2fe31e1 100644 ---- a/kernel/module-verify-defs.h -+++ b/kernel/module-verify-defs.h -@@ -11,6 +11,10 @@ - - #ifdef CONFIG_MODULE_SIG - -+#include <linux/module.h> -+ -+extern struct key *modsign_keyring; -+ - /* - * Internal state - */ -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index 4bf857e..05473e6 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -28,8 +28,6 @@ - #include <linux/err.h> - #include <linux/elf.h> - #include <linux/elfnote.h> --#include <linux/sched.h> --#include <linux/cred.h> - #include <linux/modsign.h> - #include <linux/moduleparam.h> - #include <keys/crypto-type.h> --- -1.7.10.4 - - -From 689ea2a8739a5d61b7c55cd9084dd3096585c6de Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:29:17 +0100 -Subject: [PATCH 23/27] MODSIGN: Check the ELF container - -Check the ELF container of the kernel module to prevent the kernel from -crashing or getting corrupted whilst trying to use it and locate the module -signature note if present. - -We try to check as little as possible. We check the metadata that the -signature checker actually has to use, and leave anything that it doesn't -actually need to the signature to catch. - -The stuff we need to check is: - - (1) The locations and offsets in the ELF header of important parts like the - section table. - - (2) The section table. Note that we only check sh_info for section types that - we're actually interested in (string, symbol and relocation tables). We - also check that alignments are what we expect for those tables. - - (3) That non-empty string tables have the required NUL at the end so that we - can be sure that all strings therein are NUL-terminated. We don't bother - checking for the required NUL at the beginning as it shouldn't cause a - problem to us. - - (4) The name offset and section index in each symbol. We could defer this to - when we deal with the relocation tables so that we only check symbols that - are used by relocations - but we would then end up checking some symbols - multiple times. - - (5) The module signature note section and the first note in it if present. - - (6) That relocations applied to an allocatable section only refer to - symbols in allocatable sections and absolute symbols (done in the module - signing code rather than here). - -Note that these checks survive "strip -x", "strip -g" and "eu-strip" being -applied to a module and detect if the module was given to "strip" or "strip -s" -and report an error. - -We can skip some direct checks that turn out unnecessary or redundant: - - (1) That sh_link has a greater than 0 value for symbol tables and relocation - tables. These require the index of a string table and a symbol table - respectively - and since we have already checked section 0 is of SHT_NULL - type, checking the symbol type renders the sh_link > 0 check redundant. - - (2) That a non-empty string table begins with a NUL. Since we check the - string table ends with a NUL, any string in there will be NUL-terminated - and shouldn't cause us to transgress beyond the bounds of the string table - when using strlen(). - - (3) That strings in a string table actually make sense. We don't care, so - long as it is NUL terminated. Any string that refers to an undefined - symbol is added to the crypto digest and will be checked that way. - Strings that we directly look for (such as ".modinfo") will be validated - by that. - - (4) That sections don't overlap. We don't actually care if sections overlap - in the file, provided we don't see bad metadata. If the sections holding - the allocatable content overlap, then the signature check is likely to - fail. - - (5) That symbol values and relocation offsets and addends make sense. We just - add this data to the digest if it pertains to an allocatable section. - - (6) That allocatable note sections, other than the signature note, make sense. - The contents of these get added to the digest in their entirety, so we - don't need to check them manually. - -If bad ELF is detected, ELIBBAD is indicated. - -Note! The "noinline" attribute on the module_verify_elf() function results in -somewhat smaller code. Similarly, having separate loops to check basic section -parameters and to check type-specific features of sections results in smaller -code, presumably because some local variables can be discarded. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/module-verify.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 230 insertions(+) - -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index 05473e6..2161d11 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -51,6 +51,228 @@ static const char modsign_note_name[] = ELFNOTE_NAME(MODSIGN_NOTE_NAME); - static const char modsign_note_section[] = ELFNOTE_SECTION(MODSIGN_NOTE_NAME); - - /* -+ * Verify the minimum amount of ELF structure of a module needed to check the -+ * module's signature without bad ELF crashing the kernel. -+ */ -+static noinline int module_verify_elf(struct module_verify_data *mvdata) -+{ -+ const struct elf_note *note; -+ const Elf_Ehdr *hdr = mvdata->hdr; -+ const Elf_Shdr *section, *secstop; -+ const Elf_Sym *symbols, *symbol, *symstop; -+ const char *strtab; -+ size_t size, secstrsize, strsize, notesize, notemetasize; -+ unsigned line; -+ -+ size = mvdata->size; -+ -+#define elfcheck(X) \ -+do { if (unlikely(!(X))) { line = __LINE__; goto elfcheck_error; } } while (0) -+ -+#define seccheck(X) \ -+do { if (unlikely(!(X))) { line = __LINE__; goto seccheck_error; } } while (0) -+ -+#define symcheck(X) \ -+do { if (unlikely(!(X))) { line = __LINE__; goto symcheck_error; } } while (0) -+ -+ /* Validate the ELF header */ -+ elfcheck(size > sizeof(Elf_Ehdr)); -+ elfcheck(hdr->e_ehsize < size); -+ -+ elfcheck(hdr->e_shnum < SHN_LORESERVE); -+ elfcheck(hdr->e_shstrndx < hdr->e_shnum); -+ elfcheck(hdr->e_shentsize == sizeof(Elf_Shdr)); -+ elfcheck(hdr->e_shoff < size); -+ elfcheck(hdr->e_shoff >= hdr->e_ehsize); -+ elfcheck(hdr->e_shoff % sizeof(long) == 0); -+ elfcheck(hdr->e_shnum * sizeof(Elf_Shdr) <= size - hdr->e_shoff); -+ -+ /* Validate the section table contents */ -+ mvdata->nsects = hdr->e_shnum; -+ mvdata->sections = mvdata->buffer + hdr->e_shoff; -+ secstop = mvdata->sections + mvdata->nsects; -+ -+ /* Section 0 is special, usually indicating an undefined symbol */ -+ section = &mvdata->sections[SHN_UNDEF]; -+ seccheck(section->sh_type == SHT_NULL); -+ -+ /* We also want access to the section name table */ -+ section = &mvdata->sections[hdr->e_shstrndx]; -+ seccheck(section->sh_type == SHT_STRTAB); -+ secstrsize = mvdata->sections[hdr->e_shstrndx].sh_size; -+ -+ for (section = mvdata->sections + 1; section < secstop; section++) { -+ seccheck(section->sh_name < secstrsize); -+ seccheck(section->sh_link < hdr->e_shnum); -+ -+ /* Section file offsets must reside within the file, though -+ * they don't have to actually consume file space (.bss for -+ * example). -+ */ -+ seccheck(section->sh_offset >= hdr->e_ehsize); -+ if (section->sh_addralign > 1) -+ seccheck((section->sh_offset & -+ (section->sh_addralign - 1)) == 0); -+ seccheck(section->sh_offset <= size); -+ if (section->sh_type != SHT_NOBITS) -+ seccheck(section->sh_size <= size - section->sh_offset); -+ -+ /* Some types of section should contain arrays of fixed-length -+ * records of a predetermined size and mustn't contain partial -+ * records. Also, records we're going to access directly must -+ * have appropriate alignment that we don't get a misalignment -+ * exception. -+ */ -+ if (section->sh_entsize > 1) -+ seccheck(section->sh_size % section->sh_entsize == 0); -+ -+ switch (section->sh_type) { -+ case SHT_SYMTAB: -+ seccheck(section->sh_entsize == sizeof(Elf_Sym)); -+ seccheck(section->sh_addralign % sizeof(long) == 0); -+ break; -+ case SHT_REL: -+#ifdef Elf_Rel -+ seccheck(section->sh_entsize == sizeof(Elf_Rel)); -+ seccheck(section->sh_addralign % sizeof(long) == 0); -+ break; -+#else -+ seccheck(false); -+ break; -+#endif -+ case SHT_RELA: -+#ifdef Elf_Rela -+ seccheck(section->sh_entsize == sizeof(Elf_Rela)); -+ seccheck(section->sh_addralign % sizeof(long) == 0); -+ break; -+#else -+ seccheck(false); -+ break; -+#endif -+ case SHT_NOTE: -+ seccheck(section->sh_addralign % 4 == 0); -+ break; -+ case SHT_STRTAB: -+ /* We require all string tables to be non-empty. If -+ * not empty, a string table must end in a NUL (it -+ * should also begin with a NUL, but it's not a problem -+ * for us if it doesn't). -+ */ -+ seccheck(section->sh_size >= 2); -+ strtab = mvdata->buffer + section->sh_offset; -+ seccheck(strtab[section->sh_size - 1] == '\0'); -+ break; -+ } -+ } -+ -+ /* Check features specific to the type of each section. -+ * -+ * Note that having a separate loop here allows the compiler to discard -+ * some local variables used in the above loop thus making the code -+ * smaller. -+ */ -+ for (section = mvdata->sections + 1; section < secstop; section++) { -+ switch (section->sh_type) { -+ case SHT_SYMTAB: -+ /* Symbol tables nominate a string table. */ -+ seccheck(mvdata->sections[section->sh_link].sh_type == -+ SHT_STRTAB); -+ -+ /* Validate the symbols in the table. The first symbol -+ * (STN_UNDEF) is special. -+ */ -+ symbol = symbols = mvdata->buffer + section->sh_offset; -+ symstop = mvdata->buffer + -+ (section->sh_offset + section->sh_size); -+ -+ symcheck(ELF_ST_TYPE(symbols[0].st_info) == STT_NOTYPE); -+ symcheck(symbol[0].st_shndx == SHN_UNDEF); -+ -+ strsize = mvdata->sections[section->sh_link].sh_size; -+ for (symbol++; symbol < symstop; symbol++) { -+ symcheck(symbol->st_name < strsize); -+ symcheck(symbol->st_shndx < hdr->e_shnum || -+ symbol->st_shndx >= SHN_LORESERVE); -+ } -+ break; -+ -+#ifdef Elf_Rel -+ case SHT_REL: -+#endif -+#ifdef Elf_Rela -+ case SHT_RELA: -+#endif -+ /* Relocation tables nominate a symbol table and a -+ * target section to which the relocations will be -+ * applied. -+ */ -+ seccheck(mvdata->sections[section->sh_link].sh_type == -+ SHT_SYMTAB); -+ seccheck(section->sh_info > 0); -+ seccheck(section->sh_info < hdr->e_shnum); -+ break; -+ } -+ } -+ -+ /* We can now use section name string table section as we checked its -+ * bounds in the loop above. -+ * -+ * Each name is NUL-terminated, and the table as a whole should have a -+ * NUL at either end as there to be at least one named section for the -+ * module information. -+ */ -+ section = &mvdata->sections[hdr->e_shstrndx]; -+ mvdata->secstrings = mvdata->buffer + section->sh_offset; -+ -+ for (section = mvdata->sections + 1; section < secstop; section++) { -+ const char *name = mvdata->secstrings + section->sh_name; -+ -+ switch (section->sh_type) { -+ case SHT_NOTE: -+ if (strcmp(name, modsign_note_section) != 0) -+ continue; -+ -+ /* We've found a note purporting to contain a signature -+ * so we should check the structure of that. -+ */ -+ notemetasize = sizeof(struct elf_note) + -+ roundup(sizeof(modsign_note_name), 4); -+ -+ seccheck(mvdata->sig_index == 0); -+ seccheck(section->sh_size > notemetasize); -+ note = mvdata->buffer + section->sh_offset; -+ seccheck(note->n_type == MODSIGN_NOTE_TYPE); -+ seccheck(note->n_namesz == sizeof(modsign_note_name)); -+ -+ notesize = section->sh_size - notemetasize; -+ seccheck(note->n_descsz <= notesize); -+ -+ seccheck(memcmp(note + 1, modsign_note_name, -+ note->n_namesz) == 0); -+ -+ mvdata->sig_size = note->n_descsz; -+ mvdata->sig = (void *)note + notemetasize; -+ mvdata->sig_index = section - mvdata->sections; -+ break; -+ } -+ } -+ -+ return 0; -+ -+elfcheck_error: -+ _debug("Verify ELF error (check %u)\n", line); -+ return -ELIBBAD; -+seccheck_error: -+ _debug("Verify ELF error [sec %ld] (check %u)\n", -+ (long)(section - mvdata->sections), line); -+ return -ELIBBAD; -+symcheck_error: -+ _debug("Verify ELF error [sym %ld] (check %u)\n", -+ (long)(symbol - symbols), line); -+ return -ELIBBAD; -+} -+ -+/* - * Verify a module's integrity - */ - int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) -@@ -62,6 +284,14 @@ int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) - mvdata.buffer = hdr; - mvdata.size = size; - -+ /* Minimally check the ELF to make sure building the signature digest -+ * won't crash the kernel. -+ */ -+ ret = module_verify_elf(&mvdata); -+ if (ret < 0) -+ goto out; -+ -+ /* The ELF checker found the sig for us if it exists */ - if (mvdata.sig_index <= 0) { - /* Deal with an unsigned module */ - if (modsign_signedonly) { --- -1.7.10.4 - - -From 4e90f1f1f04b2efb070f15211e644a8a86a2142e Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:29:43 +0100 -Subject: [PATCH 24/27] MODSIGN: Produce a filtered and canonicalised section - list - -Build a list of the sections in which we're interested and canonicalise the -section indices to avoid the problems of the section table being altered by ld -when the signature is linked into the binary and by strip. - -The only sections in which we're actually interested are those that are marked -allocatable (which will be kept in memory) and relocation tables that are -applicable to those sections. - -Canonicalisation is done by sorting the filtered list in order of section name. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/module-verify.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 80 insertions(+) - -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index 2161d11..646b104 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -273,6 +273,80 @@ symcheck_error: - } - - /* -+ * Canonicalise the section table index numbers. -+ * -+ * We build a list of the sections we want to add to the digest and sort it by -+ * name. We're only interested in adding two types of section: -+ * -+ * (1) Allocatable sections. These should have no references to other -+ * sections. -+ * -+ * (2) Relocation tables for allocatable sections. The section table entry -+ * has a reference to the target section to which the relocations will be -+ * applied. The relocation entries have references to symbols in -+ * non-allocatable sections. Symbols can be replaced by their contents, -+ * but do include a further reference to a section - which must be -+ * canonicalised. -+ * -+ * We also build a map of raw section index to canonical section index. -+ */ -+static int module_verify_canonicalise(struct module_verify_data *mvdata) -+{ -+ const Elf_Shdr *sechdrs = mvdata->sections; -+ unsigned *canonlist, canon, loop, tmp; -+ bool changed; -+ -+ canonlist = kmalloc(sizeof(unsigned) * mvdata->nsects * 2, GFP_KERNEL); -+ if (!canonlist) -+ return -ENOMEM; -+ -+ mvdata->canonlist = canonlist; -+ mvdata->canonmap = canonlist + mvdata->nsects; -+ canon = 0; -+ -+ for (loop = 1; loop < mvdata->nsects; loop++) { -+ const Elf_Shdr *section = mvdata->sections + loop; -+ -+ if (loop == mvdata->sig_index) -+ continue; -+ -+ /* We only want allocatable sections and relocation tables */ -+ if (section->sh_flags & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ else if ((is_elf_rel(section->sh_type) || -+ is_elf_rela(section->sh_type)) && -+ mvdata->sections[section->sh_info].sh_flags & SHF_ALLOC) -+ canonlist[canon++] = loop; -+ } -+ -+ /* Sort the canonicalisation list */ -+ do { -+ changed = false; -+ -+ for (loop = 0; loop < canon - 1; loop++) { -+ const char *x, *y; -+ -+ x = mvdata->secstrings + sechdrs[canonlist[loop + 0]].sh_name; -+ y = mvdata->secstrings + sechdrs[canonlist[loop + 1]].sh_name; -+ -+ if (strcmp(x, y) > 0) { -+ tmp = canonlist[loop + 0]; -+ canonlist[loop + 0] = canonlist[loop + 1]; -+ canonlist[loop + 1] = tmp; -+ changed = true; -+ } -+ } -+ } while (changed); -+ -+ /* What we really want is a raw-to-canon lookup table */ -+ memset(mvdata->canonmap, 0xff, mvdata->nsects * sizeof(unsigned)); -+ for (loop = 0; loop < canon; loop++) -+ mvdata->canonmap[mvdata->canonlist[loop]] = loop + 1; -+ mvdata->ncanon = canon; -+ return 0; -+} -+ -+/* - * Verify a module's integrity - */ - int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) -@@ -303,7 +377,13 @@ int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) - goto out; - } - -+ /* Produce a canonicalisation map for the sections */ -+ ret = module_verify_canonicalise(&mvdata); -+ if (ret < 0) -+ goto out; -+ - ret = 0; -+ kfree(mvdata.canonlist); - - out: - switch (ret) { --- -1.7.10.4 - - -From 5f48916c06318abb0821b41bc06f457248ed87eb Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:30:02 +0100 -Subject: [PATCH 25/27] MODSIGN: Create digest of module content and check - signature - -Apply signature checking to modules on module load, checking the signature -against the ring of public keys compiled into the kernel (if enabled by -CONFIG_MODULE_SIG). Turning on signature checking will also force the module's -ELF metadata to be verified first. - -There are several reasons why these patches are useful, amongst which are: - - (1) to prevent accidentally corrupted modules from causing damage; - - (2) to prevent maliciously modified modules from causing damage; - - (3) to allow a sysadmin (or more likely an IT department) to enforce a policy - that only known and approved modules shall be loaded onto machines which - they're expected to support; - - (4) to allow other support providers to do likewise, or at least to _detect_ - the fact that unsupported modules are loaded; - - (5) to allow the detection of modules replaced by a second-order distro or a - preloaded Linux purveyor. - -These patches have two main appeals: (a) preventing malicious modules from -being loaded, and (b) reducing support workload by pointing out modules on a -crashing box that aren't what they're expected to be. - -Note that this is not a complete solution by any means: the core kernel is not -protected, and nor are /dev/mem or /dev/kmem, but it denies (or at least -controls) one relatively simple attack vector. To protect the kernel image -would be the responsibility of the boot loader or the system BIOS. - -This facility is optional: the builder of a kernel is by no means under any -requirement to actually enable it, let alone force the set of loadable modules -to be restricted to just those that the builder provides (there are degrees of -restriction available). - -Note! The "noinline" attribute on module_verify_signature() results in -somewhat smaller code. - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/module-verify-defs.h | 11 +- - kernel/module-verify.c | 332 ++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 337 insertions(+), 6 deletions(-) - -diff --git a/kernel/module-verify-defs.h b/kernel/module-verify-defs.h -index 2fe31e1..82952b0 100644 ---- a/kernel/module-verify-defs.h -+++ b/kernel/module-verify-defs.h -@@ -42,15 +42,16 @@ struct module_verify_data { - /* - * Whether or not we support various types of ELF relocation record - */ --#if defined(MODULE_HAS_ELF_REL_ONLY) -+#ifdef Elf_Rel - #define is_elf_rel(sh_type) ((sh_type) == SHT_REL) --#define is_elf_rela(sh_type) (0) --#elif defined(MODULE_HAS_ELF_RELA_ONLY) -+#else - #define is_elf_rel(sh_type) (0) -+#endif -+ -+#ifdef Elf_Rela - #define is_elf_rela(sh_type) ((sh_type) == SHT_RELA) - #else --#define is_elf_rel(sh_type) ((sh_type) == SHT_REL) --#define is_elf_rela(sh_type) ((sh_type) == SHT_RELA) -+#define is_elf_rela(sh_type) (0) - #endif - - /* -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index 646b104..e275759 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -50,6 +50,22 @@ static bool modsign_signedonly; - static const char modsign_note_name[] = ELFNOTE_NAME(MODSIGN_NOTE_NAME); - static const char modsign_note_section[] = ELFNOTE_SECTION(MODSIGN_NOTE_NAME); - -+#define crypto_digest_update_data(C, PTR, N) \ -+do { \ -+ uint8_t *__p = (uint8_t *)(PTR); \ -+ size_t __n = (N); \ -+ count_and_csum((C), __p, __n); \ -+ verify_sig_add_data((C)->mod_sig, __p, __n); \ -+} while (0) -+ -+#define crypto_digest_update_val(C, VAL) \ -+do { \ -+ uint8_t *__p = (uint8_t *)&(VAL); \ -+ size_t __n = sizeof(VAL); \ -+ count_and_csum((C), __p, __n); \ -+ verify_sig_add_data((C)->mod_sig, __p, __n); \ -+} while (0) -+ - /* - * Verify the minimum amount of ELF structure of a module needed to check the - * module's signature without bad ELF crashing the kernel. -@@ -346,6 +362,320 @@ static int module_verify_canonicalise(struct module_verify_data *mvdata) - return 0; - } - -+#ifdef Elf_Rel -+/* -+ * Extract an ELF REL table -+ * -+ * We need to canonicalise the entries in case section/symbol addition/removal -+ * has rearranged the symbol table and the section table. -+ */ -+static int extract_elf_rel(struct module_verify_data *mvdata, -+ unsigned secix, -+ const Elf_Rel *reltab, size_t nrels, -+ const char *sh_name) -+{ -+ struct { -+#ifdef CONFIG_64BIT -+ uint64_t r_offset; -+ uint64_t st_value; -+ uint64_t st_size; -+ uint32_t r_type; -+ uint16_t st_shndx; -+ uint8_t st_info; -+ uint8_t st_other; -+#else -+ uint32_t r_offset; -+ uint32_t st_value; -+ uint32_t st_size; -+ uint16_t st_shndx; -+ uint8_t r_type; -+ uint8_t st_info; -+ uint8_t st_other; -+#endif -+ } __packed relocation; -+ -+ const Elf_Shdr *relsec, *symsec, *strsec; -+ const Elf_Rel *reloc; -+ const Elf_Sym *symbols, *symbol; -+ const char *strings; -+ unsigned long r_sym; -+ size_t nsyms, loop; -+ -+ relsec = &mvdata->sections[secix]; -+ symsec = &mvdata->sections[relsec->sh_link]; -+ strsec = &mvdata->sections[symsec->sh_link]; -+ nsyms = symsec->sh_size / sizeof(Elf_Sym); -+ symbols = mvdata->buffer + symsec->sh_offset; -+ strings = mvdata->buffer + strsec->sh_offset; -+ -+ /* Contribute the relevant bits from a join of -+ * { REL, SYMBOL, SECTION } -+ */ -+ for (loop = 0; loop < nrels; loop++) { -+ unsigned st_shndx; -+ -+ reloc = &reltab[loop]; -+ -+ /* Decode the relocation */ -+ relocation.r_offset = reloc->r_offset; -+ relocation.r_type = ELF_R_TYPE(reloc->r_info); -+ -+ /* Decode the symbol referenced by the relocation */ -+ r_sym = ELF_R_SYM(reloc->r_info); -+ if (r_sym >= nsyms) -+ return -ELIBBAD; -+ symbol = &symbols[r_sym]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = symbol->st_shndx; -+ st_shndx = symbol->st_shndx; -+ -+ /* Canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < mvdata->nsects) { -+ if (!(mvdata->sections[st_shndx].sh_flags & SHF_ALLOC)) -+ return -ELIBBAD; -+ relocation.st_shndx = mvdata->canonmap[st_shndx]; -+ } -+ -+ crypto_digest_update_val(mvdata, relocation); -+ -+ /* Undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + symbol->st_name; -+ crypto_digest_update_data(mvdata, -+ name, strlen(name) + 1); -+ } -+ } -+ -+ _debug("%08zx %02x digested the %s section, nrels %zu\n", -+ mvdata->signed_size, mvdata->csum, sh_name, nrels); -+ -+ return 0; -+} -+#endif -+ -+#ifdef Elf_Rela -+/* -+ * Extract an ELF RELA table -+ * -+ * We need to canonicalise the entries in case section/symbol addition/removal -+ * has rearranged the symbol table and the section table. -+ */ -+static int extract_elf_rela(struct module_verify_data *mvdata, -+ unsigned secix, -+ const Elf_Rela *relatab, size_t nrels, -+ const char *sh_name) -+{ -+ struct { -+#ifdef CONFIG_64BIT -+ uint64_t r_offset; -+ uint64_t r_addend; -+ uint64_t st_value; -+ uint64_t st_size; -+ uint32_t r_type; -+ uint16_t st_shndx; -+ uint8_t st_info; -+ uint8_t st_other; -+#else -+ uint32_t r_offset; -+ uint32_t r_addend; -+ uint32_t st_value; -+ uint32_t st_size; -+ uint16_t st_shndx; -+ uint8_t r_type; -+ uint8_t st_info; -+ uint8_t st_other; -+#endif -+ } __packed relocation; -+ -+ const Elf_Shdr *relsec, *symsec, *strsec; -+ const Elf_Rela *reloc; -+ const Elf_Sym *symbols, *symbol; -+ unsigned long r_sym; -+ const char *strings; -+ size_t nsyms, loop; -+ -+ relsec = &mvdata->sections[secix]; -+ symsec = &mvdata->sections[relsec->sh_link]; -+ strsec = &mvdata->sections[symsec->sh_link]; -+ nsyms = symsec->sh_size / sizeof(Elf_Sym); -+ symbols = mvdata->buffer + symsec->sh_offset; -+ strings = mvdata->buffer + strsec->sh_offset; -+ -+ /* Contribute the relevant bits from a join of -+ * { RELA, SYMBOL, SECTION } -+ */ -+ for (loop = 0; loop < nrels; loop++) { -+ unsigned st_shndx; -+ -+ reloc = &relatab[loop]; -+ -+ /* Decode the relocation */ -+ relocation.r_offset = reloc->r_offset; -+ relocation.r_addend = reloc->r_addend; -+ relocation.r_type = ELF_R_TYPE(reloc->r_info); -+ -+ /* Decode the symbol referenced by the relocation */ -+ r_sym = ELF_R_SYM(reloc->r_info); -+ if (r_sym >= nsyms) -+ return -ELIBBAD; -+ symbol = &symbols[r_sym]; -+ relocation.st_info = symbol->st_info; -+ relocation.st_other = symbol->st_other; -+ relocation.st_value = symbol->st_value; -+ relocation.st_size = symbol->st_size; -+ relocation.st_shndx = 0; -+ st_shndx = symbol->st_shndx; -+ -+ /* Canonicalise the section used by the symbol */ -+ if (st_shndx > SHN_UNDEF && st_shndx < mvdata->nsects) { -+ if (!(mvdata->sections[st_shndx].sh_flags & SHF_ALLOC)) -+ return -ELIBBAD; -+ relocation.st_shndx = mvdata->canonmap[st_shndx]; -+ } -+ -+ crypto_digest_update_val(mvdata, relocation); -+ -+ /* Undefined symbols must be named if referenced */ -+ if (st_shndx == SHN_UNDEF) { -+ const char *name = strings + symbol->st_name; -+ crypto_digest_update_data(mvdata, -+ name, strlen(name) + 1); -+ } -+ } -+ -+ _debug("%08zx %02x digested the %s section, nrels %zu\n", -+ mvdata->signed_size, mvdata->csum, sh_name, nrels); -+ -+ return 0; -+} -+#endif -+ -+/* -+ * Verify a module's signature -+ */ -+static noinline int module_verify_signature(struct module_verify_data *mvdata) -+{ -+ struct crypto_key_verify_context *mod_sig; -+ const Elf_Shdr *sechdrs = mvdata->sections; -+ const char *secstrings = mvdata->secstrings; -+ const u8 *sig = mvdata->sig; -+ size_t sig_size = mvdata->sig_size; -+ int loop, ret; -+ -+ _debug("sig in section %u (size %zu)\n", -+ mvdata->sig_index, mvdata->sig_size); -+ _debug("%02x%02x%02x%02x%02x%02x%02x%02x\n", -+ sig[0], sig[1], sig[2], sig[3], -+ sig[4], sig[5], sig[6], sig[7]); -+ -+ /* Find the crypto key for the module signature -+ * - !!! if this tries to load the required hash algorithm module, -+ * we will deadlock!!! -+ */ -+ mod_sig = verify_sig_begin(modsign_keyring, sig, sig_size); -+ if (IS_ERR(mod_sig)) { -+ pr_err("Couldn't initiate module signature verification: %ld\n", -+ PTR_ERR(mod_sig)); -+ return PTR_ERR(mod_sig); -+ } -+ -+ mvdata->mod_sig = mod_sig; -+#ifdef DEBUG -+ mvdata->xcsum = 0; -+#endif -+ -+ /* Load data from each relevant section into the digest. Note that -+ * canonlist[] is a filtered list and only contains the sections we -+ * actually want. -+ */ -+ for (loop = 0; loop < mvdata->ncanon; loop++) { -+ int sect = mvdata->canonlist[loop]; -+ unsigned long sh_type = sechdrs[sect].sh_type; -+ unsigned long sh_info = sechdrs[sect].sh_info; -+ unsigned long sh_size = sechdrs[sect].sh_size; -+ const char *sh_name = secstrings + sechdrs[sect].sh_name; -+ const void *data = mvdata->buffer + sechdrs[sect].sh_offset; -+ -+#ifdef DEBUG -+ mvdata->csum = 0; -+#endif -+ -+ /* Digest the headers of any section we include. */ -+ crypto_digest_update_data(mvdata, sh_name, strlen(sh_name)); -+ crypto_digest_update_val(mvdata, sechdrs[sect].sh_type); -+ crypto_digest_update_val(mvdata, sechdrs[sect].sh_flags); -+ crypto_digest_update_val(mvdata, sechdrs[sect].sh_size); -+ crypto_digest_update_val(mvdata, sechdrs[sect].sh_addralign); -+ -+ /* Relocation record sections refer to the section to be -+ * relocated, but this needs to be canonicalised to survive -+ * stripping. -+ */ -+ if (is_elf_rel(sh_type) || is_elf_rela(sh_type)) -+ crypto_digest_update_val(mvdata, -+ mvdata->canonmap[sh_info]); -+ -+ /* Since relocation records give details of how we have to -+ * alter the allocatable sections, we need to digest these too. -+ * -+ * These, however, refer to metadata (symbols and sections) -+ * that may have been altered by the process of adding the -+ * signature section or the process of being stripped. -+ * -+ * To deal with this, we substitute the referenced metadata for -+ * the references to that metadata. So, for instance, the -+ * symbol ref from the relocation record is replaced with the -+ * contents of the symbol to which it refers, and the symbol's -+ * section ref is replaced with a canonicalised section number. -+ */ -+#ifdef Elf_Rel -+ if (is_elf_rel(sh_type)) { -+ ret = extract_elf_rel(mvdata, sect, -+ data, -+ sh_size / sizeof(Elf_Rel), -+ sh_name); -+ if (ret < 0) -+ goto format_error; -+ continue; -+ } -+#endif -+ -+#ifdef Elf_Rela -+ if (is_elf_rela(sh_type)) { -+ ret = extract_elf_rela(mvdata, sect, -+ data, -+ sh_size / sizeof(Elf_Rela), -+ sh_name); -+ if (ret < 0) -+ goto format_error; -+ continue; -+ } -+#endif -+ -+ /* Include allocatable loadable sections */ -+ if (sh_type != SHT_NOBITS) -+ crypto_digest_update_data(mvdata, data, sh_size); -+ -+ _debug("%08zx %02x digested the %s section, size %ld\n", -+ mvdata->signed_size, mvdata->csum, sh_name, sh_size); -+ } -+ -+ _debug("Contributed %zu bytes to the digest (csum 0x%02x)\n", -+ mvdata->signed_size, mvdata->xcsum); -+ -+ /* Do the actual signature verification */ -+ ret = verify_sig_end(mvdata->mod_sig, sig, sig_size); -+ _debug("verify-sig : %d\n", ret); -+ return ret; -+ -+format_error: -+ verify_sig_cancel(mvdata->mod_sig); -+ return -ELIBBAD; -+} -+ - /* - * Verify a module's integrity - */ -@@ -382,7 +712,7 @@ int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) - if (ret < 0) - goto out; - -- ret = 0; -+ ret = module_verify_signature(&mvdata); - kfree(mvdata.canonlist); - - out: --- -1.7.10.4 - - -From 25841b75e473511f1dbe84cfb333ef2b748d2ec6 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:30:22 +0100 -Subject: [PATCH 26/27] MODSIGN: Suppress some redundant ELF checks - -Suppress some redundant ELF checks in module_verify_elf() that are also done -by copy_and_check() in the core module loader code prior to calling -module_verify(). - -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/module-verify.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index e275759..bfd1286 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -97,11 +97,11 @@ do { if (unlikely(!(X))) { line = __LINE__; goto symcheck_error; } } while (0) - - elfcheck(hdr->e_shnum < SHN_LORESERVE); - elfcheck(hdr->e_shstrndx < hdr->e_shnum); -- elfcheck(hdr->e_shentsize == sizeof(Elf_Shdr)); -- elfcheck(hdr->e_shoff < size); -+ /* elfcheck(hdr->e_shentsize == sizeof(Elf_Shdr)); */ -+ /* elfcheck(hdr->e_shoff < size); */ - elfcheck(hdr->e_shoff >= hdr->e_ehsize); - elfcheck(hdr->e_shoff % sizeof(long) == 0); -- elfcheck(hdr->e_shnum * sizeof(Elf_Shdr) <= size - hdr->e_shoff); -+ /* elfcheck(hdr->e_shnum * sizeof(Elf_Shdr) <= size - hdr->e_shoff); */ - - /* Validate the section table contents */ - mvdata->nsects = hdr->e_shnum; --- -1.7.10.4 - - -From 3ac2defabc1996584fac06b76070138fe56753e6 Mon Sep 17 00:00:00 2001 -From: David Howells <dhowells@redhat.com> -Date: Wed, 18 Jul 2012 16:30:40 +0100 -Subject: [PATCH 27/27] MODSIGN: Panic the kernel if FIPS is enabled upon - module signing failure - -If module signing fails when the kernel is running with FIPS enabled then the -kernel should panic lest the crypto layer be compromised. Possibly a panic -shouldn't happen on cases like ENOMEM. - -Reported-by: Stephan Mueller <stephan.mueller@atsec.com> -Signed-off-by: David Howells <dhowells@redhat.com> ---- - kernel/module-verify.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/kernel/module-verify.c b/kernel/module-verify.c -index bfd1286..b9c3955 100644 ---- a/kernel/module-verify.c -+++ b/kernel/module-verify.c -@@ -30,6 +30,7 @@ - #include <linux/elfnote.h> - #include <linux/modsign.h> - #include <linux/moduleparam.h> -+#include <linux/fips.h> - #include <keys/crypto-type.h> - #include "module-verify.h" - #include "module-verify-defs.h" -@@ -716,6 +717,10 @@ int module_verify(const Elf_Ehdr *hdr, size_t size, bool *_gpgsig_ok) - kfree(mvdata.canonlist); - - out: -+ if (ret < 0 && fips_enabled) -+ panic("Module verification failed with error %d in FIPS mode\n", -+ ret); -+ - switch (ret) { - case 0: /* Good signature */ - *_gpgsig_ok = true; --- -1.7.10.4 - diff --git a/freed-ora/current/master/modsign-post-KS-jwb.patch b/freed-ora/current/master/modsign-post-KS-jwb.patch new file mode 100644 index 000000000..1bafd22f5 --- /dev/null +++ b/freed-ora/current/master/modsign-post-KS-jwb.patch @@ -0,0 +1,78 @@ +From 56713a28675b966e027a824a0130b80dffab209f Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Mon, 5 Nov 2012 09:09:24 +1030 +Subject: [PATCH] MODSIGN: Add modules_sign make target + +If CONFIG_MODULE_SIG is set, and 'make modules_sign' is called then this +patch will cause the modules to get a signature appended. The make target +is intended to be run after 'make modules_install', and will modify the +modules in-place in the installed location. It can be used to produce +signed modules after they have been processed by distribution build +scripts. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor typo fix) +--- + Makefile | 6 ++++++ + scripts/Makefile.modsign | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 38 insertions(+), 0 deletions(-) + create mode 100644 scripts/Makefile.modsign + +diff --git a/Makefile b/Makefile +index 42d0e56..253aa1b 100644 +--- a/Makefile ++++ b/Makefile +@@ -981,6 +981,12 @@ _modinst_post: _modinst_ + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst + $(call cmd,depmod) + ++ifeq ($(CONFIG_MODULE_SIG), y) ++PHONY += modules_sign ++modules_sign: ++ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modsign ++endif ++ + else # CONFIG_MODULES + + # Modules not configured +diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign +new file mode 100644 +index 0000000..abfda62 +--- /dev/null ++++ b/scripts/Makefile.modsign +@@ -0,0 +1,32 @@ ++# ========================================================================== ++# Signing modules ++# ========================================================================== ++ ++PHONY := __modsign ++__modsign: ++ ++include scripts/Kbuild.include ++ ++__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) ++modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) ++ ++PHONY += $(modules) ++__modsign: $(modules) ++ @: ++ ++quiet_cmd_sign_ko = SIGN [M] $(2)/$(notdir $@) ++ cmd_sign_ko = $(mod_sign_cmd) $(2)/$(notdir $@) ++ ++# Modules built outside the kernel source tree go into extra by default ++INSTALL_MOD_DIR ?= extra ++ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D)) ++ ++modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) ++ ++$(modules): ++ $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) ++ ++# Declare the contents of the .PHONY variable as phony. We keep that ++# information in a variable se we can use it in if_changed and friends. ++ ++.PHONY: $(PHONY) +-- +1.7.7.6 + diff --git a/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz b/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz Binary files differnew file mode 100644 index 000000000..27f4cf327 --- /dev/null +++ b/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz diff --git a/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz.sign b/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz.sign new file mode 100644 index 000000000..45cd2674f --- /dev/null +++ b/freed-ora/current/master/patch-3.6-gnu-3.7-rc6-gnu.xz.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iEYEABECAAYFAlC0MEYACgkQvLfPh359R6eNWQCdEbRTm1uJmC/tdArNsTvP0jYd +AywAn1kq2CKdeInSI29DhKyZJZpmMwDb +=tm7j +-----END PGP SIGNATURE----- diff --git a/freed-ora/current/master/patch-3.7-rc6-git4.xz b/freed-ora/current/master/patch-3.7-rc6-git4.xz Binary files differnew file mode 100644 index 000000000..9dc1fa1b0 --- /dev/null +++ b/freed-ora/current/master/patch-3.7-rc6-git4.xz diff --git a/freed-ora/current/master/perf-uapi-fixes2.patch b/freed-ora/current/master/perf-uapi-fixes2.patch new file mode 100644 index 000000000..d7bdfab21 --- /dev/null +++ b/freed-ora/current/master/perf-uapi-fixes2.patch @@ -0,0 +1,1132 @@ +From ef79375f0f77e13a42eb3adf858fdd26b21f453a Mon Sep 17 00:00:00 2001 +From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> +Date: Thu, 15 Nov 2012 14:17:01 +0800 +Subject: [PATCH 1/7] perf kvm: rename perf_kvm to perf_kvm_stat + +Then, let it only be used in 'perf kvm stat' + +Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> +--- + tools/perf/builtin-kvm.c | 111 +++++++++++++++++++++++++---------------------- + 1 file changed, 60 insertions(+), 51 deletions(-) + +diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c +index 260abc5..7bd8358 100644 +--- a/tools/perf/builtin-kvm.c ++++ b/tools/perf/builtin-kvm.c +@@ -58,7 +58,7 @@ struct kvm_event_key { + }; + + +-struct perf_kvm; ++struct perf_kvm_stat; + + struct kvm_events_ops { + bool (*is_begin_event)(struct perf_evsel *evsel, +@@ -66,7 +66,7 @@ struct kvm_events_ops { + struct event_key *key); + bool (*is_end_event)(struct perf_evsel *evsel, + struct perf_sample *sample, struct event_key *key); +- void (*decode_key)(struct perf_kvm *kvm, struct event_key *key, ++ void (*decode_key)(struct perf_kvm_stat *kvm, struct event_key *key, + char decode[20]); + const char *name; + }; +@@ -79,7 +79,7 @@ struct exit_reasons_table { + #define EVENTS_BITS 12 + #define EVENTS_CACHE_SIZE (1UL << EVENTS_BITS) + +-struct perf_kvm { ++struct perf_kvm_stat { + struct perf_tool tool; + struct perf_session *session; + +@@ -146,7 +146,7 @@ static struct exit_reasons_table svm_exit_reasons[] = { + SVM_EXIT_REASONS + }; + +-static const char *get_exit_reason(struct perf_kvm *kvm, u64 exit_code) ++static const char *get_exit_reason(struct perf_kvm_stat *kvm, u64 exit_code) + { + int i = kvm->exit_reasons_size; + struct exit_reasons_table *tbl = kvm->exit_reasons; +@@ -162,7 +162,7 @@ static const char *get_exit_reason(struct perf_kvm *kvm, u64 exit_code) + return "UNKNOWN"; + } + +-static void exit_event_decode_key(struct perf_kvm *kvm, ++static void exit_event_decode_key(struct perf_kvm_stat *kvm, + struct event_key *key, + char decode[20]) + { +@@ -228,7 +228,7 @@ static bool mmio_event_end(struct perf_evsel *evsel, struct perf_sample *sample, + return false; + } + +-static void mmio_event_decode_key(struct perf_kvm *kvm __maybe_unused, ++static void mmio_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused, + struct event_key *key, + char decode[20]) + { +@@ -271,7 +271,7 @@ static bool ioport_event_end(struct perf_evsel *evsel, + return kvm_entry_event(evsel); + } + +-static void ioport_event_decode_key(struct perf_kvm *kvm __maybe_unused, ++static void ioport_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused, + struct event_key *key, + char decode[20]) + { +@@ -286,7 +286,7 @@ static struct kvm_events_ops ioport_events = { + .name = "IO Port Access" + }; + +-static bool register_kvm_events_ops(struct perf_kvm *kvm) ++static bool register_kvm_events_ops(struct perf_kvm_stat *kvm) + { + bool ret = true; + +@@ -311,7 +311,7 @@ struct vcpu_event_record { + }; + + +-static void init_kvm_event_record(struct perf_kvm *kvm) ++static void init_kvm_event_record(struct perf_kvm_stat *kvm) + { + int i; + +@@ -360,7 +360,7 @@ static struct kvm_event *kvm_alloc_init_event(struct event_key *key) + return event; + } + +-static struct kvm_event *find_create_kvm_event(struct perf_kvm *kvm, ++static struct kvm_event *find_create_kvm_event(struct perf_kvm_stat *kvm, + struct event_key *key) + { + struct kvm_event *event; +@@ -381,7 +381,7 @@ static struct kvm_event *find_create_kvm_event(struct perf_kvm *kvm, + return event; + } + +-static bool handle_begin_event(struct perf_kvm *kvm, ++static bool handle_begin_event(struct perf_kvm_stat *kvm, + struct vcpu_event_record *vcpu_record, + struct event_key *key, u64 timestamp) + { +@@ -425,7 +425,7 @@ static bool update_kvm_event(struct kvm_event *event, int vcpu_id, + return true; + } + +-static bool handle_end_event(struct perf_kvm *kvm, ++static bool handle_end_event(struct perf_kvm_stat *kvm, + struct vcpu_event_record *vcpu_record, + struct event_key *key, + u64 timestamp) +@@ -486,7 +486,7 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread, + return thread->priv; + } + +-static bool handle_kvm_event(struct perf_kvm *kvm, ++static bool handle_kvm_event(struct perf_kvm_stat *kvm, + struct thread *thread, + struct perf_evsel *evsel, + struct perf_sample *sample) +@@ -541,7 +541,7 @@ static struct kvm_event_key keys[] = { + { NULL, NULL } + }; + +-static bool select_key(struct perf_kvm *kvm) ++static bool select_key(struct perf_kvm_stat *kvm) + { + int i; + +@@ -577,7 +577,8 @@ static void insert_to_result(struct rb_root *result, struct kvm_event *event, + rb_insert_color(&event->rb, result); + } + +-static void update_total_count(struct perf_kvm *kvm, struct kvm_event *event) ++static void ++update_total_count(struct perf_kvm_stat *kvm, struct kvm_event *event) + { + int vcpu = kvm->trace_vcpu; + +@@ -590,7 +591,7 @@ static bool event_is_valid(struct kvm_event *event, int vcpu) + return !!get_event_count(event, vcpu); + } + +-static void sort_result(struct perf_kvm *kvm) ++static void sort_result(struct perf_kvm_stat *kvm) + { + unsigned int i; + int vcpu = kvm->trace_vcpu; +@@ -627,7 +628,7 @@ static void print_vcpu_info(int vcpu) + pr_info("VCPU %d:\n\n", vcpu); + } + +-static void print_result(struct perf_kvm *kvm) ++static void print_result(struct perf_kvm_stat *kvm) + { + char decode[20]; + struct kvm_event *event; +@@ -670,7 +671,8 @@ static int process_sample_event(struct perf_tool *tool, + struct machine *machine) + { + struct thread *thread = machine__findnew_thread(machine, sample->tid); +- struct perf_kvm *kvm = container_of(tool, struct perf_kvm, tool); ++ struct perf_kvm_stat *kvm = container_of(tool, struct perf_kvm_stat, ++ tool); + + if (thread == NULL) { + pr_debug("problem processing %d event, skipping it.\n", +@@ -701,7 +703,7 @@ static int get_cpu_isa(struct perf_session *session) + return isa; + } + +-static int read_events(struct perf_kvm *kvm) ++static int read_events(struct perf_kvm_stat *kvm) + { + int ret; + +@@ -750,7 +752,7 @@ static bool verify_vcpu(int vcpu) + return true; + } + +-static int kvm_events_report_vcpu(struct perf_kvm *kvm) ++static int kvm_events_report_vcpu(struct perf_kvm_stat *kvm) + { + int ret = -EINVAL; + int vcpu = kvm->trace_vcpu; +@@ -798,7 +800,8 @@ static const char * const record_args[] = { + _p; \ + }) + +-static int kvm_events_record(struct perf_kvm *kvm, int argc, const char **argv) ++static int ++kvm_events_record(struct perf_kvm_stat *kvm, int argc, const char **argv) + { + unsigned int rec_argc, i, j; + const char **rec_argv; +@@ -821,7 +824,8 @@ static int kvm_events_record(struct perf_kvm *kvm, int argc, const char **argv) + return cmd_record(i, rec_argv, NULL); + } + +-static int kvm_events_report(struct perf_kvm *kvm, int argc, const char **argv) ++static int ++kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv) + { + const struct option kvm_events_report_options[] = { + OPT_STRING(0, "event", &kvm->report_event, "report event", +@@ -864,24 +868,36 @@ static void print_kvm_stat_usage(void) + printf("\nOtherwise, it is the alias of 'perf stat':\n"); + } + +-static int kvm_cmd_stat(struct perf_kvm *kvm, int argc, const char **argv) ++static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) + { ++ struct perf_kvm_stat kvm = { ++ .file_name = file_name, ++ ++ .trace_vcpu = -1, ++ .report_event = "vmexit", ++ .sort_key = "sample", ++ ++ .exit_reasons = svm_exit_reasons, ++ .exit_reasons_size = ARRAY_SIZE(svm_exit_reasons), ++ .exit_reasons_isa = "SVM", ++ }; ++ + if (argc == 1) { + print_kvm_stat_usage(); + goto perf_stat; + } + + if (!strncmp(argv[1], "rec", 3)) +- return kvm_events_record(kvm, argc - 1, argv + 1); ++ return kvm_events_record(&kvm, argc - 1, argv + 1); + + if (!strncmp(argv[1], "rep", 3)) +- return kvm_events_report(kvm, argc - 1 , argv + 1); ++ return kvm_events_report(&kvm, argc - 1 , argv + 1); + + perf_stat: + return cmd_stat(argc, argv, NULL); + } + +-static int __cmd_record(struct perf_kvm *kvm, int argc, const char **argv) ++static int __cmd_record(const char *file_name, int argc, const char **argv) + { + int rec_argc, i = 0, j; + const char **rec_argv; +@@ -890,7 +906,7 @@ static int __cmd_record(struct perf_kvm *kvm, int argc, const char **argv) + rec_argv = calloc(rec_argc + 1, sizeof(char *)); + rec_argv[i++] = strdup("record"); + rec_argv[i++] = strdup("-o"); +- rec_argv[i++] = strdup(kvm->file_name); ++ rec_argv[i++] = strdup(file_name); + for (j = 1; j < argc; j++, i++) + rec_argv[i] = argv[j]; + +@@ -899,7 +915,7 @@ static int __cmd_record(struct perf_kvm *kvm, int argc, const char **argv) + return cmd_record(i, rec_argv, NULL); + } + +-static int __cmd_report(struct perf_kvm *kvm, int argc, const char **argv) ++static int __cmd_report(const char *file_name, int argc, const char **argv) + { + int rec_argc, i = 0, j; + const char **rec_argv; +@@ -908,7 +924,7 @@ static int __cmd_report(struct perf_kvm *kvm, int argc, const char **argv) + rec_argv = calloc(rec_argc + 1, sizeof(char *)); + rec_argv[i++] = strdup("report"); + rec_argv[i++] = strdup("-i"); +- rec_argv[i++] = strdup(kvm->file_name); ++ rec_argv[i++] = strdup(file_name); + for (j = 1; j < argc; j++, i++) + rec_argv[i] = argv[j]; + +@@ -917,7 +933,8 @@ static int __cmd_report(struct perf_kvm *kvm, int argc, const char **argv) + return cmd_report(i, rec_argv, NULL); + } + +-static int __cmd_buildid_list(struct perf_kvm *kvm, int argc, const char **argv) ++static int ++__cmd_buildid_list(const char *file_name, int argc, const char **argv) + { + int rec_argc, i = 0, j; + const char **rec_argv; +@@ -926,7 +943,7 @@ static int __cmd_buildid_list(struct perf_kvm *kvm, int argc, const char **argv) + rec_argv = calloc(rec_argc + 1, sizeof(char *)); + rec_argv[i++] = strdup("buildid-list"); + rec_argv[i++] = strdup("-i"); +- rec_argv[i++] = strdup(kvm->file_name); ++ rec_argv[i++] = strdup(file_name); + for (j = 1; j < argc; j++, i++) + rec_argv[i] = argv[j]; + +@@ -937,20 +954,12 @@ static int __cmd_buildid_list(struct perf_kvm *kvm, int argc, const char **argv) + + int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) + { +- struct perf_kvm kvm = { +- .trace_vcpu = -1, +- .report_event = "vmexit", +- .sort_key = "sample", +- +- .exit_reasons = svm_exit_reasons, +- .exit_reasons_size = ARRAY_SIZE(svm_exit_reasons), +- .exit_reasons_isa = "SVM", +- }; ++ const char *file_name; + + const struct option kvm_options[] = { +- OPT_STRING('i', "input", &kvm.file_name, "file", ++ OPT_STRING('i', "input", &file_name, "file", + "Input file name"), +- OPT_STRING('o', "output", &kvm.file_name, "file", ++ OPT_STRING('o', "output", &file_name, "file", + "Output file name"), + OPT_BOOLEAN(0, "guest", &perf_guest, + "Collect guest os data"), +@@ -985,32 +994,32 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) + if (!perf_host) + perf_guest = 1; + +- if (!kvm.file_name) { ++ if (!file_name) { + if (perf_host && !perf_guest) +- kvm.file_name = strdup("perf.data.host"); ++ file_name = strdup("perf.data.host"); + else if (!perf_host && perf_guest) +- kvm.file_name = strdup("perf.data.guest"); ++ file_name = strdup("perf.data.guest"); + else +- kvm.file_name = strdup("perf.data.kvm"); ++ file_name = strdup("perf.data.kvm"); + +- if (!kvm.file_name) { ++ if (!file_name) { + pr_err("Failed to allocate memory for filename\n"); + return -ENOMEM; + } + } + + if (!strncmp(argv[0], "rec", 3)) +- return __cmd_record(&kvm, argc, argv); ++ return __cmd_record(file_name, argc, argv); + else if (!strncmp(argv[0], "rep", 3)) +- return __cmd_report(&kvm, argc, argv); ++ return __cmd_report(file_name, argc, argv); + else if (!strncmp(argv[0], "diff", 4)) + return cmd_diff(argc, argv, NULL); + else if (!strncmp(argv[0], "top", 3)) + return cmd_top(argc, argv, NULL); + else if (!strncmp(argv[0], "buildid-list", 12)) +- return __cmd_buildid_list(&kvm, argc, argv); ++ return __cmd_buildid_list(file_name, argc, argv); + else if (!strncmp(argv[0], "stat", 4)) +- return kvm_cmd_stat(&kvm, argc, argv); ++ return kvm_cmd_stat(file_name, argc, argv); + else + usage_with_options(kvm_usage, kvm_options); + +-- +1.7.12.1 + + +From afb33bc55fb0d038ae8d8e6970ce01cb1180fc9d Mon Sep 17 00:00:00 2001 +From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> +Date: Mon, 19 Nov 2012 16:19:21 +0800 +Subject: [PATCH 2/7] perf kvm: fix building perf kvm on PowerPC + +On 11/15/2012 06:46 PM, David Howells wrote: +> Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> wrote: +> +>> Now, 'perf kvm stat' is only supported on x86, let its code depend +>> on ARCH_X86 to fix building it on other architectures +> +> Other parts of perf do this sort of thing: +> +> #if defined(__x86_64__) || defined(__i386__) +> + +Yes, thanks for you point it out, David! How about this one? + +Subject: [PATCH 2/2] perf kvm: fix building perf kvm on PowerPC + +Now, 'perf kvm stat' is only supported on x86, let its code depend +on ARCH_X86 to fix building it on other architectures + +Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> +--- + tools/perf/builtin-kvm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c +index 7bd8358..6d103a9 100644 +--- a/tools/perf/builtin-kvm.c ++++ b/tools/perf/builtin-kvm.c +@@ -22,6 +22,7 @@ + #include <pthread.h> + #include <math.h> + ++#if defined(__i386__) || defined(__x86_64__) + #include "../../arch/x86/include/asm/svm.h" + #include "../../arch/x86/include/asm/vmx.h" + #include "../../arch/x86/include/asm/kvm.h" +@@ -896,6 +897,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) + perf_stat: + return cmd_stat(argc, argv, NULL); + } ++#endif + + static int __cmd_record(const char *file_name, int argc, const char **argv) + { +@@ -1018,8 +1020,10 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) + return cmd_top(argc, argv, NULL); + else if (!strncmp(argv[0], "buildid-list", 12)) + return __cmd_buildid_list(file_name, argc, argv); ++#if defined(__i386__) || defined(__x86_64__) + else if (!strncmp(argv[0], "stat", 4)) + return kvm_cmd_stat(file_name, argc, argv); ++#endif + else + usage_with_options(kvm_usage, kvm_options); + +-- +1.7.12.1 + + +From da7616139c67ee09d223706514a92b25ef113ee3 Mon Sep 17 00:00:00 2001 +From: David Howells <dhowells@redhat.com> +Date: Mon, 5 Nov 2012 14:33:42 +0000 +Subject: [PATCH 3/7] x86: Export asm/{svm.h,vmx.h,perf_regs.h} + +Export asm/{svm.h,vmx.h,perf_regs.h} so that they can be disintegrated. + +It looks from previous commits that the first two should have been exported, +but the header-y lines weren't added to the Kbuild. + +I'm guessing that asm/perf_regs.h should be exported too. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + arch/x86/include/asm/Kbuild | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild +index 66e5f0e..79fd8a3 100644 +--- a/arch/x86/include/asm/Kbuild ++++ b/arch/x86/include/asm/Kbuild +@@ -12,6 +12,7 @@ header-y += mce.h + header-y += msr-index.h + header-y += msr.h + header-y += mtrr.h ++header-y += perf_regs.h + header-y += posix_types_32.h + header-y += posix_types_64.h + header-y += posix_types_x32.h +@@ -19,8 +20,10 @@ header-y += prctl.h + header-y += processor-flags.h + header-y += ptrace-abi.h + header-y += sigcontext32.h ++header-y += svm.h + header-y += ucontext.h + header-y += vm86.h ++header-y += vmx.h + header-y += vsyscall.h + + genhdr-y += unistd_32.h +-- +1.7.12.1 + + +From 0d7cd7aa2500f2f4dd5b8d3cb365bbb1874f10d2 Mon Sep 17 00:00:00 2001 +From: David Howells <dhowells@redhat.com> +Date: Mon, 5 Nov 2012 15:15:22 +0000 +Subject: [PATCH 4/7] UAPI: Export and disintegrate linux/hw_breakpoint.h + +Export and UAPI disintegrate linux/hw_breakpoint.h, which I think should've +been exported previously so that perf can access the bits. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + include/linux/hw_breakpoint.h | 31 +------------------------------ + include/uapi/linux/Kbuild | 1 + + include/uapi/linux/hw_breakpoint.h | 30 ++++++++++++++++++++++++++++++ + 3 files changed, 32 insertions(+), 30 deletions(-) + create mode 100644 include/uapi/linux/hw_breakpoint.h + +diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h +index 6ae9c63..0464c85 100644 +--- a/include/linux/hw_breakpoint.h ++++ b/include/linux/hw_breakpoint.h +@@ -1,35 +1,8 @@ + #ifndef _LINUX_HW_BREAKPOINT_H + #define _LINUX_HW_BREAKPOINT_H + +-enum { +- HW_BREAKPOINT_LEN_1 = 1, +- HW_BREAKPOINT_LEN_2 = 2, +- HW_BREAKPOINT_LEN_4 = 4, +- HW_BREAKPOINT_LEN_8 = 8, +-}; +- +-enum { +- HW_BREAKPOINT_EMPTY = 0, +- HW_BREAKPOINT_R = 1, +- HW_BREAKPOINT_W = 2, +- HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, +- HW_BREAKPOINT_X = 4, +- HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, +-}; +- +-enum bp_type_idx { +- TYPE_INST = 0, +-#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS +- TYPE_DATA = 0, +-#else +- TYPE_DATA = 1, +-#endif +- TYPE_MAX +-}; +- +-#ifdef __KERNEL__ +- + #include <linux/perf_event.h> ++#include <uapi/linux/hw_breakpoint.h> + + #ifdef CONFIG_HAVE_HW_BREAKPOINT + +@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) + } + + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ +-#endif /* __KERNEL__ */ +- + #endif /* _LINUX_HW_BREAKPOINT_H */ +diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild +index e194387..19e765f 100644 +--- a/include/uapi/linux/Kbuild ++++ b/include/uapi/linux/Kbuild +@@ -415,3 +415,4 @@ header-y += wireless.h + header-y += x25.h + header-y += xattr.h + header-y += xfrm.h ++header-y += hw_breakpoint.h +diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h +new file mode 100644 +index 0000000..b04000a +--- /dev/null ++++ b/include/uapi/linux/hw_breakpoint.h +@@ -0,0 +1,30 @@ ++#ifndef _UAPI_LINUX_HW_BREAKPOINT_H ++#define _UAPI_LINUX_HW_BREAKPOINT_H ++ ++enum { ++ HW_BREAKPOINT_LEN_1 = 1, ++ HW_BREAKPOINT_LEN_2 = 2, ++ HW_BREAKPOINT_LEN_4 = 4, ++ HW_BREAKPOINT_LEN_8 = 8, ++}; ++ ++enum { ++ HW_BREAKPOINT_EMPTY = 0, ++ HW_BREAKPOINT_R = 1, ++ HW_BREAKPOINT_W = 2, ++ HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, ++ HW_BREAKPOINT_X = 4, ++ HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, ++}; ++ ++enum bp_type_idx { ++ TYPE_INST = 0, ++#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS ++ TYPE_DATA = 0, ++#else ++ TYPE_DATA = 1, ++#endif ++ TYPE_MAX ++}; ++ ++#endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ +-- +1.7.12.1 + + +From fe8c6a916b2cab61db535d64d653f859b337fede Mon Sep 17 00:00:00 2001 +From: David Howells <dhowells@redhat.com> +Date: Mon, 5 Nov 2012 15:15:24 +0000 +Subject: [PATCH 5/7] tools: Define a Makefile function to do subdir + processing + +Define a Makefile function that can be called with $(call ...) to wrap the +subdir make invocations in tools/Makefile. + +This will allow us in the next patch to insert bits in there to honour O= +flags when called from the top-level Makefile. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + tools/Makefile | 24 ++++++++++++------------ + tools/scripts/Makefile.include | 8 ++++++++ + 2 files changed, 20 insertions(+), 12 deletions(-) + +diff --git a/tools/Makefile b/tools/Makefile +index 3ae4394..1f9a529 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -31,44 +31,44 @@ help: + @echo ' clean: a summary clean target to clean _all_ folders' + + cpupower: FORCE +- $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) ++ $(call descend,power/$@) + + firewire lguest perf usb virtio vm: FORCE +- $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) ++ $(call descend,$@) + + selftests: FORCE +- $(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1) ++ $(call descend,testing/$@) + + turbostat x86_energy_perf_policy: FORCE +- $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) ++ $(call descend,power/x86/$@) + + cpupower_install: +- $(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install ++ $(call descend,power/$(@:_install=),install) + + firewire_install lguest_install perf_install usb_install virtio_install vm_install: +- $(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install ++ $(call descend,$(@:_install=),install) + + selftests_install: +- $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install ++ $(call descend,testing/$(@:_clean=),install) + + turbostat_install x86_energy_perf_policy_install: +- $(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install ++ $(call descend,power/x86/$(@:_install=),install) + + install: cpupower_install firewire_install lguest_install perf_install \ + selftests_install turbostat_install usb_install virtio_install \ + vm_install x86_energy_perf_policy_install + + cpupower_clean: +- $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean ++ $(call descend,power/cpupower,clean) + + firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean: +- $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean ++ $(call descend,$(@:_clean=),clean) + + selftests_clean: +- $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean ++ $(call descend,testing/$(@:_clean=),clean) + + turbostat_clean x86_energy_perf_policy_clean: +- $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean ++ $(call descend,power/x86/$(@:_clean=),clean) + + clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \ + turbostat_clean usb_clean virtio_clean vm_clean \ +diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include +index 96ce80a..4a9e317 100644 +--- a/tools/scripts/Makefile.include ++++ b/tools/scripts/Makefile.include +@@ -41,6 +41,14 @@ else + NO_SUBDIR = : + endif + ++# ++# Define a callable command for descending to a new directory ++# ++# Call by doing: $(call descend,directory[,target]) ++# ++descend = \ ++ $(QUIET_SUBDIR0)$(1) $(QUIET_SUBDIR1) $(2) ++ + QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir + QUIET_SUBDIR1 = + +-- +1.7.12.1 + + +From 148e4a394ba91d46b311d2d108f1a541b337103f Mon Sep 17 00:00:00 2001 +From: David Howells <dhowells@redhat.com> +Date: Mon, 5 Nov 2012 21:02:08 +0000 +Subject: [PATCH 6/7] tools: Honour the O= flag when tool build called from a + higher Makefile + +Honour the O= flag that was passed to a higher level Makefile and then passed +down as part of a tool build. + +To make this work, the top-level Makefile passes the original O= flag and +subdir=tools to the tools/Makefile, and that in turn passes +subdir=$(O)/$(subdir)/foodir when building tool foo in directory +$(O)/$(subdir)/foodir (where the intervening slashes aren't added if an +element is missing). + +For example, take perf. This is found in tools/perf/. Assume we're building +into directory ~/zebra/, so we pass O=~/zebra to make. Dependening on where +we run the build from, we see: + + make run in dir $(OUTPUT) dir + ======================= ================== + linux ~/zebra/tools/perf/ + linux/tools ~/zebra/perf/ + linux/tools/perf ~/zebra/ + +and if O= is not set, we get: + + make run in dir $(OUTPUT) dir + ======================= ================== + linux linux/tools/perf/ + linux/tools linux/tools/perf/ + linux/tools/perf linux/tools/perf/ + +The output directories are created by the descend function if they don't +already exist. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + Makefile | 6 ++++-- + tools/scripts/Makefile.include | 17 +++++++++++++---- + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 9f6ca12..fda5b97 100644 +--- a/Makefile ++++ b/Makefile +@@ -1321,10 +1321,12 @@ kernelversion: + + # Clear a bunch of variables before executing the submake + tools/: FORCE +- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ ++ $(Q)mkdir -p $(objtree)/tools ++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ + + tools/%: FORCE +- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $* ++ $(Q)mkdir -p $(objtree)/tools ++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $* + + # Single targets + # --------------------------------------------------------------------------- +diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include +index 4a9e317..87467b1 100644 +--- a/tools/scripts/Makefile.include ++++ b/tools/scripts/Makefile.include +@@ -1,8 +1,11 @@ +-ifeq ("$(origin O)", "command line") ++ifeq ($(origin O), command line) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) +- OUTPUT := $(ABSOLUTE_O)/ ++ OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/) + COMMAND_O := O=$(ABSOLUTE_O) ++ifeq ($(objtree),) ++ objtree := $(O) ++endif + endif + + ifneq ($(OUTPUT),) +@@ -47,9 +50,10 @@ endif + # Call by doing: $(call descend,directory[,target]) + # + descend = \ +- $(QUIET_SUBDIR0)$(1) $(QUIET_SUBDIR1) $(2) ++ +mkdir -p $(OUTPUT)$(1) && \ ++ $(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) + +-QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir ++QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir + QUIET_SUBDIR1 = + + ifneq ($(findstring $(MAKEFLAGS),s),s) +@@ -64,5 +68,10 @@ ifndef V + $(MAKE) $(PRINT_DIR) -C $$subdir + QUIET_FLEX = @echo ' ' FLEX $@; + QUIET_BISON = @echo ' ' BISON $@; ++ ++ descend = \ ++ @echo ' ' DESCEND $(1); \ ++ mkdir -p $(OUTPUT)$(1) && \ ++ $(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) + endif + endif +-- +1.7.12.1 + + +From 2ed84acacff79f3b469fb53627dd042c53f2fcaa Mon Sep 17 00:00:00 2001 +From: David Howells <dhowells@redhat.com> +Date: Mon, 5 Nov 2012 23:03:12 +0000 +Subject: [PATCH 7/7] perf: Make perf build for x86 with UAPI disintegration + applied + +Make perf build for x86 once the UAPI disintegration patches for that arch +have been applied by adding the appropriate -I flags - in the right order - +and then converting some #includes that use ../.. notation to find main kernel +headerfiles to use <asm/foo.h> and <linux/foo.h> instead. + +Note that -Iarch/foo/include/uapi is present _before_ -Iarch/foo/include. +This makes sure we get the userspace version of the pt_regs struct. Ideally, +we wouldn't have the latter -I flag at all, but unfortunately we want +asm/svm.h and asm/vmx.h in buildin-kvm.c and these aren't part of the UAPI - +at least not for x86. I wonder if the bits outside of the __KERNEL__ guards +*should* be transferred there. + +I note also that perf seems to do its dependency handling manually by listing +all the header files it might want to use in LIB_H in the Makefile. Can this +be changed to use -MD? + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + tools/perf/Makefile | 26 +++++++++++++++++++++++++- + tools/perf/arch/x86/include/perf_regs.h | 2 +- + tools/perf/builtin-kvm.c | 6 +++--- + tools/perf/builtin-test.c | 2 +- + tools/perf/perf.h | 16 +++------------- + tools/perf/util/evsel.c | 4 ++-- + tools/perf/util/evsel.h | 2 +- + tools/perf/util/header.h | 2 +- + tools/perf/util/parse-events-test.c | 2 +- + tools/perf/util/parse-events.c | 2 +- + tools/perf/util/parse-events.h | 2 +- + tools/perf/util/pmu.h | 2 +- + tools/perf/util/session.h | 2 +- + 13 files changed, 42 insertions(+), 28 deletions(-) + +diff --git a/tools/perf/Makefile b/tools/perf/Makefile +index 00deed4d..4d4b54f 100644 +--- a/tools/perf/Makefile ++++ b/tools/perf/Makefile +@@ -169,7 +169,31 @@ endif + + ### --- END CONFIGURATION SECTION --- + +-BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE ++ifeq ($(srctree),) ++srctree := $(patsubst %/,%,$(dir $(shell pwd))) ++srctree := $(patsubst %/,%,$(dir $(srctree))) ++#$(info Determined 'srctree' to be $(srctree)) ++endif ++ ++ifneq ($(objtree),) ++#$(info Determined 'objtree' to be $(objtree)) ++endif ++ ++ifneq ($(OUTPUT),) ++#$(info Determined 'OUTPUT' to be $(OUTPUT)) ++endif ++ ++BASIC_CFLAGS = \ ++ -Iutil/include \ ++ -Iarch/$(ARCH)/include \ ++ $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \ ++ -I$(srctree)/arch/$(ARCH)/include/uapi \ ++ -I$(srctree)/arch/$(ARCH)/include \ ++ $(if $(objtree),-I$(objtree)/include/generated/uapi) \ ++ -I$(srctree)/include/uapi \ ++ -I$(OUTPUT)util \ ++ -I$(TRACE_EVENT_DIR) \ ++ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + BASIC_LDFLAGS = + + # Guard against environment variables +diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h +index 46fc9f1..7fcdcdb 100644 +--- a/tools/perf/arch/x86/include/perf_regs.h ++++ b/tools/perf/arch/x86/include/perf_regs.h +@@ -3,7 +3,7 @@ + + #include <stdlib.h> + #include "../../util/types.h" +-#include "../../../../../arch/x86/include/asm/perf_regs.h" ++#include <asm/perf_regs.h> + + #ifndef ARCH_X86_64 + #define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1) +diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c +index 6d103a9..283b439 100644 +--- a/tools/perf/builtin-kvm.c ++++ b/tools/perf/builtin-kvm.c +@@ -23,9 +23,9 @@ + #include <math.h> + + #if defined(__i386__) || defined(__x86_64__) +-#include "../../arch/x86/include/asm/svm.h" +-#include "../../arch/x86/include/asm/vmx.h" +-#include "../../arch/x86/include/asm/kvm.h" ++#include <asm/svm.h> ++#include <asm/vmx.h> ++#include <asm/kvm.h> + + struct event_key { + #define INVALID_KEY (~0ULL) +diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c +index 484f26c..3626a01 100644 +--- a/tools/perf/builtin-test.c ++++ b/tools/perf/builtin-test.c +@@ -15,7 +15,7 @@ + #include "util/thread_map.h" + #include "util/pmu.h" + #include "event-parse.h" +-#include "../../include/linux/hw_breakpoint.h" ++#include "../../include/uapi/linux/hw_breakpoint.h" + + #include <sys/mman.h> + +diff --git a/tools/perf/perf.h b/tools/perf/perf.h +index c50985e..238f923 100644 +--- a/tools/perf/perf.h ++++ b/tools/perf/perf.h +@@ -5,8 +5,9 @@ struct winsize; + + void get_term_dimensions(struct winsize *ws); + ++#include <asm/unistd.h> ++ + #if defined(__i386__) +-#include "../../arch/x86/include/asm/unistd.h" + #define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") + #define cpu_relax() asm volatile("rep; nop" ::: "memory"); + #define CPUINFO_PROC "model name" +@@ -16,7 +17,6 @@ void get_term_dimensions(struct winsize *ws); + #endif + + #if defined(__x86_64__) +-#include "../../arch/x86/include/asm/unistd.h" + #define rmb() asm volatile("lfence" ::: "memory") + #define cpu_relax() asm volatile("rep; nop" ::: "memory"); + #define CPUINFO_PROC "model name" +@@ -26,20 +26,17 @@ void get_term_dimensions(struct winsize *ws); + #endif + + #ifdef __powerpc__ +-#include "../../arch/powerpc/include/asm/unistd.h" + #define rmb() asm volatile ("sync" ::: "memory") + #define cpu_relax() asm volatile ("" ::: "memory"); + #define CPUINFO_PROC "cpu" + #endif + + #ifdef __s390__ +-#include "../../arch/s390/include/asm/unistd.h" + #define rmb() asm volatile("bcr 15,0" ::: "memory") + #define cpu_relax() asm volatile("" ::: "memory"); + #endif + + #ifdef __sh__ +-#include "../../arch/sh/include/asm/unistd.h" + #if defined(__SH4A__) || defined(__SH5__) + # define rmb() asm volatile("synco" ::: "memory") + #else +@@ -50,35 +47,30 @@ void get_term_dimensions(struct winsize *ws); + #endif + + #ifdef __hppa__ +-#include "../../arch/parisc/include/asm/unistd.h" + #define rmb() asm volatile("" ::: "memory") + #define cpu_relax() asm volatile("" ::: "memory"); + #define CPUINFO_PROC "cpu" + #endif + + #ifdef __sparc__ +-#include "../../arch/sparc/include/uapi/asm/unistd.h" + #define rmb() asm volatile("":::"memory") + #define cpu_relax() asm volatile("":::"memory") + #define CPUINFO_PROC "cpu" + #endif + + #ifdef __alpha__ +-#include "../../arch/alpha/include/asm/unistd.h" + #define rmb() asm volatile("mb" ::: "memory") + #define cpu_relax() asm volatile("" ::: "memory") + #define CPUINFO_PROC "cpu model" + #endif + + #ifdef __ia64__ +-#include "../../arch/ia64/include/asm/unistd.h" + #define rmb() asm volatile ("mf" ::: "memory") + #define cpu_relax() asm volatile ("hint @pause" ::: "memory") + #define CPUINFO_PROC "model name" + #endif + + #ifdef __arm__ +-#include "../../arch/arm/include/asm/unistd.h" + /* + * Use the __kuser_memory_barrier helper in the CPU helper page. See + * arch/arm/kernel/entry-armv.S in the kernel source for details. +@@ -89,13 +81,11 @@ void get_term_dimensions(struct winsize *ws); + #endif + + #ifdef __aarch64__ +-#include "../../arch/arm64/include/asm/unistd.h" + #define rmb() asm volatile("dmb ld" ::: "memory") + #define cpu_relax() asm volatile("yield" ::: "memory") + #endif + + #ifdef __mips__ +-#include "../../arch/mips/include/asm/unistd.h" + #define rmb() asm volatile( \ + ".set mips2\n\t" \ + "sync\n\t" \ +@@ -112,7 +102,7 @@ void get_term_dimensions(struct winsize *ws); + #include <sys/types.h> + #include <sys/syscall.h> + +-#include "../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + #include "util/types.h" + #include <stdbool.h> + +diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c +index 618d411..d144d46 100644 +--- a/tools/perf/util/evsel.c ++++ b/tools/perf/util/evsel.c +@@ -18,8 +18,8 @@ + #include "cpumap.h" + #include "thread_map.h" + #include "target.h" +-#include "../../../include/linux/hw_breakpoint.h" +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/hw_breakpoint.h> ++#include <linux/perf_event.h> + #include "perf_regs.h" + + #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) +diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h +index 6f94d6d..bb84275 100644 +--- a/tools/perf/util/evsel.h ++++ b/tools/perf/util/evsel.h +@@ -3,7 +3,7 @@ + + #include <linux/list.h> + #include <stdbool.h> +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + #include "types.h" + #include "xyarray.h" + #include "cgroup.h" +diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h +index 879d215..9bc0078 100644 +--- a/tools/perf/util/header.h ++++ b/tools/perf/util/header.h +@@ -1,7 +1,7 @@ + #ifndef __PERF_HEADER_H + #define __PERF_HEADER_H + +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + #include <sys/types.h> + #include <stdbool.h> + #include "types.h" +diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c +index 516ecd9..6ef213b 100644 +--- a/tools/perf/util/parse-events-test.c ++++ b/tools/perf/util/parse-events-test.c +@@ -3,7 +3,7 @@ + #include "evsel.h" + #include "evlist.h" + #include "sysfs.h" +-#include "../../../include/linux/hw_breakpoint.h" ++#include <linux/hw_breakpoint.h> + + #define TEST_ASSERT_VAL(text, cond) \ + do { \ +diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c +index 75c7b0f..6b6d03e 100644 +--- a/tools/perf/util/parse-events.c ++++ b/tools/perf/util/parse-events.c +@@ -1,4 +1,4 @@ +-#include "../../../include/linux/hw_breakpoint.h" ++#include <linux/hw_breakpoint.h> + #include "util.h" + #include "../perf.h" + #include "evlist.h" +diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h +index 839230c..2820c40 100644 +--- a/tools/perf/util/parse-events.h ++++ b/tools/perf/util/parse-events.h +@@ -7,7 +7,7 @@ + #include <linux/list.h> + #include <stdbool.h> + #include "types.h" +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + #include "types.h" + + struct list_head; +diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h +index 39f3aba..fdeb8ac 100644 +--- a/tools/perf/util/pmu.h ++++ b/tools/perf/util/pmu.h +@@ -2,7 +2,7 @@ + #define __PMU_H + + #include <linux/bitops.h> +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + + enum { + PERF_PMU_FORMAT_VALUE_CONFIG, +diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h +index dd64261..0eae00a 100644 +--- a/tools/perf/util/session.h ++++ b/tools/perf/util/session.h +@@ -7,7 +7,7 @@ + #include "symbol.h" + #include "thread.h" + #include <linux/rbtree.h> +-#include "../../../include/uapi/linux/perf_event.h" ++#include <linux/perf_event.h> + + struct sample_queue; + struct ip_callchain; +-- +1.7.12.1 + diff --git a/freed-ora/current/master/power-x86-destdir.patch b/freed-ora/current/master/power-x86-destdir.patch index 5fb48ac13..97665314f 100644 --- a/freed-ora/current/master/power-x86-destdir.patch +++ b/freed-ora/current/master/power-x86-destdir.patch @@ -1,13 +1,14 @@ diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile -index fd8e1f1..7af5e8c 100644 +index f856495..984cc00 100644 --- a/tools/power/x86/turbostat/Makefile +++ b/tools/power/x86/turbostat/Makefile -@@ -1,8 +1,10 @@ +@@ -1,3 +1,5 @@ +DESTDIR ?= + turbostat : turbostat.c + CFLAGS += -Wall - clean : +@@ -5,5 +7,5 @@ clean : rm -f turbostat install : diff --git a/freed-ora/current/master/scripts/generate-git-snapshot.sh b/freed-ora/current/master/scripts/generate-git-snapshot.sh index 618d80c08..239b846c9 100755 --- a/freed-ora/current/master/scripts/generate-git-snapshot.sh +++ b/freed-ora/current/master/scripts/generate-git-snapshot.sh @@ -2,7 +2,7 @@ # # Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc or wherever. -VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/.xz//) +VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/-git.*// | sed s/.xz//) OLDGIT=$(grep gitrev kernel.spec | head -n1 | sed s/%define\ gitrev\ //) export NEWGIT=$(($OLDGIT+1)) diff --git a/freed-ora/current/master/secure-boot-20121105.patch b/freed-ora/current/master/secure-boot-20121105.patch new file mode 100644 index 000000000..0b6b04038 --- /dev/null +++ b/freed-ora/current/master/secure-boot-20121105.patch @@ -0,0 +1,1407 @@ +From 57c0dbcbafaa724313c672830ff0087f56a84c47 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:40:56 -0400 +Subject: [PATCH 01/14] Secure boot: Add new capability + +Secure boot adds certain policy requirements, including that root must not +be able to do anything that could cause the kernel to execute arbitrary code. +The simplest way to handle this would seem to be to add a new capability +and gate various functionality on that. We'll then strip it from the initial +capability set if required. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + include/uapi/linux/capability.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/linux/capability.h b/include/linux/capability.h +index d10b7ed..4345bc8 100644 +--- a/include/uapi/linux/capability.h ++++ b/include/uapi/linux/capability.h +@@ -364,7 +364,11 @@ struct cpu_vfs_cap_data { + + #define CAP_BLOCK_SUSPEND 36 + +-#define CAP_LAST_CAP CAP_BLOCK_SUSPEND ++/* Allow things that trivially permit root to modify the running kernel */ ++ ++#define CAP_COMPROMISE_KERNEL 37 ++ ++#define CAP_LAST_CAP CAP_COMPROMISE_KERNEL + + #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) + +-- +1.7.11.4 + + +From 95fd8148be46036e20fc64c480104d2a2b454e27 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:40:57 -0400 +Subject: [PATCH 02/14] PCI: Lock down BAR access in secure boot environments + +Any hardware that can potentially generate DMA has to be locked down from +userspace in order to avoid it being possible for an attacker to cause +arbitrary kernel behaviour. Default to paranoid - in future we can +potentially relax this for sufficiently IOMMU-isolated devices. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + drivers/pci/pci-sysfs.c | 9 +++++++++ + drivers/pci/proc.c | 8 +++++++- + drivers/pci/syscall.c | 2 +- + 3 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c +index 6869009..c03fb85 100644 +--- a/drivers/pci/pci-sysfs.c ++++ b/drivers/pci/pci-sysfs.c +@@ -542,6 +542,9 @@ pci_write_config(struct file* filp, struct kobject *kobj, + loff_t init_off = off; + u8 *data = (u8*) buf; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (off > dev->cfg_size) + return 0; + if (off + count > dev->cfg_size) { +@@ -844,6 +847,9 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, + resource_size_t start, end; + int i; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + for (i = 0; i < PCI_ROM_RESOURCE; i++) + if (res == &pdev->resource[i]) + break; +@@ -951,6 +957,9 @@ pci_write_resource_io(struct file *filp, struct kobject *kobj, + struct bin_attribute *attr, char *buf, + loff_t off, size_t count) + { ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + return pci_resource_io(filp, kobj, attr, buf, off, count, true); + } + +diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c +index 27911b5..ac8c9a5 100644 +--- a/drivers/pci/proc.c ++++ b/drivers/pci/proc.c +@@ -135,6 +135,9 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof + int size = dp->size; + int cnt; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (pos >= size) + return 0; + if (nbytes >= size) +@@ -211,6 +214,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, + #endif /* HAVE_PCI_MMAP */ + int ret = 0; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + switch (cmd) { + case PCIIOC_CONTROLLER: + ret = pci_domain_nr(dev->bus); +@@ -251,7 +257,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) + struct pci_filp_private *fpriv = file->private_data; + int i, ret; + +- if (!capable(CAP_SYS_RAWIO)) ++ if (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL)) + return -EPERM; + + /* Make sure the caller is mapping a real resource for this device */ +diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c +index e1c1ec5..97e785f 100644 +--- a/drivers/pci/syscall.c ++++ b/drivers/pci/syscall.c +@@ -92,7 +92,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, + u32 dword; + int err = 0; + +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_COMPROMISE_KERNEL)) + return -EPERM; + + dev = pci_get_bus_and_slot(bus, dfn); +-- +1.7.11.4 + + +From 2d23d2726583d79062e58abcc32c7dd027d312aa Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:40:58 -0400 +Subject: [PATCH 03/14] x86: Lock down IO port access in secure boot + environments + +IO port access would permit users to gain access to PCI configuration +registers, which in turn (on a lot of hardware) give access to MMIO register +space. This would potentially permit root to trigger arbitrary DMA, so lock +it down by default. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + arch/x86/kernel/ioport.c | 4 ++-- + drivers/char/mem.c | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c +index 8c96897..a2578c4 100644 +--- a/arch/x86/kernel/ioport.c ++++ b/arch/x86/kernel/ioport.c +@@ -28,7 +28,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) + + if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) + return -EINVAL; +- if (turn_on && !capable(CAP_SYS_RAWIO)) ++ if (turn_on && (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL))) + return -EPERM; + + /* +@@ -102,7 +102,7 @@ long sys_iopl(unsigned int level, struct pt_regs *regs) + return -EINVAL; + /* Trying to gain more privileges? */ + if (level > old) { +- if (!capable(CAP_SYS_RAWIO)) ++ if (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL)) + return -EPERM; + } + regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12); +diff --git a/drivers/char/mem.c b/drivers/char/mem.c +index e5eedfa..1e0a660 100644 +--- a/drivers/char/mem.c ++++ b/drivers/char/mem.c +@@ -597,6 +597,9 @@ static ssize_t write_port(struct file *file, const char __user *buf, + unsigned long i = *ppos; + const char __user * tmp = buf; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (!access_ok(VERIFY_READ, buf, count)) + return -EFAULT; + while (count-- > 0 && i < 65536) { +-- +1.7.11.4 + + +From e063cb2f3a667d2540682d4bdbef91fdb23b1a84 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:40:59 -0400 +Subject: [PATCH 04/14] ACPI: Limit access to custom_method + +It must be impossible for even root to get code executed in kernel context +under a secure boot environment. custom_method effectively allows arbitrary +access to system memory, so it needs to have a capability check here. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + drivers/acpi/custom_method.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c +index 5d42c24..247d58b 100644 +--- a/drivers/acpi/custom_method.c ++++ b/drivers/acpi/custom_method.c +@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, + struct acpi_table_header table; + acpi_status status; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (!(*ppos)) { + /* parse the table header to get the table length */ + if (count <= sizeof(struct acpi_table_header)) +-- +1.7.11.4 + + +From a1cccbd084c7355dcb2be7ae2934f168ce9ba9d5 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:41:00 -0400 +Subject: [PATCH 05/14] asus-wmi: Restrict debugfs interface + +We have no way of validating what all of the Asus WMI methods do on a +given machine, and there's a risk that some will allow hardware state to +be manipulated in such a way that arbitrary code can be executed in the +kernel. Add a capability check to prevent that. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + drivers/platform/x86/asus-wmi.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index 2eb9fe8..61e055d 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -1523,6 +1523,9 @@ static int show_dsts(struct seq_file *m, void *data) + int err; + u32 retval = -1; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval); + + if (err < 0) +@@ -1539,6 +1542,9 @@ static int show_devs(struct seq_file *m, void *data) + int err; + u32 retval = -1; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param, + &retval); + +@@ -1563,6 +1569,9 @@ static int show_call(struct seq_file *m, void *data) + union acpi_object *obj; + acpi_status status; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, + 1, asus->debug.method_id, + &input, &output); +-- +1.7.11.4 + + +From 1c9e53b626268f82509062751eda14e8572717cf Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:41:01 -0400 +Subject: [PATCH 06/14] Restrict /dev/mem and /dev/kmem in secure boot setups + +Allowing users to write to address space makes it possible for the kernel +to be subverted. Restrict this when we need to protect the kernel. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + drivers/char/mem.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/char/mem.c b/drivers/char/mem.c +index 1e0a660..33eb947 100644 +--- a/drivers/char/mem.c ++++ b/drivers/char/mem.c +@@ -158,6 +158,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf, + unsigned long copied; + void *ptr; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (!valid_phys_addr_range(p, count)) + return -EFAULT; + +@@ -530,6 +533,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, + char * kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ + int err = 0; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + if (p < (unsigned long) high_memory) { + unsigned long to_write = min_t(unsigned long, count, + (unsigned long)high_memory - p); +-- +1.7.11.4 + + +From fbf919bf372b9a7a08bdacac8129d47ced1b1f19 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Thu, 20 Sep 2012 10:41:02 -0400 +Subject: [PATCH 07/14] Secure boot: Add a dummy kernel parameter that will + switch on Secure Boot mode + +This forcibly drops CAP_COMPROMISE_KERNEL from both cap_permitted and cap_bset +in the init_cred struct, which everything else inherits from. This works on +any machine and can be used to develop even if the box doesn't have UEFI. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + Documentation/kernel-parameters.txt | 7 +++++++ + kernel/cred.c | 17 +++++++++++++++++ + 2 files changed, 24 insertions(+) + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index 9b2b8d3..93978d5 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -2562,6 +2562,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + Note: increases power consumption, thus should only be + enabled if running jitter sensitive (HPC/RT) workloads. + ++ secureboot_enable= ++ [KNL] Enables an emulated UEFI Secure Boot mode. This ++ locks down various aspects of the kernel guarded by the ++ CAP_COMPROMISE_KERNEL capability. This includes things ++ like /dev/mem, IO port access, and other areas. It can ++ be used on non-UEFI machines for testing purposes. ++ + security= [SECURITY] Choose a security module to enable at boot. + If this boot parameter is not specified, only the first + security module asking for security registration will be +diff --git a/kernel/cred.c b/kernel/cred.c +index de728ac..7e6e83f 100644 +--- a/kernel/cred.c ++++ b/kernel/cred.c +@@ -623,6 +623,23 @@ void __init cred_init(void) + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); + } + ++void __init secureboot_enable() ++{ ++ pr_info("Secure boot enabled\n"); ++ cap_lower((&init_cred)->cap_bset, CAP_COMPROMISE_KERNEL); ++ cap_lower((&init_cred)->cap_permitted, CAP_COMPROMISE_KERNEL); ++} ++ ++/* Dummy Secure Boot enable option to fake out UEFI SB=1 */ ++static int __init secureboot_enable_opt(char *str) ++{ ++ int sb_enable = !!simple_strtol(str, NULL, 0); ++ if (sb_enable) ++ secureboot_enable(); ++ return 1; ++} ++__setup("secureboot_enable=", secureboot_enable_opt); ++ + /** + * prepare_kernel_cred - Prepare a set of credentials for a kernel service + * @daemon: A userspace daemon to be used as a reference +-- +1.7.11.4 + + +From 43ed7865d867ae692e30227d66fa58cdecbd9269 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Thu, 20 Sep 2012 10:41:03 -0400 +Subject: [PATCH 08/14] efi: Enable secure boot lockdown automatically when + enabled in firmware + +The firmware has a set of flags that indicate whether secure boot is enabled +and enforcing. Use them to indicate whether the kernel should lock itself +down. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + Documentation/x86/zero-page.txt | 2 ++ + arch/x86/boot/compressed/eboot.c | 32 ++++++++++++++++++++++++++++++++ + arch/x86/include/asm/bootparam.h | 3 ++- + arch/x86/kernel/setup.c | 3 +++ + include/linux/cred.h | 2 ++ + 5 files changed, 41 insertions(+), 1 deletion(-) + +diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt +index cf5437d..7f9ed48 100644 +--- a/Documentation/x86/zero-page.txt ++++ b/Documentation/x86/zero-page.txt +@@ -27,6 +27,8 @@ Offset Proto Name Meaning + 1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) + 1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer + (below) ++1EB/001 ALL kbd_status Numlock is enabled ++1EC/001 ALL secure_boot Kernel should enable secure boot lockdowns + 290/040 ALL edd_mbr_sig_buffer EDD MBR signatures + 2D0/A00 ALL e820_map E820 memory map table + (array of struct e820entry) +diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c +index b3e0227..3789356 100644 +--- a/arch/x86/boot/compressed/eboot.c ++++ b/arch/x86/boot/compressed/eboot.c +@@ -724,6 +724,36 @@ fail: + return status; + } + ++static int get_secure_boot(efi_system_table_t *_table) ++{ ++ u8 sb, setup; ++ unsigned long datasize = sizeof(sb); ++ efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; ++ efi_status_t status; ++ ++ status = efi_call_phys5(sys_table->runtime->get_variable, ++ L"SecureBoot", &var_guid, NULL, &datasize, &sb); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (sb == 0) ++ return 0; ++ ++ ++ status = efi_call_phys5(sys_table->runtime->get_variable, ++ L"SetupMode", &var_guid, NULL, &datasize, ++ &setup); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (setup == 1) ++ return 0; ++ ++ return 1; ++} ++ + /* + * Because the x86 boot code expects to be passed a boot_params we + * need to create one ourselves (usually the bootloader would create +@@ -1018,6 +1048,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, + if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) + goto fail; + ++ boot_params->secure_boot = get_secure_boot(sys_table); ++ + setup_graphics(boot_params); + + status = efi_call_phys3(sys_table->boottime->allocate_pool, +diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h +index 2ad874c..c7338e0 100644 +--- a/arch/x86/include/asm/bootparam.h ++++ b/arch/x86/include/asm/bootparam.h +@@ -114,7 +114,8 @@ struct boot_params { + __u8 eddbuf_entries; /* 0x1e9 */ + __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ + __u8 kbd_status; /* 0x1eb */ +- __u8 _pad6[5]; /* 0x1ec */ ++ __u8 secure_boot; /* 0x1ec */ ++ __u8 _pad6[4]; /* 0x1ed */ + struct setup_header hdr; /* setup header */ /* 0x1f1 */ + __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)]; + __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */ +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index f4b9b80..239bf2a 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -947,6 +947,9 @@ void __init setup_arch(char **cmdline_p) + + io_delay_init(); + ++ if (boot_params.secure_boot) ++ secureboot_enable(); ++ + /* + * Parse the ACPI tables for possible boot-time SMP configuration. + */ +diff --git a/include/linux/cred.h b/include/linux/cred.h +index ebbed2c..a24faf1 100644 +--- a/include/linux/cred.h ++++ b/include/linux/cred.h +@@ -170,6 +170,8 @@ extern int set_security_override_from_ctx(struct cred *, const char *); + extern int set_create_files_as(struct cred *, struct inode *); + extern void __init cred_init(void); + ++extern void secureboot_enable(void); ++ + /* + * check for validity of credentials + */ +-- +1.7.11.4 + + +From 3acf1ceb5f6f3be9103c9da16ddc24afc6d8b02a Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Thu, 20 Sep 2012 10:41:04 -0400 +Subject: [PATCH 09/14] acpi: Ignore acpi_rsdp kernel parameter in a secure + boot environment + +This option allows userspace to pass the RSDP address to the kernel. This +could potentially be used to circumvent the secure boot trust model. +We ignore the setting if we don't have the CAP_COMPROMISE_KERNEL capability. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + drivers/acpi/osl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c +index 9eaf708..f94341b 100644 +--- a/drivers/acpi/osl.c ++++ b/drivers/acpi/osl.c +@@ -246,7 +246,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp); + acpi_physical_address __init acpi_os_get_root_pointer(void) + { + #ifdef CONFIG_KEXEC +- if (acpi_rsdp) ++ if (acpi_rsdp && capable(CAP_COMPROMISE_KERNEL)) + return acpi_rsdp; + #endif + +-- +1.7.11.4 + + +From 03fb06d272ddc1062e610521c5cfdbe42f251209 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Thu, 20 Sep 2012 10:41:05 -0400 +Subject: [PATCH 10/14] SELinux: define mapping for new Secure Boot capability + +Add the name of the new Secure Boot capability. This allows SELinux +policies to properly map CAP_COMPROMISE_KERNEL to the appropriate +capability class. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + security/selinux/include/classmap.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h +index df2de54..70e2834 100644 +--- a/security/selinux/include/classmap.h ++++ b/security/selinux/include/classmap.h +@@ -146,8 +146,8 @@ struct security_class_mapping secclass_map[] = { + { "memprotect", { "mmap_zero", NULL } }, + { "peer", { "recv", NULL } }, + { "capability2", +- { "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend", +- NULL } }, ++ { "mac_override", "mac_admin", "syslog", "wake_alarm", ++ "block_suspend", "compromise_kernel", NULL } }, + { "kernel_service", { "use_as_override", "create_files_as", NULL } }, + { "tun_socket", + { COMMON_SOCK_PERMS, NULL } }, +-- +1.7.11.4 + + +From 0cfaa5ecf01f8eaaa2a84d88b7258a94ac9a1bfe Mon Sep 17 00:00:00 2001 +From: Matthew Garrett <mjg@redhat.com> +Date: Tue, 4 Sep 2012 11:55:13 -0400 +Subject: [PATCH 11/14] kexec: Disable in a secure boot environment + +kexec could be used as a vector for a malicious user to use a signed kernel +to circumvent the secure boot trust model. In the long run we'll want to +support signed kexec payloads, but for the moment we should just disable +loading entirely in that situation. + +Signed-off-by: Matthew Garrett <mjg@redhat.com> +--- + kernel/kexec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/kexec.c b/kernel/kexec.c +index 0668d58..8b976a5 100644 +--- a/kernel/kexec.c ++++ b/kernel/kexec.c +@@ -944,7 +944,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, + int result; + + /* We only trust the superuser with rebooting the system. */ +- if (!capable(CAP_SYS_BOOT)) ++ if (!capable(CAP_SYS_BOOT) || !capable(CAP_COMPROMISE_KERNEL)) + return -EPERM; + + /* +-- +1.7.11.4 + + +From 895c46276788b3711aee05a1a1d685eff69d48b9 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Mon, 25 Jun 2012 21:29:46 -0400 +Subject: [PATCH 12/14] Documentation: kernel-parameters.txt remove + capability.disable + +Remove the documentation for capability.disable. The code supporting this +parameter was removed with: + + commit 5915eb53861c5776cfec33ca4fcc1fd20d66dd27 + Author: Miklos Szeredi <mszeredi@suse.cz> + Date: Thu Jul 3 20:56:05 2008 +0200 + + security: remove dummy module + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + Documentation/kernel-parameters.txt | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index 93978d5..e3e5f8c 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -446,12 +446,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + possible to determine what the correct size should be. + This option provides an override for these situations. + +- capability.disable= +- [SECURITY] Disable capabilities. This would normally +- be used only if an alternative security model is to be +- configured. Potentially dangerous and should only be +- used if you are entirely sure of the consequences. +- + ccw_timeout_log [S390] + See Documentation/s390/CommonIO for details. + +-- +1.7.11.4 + + +From 1cc529e97756554953187fe48b9b8cf0e24b9bc7 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Fri, 5 Oct 2012 10:12:48 -0400 +Subject: [PATCH] modsign: Always enforce module signing in a Secure Boot + environment + +If a machine is booted into a Secure Boot environment, we need to +protect the trust model. This requires that all modules be signed +with a key that is in the kernel's _modsign keyring. The checks for +this are already done via the 'sig_enforce' module parameter. Make +this visible within the kernel and force it to be true. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + kernel/cred.c | 8 ++++++++ + kernel/module.c | 4 ++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/kernel/cred.c b/kernel/cred.c +index 7e6e83f..2b0b980 100644 +--- a/kernel/cred.c ++++ b/kernel/cred.c +@@ -623,11 +623,19 @@ void __init cred_init(void) + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); + } + ++#ifdef CONFIG_MODULE_SIG ++extern bool sig_enforce; ++#endif ++ + void __init secureboot_enable() + { + pr_info("Secure boot enabled\n"); + cap_lower((&init_cred)->cap_bset, CAP_COMPROMISE_KERNEL); + cap_lower((&init_cred)->cap_permitted, CAP_COMPROMISE_KERNEL); ++#ifdef CONFIG_MODULE_SIG ++ /* Enable module signature enforcing */ ++ sig_enforce = true; ++#endif + } + + /* Dummy Secure Boot enable option to fake out UEFI SB=1 */ +diff --git a/kernel/module.c b/kernel/module.c +index de16959..7d4c50a 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -106,9 +106,9 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ + + #ifdef CONFIG_MODULE_SIG + #ifdef CONFIG_MODULE_SIG_FORCE +-static bool sig_enforce = true; ++bool sig_enforce = true; + #else +-static bool sig_enforce = false; ++bool sig_enforce = false; + + static int param_set_bool_enable_only(const char *val, + const struct kernel_param *kp) +-- +1.7.11.4 + +From 945f3829d0d376c5e0c790b57c4fa9e875d602d3 Mon Sep 17 00:00:00 2001 +From: Dave Howells <dhowells@redhat.com> +Date: Tue, 23 Oct 2012 09:30:54 -0400 +Subject: [PATCH 1/2] Add EFI signature data types, such as are used for + containing hashes, keys and certificates for + cryptographic verification. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + include/linux/efi.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 8670eb1..836c797 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -312,6 +312,12 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, + #define EFI_FILE_SYSTEM_GUID \ + EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) + ++#define EFI_CERT_SHA256_GUID \ ++ EFI_GUID( 0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 ) ++ ++#define EFI_CERT_X509_GUID \ ++ EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) ++ + typedef struct { + efi_guid_t guid; + u64 table; +@@ -447,6 +453,20 @@ typedef struct { + + #define EFI_INVALID_TABLE_ADDR (~0UL) + ++typedef struct { ++ efi_guid_t signature_owner; ++ u8 signature_data[]; ++} efi_signature_data_t; ++ ++typedef struct { ++ efi_guid_t signature_type; ++ u32 signature_list_size; ++ u32 signature_header_size; ++ u32 signature_size; ++ u8 signature_header[]; ++ /* efi_signature_data_t signatures[][] */ ++} efi_signature_list_t; ++ + /* + * All runtime access to EFI goes through this structure: + */ +-- +1.7.12.1 + + +From 5934634101936bc4ee4636df7269e00c4979911c Mon Sep 17 00:00:00 2001 +From: Dave Howells <dhowells@redhat.com> +Date: Tue, 23 Oct 2012 09:36:28 -0400 +Subject: [PATCH 2/2] Add an EFI signature blob parser and key loader. X.509 + certificates are loaded into the specified keyring as + asymmetric type keys. + +Signed-off-by: David Howells <dhowells@redhat.com> +--- + crypto/asymmetric_keys/Kconfig | 7 +++ + crypto/asymmetric_keys/Makefile | 1 + + crypto/asymmetric_keys/efi_parser.c | 107 ++++++++++++++++++++++++++++++++++++ + include/linux/efi.h | 4 ++ + 4 files changed, 119 insertions(+) + create mode 100644 crypto/asymmetric_keys/efi_parser.c + +diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig +index 6d2c2ea..eb53fc3 100644 +--- a/crypto/asymmetric_keys/Kconfig ++++ b/crypto/asymmetric_keys/Kconfig +@@ -35,4 +35,11 @@ config X509_CERTIFICATE_PARSER + data and provides the ability to instantiate a crypto key from a + public key packet found inside the certificate. + ++config EFI_SIGNATURE_LIST_PARSER ++ bool "EFI signature list parser" ++ select X509_CERTIFICATE_PARSER ++ help ++ This option provides support for parsing EFI signature lists for ++ X.509 certificates and turning them into keys. ++ + endif # ASYMMETRIC_KEY_TYPE +diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile +index 0727204..cd8388e 100644 +--- a/crypto/asymmetric_keys/Makefile ++++ b/crypto/asymmetric_keys/Makefile +@@ -8,6 +8,7 @@ asymmetric_keys-y := asymmetric_type.o signature.o + + obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o + obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o ++obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o + + # + # X.509 Certificate handling +diff --git a/crypto/asymmetric_keys/efi_parser.c b/crypto/asymmetric_keys/efi_parser.c +new file mode 100644 +index 0000000..59b859a +--- /dev/null ++++ b/crypto/asymmetric_keys/efi_parser.c +@@ -0,0 +1,107 @@ ++/* EFI signature/key/certificate list parser ++ * ++ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. ++ * Written by David Howells (dhowells@redhat.com) ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public Licence ++ * as published by the Free Software Foundation; either version ++ * 2 of the Licence, or (at your option) any later version. ++ */ ++ ++#define pr_fmt(fmt) "EFI: "fmt ++#include <linux/module.h> ++#include <linux/printk.h> ++#include <linux/err.h> ++#include <linux/efi.h> ++#include <keys/asymmetric-type.h> ++ ++static __initdata efi_guid_t efi_cert_x509_guid = EFI_CERT_X509_GUID; ++ ++/** ++ * parse_efi_signature_list - Parse an EFI signature list for certificates ++ * @data: The data blob to parse ++ * @size: The size of the data blob ++ * @keyring: The keyring to add extracted keys to ++ */ ++int __init parse_efi_signature_list(const void *data, size_t size, struct key *keyring) ++{ ++ unsigned offs = 0; ++ size_t lsize, esize, hsize, elsize; ++ ++ pr_devel("-->%s(,%zu)\n", __func__, size); ++ ++ while (size > 0) { ++ efi_signature_list_t list; ++ const efi_signature_data_t *elem; ++ key_ref_t key; ++ ++ if (size < sizeof(list)) ++ return -EBADMSG; ++ ++ memcpy(&list, data, sizeof(list)); ++ pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n", ++ offs, ++ list.signature_type.b, list.signature_list_size, ++ list.signature_header_size, list.signature_size); ++ ++ lsize = list.signature_list_size; ++ hsize = list.signature_header_size; ++ esize = list.signature_size; ++ elsize = lsize - sizeof(list) - hsize; ++ ++ if (lsize > size) { ++ pr_devel("<--%s() = -EBADMSG [overrun @%x]\n", ++ __func__, offs); ++ return -EBADMSG; ++ } ++ if (lsize < sizeof(list) || ++ lsize - sizeof(list) < hsize || ++ esize < sizeof(*elem) || ++ elsize < esize || ++ elsize % esize != 0) { ++ pr_devel("- bad size combo @%x\n", offs); ++ continue; ++ } ++ ++ if (efi_guidcmp(list.signature_type, efi_cert_x509_guid) != 0) { ++ data += lsize; ++ size -= lsize; ++ offs += lsize; ++ continue; ++ } ++ ++ data += sizeof(list) + hsize; ++ size -= sizeof(list) + hsize; ++ offs += sizeof(list) + hsize; ++ ++ for (; elsize > 0; elsize -= esize) { ++ elem = data; ++ ++ pr_devel("ELEM[%04x]\n", offs); ++ ++ key = key_create_or_update( ++ make_key_ref(keyring, 1), ++ "asymmetric", ++ NULL, ++ &elem->signature_data, ++ esize - sizeof(*elem), ++ (KEY_POS_ALL & ~KEY_POS_SETATTR) | ++ KEY_USR_VIEW, ++ KEY_ALLOC_NOT_IN_QUOTA); ++ ++ if (IS_ERR(key)) ++ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", ++ PTR_ERR(key)); ++ else ++ pr_notice("Loaded cert '%s'\n", ++ key_ref_to_ptr(key)->description); ++ ++ data += esize; ++ size -= esize; ++ offs += esize; ++ } ++ } ++ ++ return 0; ++} +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 836c797..9cc3250 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -536,6 +536,10 @@ extern int efi_set_rtc_mmss(unsigned long nowtime); + extern void efi_reserve_boot_services(void); + extern struct efi_memory_map memmap; + ++struct key; ++extern int __init parse_efi_signature_list(const void *data, size_t size, ++ struct key *keyring); ++ + /** + * efi_range_is_wc - check the WC bit on an address range + * @start: starting kvirt address +-- +1.7.12.1 + +From a06f449cee6152ce8f0a051593fceb82d26e4f16 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Fri, 26 Oct 2012 12:29:49 -0400 +Subject: [PATCH] EFI: Add in-kernel variable to determine if Secure Boot is + enabled + +There are a few cases where in-kernel functions may need to know if +Secure Boot is enabled. The added capability check cannot be used as the +kernel can't drop it's own capabilites, so we add a global variable +similar to efi_enabled so they can determine if Secure Boot is enabled. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + arch/x86/kernel/setup.c | 6 +++++- + arch/x86/platform/efi/efi.c | 2 ++ + include/linux/efi.h | 3 +++ + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index b4f4666..db74940 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -961,8 +961,12 @@ void __init setup_arch(char **cmdline_p) + + io_delay_init(); + +- if (boot_params.secure_boot) ++ if (boot_params.secure_boot) { + secureboot_enable(); ++#ifdef CONFIG_EFI ++ secure_boot_enabled = 1; ++#endif ++ } + + /* + * Parse the ACPI tables for possible boot-time SMP configuration. +diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c +index 72d8899..882d794 100644 +--- a/arch/x86/platform/efi/efi.c ++++ b/arch/x86/platform/efi/efi.c +@@ -53,6 +53,8 @@ + int efi_enabled; + EXPORT_SYMBOL(efi_enabled); + ++int secure_boot_enabled; ++ + struct efi __read_mostly efi = { + .mps = EFI_INVALID_TABLE_ADDR, + .acpi = EFI_INVALID_TABLE_ADDR, +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 54b5936..411997f 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -575,11 +575,14 @@ extern int __init efi_setup_pcdp_console(char *); + # ifdef CONFIG_X86 + extern int efi_enabled; + extern bool efi_64bit; ++ extern int secure_boot_enabled; + # else + # define efi_enabled 1 ++# define secure_boot_enabled 0 + # endif + #else + # define efi_enabled 0 ++# define secure_boot_enabled 0 + #endif + + /* +-- +1.7.12.1 + +From 2a5f33b264daffd717b509bc5ac3cdc060b5573e Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Fri, 26 Oct 2012 12:36:24 -0400 +Subject: [PATCH 2/3] MODSIGN: Add module certificate blacklist keyring + +This adds an additional keyring that is used to store certificates that +are blacklisted. This keyring is searched first when loading signed modules +and if the module's certificate is found, it will refuse to load. This is +useful in cases where third party certificates are used for module signing. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + init/Kconfig | 8 ++++++++ + kernel/modsign_pubkey.c | 17 +++++++++++++++++ + kernel/module-internal.h | 3 +++ + kernel/module_signing.c | 14 +++++++++++++- + 4 files changed, 41 insertions(+), 1 deletion(-) + +diff --git a/init/Kconfig b/init/Kconfig +index 6fdd6e3..7a9bf00 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1602,6 +1602,14 @@ config MODULE_SIG_FORCE + Reject unsigned modules or signed modules for which we don't have a + key. Without this, such modules will simply taint the kernel. + ++config MODULE_SIG_BLACKLIST ++ bool "Support for blacklisting module signature certificates" ++ depends on MODULE_SIG ++ help ++ This adds support for keeping a blacklist of certificates that ++ should not pass module signature verification. If a module is ++ signed with something in this keyring, the load will be rejected. ++ + choice + prompt "Which hash algorithm should modules be signed with?" + depends on MODULE_SIG +diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c +index 4646eb2..6d70783 100644 +--- a/kernel/modsign_pubkey.c ++++ b/kernel/modsign_pubkey.c +@@ -17,6 +17,9 @@ + #include "module-internal.h" + + struct key *modsign_keyring; ++#ifdef CONFIG_MODULE_SIG_BLACKLIST ++struct key *modsign_blacklist; ++#endif + + extern __initdata const u8 modsign_certificate_list[]; + extern __initdata const u8 modsign_certificate_list_end[]; +@@ -52,6 +55,20 @@ static __init int module_verify_init(void) + if (key_instantiate_and_link(modsign_keyring, NULL, 0, NULL, NULL) < 0) + panic("Can't instantiate module signing keyring\n"); + ++#ifdef CONFIG_MODULE_SIG_BLACKLIST ++ modsign_blacklist = key_alloc(&key_type_keyring, ".modsign_blacklist", ++ KUIDT_INIT(0), KGIDT_INIT(0), ++ current_cred(), ++ (KEY_POS_ALL & ~KEY_POS_SETATTR) | ++ KEY_USR_VIEW | KEY_USR_READ, ++ KEY_ALLOC_NOT_IN_QUOTA); ++ if (IS_ERR(modsign_blacklist)) ++ panic("Can't allocate module signing blacklist keyring\n"); ++ ++ if (key_instantiate_and_link(modsign_blacklist, NULL, 0, NULL, NULL) < 0) ++ panic("Can't instantiate module signing blacklist keyring\n"); ++#endif ++ + return 0; + } + +diff --git a/kernel/module-internal.h b/kernel/module-internal.h +index 24f9247..51a8380 100644 +--- a/kernel/module-internal.h ++++ b/kernel/module-internal.h +@@ -10,5 +10,8 @@ + */ + + extern struct key *modsign_keyring; ++#ifdef CONFIG_MODULE_SIG_BLACKLIST ++extern struct key *modsign_blacklist; ++#endif + + extern int mod_verify_sig(const void *mod, unsigned long *_modlen); +diff --git a/kernel/module_signing.c b/kernel/module_signing.c +index ea1b1df..602aa24 100644 +--- a/kernel/module_signing.c ++++ b/kernel/module_signing.c +@@ -132,7 +132,7 @@ static int mod_extract_mpi_array(struct public_key_signature *pks, + static struct key *request_asymmetric_key(const char *signer, size_t signer_len, + const u8 *key_id, size_t key_id_len) + { +- key_ref_t key; ++ key_ref_t key, blacklist; + size_t i; + char *id, *q; + +@@ -157,6 +157,18 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len, + + pr_debug("Look up: \"%s\"\n", id); + ++#ifdef CONFIG_MODULE_SIG_BLACKLIST ++ blacklist = keyring_search(make_key_ref(modsign_blacklist, 1), ++ &key_type_asymmetric, id); ++ if (!IS_ERR(blacklist)) { ++ /* module is signed with a cert in the blacklist. reject */ ++ pr_err("Module key '%s' is in blacklist\n", id); ++ key_ref_put(blacklist); ++ kfree(id); ++ return ERR_PTR(-EKEYREJECTED); ++ } ++#endif ++ + key = keyring_search(make_key_ref(modsign_keyring, 1), + &key_type_asymmetric, id); + if (IS_ERR(key)) +-- +1.7.12.1 + + + +From ddd5e2e1b775fb19aeec7fb842e707fc35347bc0 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Fri, 26 Oct 2012 12:42:16 -0400 +Subject: [PATCH] MODSIGN: Import certificates from UEFI Secure Boot + +Secure Boot stores a list of allowed certificates in the 'db' variable. +This imports those certificates into the module signing keyring. This +allows for a third party signing certificate to be used in conjunction +with signed modules. By importing the public certificate into the 'db' +variable, a user can allow a module signed with that certificate to +load. + +In the opposite case, Secure Boot maintains a list of disallowed +certificates in the 'dbx' variable. We load those certificates into +the newly introduced module blacklist keyring and forbid any module +signed with those from loading. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + include/linux/efi.h | 3 ++ + init/Kconfig | 9 ++++++ + kernel/Makefile | 3 ++ + kernel/modsign_uefi.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 99 insertions(+) + create mode 100644 kernel/modsign_uefi.c + +diff --git a/include/linux/efi.h b/include/linux/efi.h +index ff72468..509755e 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -318,6 +318,9 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, + #define EFI_CERT_X509_GUID \ + EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) + ++#define EFI_IMAGE_SECURITY_DATABASE_GUID \ ++ EFI_GUID( 0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f ) ++ + typedef struct { + efi_guid_t guid; + u64 table; +diff --git a/init/Kconfig b/init/Kconfig +index 7a9bf00..9c4c529 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1610,6 +1610,15 @@ config MODULE_SIG_BLACKLIST + should not pass module signature verification. If a module is + signed with something in this keyring, the load will be rejected. + ++config MODULE_SIG_UEFI ++ bool "Allow modules signed with certs stored in UEFI" ++ depends on MODULE_SIG && MODULE_SIG_BLACKLIST && EFI ++ select EFI_SIGNATURE_LIST_PARSER ++ help ++ This will import certificates stored in UEFI and allow modules ++ signed with those to be loaded. It will also disallow loading ++ of modules stored in the UEFI dbx variable. ++ + choice + prompt "Which hash algorithm should modules be signed with?" + depends on MODULE_SIG +diff --git a/kernel/Makefile b/kernel/Makefile +index 0dfeca4..ff1468f 100644 +--- a/kernel/Makefile ++++ b/kernel/Makefile +@@ -55,6 +55,7 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o + obj-$(CONFIG_UID16) += uid16.o + obj-$(CONFIG_MODULES) += module.o + obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o ++obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o + obj-$(CONFIG_KALLSYMS) += kallsyms.o + obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o + obj-$(CONFIG_KEXEC) += kexec.o +@@ -113,6 +114,8 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o + + $(obj)/configs.o: $(obj)/config_data.h + ++$(obj)/modsign_uefi.o: KBUILD_CFLAGS += -fshort-wchar ++ + # config_data.h contains the same information as ikconfig.h but gzipped. + # Info from config_data can be extracted from /proc/config* + targets += config_data.gz +diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c +new file mode 100644 +index 0000000..049669d +--- /dev/null ++++ b/kernel/modsign_uefi.c +@@ -0,0 +1,84 @@ ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/cred.h> ++#include <linux/err.h> ++#include <linux/efi.h> ++#include <keys/asymmetric-type.h> ++#include "module-internal.h" ++ ++static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, unsigned long *size) ++{ ++ efi_status_t status; ++ unsigned long lsize = 4; ++ unsigned long tmpdb[4]; ++ void *db = NULL; ++ ++ status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb); ++ if (status != EFI_BUFFER_TOO_SMALL) { ++ pr_err("Couldn't get size: 0x%lx\n", status); ++ return NULL; ++ } ++ ++ db = kmalloc(lsize, GFP_KERNEL); ++ if (!db) { ++ pr_err("Couldn't allocate memory for uefi cert list\n"); ++ goto out; ++ } ++ ++ status = efi.get_variable(name, guid, NULL, &lsize, db); ++ if (status != EFI_SUCCESS) { ++ kfree(db); ++ db = NULL; ++ pr_err("Error reading db var: 0x%lx\n", status); ++ } ++out: ++ *size = lsize; ++ return db; ++} ++ ++/* ++ * * Load the certs contained in the UEFI databases ++ * */ ++static int __init load_uefi_certs(void) ++{ ++ efi_guid_t secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID; ++ void *db = NULL, *dbx = NULL; ++ unsigned long dbsize = 0, dbxsize = 0; ++ int rc = 0; ++ ++ /* Check if SB is enabled and just return if not */ ++ if (!secure_boot_enabled) ++ return 0; ++ ++ db = get_cert_list(L"db", &secure_var, &dbsize); ++ if (!db) { ++ pr_err("Couldn't get db list\n"); ++ rc = -1; ++ goto err; ++ } ++ ++ /* Get dbx. It might not exist, so it isn't an error if we can't ++ * get it. ++ */ ++ dbx = get_cert_list(L"dbx", &secure_var, &dbxsize); ++ if (!dbx) { ++ pr_err("Couldn't get dbx list\n"); ++ } ++ ++ rc = parse_efi_signature_list(db, dbsize, modsign_keyring); ++ if (rc) ++ pr_err("Couldn't parse db signatures: %d\n", rc); ++ ++ if (dbx) { ++ rc = parse_efi_signature_list(dbx, dbxsize, ++ modsign_blacklist); ++ if (rc) ++ pr_err("Couldn't parse dbx signatures: %d\n", rc); ++ } ++ ++err: ++ kfree(db); ++ kfree(dbx); ++ return rc; ++} ++late_initcall(load_uefi_certs); +-- +1.7.12.1 + + +From 924e09f1b267c407ca037171bc6f8f90b09265d6 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Fri, 26 Oct 2012 14:02:09 -0400 +Subject: [PATCH] hibernate: Disable in a Secure Boot environment + +There is currently no way to verify the resume image when returning +from hibernate. This might compromise the secure boot trust model, +so until we can work with signed hibernate images we disable it in +a Secure Boot environment. + +Signed-off-by: Josh Boyer <jwboyer@redhat.com> +--- + v2: Updated to include swsup after feedback from Jiri Kosina <jkosina@suse.cz> + + kernel/power/hibernate.c | 14 +++++++++++++- + kernel/power/main.c | 4 +++- + kernel/power/user.c | 3 +++ + 3 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index b26f5f1..f04343b 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -632,6 +632,10 @@ int hibernate(void) + { + int error; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) { ++ return -EPERM; ++ } ++ + lock_system_sleep(); + /* The snapshot device should not be opened while we're running */ + if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { +@@ -723,7 +727,7 @@ static int software_resume(void) + /* + * If the user said "noresume".. bail out early. + */ +- if (noresume) ++ if (noresume || !capable(CAP_COMPROMISE_KERNEL)) + return 0; + + /* +@@ -889,6 +893,11 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr, + int i; + char *start = buf; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) { ++ buf += sprintf(buf, "[%s]\n", "disabled"); ++ return buf-start; ++ } ++ + for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { + if (!hibernation_modes[i]) + continue; +@@ -923,6 +932,9 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, + char *p; + int mode = HIBERNATION_INVALID; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + p = memchr(buf, '\n', n); + len = p ? p - buf : n; + +diff --git a/kernel/power/main.c b/kernel/power/main.c +index f458238..72580c1 100644 +--- a/kernel/power/main.c ++++ b/kernel/power/main.c +@@ -301,7 +301,9 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr, + } + #endif + #ifdef CONFIG_HIBERNATION +- s += sprintf(s, "%s\n", "disk"); ++ if (capable(CAP_COMPROMISE_KERNEL)) { ++ s += sprintf(s, "%s\n", "disk"); ++ } + #else + if (s != buf) + /* convert the last space to a newline */ +diff --git a/kernel/power/user.c b/kernel/power/user.c +index 4ed81e7..b11a0f4 100644 +--- a/kernel/power/user.c ++++ b/kernel/power/user.c +@@ -48,6 +48,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) + struct snapshot_data *data; + int error; + ++ if (!capable(CAP_COMPROMISE_KERNEL)) ++ return -EPERM; ++ + lock_system_sleep(); + + if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { +-- +1.7.12.1 + diff --git a/freed-ora/current/master/sources b/freed-ora/current/master/sources index f3a7fa97f..14616a6d9 100644 --- a/freed-ora/current/master/sources +++ b/freed-ora/current/master/sources @@ -1 +1,3 @@ -2407fc9563a74acaf38aa0c06516eb1c linux-libre-3.5-gnu.tar.xz +a2312edd0265b5b07bd4b50afae2b380 linux-libre-3.6-gnu.tar.xz +2a1ca1954292cc048d54643ecbce84f4 patch-3.6-gnu-3.7-rc6-gnu.xz +3c55ad6c91d5461e0778867c1c2e4b84 patch-3.7-rc6-git4.xz diff --git a/freed-ora/current/master/team-update-from-net-next.patch b/freed-ora/current/master/team-update-from-net-next.patch deleted file mode 100644 index 14794ce08..000000000 --- a/freed-ora/current/master/team-update-from-net-next.patch +++ /dev/null @@ -1,1839 +0,0 @@ -Update team driver to latest net-next. - -Split patches available here: -http://people.redhat.com/jpirko/f18_team_update/ - -David S. Miller (1): - team: Revert previous two changes. - -Jiri Pirko (25): - team: make team_mode struct const - team: for nomode use dummy struct team_mode - team: add mode priv to port - team: lb: push hash counting into separate function - team: allow read/write-only options - team: introduce array options - team: comments: s/net\/drivers\/team/drivers\/net\/team/ - team: push array_index and port into separate structure - team: allow async option changes - team: fix error path in team_nl_fill_options_get() - team: fix error path in team_nl_fill_port_list_get() - team: allow to specify one option instance to be send to userspace - team: pass NULL to __team_option_inst_add() instead of 0 - team: add port_[enabled/disabled] mode callbacks - team: lb: introduce infrastructure for userspace driven tx - loadbalancing - team: implement multipart netlink messages for options transfers - team: ensure correct order of netlink messages delivery - team: allow to send multiple set events in one message - team: use rcu_dereference_bh() in tx path - team: use rcu_access_pointer to access RCU pointer by writer - team: use RCU_INIT_POINTER for NULL assignment of RCU pointer - team: do RCU update path fixups - team: fix team_adjust_ops with regard to enabled ports - team: do not allow to map disabled ports - team: remove unused rcu_head field from team_port struct - - drivers/net/team/team.c | 577 ++++++++++++++++++----------- - drivers/net/team/team_mode_activebackup.c | 14 +- - drivers/net/team/team_mode_loadbalance.c | 543 +++++++++++++++++++++++++-- - drivers/net/team/team_mode_roundrobin.c | 4 +- - include/linux/if_team.h | 25 +- - 5 files changed, 919 insertions(+), 244 deletions(-) - -Signed-off-by: Jiri Pirko <jpirko@redhat.com> - -diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c -index c61ae35..5350eea 100644 ---- a/drivers/net/team/team.c -+++ b/drivers/net/team/team.c -@@ -1,5 +1,5 @@ - /* -- * net/drivers/team/team.c - Network team device driver -+ * drivers/net/team/team.c - Network team device driver - * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com> - * - * This program is free software; you can redistribute it and/or modify -@@ -82,14 +82,16 @@ static void team_refresh_port_linkup(struct team_port *port) - port->state.linkup; - } - -+ - /******************* - * Options handling - *******************/ - - struct team_option_inst { /* One for each option instance */ - struct list_head list; -+ struct list_head tmp_list; - struct team_option *option; -- struct team_port *port; /* != NULL if per-port */ -+ struct team_option_inst_info info; - bool changed; - bool removed; - }; -@@ -106,22 +108,6 @@ static struct team_option *__team_find_option(struct team *team, - return NULL; - } - --static int __team_option_inst_add(struct team *team, struct team_option *option, -- struct team_port *port) --{ -- struct team_option_inst *opt_inst; -- -- opt_inst = kmalloc(sizeof(*opt_inst), GFP_KERNEL); -- if (!opt_inst) -- return -ENOMEM; -- opt_inst->option = option; -- opt_inst->port = port; -- opt_inst->changed = true; -- opt_inst->removed = false; -- list_add_tail(&opt_inst->list, &team->option_inst_list); -- return 0; --} -- - static void __team_option_inst_del(struct team_option_inst *opt_inst) - { - list_del(&opt_inst->list); -@@ -139,14 +125,49 @@ static void __team_option_inst_del_option(struct team *team, - } - } - -+static int __team_option_inst_add(struct team *team, struct team_option *option, -+ struct team_port *port) -+{ -+ struct team_option_inst *opt_inst; -+ unsigned int array_size; -+ unsigned int i; -+ int err; -+ -+ array_size = option->array_size; -+ if (!array_size) -+ array_size = 1; /* No array but still need one instance */ -+ -+ for (i = 0; i < array_size; i++) { -+ opt_inst = kmalloc(sizeof(*opt_inst), GFP_KERNEL); -+ if (!opt_inst) -+ return -ENOMEM; -+ opt_inst->option = option; -+ opt_inst->info.port = port; -+ opt_inst->info.array_index = i; -+ opt_inst->changed = true; -+ opt_inst->removed = false; -+ list_add_tail(&opt_inst->list, &team->option_inst_list); -+ if (option->init) { -+ err = option->init(team, &opt_inst->info); -+ if (err) -+ return err; -+ } -+ -+ } -+ return 0; -+} -+ - static int __team_option_inst_add_option(struct team *team, - struct team_option *option) - { - struct team_port *port; - int err; - -- if (!option->per_port) -- return __team_option_inst_add(team, option, 0); -+ if (!option->per_port) { -+ err = __team_option_inst_add(team, option, NULL); -+ if (err) -+ goto inst_del_option; -+ } - - list_for_each_entry(port, &team->port_list, list) { - err = __team_option_inst_add(team, option, port); -@@ -180,7 +201,7 @@ static void __team_option_inst_del_port(struct team *team, - - list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) { - if (opt_inst->option->per_port && -- opt_inst->port == port) -+ opt_inst->info.port == port) - __team_option_inst_del(opt_inst); - } - } -@@ -211,7 +232,7 @@ static void __team_option_inst_mark_removed_port(struct team *team, - struct team_option_inst *opt_inst; - - list_for_each_entry(opt_inst, &team->option_inst_list, list) { -- if (opt_inst->port == port) { -+ if (opt_inst->info.port == port) { - opt_inst->changed = true; - opt_inst->removed = true; - } -@@ -324,28 +345,12 @@ void team_options_unregister(struct team *team, - } - EXPORT_SYMBOL(team_options_unregister); - --static int team_option_port_add(struct team *team, struct team_port *port) --{ -- int err; -- -- err = __team_option_inst_add_port(team, port); -- if (err) -- return err; -- __team_options_change_check(team); -- return 0; --} -- --static void team_option_port_del(struct team *team, struct team_port *port) --{ -- __team_option_inst_mark_removed_port(team, port); -- __team_options_change_check(team); -- __team_option_inst_del_port(team, port); --} -- - static int team_option_get(struct team *team, - struct team_option_inst *opt_inst, - struct team_gsetter_ctx *ctx) - { -+ if (!opt_inst->option->getter) -+ return -EOPNOTSUPP; - return opt_inst->option->getter(team, ctx); - } - -@@ -353,16 +358,26 @@ static int team_option_set(struct team *team, - struct team_option_inst *opt_inst, - struct team_gsetter_ctx *ctx) - { -- int err; -+ if (!opt_inst->option->setter) -+ return -EOPNOTSUPP; -+ return opt_inst->option->setter(team, ctx); -+} - -- err = opt_inst->option->setter(team, ctx); -- if (err) -- return err; -+void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info) -+{ -+ struct team_option_inst *opt_inst; - -+ opt_inst = container_of(opt_inst_info, struct team_option_inst, info); - opt_inst->changed = true; -+} -+EXPORT_SYMBOL(team_option_inst_set_change); -+ -+void team_options_change_check(struct team *team) -+{ - __team_options_change_check(team); -- return err; - } -+EXPORT_SYMBOL(team_options_change_check); -+ - - /**************** - * Mode handling -@@ -371,13 +386,18 @@ static int team_option_set(struct team *team, - static LIST_HEAD(mode_list); - static DEFINE_SPINLOCK(mode_list_lock); - --static struct team_mode *__find_mode(const char *kind) -+struct team_mode_item { -+ struct list_head list; -+ const struct team_mode *mode; -+}; -+ -+static struct team_mode_item *__find_mode(const char *kind) - { -- struct team_mode *mode; -+ struct team_mode_item *mitem; - -- list_for_each_entry(mode, &mode_list, list) { -- if (strcmp(mode->kind, kind) == 0) -- return mode; -+ list_for_each_entry(mitem, &mode_list, list) { -+ if (strcmp(mitem->mode->kind, kind) == 0) -+ return mitem; - } - return NULL; - } -@@ -392,49 +412,65 @@ static bool is_good_mode_name(const char *name) - return true; - } - --int team_mode_register(struct team_mode *mode) -+int team_mode_register(const struct team_mode *mode) - { - int err = 0; -+ struct team_mode_item *mitem; - - if (!is_good_mode_name(mode->kind) || - mode->priv_size > TEAM_MODE_PRIV_SIZE) - return -EINVAL; -+ -+ mitem = kmalloc(sizeof(*mitem), GFP_KERNEL); -+ if (!mitem) -+ return -ENOMEM; -+ - spin_lock(&mode_list_lock); - if (__find_mode(mode->kind)) { - err = -EEXIST; -+ kfree(mitem); - goto unlock; - } -- list_add_tail(&mode->list, &mode_list); -+ mitem->mode = mode; -+ list_add_tail(&mitem->list, &mode_list); - unlock: - spin_unlock(&mode_list_lock); - return err; - } - EXPORT_SYMBOL(team_mode_register); - --int team_mode_unregister(struct team_mode *mode) -+void team_mode_unregister(const struct team_mode *mode) - { -+ struct team_mode_item *mitem; -+ - spin_lock(&mode_list_lock); -- list_del_init(&mode->list); -+ mitem = __find_mode(mode->kind); -+ if (mitem) { -+ list_del_init(&mitem->list); -+ kfree(mitem); -+ } - spin_unlock(&mode_list_lock); -- return 0; - } - EXPORT_SYMBOL(team_mode_unregister); - --static struct team_mode *team_mode_get(const char *kind) -+static const struct team_mode *team_mode_get(const char *kind) - { -- struct team_mode *mode; -+ struct team_mode_item *mitem; -+ const struct team_mode *mode = NULL; - - spin_lock(&mode_list_lock); -- mode = __find_mode(kind); -- if (!mode) { -+ mitem = __find_mode(kind); -+ if (!mitem) { - spin_unlock(&mode_list_lock); - request_module("team-mode-%s", kind); - spin_lock(&mode_list_lock); -- mode = __find_mode(kind); -+ mitem = __find_mode(kind); - } -- if (mode) -+ if (mitem) { -+ mode = mitem->mode; - if (!try_module_get(mode->owner)) - mode = NULL; -+ } - - spin_unlock(&mode_list_lock); - return mode; -@@ -458,26 +494,45 @@ rx_handler_result_t team_dummy_receive(struct team *team, - return RX_HANDLER_ANOTHER; - } - --static void team_adjust_ops(struct team *team) -+static const struct team_mode __team_no_mode = { -+ .kind = "*NOMODE*", -+}; -+ -+static bool team_is_mode_set(struct team *team) -+{ -+ return team->mode != &__team_no_mode; -+} -+ -+static void team_set_no_mode(struct team *team) -+{ -+ team->mode = &__team_no_mode; -+} -+ -+static void __team_adjust_ops(struct team *team, int en_port_count) - { - /* - * To avoid checks in rx/tx skb paths, ensure here that non-null and - * correct ops are always set. - */ - -- if (list_empty(&team->port_list) || -- !team->mode || !team->mode->ops->transmit) -+ if (!en_port_count || !team_is_mode_set(team) || -+ !team->mode->ops->transmit) - team->ops.transmit = team_dummy_transmit; - else - team->ops.transmit = team->mode->ops->transmit; - -- if (list_empty(&team->port_list) || -- !team->mode || !team->mode->ops->receive) -+ if (!en_port_count || !team_is_mode_set(team) || -+ !team->mode->ops->receive) - team->ops.receive = team_dummy_receive; - else - team->ops.receive = team->mode->ops->receive; - } - -+static void team_adjust_ops(struct team *team) -+{ -+ __team_adjust_ops(team, team->en_port_count); -+} -+ - /* - * We can benefit from the fact that it's ensured no port is present - * at the time of mode change. Therefore no packets are in fly so there's no -@@ -487,7 +542,7 @@ static int __team_change_mode(struct team *team, - const struct team_mode *new_mode) - { - /* Check if mode was previously set and do cleanup if so */ -- if (team->mode) { -+ if (team_is_mode_set(team)) { - void (*exit_op)(struct team *team) = team->ops.exit; - - /* Clear ops area so no callback is called any longer */ -@@ -497,7 +552,7 @@ static int __team_change_mode(struct team *team, - if (exit_op) - exit_op(team); - team_mode_put(team->mode); -- team->mode = NULL; -+ team_set_no_mode(team); - /* zero private data area */ - memset(&team->mode_priv, 0, - sizeof(struct team) - offsetof(struct team, mode_priv)); -@@ -523,7 +578,7 @@ static int __team_change_mode(struct team *team, - - static int team_change_mode(struct team *team, const char *kind) - { -- struct team_mode *new_mode; -+ const struct team_mode *new_mode; - struct net_device *dev = team->dev; - int err; - -@@ -532,7 +587,7 @@ static int team_change_mode(struct team *team, const char *kind) - return -EBUSY; - } - -- if (team->mode && strcmp(team->mode->kind, kind) == 0) { -+ if (team_is_mode_set(team) && strcmp(team->mode->kind, kind) == 0) { - netdev_err(dev, "Unable to change to the same mode the team is in\n"); - return -EINVAL; - } -@@ -559,8 +614,6 @@ static int team_change_mode(struct team *team, const char *kind) - * Rx path frame handler - ************************/ - --static bool team_port_enabled(struct team_port *port); -- - /* note: already called with rcu_read_lock */ - static rx_handler_result_t team_handle_frame(struct sk_buff **pskb) - { -@@ -618,10 +671,11 @@ static bool team_port_find(const struct team *team, - return false; - } - --static bool team_port_enabled(struct team_port *port) -+bool team_port_enabled(struct team_port *port) - { - return port->index != -1; - } -+EXPORT_SYMBOL(team_port_enabled); - - /* - * Enable/disable port by adding to enabled port hashlist and setting -@@ -637,6 +691,9 @@ static void team_port_enable(struct team *team, - port->index = team->en_port_count++; - hlist_add_head_rcu(&port->hlist, - team_port_index_hash(team, port->index)); -+ team_adjust_ops(team); -+ if (team->ops.port_enabled) -+ team->ops.port_enabled(team, port); - } - - static void __reconstruct_port_hlist(struct team *team, int rm_index) -@@ -656,14 +713,20 @@ static void __reconstruct_port_hlist(struct team *team, int rm_index) - static void team_port_disable(struct team *team, - struct team_port *port) - { -- int rm_index = port->index; -- - if (!team_port_enabled(port)) - return; -+ if (team->ops.port_disabled) -+ team->ops.port_disabled(team, port); - hlist_del_rcu(&port->hlist); -- __reconstruct_port_hlist(team, rm_index); -- team->en_port_count--; -+ __reconstruct_port_hlist(team, port->index); - port->index = -1; -+ __team_adjust_ops(team, team->en_port_count - 1); -+ /* -+ * Wait until readers see adjusted ops. This ensures that -+ * readers never see team->en_port_count == 0 -+ */ -+ synchronize_rcu(); -+ team->en_port_count--; - } - - #define TEAM_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \ -@@ -758,7 +821,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev) - return -EBUSY; - } - -- port = kzalloc(sizeof(struct team_port), GFP_KERNEL); -+ port = kzalloc(sizeof(struct team_port) + team->mode->port_priv_size, -+ GFP_KERNEL); - if (!port) - return -ENOMEM; - -@@ -809,7 +873,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev) - goto err_handler_register; - } - -- err = team_option_port_add(team, port); -+ err = __team_option_inst_add_port(team, port); - if (err) { - netdev_err(dev, "Device %s failed to add per-port options\n", - portname); -@@ -819,9 +883,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev) - port->index = -1; - team_port_enable(team, port); - list_add_tail_rcu(&port->list, &team->port_list); -- team_adjust_ops(team); - __team_compute_features(team); - __team_port_change_check(port, !!netif_carrier_ok(port_dev)); -+ __team_options_change_check(team); - - netdev_info(dev, "Port device %s added\n", portname); - -@@ -865,12 +929,13 @@ static int team_port_del(struct team *team, struct net_device *port_dev) - return -ENOENT; - } - -+ __team_option_inst_mark_removed_port(team, port); -+ __team_options_change_check(team); -+ __team_option_inst_del_port(team, port); - port->removed = true; - __team_port_change_check(port, false); - team_port_disable(team, port); - list_del_rcu(&port->list); -- team_adjust_ops(team); -- team_option_port_del(team, port); - netdev_rx_handler_unregister(port_dev); - netdev_set_master(port_dev, NULL); - vlan_vids_del_by_dev(port_dev, dev); -@@ -891,11 +956,9 @@ static int team_port_del(struct team *team, struct net_device *port_dev) - * Net device ops - *****************/ - --static const char team_no_mode_kind[] = "*NOMODE*"; -- - static int team_mode_option_get(struct team *team, struct team_gsetter_ctx *ctx) - { -- ctx->data.str_val = team->mode ? team->mode->kind : team_no_mode_kind; -+ ctx->data.str_val = team->mode->kind; - return 0; - } - -@@ -907,39 +970,47 @@ static int team_mode_option_set(struct team *team, struct team_gsetter_ctx *ctx) - static int team_port_en_option_get(struct team *team, - struct team_gsetter_ctx *ctx) - { -- ctx->data.bool_val = team_port_enabled(ctx->port); -+ struct team_port *port = ctx->info->port; -+ -+ ctx->data.bool_val = team_port_enabled(port); - return 0; - } - - static int team_port_en_option_set(struct team *team, - struct team_gsetter_ctx *ctx) - { -+ struct team_port *port = ctx->info->port; -+ - if (ctx->data.bool_val) -- team_port_enable(team, ctx->port); -+ team_port_enable(team, port); - else -- team_port_disable(team, ctx->port); -+ team_port_disable(team, port); - return 0; - } - - static int team_user_linkup_option_get(struct team *team, - struct team_gsetter_ctx *ctx) - { -- ctx->data.bool_val = ctx->port->user.linkup; -+ struct team_port *port = ctx->info->port; -+ -+ ctx->data.bool_val = port->user.linkup; - return 0; - } - - static int team_user_linkup_option_set(struct team *team, - struct team_gsetter_ctx *ctx) - { -- ctx->port->user.linkup = ctx->data.bool_val; -- team_refresh_port_linkup(ctx->port); -+ struct team_port *port = ctx->info->port; -+ -+ port->user.linkup = ctx->data.bool_val; -+ team_refresh_port_linkup(port); - return 0; - } - - static int team_user_linkup_en_option_get(struct team *team, - struct team_gsetter_ctx *ctx) - { -- struct team_port *port = ctx->port; -+ struct team_port *port = ctx->info->port; - - ctx->data.bool_val = port->user.linkup_enabled; - return 0; -@@ -948,10 +1019,10 @@ static int team_user_linkup_en_option_get(struct team *team, - static int team_user_linkup_en_option_set(struct team *team, - struct team_gsetter_ctx *ctx) - { -- struct team_port *port = ctx->port; -+ struct team_port *port = ctx->info->port; - - port->user.linkup_enabled = ctx->data.bool_val; -- team_refresh_port_linkup(ctx->port); -+ team_refresh_port_linkup(port); - return 0; - } - -@@ -993,6 +1064,7 @@ static int team_init(struct net_device *dev) - - team->dev = dev; - mutex_init(&team->lock); -+ team_set_no_mode(team); - - team->pcpu_stats = alloc_percpu(struct team_pcpu_stats); - if (!team->pcpu_stats) -@@ -1482,16 +1554,128 @@ err_fill: - return err; - } - --static int team_nl_fill_options_get(struct sk_buff *skb, -- u32 pid, u32 seq, int flags, -- struct team *team, bool fillall) -+typedef int team_nl_send_func_t(struct sk_buff *skb, -+ struct team *team, u32 pid); -+ -+static int team_nl_send_unicast(struct sk_buff *skb, struct team *team, u32 pid) -+{ -+ return genlmsg_unicast(dev_net(team->dev), skb, pid); -+} -+ -+static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team, -+ struct team_option_inst *opt_inst) -+{ -+ struct nlattr *option_item; -+ struct team_option *option = opt_inst->option; -+ struct team_option_inst_info *opt_inst_info = &opt_inst->info; -+ struct team_gsetter_ctx ctx; -+ int err; -+ -+ ctx.info = opt_inst_info; -+ err = team_option_get(team, opt_inst, &ctx); -+ if (err) -+ return err; -+ -+ option_item = nla_nest_start(skb, TEAM_ATTR_ITEM_OPTION); -+ if (!option_item) -+ return -EMSGSIZE; -+ -+ if (nla_put_string(skb, TEAM_ATTR_OPTION_NAME, option->name)) -+ goto nest_cancel; -+ if (opt_inst_info->port && -+ nla_put_u32(skb, TEAM_ATTR_OPTION_PORT_IFINDEX, -+ opt_inst_info->port->dev->ifindex)) -+ goto nest_cancel; -+ if (opt_inst->option->array_size && -+ nla_put_u32(skb, TEAM_ATTR_OPTION_ARRAY_INDEX, -+ opt_inst_info->array_index)) -+ goto nest_cancel; -+ -+ switch (option->type) { -+ case TEAM_OPTION_TYPE_U32: -+ if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_U32)) -+ goto nest_cancel; -+ if (nla_put_u32(skb, TEAM_ATTR_OPTION_DATA, ctx.data.u32_val)) -+ goto nest_cancel; -+ break; -+ case TEAM_OPTION_TYPE_STRING: -+ if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_STRING)) -+ goto nest_cancel; -+ if (nla_put_string(skb, TEAM_ATTR_OPTION_DATA, -+ ctx.data.str_val)) -+ goto nest_cancel; -+ break; -+ case TEAM_OPTION_TYPE_BINARY: -+ if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_BINARY)) -+ goto nest_cancel; -+ if (nla_put(skb, TEAM_ATTR_OPTION_DATA, ctx.data.bin_val.len, -+ ctx.data.bin_val.ptr)) -+ goto nest_cancel; -+ break; -+ case TEAM_OPTION_TYPE_BOOL: -+ if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_FLAG)) -+ goto nest_cancel; -+ if (ctx.data.bool_val && -+ nla_put_flag(skb, TEAM_ATTR_OPTION_DATA)) -+ goto nest_cancel; -+ break; -+ default: -+ BUG(); -+ } -+ if (opt_inst->removed && nla_put_flag(skb, TEAM_ATTR_OPTION_REMOVED)) -+ goto nest_cancel; -+ if (opt_inst->changed) { -+ if (nla_put_flag(skb, TEAM_ATTR_OPTION_CHANGED)) -+ goto nest_cancel; -+ opt_inst->changed = false; -+ } -+ nla_nest_end(skb, option_item); -+ return 0; -+ -+nest_cancel: -+ nla_nest_cancel(skb, option_item); -+ return -EMSGSIZE; -+} -+ -+static int __send_and_alloc_skb(struct sk_buff **pskb, -+ struct team *team, u32 pid, -+ team_nl_send_func_t *send_func) -+{ -+ int err; -+ -+ if (*pskb) { -+ err = send_func(*pskb, team, pid); -+ if (err) -+ return err; -+ } -+ *pskb = genlmsg_new(NLMSG_DEFAULT_SIZE - GENL_HDRLEN, GFP_KERNEL); -+ if (!*pskb) -+ return -ENOMEM; -+ return 0; -+} -+ -+static int team_nl_send_options_get(struct team *team, u32 pid, u32 seq, -+ int flags, team_nl_send_func_t *send_func, -+ struct list_head *sel_opt_inst_list) - { - struct nlattr *option_list; -+ struct nlmsghdr *nlh; - void *hdr; - struct team_option_inst *opt_inst; - int err; -+ struct sk_buff *skb = NULL; -+ bool incomplete; -+ int i; - -- hdr = genlmsg_put(skb, pid, seq, &team_nl_family, flags, -+ opt_inst = list_first_entry(sel_opt_inst_list, -+ struct team_option_inst, tmp_list); -+ -+start_again: -+ err = __send_and_alloc_skb(&skb, team, pid, send_func); -+ if (err) -+ return err; -+ -+ hdr = genlmsg_put(skb, pid, seq, &team_nl_family, flags | NLM_F_MULTI, - TEAM_CMD_OPTIONS_GET); - if (IS_ERR(hdr)) - return PTR_ERR(hdr); -@@ -1500,122 +1684,80 @@ static int team_nl_fill_options_get(struct sk_buff *skb, - goto nla_put_failure; - option_list = nla_nest_start(skb, TEAM_ATTR_LIST_OPTION); - if (!option_list) -- return -EMSGSIZE; -- -- list_for_each_entry(opt_inst, &team->option_inst_list, list) { -- struct nlattr *option_item; -- struct team_option *option = opt_inst->option; -- struct team_gsetter_ctx ctx; -+ goto nla_put_failure; - -- /* Include only changed options if fill all mode is not on */ -- if (!fillall && !opt_inst->changed) -- continue; -- option_item = nla_nest_start(skb, TEAM_ATTR_ITEM_OPTION); -- if (!option_item) -- goto nla_put_failure; -- if (nla_put_string(skb, TEAM_ATTR_OPTION_NAME, option->name)) -- goto nla_put_failure; -- if (opt_inst->changed) { -- if (nla_put_flag(skb, TEAM_ATTR_OPTION_CHANGED)) -- goto nla_put_failure; -- opt_inst->changed = false; -- } -- if (opt_inst->removed && -- nla_put_flag(skb, TEAM_ATTR_OPTION_REMOVED)) -- goto nla_put_failure; -- if (opt_inst->port && -- nla_put_u32(skb, TEAM_ATTR_OPTION_PORT_IFINDEX, -- opt_inst->port->dev->ifindex)) -- goto nla_put_failure; -- ctx.port = opt_inst->port; -- switch (option->type) { -- case TEAM_OPTION_TYPE_U32: -- if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_U32)) -- goto nla_put_failure; -- err = team_option_get(team, opt_inst, &ctx); -- if (err) -- goto errout; -- if (nla_put_u32(skb, TEAM_ATTR_OPTION_DATA, -- ctx.data.u32_val)) -- goto nla_put_failure; -- break; -- case TEAM_OPTION_TYPE_STRING: -- if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_STRING)) -- goto nla_put_failure; -- err = team_option_get(team, opt_inst, &ctx); -- if (err) -- goto errout; -- if (nla_put_string(skb, TEAM_ATTR_OPTION_DATA, -- ctx.data.str_val)) -- goto nla_put_failure; -- break; -- case TEAM_OPTION_TYPE_BINARY: -- if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_BINARY)) -- goto nla_put_failure; -- err = team_option_get(team, opt_inst, &ctx); -- if (err) -- goto errout; -- if (nla_put(skb, TEAM_ATTR_OPTION_DATA, -- ctx.data.bin_val.len, ctx.data.bin_val.ptr)) -- goto nla_put_failure; -- break; -- case TEAM_OPTION_TYPE_BOOL: -- if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_FLAG)) -- goto nla_put_failure; -- err = team_option_get(team, opt_inst, &ctx); -- if (err) -- goto errout; -- if (ctx.data.bool_val && -- nla_put_flag(skb, TEAM_ATTR_OPTION_DATA)) -- goto nla_put_failure; -- break; -- default: -- BUG(); -+ i = 0; -+ incomplete = false; -+ list_for_each_entry_from(opt_inst, sel_opt_inst_list, tmp_list) { -+ err = team_nl_fill_one_option_get(skb, team, opt_inst); -+ if (err) { -+ if (err == -EMSGSIZE) { -+ if (!i) -+ goto errout; -+ incomplete = true; -+ break; -+ } -+ goto errout; - } -- nla_nest_end(skb, option_item); -+ i++; - } - - nla_nest_end(skb, option_list); -- return genlmsg_end(skb, hdr); -+ genlmsg_end(skb, hdr); -+ if (incomplete) -+ goto start_again; -+ -+send_done: -+ nlh = nlmsg_put(skb, pid, seq, NLMSG_DONE, 0, flags | NLM_F_MULTI); -+ if (!nlh) { -+ err = __send_and_alloc_skb(&skb, team, pid, send_func); -+ if (err) -+ goto errout; -+ goto send_done; -+ } -+ -+ return send_func(skb, team, pid); - - nla_put_failure: - err = -EMSGSIZE; - errout: - genlmsg_cancel(skb, hdr); -+ nlmsg_free(skb); - return err; - } - --static int team_nl_fill_options_get_all(struct sk_buff *skb, -- struct genl_info *info, int flags, -- struct team *team) --{ -- return team_nl_fill_options_get(skb, info->snd_pid, -- info->snd_seq, NLM_F_ACK, -- team, true); --} -- - static int team_nl_cmd_options_get(struct sk_buff *skb, struct genl_info *info) - { - struct team *team; -+ struct team_option_inst *opt_inst; - int err; -+ LIST_HEAD(sel_opt_inst_list); - - team = team_nl_team_get(info); - if (!team) - return -EINVAL; - -- err = team_nl_send_generic(info, team, team_nl_fill_options_get_all); -+ list_for_each_entry(opt_inst, &team->option_inst_list, list) -+ list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list); -+ err = team_nl_send_options_get(team, info->snd_pid, info->snd_seq, -+ NLM_F_ACK, team_nl_send_unicast, -+ &sel_opt_inst_list); - - team_nl_team_put(team); - - return err; - } - -+static int team_nl_send_event_options_get(struct team *team, -+ struct list_head *sel_opt_inst_list); -+ - static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) - { - struct team *team; - int err = 0; - int i; - struct nlattr *nl_option; -+ LIST_HEAD(opt_inst_list); - - team = team_nl_team_get(info); - if (!team) -@@ -1629,10 +1771,12 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) - - nla_for_each_nested(nl_option, info->attrs[TEAM_ATTR_LIST_OPTION], i) { - struct nlattr *opt_attrs[TEAM_ATTR_OPTION_MAX + 1]; -- struct nlattr *attr_port_ifindex; -+ struct nlattr *attr; - struct nlattr *attr_data; - enum team_option_type opt_type; - int opt_port_ifindex = 0; /* != 0 for per-port options */ -+ u32 opt_array_index = 0; -+ bool opt_is_array = false; - struct team_option_inst *opt_inst; - char *opt_name; - bool opt_found = false; -@@ -1674,23 +1818,33 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) - } - - opt_name = nla_data(opt_attrs[TEAM_ATTR_OPTION_NAME]); -- attr_port_ifindex = opt_attrs[TEAM_ATTR_OPTION_PORT_IFINDEX]; -- if (attr_port_ifindex) -- opt_port_ifindex = nla_get_u32(attr_port_ifindex); -+ attr = opt_attrs[TEAM_ATTR_OPTION_PORT_IFINDEX]; -+ if (attr) -+ opt_port_ifindex = nla_get_u32(attr); -+ -+ attr = opt_attrs[TEAM_ATTR_OPTION_ARRAY_INDEX]; -+ if (attr) { -+ opt_is_array = true; -+ opt_array_index = nla_get_u32(attr); -+ } - - list_for_each_entry(opt_inst, &team->option_inst_list, list) { - struct team_option *option = opt_inst->option; - struct team_gsetter_ctx ctx; -+ struct team_option_inst_info *opt_inst_info; - int tmp_ifindex; - -- tmp_ifindex = opt_inst->port ? -- opt_inst->port->dev->ifindex : 0; -+ opt_inst_info = &opt_inst->info; -+ tmp_ifindex = opt_inst_info->port ? -+ opt_inst_info->port->dev->ifindex : 0; - if (option->type != opt_type || - strcmp(option->name, opt_name) || -- tmp_ifindex != opt_port_ifindex) -+ tmp_ifindex != opt_port_ifindex || -+ (option->array_size && !opt_is_array) || -+ opt_inst_info->array_index != opt_array_index) - continue; - opt_found = true; -- ctx.port = opt_inst->port; -+ ctx.info = opt_inst_info; - switch (opt_type) { - case TEAM_OPTION_TYPE_U32: - ctx.data.u32_val = nla_get_u32(attr_data); -@@ -1715,6 +1869,8 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) - err = team_option_set(team, opt_inst, &ctx); - if (err) - goto team_put; -+ opt_inst->changed = true; -+ list_add(&opt_inst->tmp_list, &opt_inst_list); - } - if (!opt_found) { - err = -ENOENT; -@@ -1722,6 +1878,8 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) - } - } - -+ err = team_nl_send_event_options_get(team, &opt_inst_list); -+ - team_put: - team_nl_team_put(team); - -@@ -1746,7 +1904,7 @@ static int team_nl_fill_port_list_get(struct sk_buff *skb, - goto nla_put_failure; - port_list = nla_nest_start(skb, TEAM_ATTR_LIST_PORT); - if (!port_list) -- return -EMSGSIZE; -+ goto nla_put_failure; - - list_for_each_entry(port, &team->port_list, list) { - struct nlattr *port_item; -@@ -1838,27 +1996,18 @@ static struct genl_multicast_group team_change_event_mcgrp = { - .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, - }; - --static int team_nl_send_event_options_get(struct team *team) -+static int team_nl_send_multicast(struct sk_buff *skb, -+ struct team *team, u32 pid) - { -- struct sk_buff *skb; -- int err; -- struct net *net = dev_net(team->dev); -- -- skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); -- if (!skb) -- return -ENOMEM; -- -- err = team_nl_fill_options_get(skb, 0, 0, 0, team, false); -- if (err < 0) -- goto err_fill; -- -- err = genlmsg_multicast_netns(net, skb, 0, team_change_event_mcgrp.id, -- GFP_KERNEL); -- return err; -+ return genlmsg_multicast_netns(dev_net(team->dev), skb, 0, -+ team_change_event_mcgrp.id, GFP_KERNEL); -+} - --err_fill: -- nlmsg_free(skb); -- return err; -+static int team_nl_send_event_options_get(struct team *team, -+ struct list_head *sel_opt_inst_list) -+{ -+ return team_nl_send_options_get(team, 0, 0, 0, team_nl_send_multicast, -+ sel_opt_inst_list); - } - - static int team_nl_send_event_port_list_get(struct team *team) -@@ -1918,10 +2067,17 @@ static void team_nl_fini(void) - static void __team_options_change_check(struct team *team) - { - int err; -+ struct team_option_inst *opt_inst; -+ LIST_HEAD(sel_opt_inst_list); - -- err = team_nl_send_event_options_get(team); -+ list_for_each_entry(opt_inst, &team->option_inst_list, list) { -+ if (opt_inst->changed) -+ list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list); -+ } -+ err = team_nl_send_event_options_get(team, &sel_opt_inst_list); - if (err) -- netdev_warn(team->dev, "Failed to send options change via netlink\n"); -+ netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n", -+ err); - } - - /* rtnl lock is held */ -@@ -1965,6 +2121,7 @@ static void team_port_change_check(struct team_port *port, bool linkup) - mutex_unlock(&team->lock); - } - -+ - /************************************ - * Net device notifier event handler - ************************************/ -diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c -index fd6bd03..253b8a5 100644 ---- a/drivers/net/team/team_mode_activebackup.c -+++ b/drivers/net/team/team_mode_activebackup.c -@@ -1,5 +1,5 @@ - /* -- * net/drivers/team/team_mode_activebackup.c - Active-backup mode for team -+ * drivers/net/team/team_mode_activebackup.c - Active-backup mode for team - * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com> - * - * This program is free software; you can redistribute it and/or modify -@@ -40,7 +40,7 @@ static bool ab_transmit(struct team *team, struct sk_buff *skb) - { - struct team_port *active_port; - -- active_port = rcu_dereference(ab_priv(team)->active_port); -+ active_port = rcu_dereference_bh(ab_priv(team)->active_port); - if (unlikely(!active_port)) - goto drop; - skb->dev = active_port->dev; -@@ -61,8 +61,12 @@ static void ab_port_leave(struct team *team, struct team_port *port) - - static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) - { -- if (ab_priv(team)->active_port) -- ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex; -+ struct team_port *active_port; -+ -+ active_port = rcu_dereference_protected(ab_priv(team)->active_port, -+ lockdep_is_held(&team->lock)); -+ if (active_port) -+ ctx->data.u32_val = active_port->dev->ifindex; - else - ctx->data.u32_val = 0; - return 0; -@@ -108,7 +112,7 @@ static const struct team_mode_ops ab_mode_ops = { - .port_leave = ab_port_leave, - }; - --static struct team_mode ab_mode = { -+static const struct team_mode ab_mode = { - .kind = "activebackup", - .owner = THIS_MODULE, - .priv_size = sizeof(struct ab_priv), -diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c -index 86e8183..51a4b19 100644 ---- a/drivers/net/team/team_mode_loadbalance.c -+++ b/drivers/net/team/team_mode_loadbalance.c -@@ -17,34 +17,210 @@ - #include <linux/filter.h> - #include <linux/if_team.h> - -+struct lb_priv; -+ -+typedef struct team_port *lb_select_tx_port_func_t(struct team *, -+ struct lb_priv *, -+ struct sk_buff *, -+ unsigned char); -+ -+#define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */ -+ -+struct lb_stats { -+ u64 tx_bytes; -+}; -+ -+struct lb_pcpu_stats { -+ struct lb_stats hash_stats[LB_TX_HASHTABLE_SIZE]; -+ struct u64_stats_sync syncp; -+}; -+ -+struct lb_stats_info { -+ struct lb_stats stats; -+ struct lb_stats last_stats; -+ struct team_option_inst_info *opt_inst_info; -+}; -+ -+struct lb_port_mapping { -+ struct team_port __rcu *port; -+ struct team_option_inst_info *opt_inst_info; -+}; -+ -+struct lb_priv_ex { -+ struct team *team; -+ struct lb_port_mapping tx_hash_to_port_mapping[LB_TX_HASHTABLE_SIZE]; -+ struct sock_fprog *orig_fprog; -+ struct { -+ unsigned int refresh_interval; /* in tenths of second */ -+ struct delayed_work refresh_dw; -+ struct lb_stats_info info[LB_TX_HASHTABLE_SIZE]; -+ } stats; -+}; -+ - struct lb_priv { - struct sk_filter __rcu *fp; -- struct sock_fprog *orig_fprog; -+ lb_select_tx_port_func_t __rcu *select_tx_port_func; -+ struct lb_pcpu_stats __percpu *pcpu_stats; -+ struct lb_priv_ex *ex; /* priv extension */ - }; - --static struct lb_priv *lb_priv(struct team *team) -+static struct lb_priv *get_lb_priv(struct team *team) - { - return (struct lb_priv *) &team->mode_priv; - } - --static bool lb_transmit(struct team *team, struct sk_buff *skb) -+struct lb_port_priv { -+ struct lb_stats __percpu *pcpu_stats; -+ struct lb_stats_info stats_info; -+}; -+ -+static struct lb_port_priv *get_lb_port_priv(struct team_port *port) -+{ -+ return (struct lb_port_priv *) &port->mode_priv; -+} -+ -+#define LB_HTPM_PORT_BY_HASH(lp_priv, hash) \ -+ (lb_priv)->ex->tx_hash_to_port_mapping[hash].port -+ -+#define LB_HTPM_OPT_INST_INFO_BY_HASH(lp_priv, hash) \ -+ (lb_priv)->ex->tx_hash_to_port_mapping[hash].opt_inst_info -+ -+static void lb_tx_hash_to_port_mapping_null_port(struct team *team, -+ struct team_port *port) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ bool changed = false; -+ int i; -+ -+ for (i = 0; i < LB_TX_HASHTABLE_SIZE; i++) { -+ struct lb_port_mapping *pm; -+ -+ pm = &lb_priv->ex->tx_hash_to_port_mapping[i]; -+ if (rcu_access_pointer(pm->port) == port) { -+ RCU_INIT_POINTER(pm->port, NULL); -+ team_option_inst_set_change(pm->opt_inst_info); -+ changed = true; -+ } -+ } -+ if (changed) -+ team_options_change_check(team); -+} -+ -+/* Basic tx selection based solely by hash */ -+static struct team_port *lb_hash_select_tx_port(struct team *team, -+ struct lb_priv *lb_priv, -+ struct sk_buff *skb, -+ unsigned char hash) - { -- struct sk_filter *fp; -- struct team_port *port; -- unsigned int hash; - int port_index; - -- fp = rcu_dereference(lb_priv(team)->fp); -- if (unlikely(!fp)) -- goto drop; -- hash = SK_RUN_FILTER(fp, skb); - port_index = hash % team->en_port_count; -- port = team_get_port_by_index_rcu(team, port_index); -+ return team_get_port_by_index_rcu(team, port_index); -+} -+ -+/* Hash to port mapping select tx port */ -+static struct team_port *lb_htpm_select_tx_port(struct team *team, -+ struct lb_priv *lb_priv, -+ struct sk_buff *skb, -+ unsigned char hash) -+{ -+ return rcu_dereference_bh(LB_HTPM_PORT_BY_HASH(lb_priv, hash)); -+} -+ -+struct lb_select_tx_port { -+ char *name; -+ lb_select_tx_port_func_t *func; -+}; -+ -+static const struct lb_select_tx_port lb_select_tx_port_list[] = { -+ { -+ .name = "hash", -+ .func = lb_hash_select_tx_port, -+ }, -+ { -+ .name = "hash_to_port_mapping", -+ .func = lb_htpm_select_tx_port, -+ }, -+}; -+#define LB_SELECT_TX_PORT_LIST_COUNT ARRAY_SIZE(lb_select_tx_port_list) -+ -+static char *lb_select_tx_port_get_name(lb_select_tx_port_func_t *func) -+{ -+ int i; -+ -+ for (i = 0; i < LB_SELECT_TX_PORT_LIST_COUNT; i++) { -+ const struct lb_select_tx_port *item; -+ -+ item = &lb_select_tx_port_list[i]; -+ if (item->func == func) -+ return item->name; -+ } -+ return NULL; -+} -+ -+static lb_select_tx_port_func_t *lb_select_tx_port_get_func(const char *name) -+{ -+ int i; -+ -+ for (i = 0; i < LB_SELECT_TX_PORT_LIST_COUNT; i++) { -+ const struct lb_select_tx_port *item; -+ -+ item = &lb_select_tx_port_list[i]; -+ if (!strcmp(item->name, name)) -+ return item->func; -+ } -+ return NULL; -+} -+ -+static unsigned int lb_get_skb_hash(struct lb_priv *lb_priv, -+ struct sk_buff *skb) -+{ -+ struct sk_filter *fp; -+ uint32_t lhash; -+ unsigned char *c; -+ -+ fp = rcu_dereference_bh(lb_priv->fp); -+ if (unlikely(!fp)) -+ return 0; -+ lhash = SK_RUN_FILTER(fp, skb); -+ c = (char *) &lhash; -+ return c[0] ^ c[1] ^ c[2] ^ c[3]; -+} -+ -+static void lb_update_tx_stats(unsigned int tx_bytes, struct lb_priv *lb_priv, -+ struct lb_port_priv *lb_port_priv, -+ unsigned char hash) -+{ -+ struct lb_pcpu_stats *pcpu_stats; -+ struct lb_stats *port_stats; -+ struct lb_stats *hash_stats; -+ -+ pcpu_stats = this_cpu_ptr(lb_priv->pcpu_stats); -+ port_stats = this_cpu_ptr(lb_port_priv->pcpu_stats); -+ hash_stats = &pcpu_stats->hash_stats[hash]; -+ u64_stats_update_begin(&pcpu_stats->syncp); -+ port_stats->tx_bytes += tx_bytes; -+ hash_stats->tx_bytes += tx_bytes; -+ u64_stats_update_end(&pcpu_stats->syncp); -+} -+ -+static bool lb_transmit(struct team *team, struct sk_buff *skb) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ lb_select_tx_port_func_t *select_tx_port_func; -+ struct team_port *port; -+ unsigned char hash; -+ unsigned int tx_bytes = skb->len; -+ -+ hash = lb_get_skb_hash(lb_priv, skb); -+ select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func); -+ port = select_tx_port_func(team, lb_priv, skb, hash); - if (unlikely(!port)) - goto drop; - skb->dev = port->dev; - if (dev_queue_xmit(skb)) - return false; -+ lb_update_tx_stats(tx_bytes, lb_priv, get_lb_port_priv(port), hash); - return true; - - drop: -@@ -54,14 +230,16 @@ drop: - - static int lb_bpf_func_get(struct team *team, struct team_gsetter_ctx *ctx) - { -- if (!lb_priv(team)->orig_fprog) { -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ -+ if (!lb_priv->ex->orig_fprog) { - ctx->data.bin_val.len = 0; - ctx->data.bin_val.ptr = NULL; - return 0; - } -- ctx->data.bin_val.len = lb_priv(team)->orig_fprog->len * -+ ctx->data.bin_val.len = lb_priv->ex->orig_fprog->len * - sizeof(struct sock_filter); -- ctx->data.bin_val.ptr = lb_priv(team)->orig_fprog->filter; -+ ctx->data.bin_val.ptr = lb_priv->ex->orig_fprog->filter; - return 0; - } - -@@ -94,7 +272,9 @@ static void __fprog_destroy(struct sock_fprog *fprog) - - static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx) - { -+ struct lb_priv *lb_priv = get_lb_priv(team); - struct sk_filter *fp = NULL; -+ struct sk_filter *orig_fp; - struct sock_fprog *fprog = NULL; - int err; - -@@ -110,14 +290,238 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx) - } - } - -- if (lb_priv(team)->orig_fprog) { -+ if (lb_priv->ex->orig_fprog) { - /* Clear old filter data */ -- __fprog_destroy(lb_priv(team)->orig_fprog); -- sk_unattached_filter_destroy(lb_priv(team)->fp); -+ __fprog_destroy(lb_priv->ex->orig_fprog); -+ orig_fp = rcu_dereference_protected(lb_priv->fp, -+ lockdep_is_held(&team->lock)); -+ sk_unattached_filter_destroy(orig_fp); - } - -- rcu_assign_pointer(lb_priv(team)->fp, fp); -- lb_priv(team)->orig_fprog = fprog; -+ rcu_assign_pointer(lb_priv->fp, fp); -+ lb_priv->ex->orig_fprog = fprog; -+ return 0; -+} -+ -+static int lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ lb_select_tx_port_func_t *func; -+ char *name; -+ -+ func = rcu_dereference_protected(lb_priv->select_tx_port_func, -+ lockdep_is_held(&team->lock)); -+ name = lb_select_tx_port_get_name(func); -+ BUG_ON(!name); -+ ctx->data.str_val = name; -+ return 0; -+} -+ -+static int lb_tx_method_set(struct team *team, struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ lb_select_tx_port_func_t *func; -+ -+ func = lb_select_tx_port_get_func(ctx->data.str_val); -+ if (!func) -+ return -EINVAL; -+ rcu_assign_pointer(lb_priv->select_tx_port_func, func); -+ return 0; -+} -+ -+static int lb_tx_hash_to_port_mapping_init(struct team *team, -+ struct team_option_inst_info *info) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ unsigned char hash = info->array_index; -+ -+ LB_HTPM_OPT_INST_INFO_BY_HASH(lb_priv, hash) = info; -+ return 0; -+} -+ -+static int lb_tx_hash_to_port_mapping_get(struct team *team, -+ struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ struct team_port *port; -+ unsigned char hash = ctx->info->array_index; -+ -+ port = LB_HTPM_PORT_BY_HASH(lb_priv, hash); -+ ctx->data.u32_val = port ? port->dev->ifindex : 0; -+ return 0; -+} -+ -+static int lb_tx_hash_to_port_mapping_set(struct team *team, -+ struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ struct team_port *port; -+ unsigned char hash = ctx->info->array_index; -+ -+ list_for_each_entry(port, &team->port_list, list) { -+ if (ctx->data.u32_val == port->dev->ifindex && -+ team_port_enabled(port)) { -+ rcu_assign_pointer(LB_HTPM_PORT_BY_HASH(lb_priv, hash), -+ port); -+ return 0; -+ } -+ } -+ return -ENODEV; -+} -+ -+static int lb_hash_stats_init(struct team *team, -+ struct team_option_inst_info *info) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ unsigned char hash = info->array_index; -+ -+ lb_priv->ex->stats.info[hash].opt_inst_info = info; -+ return 0; -+} -+ -+static int lb_hash_stats_get(struct team *team, struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ unsigned char hash = ctx->info->array_index; -+ -+ ctx->data.bin_val.ptr = &lb_priv->ex->stats.info[hash].stats; -+ ctx->data.bin_val.len = sizeof(struct lb_stats); -+ return 0; -+} -+ -+static int lb_port_stats_init(struct team *team, -+ struct team_option_inst_info *info) -+{ -+ struct team_port *port = info->port; -+ struct lb_port_priv *lb_port_priv = get_lb_port_priv(port); -+ -+ lb_port_priv->stats_info.opt_inst_info = info; -+ return 0; -+} -+ -+static int lb_port_stats_get(struct team *team, struct team_gsetter_ctx *ctx) -+{ -+ struct team_port *port = ctx->info->port; -+ struct lb_port_priv *lb_port_priv = get_lb_port_priv(port); -+ -+ ctx->data.bin_val.ptr = &lb_port_priv->stats_info.stats; -+ ctx->data.bin_val.len = sizeof(struct lb_stats); -+ return 0; -+} -+ -+static void __lb_stats_info_refresh_prepare(struct lb_stats_info *s_info) -+{ -+ memcpy(&s_info->last_stats, &s_info->stats, sizeof(struct lb_stats)); -+ memset(&s_info->stats, 0, sizeof(struct lb_stats)); -+} -+ -+static bool __lb_stats_info_refresh_check(struct lb_stats_info *s_info, -+ struct team *team) -+{ -+ if (memcmp(&s_info->last_stats, &s_info->stats, -+ sizeof(struct lb_stats))) { -+ team_option_inst_set_change(s_info->opt_inst_info); -+ return true; -+ } -+ return false; -+} -+ -+static void __lb_one_cpu_stats_add(struct lb_stats *acc_stats, -+ struct lb_stats *cpu_stats, -+ struct u64_stats_sync *syncp) -+{ -+ unsigned int start; -+ struct lb_stats tmp; -+ -+ do { -+ start = u64_stats_fetch_begin_bh(syncp); -+ tmp.tx_bytes = cpu_stats->tx_bytes; -+ } while (u64_stats_fetch_retry_bh(syncp, start)); -+ acc_stats->tx_bytes += tmp.tx_bytes; -+} -+ -+static void lb_stats_refresh(struct work_struct *work) -+{ -+ struct team *team; -+ struct lb_priv *lb_priv; -+ struct lb_priv_ex *lb_priv_ex; -+ struct lb_pcpu_stats *pcpu_stats; -+ struct lb_stats *stats; -+ struct lb_stats_info *s_info; -+ struct team_port *port; -+ bool changed = false; -+ int i; -+ int j; -+ -+ lb_priv_ex = container_of(work, struct lb_priv_ex, -+ stats.refresh_dw.work); -+ -+ team = lb_priv_ex->team; -+ lb_priv = get_lb_priv(team); -+ -+ if (!mutex_trylock(&team->lock)) { -+ schedule_delayed_work(&lb_priv_ex->stats.refresh_dw, 0); -+ return; -+ } -+ -+ for (j = 0; j < LB_TX_HASHTABLE_SIZE; j++) { -+ s_info = &lb_priv->ex->stats.info[j]; -+ __lb_stats_info_refresh_prepare(s_info); -+ for_each_possible_cpu(i) { -+ pcpu_stats = per_cpu_ptr(lb_priv->pcpu_stats, i); -+ stats = &pcpu_stats->hash_stats[j]; -+ __lb_one_cpu_stats_add(&s_info->stats, stats, -+ &pcpu_stats->syncp); -+ } -+ changed |= __lb_stats_info_refresh_check(s_info, team); -+ } -+ -+ list_for_each_entry(port, &team->port_list, list) { -+ struct lb_port_priv *lb_port_priv = get_lb_port_priv(port); -+ -+ s_info = &lb_port_priv->stats_info; -+ __lb_stats_info_refresh_prepare(s_info); -+ for_each_possible_cpu(i) { -+ pcpu_stats = per_cpu_ptr(lb_priv->pcpu_stats, i); -+ stats = per_cpu_ptr(lb_port_priv->pcpu_stats, i); -+ __lb_one_cpu_stats_add(&s_info->stats, stats, -+ &pcpu_stats->syncp); -+ } -+ changed |= __lb_stats_info_refresh_check(s_info, team); -+ } -+ -+ if (changed) -+ team_options_change_check(team); -+ -+ schedule_delayed_work(&lb_priv_ex->stats.refresh_dw, -+ (lb_priv_ex->stats.refresh_interval * HZ) / 10); -+ -+ mutex_unlock(&team->lock); -+} -+ -+static int lb_stats_refresh_interval_get(struct team *team, -+ struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ -+ ctx->data.u32_val = lb_priv->ex->stats.refresh_interval; -+ return 0; -+} -+ -+static int lb_stats_refresh_interval_set(struct team *team, -+ struct team_gsetter_ctx *ctx) -+{ -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ unsigned int interval; -+ -+ interval = ctx->data.u32_val; -+ if (lb_priv->ex->stats.refresh_interval == interval) -+ return 0; -+ lb_priv->ex->stats.refresh_interval = interval; -+ if (interval) -+ schedule_delayed_work(&lb_priv->ex->stats.refresh_dw, 0); -+ else -+ cancel_delayed_work(&lb_priv->ex->stats.refresh_dw); - return 0; - } - -@@ -128,30 +532,125 @@ static const struct team_option lb_options[] = { - .getter = lb_bpf_func_get, - .setter = lb_bpf_func_set, - }, -+ { -+ .name = "lb_tx_method", -+ .type = TEAM_OPTION_TYPE_STRING, -+ .getter = lb_tx_method_get, -+ .setter = lb_tx_method_set, -+ }, -+ { -+ .name = "lb_tx_hash_to_port_mapping", -+ .array_size = LB_TX_HASHTABLE_SIZE, -+ .type = TEAM_OPTION_TYPE_U32, -+ .init = lb_tx_hash_to_port_mapping_init, -+ .getter = lb_tx_hash_to_port_mapping_get, -+ .setter = lb_tx_hash_to_port_mapping_set, -+ }, -+ { -+ .name = "lb_hash_stats", -+ .array_size = LB_TX_HASHTABLE_SIZE, -+ .type = TEAM_OPTION_TYPE_BINARY, -+ .init = lb_hash_stats_init, -+ .getter = lb_hash_stats_get, -+ }, -+ { -+ .name = "lb_port_stats", -+ .per_port = true, -+ .type = TEAM_OPTION_TYPE_BINARY, -+ .init = lb_port_stats_init, -+ .getter = lb_port_stats_get, -+ }, -+ { -+ .name = "lb_stats_refresh_interval", -+ .type = TEAM_OPTION_TYPE_U32, -+ .getter = lb_stats_refresh_interval_get, -+ .setter = lb_stats_refresh_interval_set, -+ }, - }; - - static int lb_init(struct team *team) - { -- return team_options_register(team, lb_options, -- ARRAY_SIZE(lb_options)); -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ lb_select_tx_port_func_t *func; -+ int err; -+ -+ /* set default tx port selector */ -+ func = lb_select_tx_port_get_func("hash"); -+ BUG_ON(!func); -+ rcu_assign_pointer(lb_priv->select_tx_port_func, func); -+ -+ lb_priv->ex = kzalloc(sizeof(*lb_priv->ex), GFP_KERNEL); -+ if (!lb_priv->ex) -+ return -ENOMEM; -+ lb_priv->ex->team = team; -+ -+ lb_priv->pcpu_stats = alloc_percpu(struct lb_pcpu_stats); -+ if (!lb_priv->pcpu_stats) { -+ err = -ENOMEM; -+ goto err_alloc_pcpu_stats; -+ } -+ -+ INIT_DELAYED_WORK(&lb_priv->ex->stats.refresh_dw, lb_stats_refresh); -+ -+ err = team_options_register(team, lb_options, ARRAY_SIZE(lb_options)); -+ if (err) -+ goto err_options_register; -+ return 0; -+ -+err_options_register: -+ free_percpu(lb_priv->pcpu_stats); -+err_alloc_pcpu_stats: -+ kfree(lb_priv->ex); -+ return err; - } - - static void lb_exit(struct team *team) - { -+ struct lb_priv *lb_priv = get_lb_priv(team); -+ - team_options_unregister(team, lb_options, - ARRAY_SIZE(lb_options)); -+ cancel_delayed_work_sync(&lb_priv->ex->stats.refresh_dw); -+ free_percpu(lb_priv->pcpu_stats); -+ kfree(lb_priv->ex); -+} -+ -+static int lb_port_enter(struct team *team, struct team_port *port) -+{ -+ struct lb_port_priv *lb_port_priv = get_lb_port_priv(port); -+ -+ lb_port_priv->pcpu_stats = alloc_percpu(struct lb_stats); -+ if (!lb_port_priv->pcpu_stats) -+ return -ENOMEM; -+ return 0; -+} -+ -+static void lb_port_leave(struct team *team, struct team_port *port) -+{ -+ struct lb_port_priv *lb_port_priv = get_lb_port_priv(port); -+ -+ free_percpu(lb_port_priv->pcpu_stats); -+} -+ -+static void lb_port_disabled(struct team *team, struct team_port *port) -+{ -+ lb_tx_hash_to_port_mapping_null_port(team, port); - } - - static const struct team_mode_ops lb_mode_ops = { - .init = lb_init, - .exit = lb_exit, -+ .port_enter = lb_port_enter, -+ .port_leave = lb_port_leave, -+ .port_disabled = lb_port_disabled, - .transmit = lb_transmit, - }; - --static struct team_mode lb_mode = { -+static const struct team_mode lb_mode = { - .kind = "loadbalance", - .owner = THIS_MODULE, - .priv_size = sizeof(struct lb_priv), -+ .port_priv_size = sizeof(struct lb_port_priv), - .ops = &lb_mode_ops, - }; - -diff --git a/drivers/net/team/team_mode_roundrobin.c b/drivers/net/team/team_mode_roundrobin.c -index 6abfbdc..52dd0ec 100644 ---- a/drivers/net/team/team_mode_roundrobin.c -+++ b/drivers/net/team/team_mode_roundrobin.c -@@ -1,5 +1,5 @@ - /* -- * net/drivers/team/team_mode_roundrobin.c - Round-robin mode for team -+ * drivers/net/team/team_mode_roundrobin.c - Round-robin mode for team - * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com> - * - * This program is free software; you can redistribute it and/or modify -@@ -81,7 +81,7 @@ static const struct team_mode_ops rr_mode_ops = { - .port_change_mac = rr_port_change_mac, - }; - --static struct team_mode rr_mode = { -+static const struct team_mode rr_mode = { - .kind = "roundrobin", - .owner = THIS_MODULE, - .priv_size = sizeof(struct rr_priv), -diff --git a/include/linux/if_team.h b/include/linux/if_team.h -index 8185f57..99efd60 100644 ---- a/include/linux/if_team.h -+++ b/include/linux/if_team.h -@@ -60,9 +60,11 @@ struct team_port { - unsigned int mtu; - } orig; - -- struct rcu_head rcu; -+ long mode_priv[0]; - }; - -+extern bool team_port_enabled(struct team_port *port); -+ - struct team_mode_ops { - int (*init)(struct team *team); - void (*exit)(struct team *team); -@@ -73,6 +75,8 @@ struct team_mode_ops { - int (*port_enter)(struct team *team, struct team_port *port); - void (*port_leave)(struct team *team, struct team_port *port); - void (*port_change_mac)(struct team *team, struct team_port *port); -+ void (*port_enabled)(struct team *team, struct team_port *port); -+ void (*port_disabled)(struct team *team, struct team_port *port); - }; - - enum team_option_type { -@@ -82,6 +86,11 @@ enum team_option_type { - TEAM_OPTION_TYPE_BOOL, - }; - -+struct team_option_inst_info { -+ u32 array_index; -+ struct team_port *port; /* != NULL if per-port */ -+}; -+ - struct team_gsetter_ctx { - union { - u32 u32_val; -@@ -92,23 +101,28 @@ struct team_gsetter_ctx { - } bin_val; - bool bool_val; - } data; -- struct team_port *port; -+ struct team_option_inst_info *info; - }; - - struct team_option { - struct list_head list; - const char *name; - bool per_port; -+ unsigned int array_size; /* != 0 means the option is array */ - enum team_option_type type; -+ int (*init)(struct team *team, struct team_option_inst_info *info); - int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); - int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); - }; - -+extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info); -+extern void team_options_change_check(struct team *team); -+ - struct team_mode { -- struct list_head list; - const char *kind; - struct module *owner; - size_t priv_size; -+ size_t port_priv_size; - const struct team_mode_ops *ops; - }; - -@@ -178,8 +192,8 @@ extern int team_options_register(struct team *team, - extern void team_options_unregister(struct team *team, - const struct team_option *option, - size_t option_count); --extern int team_mode_register(struct team_mode *mode); --extern int team_mode_unregister(struct team_mode *mode); -+extern int team_mode_register(const struct team_mode *mode); -+extern void team_mode_unregister(const struct team_mode *mode); - - #endif /* __KERNEL__ */ - -@@ -241,6 +255,7 @@ enum { - TEAM_ATTR_OPTION_DATA, /* dynamic */ - TEAM_ATTR_OPTION_REMOVED, /* flag */ - TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ -+ TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */ - - __TEAM_ATTR_OPTION_MAX, - TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, -_______________________________________________ -kernel mailing list -kernel@lists.fedoraproject.org -https://admin.fedoraproject.org/mailman/listinfo/kernel diff --git a/freed-ora/current/master/uapi-prefix-fix.patch b/freed-ora/current/master/uapi-prefix-fix.patch new file mode 100644 index 000000000..8b95d2a0b --- /dev/null +++ b/freed-ora/current/master/uapi-prefix-fix.patch @@ -0,0 +1,68 @@ +Return-Path: dhowells@redhat.com +Received: from zmta05.collab.prod.int.phx2.redhat.com (LHLO + zmta05.collab.prod.int.phx2.redhat.com) (10.5.81.12) by + zmail13.collab.prod.int.phx2.redhat.com with LMTP; Tue, 13 Nov 2012 + 09:26:44 -0500 (EST) +Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by zmta05.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 6E2CFF268E; + Tue, 13 Nov 2012 09:26:44 -0500 (EST) +Received: from warthog.procyon.org.uk (ovpn-113-117.phx2.redhat.com [10.3.113.117]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qADEQgUu016945; + Tue, 13 Nov 2012 09:26:42 -0500 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Subject: [PATCH] UAPI: Strip the _UAPI prefix from header guards during + header installation +To: torvalds@osdl.org +From: David Howells <dhowells@redhat.com> +Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, + Tomasz Torcz <tomek@pipebreaker.pl>, Josh Boyer <jwboyer@redhat.com> +Date: Tue, 13 Nov 2012 14:26:41 +0000 +Message-ID: <20121113142641.16744.72039.stgit@warthog.procyon.org.uk> +User-Agent: StGit/0.16 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Content-Length: 1691 +Lines: 37 + +Strip the _UAPI prefix from header guards during header installation so that +any userspace dependencies aren't affected. glibc, for example, checks for +linux/types.h, linux/kernel.h, linux/compiler.h and linux/list.h by their +guards - though the last two aren't actually exported. + + libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -Wall -Werror -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fno-delete-null-pointer-checks -fstack-protector -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c child.c -fPIC -DPIC -o .libs/child.o + In file included from cli.c:20:0: + common.h:152:8: error: redefinition of 'struct sysinfo' + In file included from /usr/include/linux/kernel.h:4:0, + from /usr/include/linux/sysctl.h:25, + from /usr/include/sys/sysctl.h:43, + from common.h:50, + from cli.c:20: + /usr/include/linux/sysinfo.h:7:8: note: originally defined here + +Reported-by: Tomasz Torcz <tomek@pipebreaker.pl> +Signed-off-by: David Howells <dhowells@redhat.com> +Acked-by: Josh Boyer <jwboyer@redhat.com> +--- + + 0 files changed + +diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl +index 239d22d..6c353ae 100644 +--- a/scripts/headers_install.pl ++++ b/scripts/headers_install.pl +@@ -42,6 +42,9 @@ foreach my $filename (@files) { + $line =~ s/(^|\s)(inline)\b/$1__$2__/g; + $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; + $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; ++ $line =~ s/#ifndef _UAPI/#ifndef /; ++ $line =~ s/#define _UAPI/#define /; ++ $line =~ s!#endif /[*] _UAPI!#endif /* !; + printf {$out} "%s", $line; + } + close $out; + diff --git a/freed-ora/current/master/unhandled-irqs-switch-to-polling.patch b/freed-ora/current/master/unhandled-irqs-switch-to-polling.patch deleted file mode 100644 index 0fc4d080e..000000000 --- a/freed-ora/current/master/unhandled-irqs-switch-to-polling.patch +++ /dev/null @@ -1,245 +0,0 @@ -From f9b32cd97783f2be14386f1347439e86109050b9 Mon Sep 17 00:00:00 2001 -From: Jeroen Van den Keybus <jeroen.vandenkeybus@gmail.com> -Date: Mon, 30 Jan 2012 22:37:28 +0100 -Subject: [PATCH] Unhandled IRQs on AMD E-450: temporarily switch to - low-performance polling IRQ mode - -It seems that some motherboard designs using the ASM1083 PCI/PCIe -bridge (PCI device ID 1b21:1080, Rev. 01) suffer from stuck IRQ lines -on the PCI bus (causing the kernel to emit 'IRQxx: nobody cared' and -disable the IRQ). The following patch is an attempt to mitigate the -serious impact of permanently disabling an IRQ in that case and -actually make PCI devices better usable on this platform. - -It seems that the bridge fails to issue a IRQ deassertion message on -the PCIe bus, when the relevant driver causes the interrupting PCI -device to deassert its IRQ line. To solve this issue, it was tried to -re-issue an IRQ on a PCI device being able to do so (e1000 in this -case), but we suspect that the attempt to re-assert/deassert may have -occurred too soon after the initial IRQ for the ASM1083. Anyway, it -didn't work but if, after some delay, a new IRQ occurred, the related -IRQ deassertion message eventually did clear the IOAPIC IRQ. It would -be useful to re-enable the IRQ here. - -Therefore the patch below to poll_spurious_irqs() in spurious.c is -proposed, It does the following: - -1. lets the kernel decide that an IRQ is unhandled after only 10 -positives (instead of 100,000); -2. briefly (a few seconds or so, currently 1 s) switches to polling -IRQ at a higher rate than usual (100..1,000Hz instead of 10Hz, -currently 100Hz), but not too high to avoid excessive CPU load. Any -device drivers 'see' their interrupts handled with a higher latency -than usual, but they will still operate properly; -3. afterwards, simply reenable the IRQ. - -If proper operation of the PCIe legacy IRQ line emulation is restored -after 3, the system operates again at normal performance. If the IRQ -is still stuck after this procedure, the sequence repeats. - -If a genuinely stuck IRQ is used with this solution, the system would -simply sustain short bursts of 10 unhandled IRQs per second, and use -polling mode indefinitely at a moderate 100Hz rate. It seemed a good -alternative to the default irqpoll behaviour to me, which is why I -left it in poll_spurious_irqs() (instead of creating a new kernel -option). Additionally, if any device happens to share an IRQ with a -faulty one, that device is no longer banned forever. - -Debugging output is still present and may be removed. Bad IRQ -reporting is also commented out now. - -I have now tried it for about 2 months and I can conclude the following: - -1. The patch works and, judging from my Firewire card interrupt on -IRQ16, which repeats every 64 secs, I can confirm that the IRQ usually -gets reset when a new IRQ arrives (polling mode runs for 64 seconds -every time). -2. When testing a SiL-3114 SATA PCI card behind the ASM1083, I could -keep this running at fairly high speeds (50..70MB/s) for an hour or -so, but eventually the SiL driver crashed. In such conditions the PCI -system had to deal with a few hundred IRQs per second / polling mode -kicking in every 5..10 seconds). - -I would like to thank Clemens Ladisch for his invaluable help in -finding a solution (and providing a patch to avoid my SATA going down -every time during debugging). - -Signed-off-by: Jeroen Van den Keybus <jeroen.vandenkeybus@gmail.com> - -Make it less chatty. Only kick it in if we detect an ASM1083 PCI bridge. -Fix logic error due to lack of braces - -Josh Boyer <jwboyer@redhat.com> -====== ---- - drivers/pci/quirks.c | 16 +++++++++++ - kernel/irq/spurious.c | 73 +++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 75 insertions(+), 14 deletions(-) - -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 78fda9c..6ba5dbf 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -1677,6 +1677,22 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); - -+/* ASM108x transparent PCI bridges apparently have broken IRQ deassert -+ * handling. This causes interrupts to get "stuck" and eventually disabled. -+ * However, the interrupts are often shared and disabling them is fairly bad. -+ * It's been somewhat successful to switch to polling mode and retry after -+ * a bit, so let's do that. -+ */ -+extern int irq_poll_and_retry; -+static void quirk_asm108x_poll_interrupts(struct pci_dev *dev) -+{ -+ dev_info(&dev->dev, "Buggy bridge found [%04x:%04x]\n", -+ dev->vendor, dev->device); -+ dev_info(&dev->dev, "Stuck interrupts will be polled and retried\n"); -+ irq_poll_and_retry = 1; -+} -+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_asm108x_poll_interrupts); -+ - #ifdef CONFIG_X86_IO_APIC - /* - * Boot interrupts on some chipsets cannot be turned off. For these chipsets, -diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c -index 611cd60..f722eb6 100644 ---- a/kernel/irq/spurious.c -+++ b/kernel/irq/spurious.c -@@ -18,6 +18,8 @@ - - static int irqfixup __read_mostly; - -+int irq_poll_and_retry = 0; -+ - #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10) - static void poll_spurious_irqs(unsigned long dummy); - static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs, 0, 0); -@@ -141,12 +143,13 @@ out: - static void poll_spurious_irqs(unsigned long dummy) - { - struct irq_desc *desc; -- int i; -+ int i, poll_again; - - if (atomic_inc_return(&irq_poll_active) != 1) - goto out; - irq_poll_cpu = smp_processor_id(); - -+ poll_again = 0; /* Will stay false as long as no polling candidate is found */ - for_each_irq_desc(i, desc) { - unsigned int state; - -@@ -159,14 +162,33 @@ static void poll_spurious_irqs(unsigned long dummy) - if (!(state & IRQS_SPURIOUS_DISABLED)) - continue; - -- local_irq_disable(); -- try_one_irq(i, desc, true); -- local_irq_enable(); -+ /* We end up here with a disabled spurious interrupt. -+ desc->irqs_unhandled now tracks the number of times -+ the interrupt has been polled */ -+ if (irq_poll_and_retry) { -+ if (desc->irqs_unhandled < 100) { /* 1 second delay with poll frequency 100 Hz */ -+ local_irq_disable(); -+ try_one_irq(i, desc, true); -+ local_irq_enable(); -+ desc->irqs_unhandled++; -+ poll_again = 1; -+ } else { -+ irq_enable(desc); /* Reenable the interrupt line */ -+ desc->depth--; -+ desc->istate &= (~IRQS_SPURIOUS_DISABLED); -+ desc->irqs_unhandled = 0; -+ } -+ } else { -+ local_irq_disable(); -+ try_one_irq(i, desc, true); -+ local_irq_enable(); -+ } - } -+ if (poll_again) -+ mod_timer(&poll_spurious_irq_timer, -+ jiffies + POLL_SPURIOUS_IRQ_INTERVAL); - out: - atomic_dec(&irq_poll_active); -- mod_timer(&poll_spurious_irq_timer, -- jiffies + POLL_SPURIOUS_IRQ_INTERVAL); - } - - static inline int bad_action_ret(irqreturn_t action_ret) -@@ -177,11 +199,19 @@ static inline int bad_action_ret(irqreturn_t action_ret) - } - - /* -- * If 99,900 of the previous 100,000 interrupts have not been handled -+ * If 9 of the previous 10 interrupts have not been handled - * then assume that the IRQ is stuck in some manner. Drop a diagnostic - * and try to turn the IRQ off. - * -- * (The other 100-of-100,000 interrupts may have been a correctly -+ * Although this may cause early deactivation of a sporadically -+ * malfunctioning IRQ line, the poll system will: -+ * a) Poll it for 100 cycles at a 100 Hz rate -+ * b) Reenable it afterwards -+ * -+ * In worst case, with current settings, this will cause short bursts -+ * of 10 interrupts every second. -+ * -+ * (The other single interrupt may have been a correctly - * functioning device sharing an IRQ with the failing one) - */ - static void -@@ -269,6 +299,8 @@ try_misrouted_irq(unsigned int irq, struct irq_desc *desc, - void note_interrupt(unsigned int irq, struct irq_desc *desc, - irqreturn_t action_ret) - { -+ int unhandled_thresh = 999000; -+ - if (desc->istate & IRQS_POLL_INPROGRESS) - return; - -@@ -302,19 +334,32 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc, - } - - desc->irq_count++; -- if (likely(desc->irq_count < 100000)) -- return; -+ if (!irq_poll_and_retry) { -+ if (likely(desc->irq_count < 100000)) -+ return; -+ } else { -+ if (likely(desc->irq_count < 10)) -+ return; -+ } - - desc->irq_count = 0; -- if (unlikely(desc->irqs_unhandled > 99900)) { -+ if (irq_poll_and_retry) -+ unhandled_thresh = 9; -+ -+ if (unlikely(desc->irqs_unhandled >= unhandled_thresh)) { - /* -- * The interrupt is stuck -+ * The interrupt might be stuck - */ -- __report_bad_irq(irq, desc, action_ret); -+ if (!irq_poll_and_retry) { -+ __report_bad_irq(irq, desc, action_ret); -+ printk(KERN_EMERG "Disabling IRQ %d\n", irq); -+ } else { -+ printk(KERN_INFO "IRQ %d might be stuck. Polling\n", -+ irq); -+ } - /* - * Now kill the IRQ - */ -- printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->istate |= IRQS_SPURIOUS_DISABLED; - desc->depth++; - irq_disable(desc); --- -1.7.7.6 - diff --git a/freed-ora/current/master/uprobes-3.5-tip.patch b/freed-ora/current/master/uprobes-3.5-tip.patch deleted file mode 100644 index 8105dc45c..000000000 --- a/freed-ora/current/master/uprobes-3.5-tip.patch +++ /dev/null @@ -1,915 +0,0 @@ -The split-out series is available in the git repository at: - - git://fedorapeople.org/home/fedora/aarapov/public_git/kernel-uprobes.git tags/rawhide_exported - -Ananth N Mavinakayanahalli (1): - uprobes: Pass probed vaddr to arch_uprobe_analyze_insn() - -Josh Stone (1): - uprobes: add exports necessary for uprobes use by modules - -Oleg Nesterov (21): - uprobes: Optimize is_swbp_at_addr() for current->mm - uprobes: Change read_opcode() to use FOLL_FORCE - uprobes: Introduce find_active_uprobe() helper - uprobes: Teach find_active_uprobe() to provide the "is_swbp" info - uprobes: Change register_for_each_vma() to take mm->mmap_sem for writing - uprobes: Teach handle_swbp() to rely on "is_swbp" rather than uprobes_srcu - uprobes: Kill uprobes_srcu/uprobe_srcu_id - uprobes: Valid_vma() should reject VM_HUGETLB - uprobes: __copy_insn() should ensure a_ops->readpage != NULL - uprobes: Write_opcode()->__replace_page() can race with try_to_unmap() - uprobes: Install_breakpoint() should fail if is_swbp_insn() == T - uprobes: Rework register_for_each_vma() to make it O(n) - uprobes: Change build_map_info() to try kmalloc(GFP_NOWAIT) first - uprobes: Copy_insn() shouldn't depend on mm/vma/vaddr - uprobes: Copy_insn() should not return -ENOMEM if __copy_insn() fails - uprobes: No need to re-check vma_address() in write_opcode() - uprobes: Simplify the usage of uprobe->pending_list - uprobes: Don't use loff_t for the valid virtual address - uprobes: __copy_insn() needs "loff_t offset" - uprobes: Remove the unnecessary initialization in add_utask() - uprobes: Move BUG_ON(UPROBE_SWBP_INSN_SIZE) from write_opcode() to install_breakpoint() - -Peter Zijlstra (1): - uprobes: Document uprobe_register() vs uprobe_mmap() race - -Signed-off-by: Anton Arapov <anton@redhat.com> ---- - arch/x86/include/asm/uprobes.h | 2 +- - arch/x86/kernel/ptrace.c | 6 + - arch/x86/kernel/uprobes.c | 3 +- - include/linux/sched.h | 1 - - kernel/events/uprobes.c | 464 ++++++++++++++++++++-------------------- - 5 files changed, 240 insertions(+), 236 deletions(-) - -diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h -index 1e9bed1..f3971bb 100644 ---- a/arch/x86/include/asm/uprobes.h -+++ b/arch/x86/include/asm/uprobes.h -@@ -48,7 +48,7 @@ struct arch_uprobe_task { - #endif - }; - --extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm); -+extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr); - extern int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs); - extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs); - extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk); -diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c -index c4c6a5c..a6a6871 100644 ---- a/arch/x86/kernel/ptrace.c -+++ b/arch/x86/kernel/ptrace.c -@@ -1415,6 +1415,12 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) - #endif - } - -+/* -+ * This is declared in linux/regset.h and defined in machine-dependent -+ * code. We put the export here to ensure no machine forgets it. -+ */ -+EXPORT_SYMBOL_GPL(task_user_regset_view); -+ - static void fill_sigtrap_info(struct task_struct *tsk, - struct pt_regs *regs, - int error_code, int si_code, -diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c -index dc4e910..36fd420 100644 ---- a/arch/x86/kernel/uprobes.c -+++ b/arch/x86/kernel/uprobes.c -@@ -409,9 +409,10 @@ static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm, - * arch_uprobe_analyze_insn - instruction analysis including validity and fixups. - * @mm: the probed address space. - * @arch_uprobe: the probepoint information. -+ * @addr: virtual address at which to install the probepoint - * Return 0 on success or a -ve number on error. - */ --int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm) -+int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long addr) - { - int ret; - struct insn insn; -diff --git a/include/linux/sched.h b/include/linux/sched.h -index 4059c0f..c7cfa69 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1581,7 +1581,6 @@ struct task_struct { - #endif - #ifdef CONFIG_UPROBES - struct uprobe_task *utask; -- int uprobe_srcu_id; - #endif - }; - -diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c -index 985be4d..d9e5ba5 100644 ---- a/kernel/events/uprobes.c -+++ b/kernel/events/uprobes.c -@@ -34,17 +34,34 @@ - #include <linux/kdebug.h> /* notifier mechanism */ - - #include <linux/uprobes.h> -+#include <linux/export.h> - - #define UINSNS_PER_PAGE (PAGE_SIZE/UPROBE_XOL_SLOT_BYTES) - #define MAX_UPROBE_XOL_SLOTS UINSNS_PER_PAGE - --static struct srcu_struct uprobes_srcu; - static struct rb_root uprobes_tree = RB_ROOT; - - static DEFINE_SPINLOCK(uprobes_treelock); /* serialize rbtree access */ - - #define UPROBES_HASH_SZ 13 - -+/* -+ * We need separate register/unregister and mmap/munmap lock hashes because -+ * of mmap_sem nesting. -+ * -+ * uprobe_register() needs to install probes on (potentially) all processes -+ * and thus needs to acquire multiple mmap_sems (consequtively, not -+ * concurrently), whereas uprobe_mmap() is called while holding mmap_sem -+ * for the particular process doing the mmap. -+ * -+ * uprobe_register()->register_for_each_vma() needs to drop/acquire mmap_sem -+ * because of lock order against i_mmap_mutex. This means there's a hole in -+ * the register vma iteration where a mmap() can happen. -+ * -+ * Thus uprobe_register() can race with uprobe_mmap() and we can try and -+ * install a probe where one is already installed. -+ */ -+ - /* serialize (un)register */ - static struct mutex uprobes_mutex[UPROBES_HASH_SZ]; - -@@ -61,17 +78,6 @@ static struct mutex uprobes_mmap_mutex[UPROBES_HASH_SZ]; - */ - static atomic_t uprobe_events = ATOMIC_INIT(0); - --/* -- * Maintain a temporary per vma info that can be used to search if a vma -- * has already been handled. This structure is introduced since extending -- * vm_area_struct wasnt recommended. -- */ --struct vma_info { -- struct list_head probe_list; -- struct mm_struct *mm; -- loff_t vaddr; --}; -- - struct uprobe { - struct rb_node rb_node; /* node in the rb tree */ - atomic_t ref; -@@ -100,7 +106,8 @@ static bool valid_vma(struct vm_area_struct *vma, bool is_register) - if (!is_register) - return true; - -- if ((vma->vm_flags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) == (VM_READ|VM_EXEC)) -+ if ((vma->vm_flags & (VM_HUGETLB|VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) -+ == (VM_READ|VM_EXEC)) - return true; - - return false; -@@ -129,33 +136,17 @@ static loff_t vma_address(struct vm_area_struct *vma, loff_t offset) - static int __replace_page(struct vm_area_struct *vma, struct page *page, struct page *kpage) - { - struct mm_struct *mm = vma->vm_mm; -- pgd_t *pgd; -- pud_t *pud; -- pmd_t *pmd; -- pte_t *ptep; -- spinlock_t *ptl; - unsigned long addr; -- int err = -EFAULT; -+ spinlock_t *ptl; -+ pte_t *ptep; - - addr = page_address_in_vma(page, vma); - if (addr == -EFAULT) -- goto out; -- -- pgd = pgd_offset(mm, addr); -- if (!pgd_present(*pgd)) -- goto out; -- -- pud = pud_offset(pgd, addr); -- if (!pud_present(*pud)) -- goto out; -- -- pmd = pmd_offset(pud, addr); -- if (!pmd_present(*pmd)) -- goto out; -+ return -EFAULT; - -- ptep = pte_offset_map_lock(mm, pmd, addr, &ptl); -+ ptep = page_check_address(page, mm, addr, &ptl, 0); - if (!ptep) -- goto out; -+ return -EAGAIN; - - get_page(kpage); - page_add_new_anon_rmap(kpage, vma, addr); -@@ -174,10 +165,8 @@ static int __replace_page(struct vm_area_struct *vma, struct page *page, struct - try_to_free_swap(page); - put_page(page); - pte_unmap_unlock(ptep, ptl); -- err = 0; - --out: -- return err; -+ return 0; - } - - /** -@@ -222,9 +211,8 @@ static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, - void *vaddr_old, *vaddr_new; - struct vm_area_struct *vma; - struct uprobe *uprobe; -- loff_t addr; - int ret; -- -+retry: - /* Read the page with vaddr into memory */ - ret = get_user_pages(NULL, mm, vaddr, 1, 0, 0, &old_page, &vma); - if (ret <= 0) -@@ -246,10 +234,6 @@ static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, - if (mapping != vma->vm_file->f_mapping) - goto put_out; - -- addr = vma_address(vma, uprobe->offset); -- if (vaddr != (unsigned long)addr) -- goto put_out; -- - ret = -ENOMEM; - new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vaddr); - if (!new_page) -@@ -267,11 +251,7 @@ static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, - vaddr_new = kmap_atomic(new_page); - - memcpy(vaddr_new, vaddr_old, PAGE_SIZE); -- -- /* poke the new insn in, ASSUMES we don't cross page boundary */ -- vaddr &= ~PAGE_MASK; -- BUG_ON(vaddr + UPROBE_SWBP_INSN_SIZE > PAGE_SIZE); -- memcpy(vaddr_new + vaddr, &opcode, UPROBE_SWBP_INSN_SIZE); -+ memcpy(vaddr_new + (vaddr & ~PAGE_MASK), &opcode, UPROBE_SWBP_INSN_SIZE); - - kunmap_atomic(vaddr_new); - kunmap_atomic(vaddr_old); -@@ -291,6 +271,8 @@ unlock_out: - put_out: - put_page(old_page); - -+ if (unlikely(ret == -EAGAIN)) -+ goto retry; - return ret; - } - -@@ -312,7 +294,7 @@ static int read_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_ - void *vaddr_new; - int ret; - -- ret = get_user_pages(NULL, mm, vaddr, 1, 0, 0, &page, NULL); -+ ret = get_user_pages(NULL, mm, vaddr, 1, 0, 1, &page, NULL); - if (ret <= 0) - return ret; - -@@ -333,10 +315,20 @@ static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr) - uprobe_opcode_t opcode; - int result; - -+ if (current->mm == mm) { -+ pagefault_disable(); -+ result = __copy_from_user_inatomic(&opcode, (void __user*)vaddr, -+ sizeof(opcode)); -+ pagefault_enable(); -+ -+ if (likely(result == 0)) -+ goto out; -+ } -+ - result = read_opcode(mm, vaddr, &opcode); - if (result) - return result; -- -+out: - if (is_swbp_insn(&opcode)) - return 1; - -@@ -355,7 +347,9 @@ static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr) - int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) - { - int result; -- -+ /* -+ * See the comment near uprobes_hash(). -+ */ - result = is_swbp_at_addr(mm, vaddr); - if (result == 1) - return -EEXIST; -@@ -520,7 +514,6 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset) - uprobe->inode = igrab(inode); - uprobe->offset = offset; - init_rwsem(&uprobe->consumer_rwsem); -- INIT_LIST_HEAD(&uprobe->pending_list); - - /* add to uprobes_tree, sorted on inode:offset */ - cur_uprobe = insert_uprobe(uprobe); -@@ -588,20 +581,22 @@ static bool consumer_del(struct uprobe *uprobe, struct uprobe_consumer *uc) - } - - static int --__copy_insn(struct address_space *mapping, struct vm_area_struct *vma, char *insn, -- unsigned long nbytes, unsigned long offset) -+__copy_insn(struct address_space *mapping, struct file *filp, char *insn, -+ unsigned long nbytes, loff_t offset) - { -- struct file *filp = vma->vm_file; - struct page *page; - void *vaddr; -- unsigned long off1; -- unsigned long idx; -+ unsigned long off; -+ pgoff_t idx; - - if (!filp) - return -EINVAL; - -- idx = (unsigned long)(offset >> PAGE_CACHE_SHIFT); -- off1 = offset &= ~PAGE_MASK; -+ if (!mapping->a_ops->readpage) -+ return -EIO; -+ -+ idx = offset >> PAGE_CACHE_SHIFT; -+ off = offset & ~PAGE_MASK; - - /* - * Ensure that the page that has the original instruction is -@@ -612,22 +607,20 @@ __copy_insn(struct address_space *mapping, struct vm_area_struct *vma, char *ins - return PTR_ERR(page); - - vaddr = kmap_atomic(page); -- memcpy(insn, vaddr + off1, nbytes); -+ memcpy(insn, vaddr + off, nbytes); - kunmap_atomic(vaddr); - page_cache_release(page); - - return 0; - } - --static int --copy_insn(struct uprobe *uprobe, struct vm_area_struct *vma, unsigned long addr) -+static int copy_insn(struct uprobe *uprobe, struct file *filp) - { - struct address_space *mapping; - unsigned long nbytes; - int bytes; - -- addr &= ~PAGE_MASK; -- nbytes = PAGE_SIZE - addr; -+ nbytes = PAGE_SIZE - (uprobe->offset & ~PAGE_MASK); - mapping = uprobe->inode->i_mapping; - - /* Instruction at end of binary; copy only available bytes */ -@@ -638,13 +631,13 @@ copy_insn(struct uprobe *uprobe, struct vm_area_struct *vma, unsigned long addr) - - /* Instruction at the page-boundary; copy bytes in second page */ - if (nbytes < bytes) { -- if (__copy_insn(mapping, vma, uprobe->arch.insn + nbytes, -- bytes - nbytes, uprobe->offset + nbytes)) -- return -ENOMEM; -- -+ int err = __copy_insn(mapping, filp, uprobe->arch.insn + nbytes, -+ bytes - nbytes, uprobe->offset + nbytes); -+ if (err) -+ return err; - bytes = nbytes; - } -- return __copy_insn(mapping, vma, uprobe->arch.insn, bytes, uprobe->offset); -+ return __copy_insn(mapping, filp, uprobe->arch.insn, bytes, uprobe->offset); - } - - /* -@@ -672,9 +665,8 @@ copy_insn(struct uprobe *uprobe, struct vm_area_struct *vma, unsigned long addr) - */ - static int - install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, -- struct vm_area_struct *vma, loff_t vaddr) -+ struct vm_area_struct *vma, unsigned long vaddr) - { -- unsigned long addr; - int ret; - - /* -@@ -687,20 +679,22 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, - if (!uprobe->consumers) - return -EEXIST; - -- addr = (unsigned long)vaddr; -- - if (!(uprobe->flags & UPROBE_COPY_INSN)) { -- ret = copy_insn(uprobe, vma, addr); -+ ret = copy_insn(uprobe, vma->vm_file); - if (ret) - return ret; - - if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn)) -- return -EEXIST; -+ return -ENOTSUPP; - -- ret = arch_uprobe_analyze_insn(&uprobe->arch, mm); -+ ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr); - if (ret) - return ret; - -+ /* write_opcode() assumes we don't cross page boundary */ -+ BUG_ON((uprobe->offset & ~PAGE_MASK) + -+ UPROBE_SWBP_INSN_SIZE > PAGE_SIZE); -+ - uprobe->flags |= UPROBE_COPY_INSN; - } - -@@ -713,7 +707,7 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, - * Hence increment before and decrement on failure. - */ - atomic_inc(&mm->uprobes_state.count); -- ret = set_swbp(&uprobe->arch, mm, addr); -+ ret = set_swbp(&uprobe->arch, mm, vaddr); - if (ret) - atomic_dec(&mm->uprobes_state.count); - -@@ -721,27 +715,21 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, - } - - static void --remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, loff_t vaddr) -+remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr) - { -- if (!set_orig_insn(&uprobe->arch, mm, (unsigned long)vaddr, true)) -+ if (!set_orig_insn(&uprobe->arch, mm, vaddr, true)) - atomic_dec(&mm->uprobes_state.count); - } - - /* -- * There could be threads that have hit the breakpoint and are entering the -- * notifier code and trying to acquire the uprobes_treelock. The thread -- * calling delete_uprobe() that is removing the uprobe from the rb_tree can -- * race with these threads and might acquire the uprobes_treelock compared -- * to some of the breakpoint hit threads. In such a case, the breakpoint -- * hit threads will not find the uprobe. The current unregistering thread -- * waits till all other threads have hit a breakpoint, to acquire the -- * uprobes_treelock before the uprobe is removed from the rbtree. -+ * There could be threads that have already hit the breakpoint. They -+ * will recheck the current insn and restart if find_uprobe() fails. -+ * See find_active_uprobe(). - */ - static void delete_uprobe(struct uprobe *uprobe) - { - unsigned long flags; - -- synchronize_srcu(&uprobes_srcu); - spin_lock_irqsave(&uprobes_treelock, flags); - rb_erase(&uprobe->rb_node, &uprobes_tree); - spin_unlock_irqrestore(&uprobes_treelock, flags); -@@ -750,139 +738,135 @@ static void delete_uprobe(struct uprobe *uprobe) - atomic_dec(&uprobe_events); - } - --static struct vma_info * --__find_next_vma_info(struct address_space *mapping, struct list_head *head, -- struct vma_info *vi, loff_t offset, bool is_register) -+struct map_info { -+ struct map_info *next; -+ struct mm_struct *mm; -+ unsigned long vaddr; -+}; -+ -+static inline struct map_info *free_map_info(struct map_info *info) -+{ -+ struct map_info *next = info->next; -+ kfree(info); -+ return next; -+} -+ -+static struct map_info * -+build_map_info(struct address_space *mapping, loff_t offset, bool is_register) - { -+ unsigned long pgoff = offset >> PAGE_SHIFT; - struct prio_tree_iter iter; - struct vm_area_struct *vma; -- struct vma_info *tmpvi; -- unsigned long pgoff; -- int existing_vma; -- loff_t vaddr; -- -- pgoff = offset >> PAGE_SHIFT; -+ struct map_info *curr = NULL; -+ struct map_info *prev = NULL; -+ struct map_info *info; -+ int more = 0; - -+ again: -+ mutex_lock(&mapping->i_mmap_mutex); - vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) { - if (!valid_vma(vma, is_register)) - continue; - -- existing_vma = 0; -- vaddr = vma_address(vma, offset); -- -- list_for_each_entry(tmpvi, head, probe_list) { -- if (tmpvi->mm == vma->vm_mm && tmpvi->vaddr == vaddr) { -- existing_vma = 1; -- break; -- } -+ if (!prev && !more) { -+ /* -+ * Needs GFP_NOWAIT to avoid i_mmap_mutex recursion through -+ * reclaim. This is optimistic, no harm done if it fails. -+ */ -+ prev = kmalloc(sizeof(struct map_info), -+ GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN); -+ if (prev) -+ prev->next = NULL; - } -- -- /* -- * Another vma needs a probe to be installed. However skip -- * installing the probe if the vma is about to be unlinked. -- */ -- if (!existing_vma && atomic_inc_not_zero(&vma->vm_mm->mm_users)) { -- vi->mm = vma->vm_mm; -- vi->vaddr = vaddr; -- list_add(&vi->probe_list, head); -- -- return vi; -+ if (!prev) { -+ more++; -+ continue; - } -- } - -- return NULL; --} -- --/* -- * Iterate in the rmap prio tree and find a vma where a probe has not -- * yet been inserted. -- */ --static struct vma_info * --find_next_vma_info(struct address_space *mapping, struct list_head *head, -- loff_t offset, bool is_register) --{ -- struct vma_info *vi, *retvi; -+ if (!atomic_inc_not_zero(&vma->vm_mm->mm_users)) -+ continue; - -- vi = kzalloc(sizeof(struct vma_info), GFP_KERNEL); -- if (!vi) -- return ERR_PTR(-ENOMEM); -+ info = prev; -+ prev = prev->next; -+ info->next = curr; -+ curr = info; - -- mutex_lock(&mapping->i_mmap_mutex); -- retvi = __find_next_vma_info(mapping, head, vi, offset, is_register); -+ info->mm = vma->vm_mm; -+ info->vaddr = vma_address(vma, offset); -+ } - mutex_unlock(&mapping->i_mmap_mutex); - -- if (!retvi) -- kfree(vi); -+ if (!more) -+ goto out; -+ -+ prev = curr; -+ while (curr) { -+ mmput(curr->mm); -+ curr = curr->next; -+ } - -- return retvi; -+ do { -+ info = kmalloc(sizeof(struct map_info), GFP_KERNEL); -+ if (!info) { -+ curr = ERR_PTR(-ENOMEM); -+ goto out; -+ } -+ info->next = prev; -+ prev = info; -+ } while (--more); -+ -+ goto again; -+ out: -+ while (prev) -+ prev = free_map_info(prev); -+ return curr; - } - - static int register_for_each_vma(struct uprobe *uprobe, bool is_register) - { -- struct list_head try_list; -- struct vm_area_struct *vma; -- struct address_space *mapping; -- struct vma_info *vi, *tmpvi; -- struct mm_struct *mm; -- loff_t vaddr; -- int ret; -+ struct map_info *info; -+ int err = 0; - -- mapping = uprobe->inode->i_mapping; -- INIT_LIST_HEAD(&try_list); -+ info = build_map_info(uprobe->inode->i_mapping, -+ uprobe->offset, is_register); -+ if (IS_ERR(info)) -+ return PTR_ERR(info); - -- ret = 0; -+ while (info) { -+ struct mm_struct *mm = info->mm; -+ struct vm_area_struct *vma; - -- for (;;) { -- vi = find_next_vma_info(mapping, &try_list, uprobe->offset, is_register); -- if (!vi) -- break; -+ if (err) -+ goto free; - -- if (IS_ERR(vi)) { -- ret = PTR_ERR(vi); -- break; -- } -+ down_write(&mm->mmap_sem); -+ vma = find_vma(mm, (unsigned long)info->vaddr); -+ if (!vma || !valid_vma(vma, is_register)) -+ goto unlock; - -- mm = vi->mm; -- down_read(&mm->mmap_sem); -- vma = find_vma(mm, (unsigned long)vi->vaddr); -- if (!vma || !valid_vma(vma, is_register)) { -- list_del(&vi->probe_list); -- kfree(vi); -- up_read(&mm->mmap_sem); -- mmput(mm); -- continue; -- } -- vaddr = vma_address(vma, uprobe->offset); - if (vma->vm_file->f_mapping->host != uprobe->inode || -- vaddr != vi->vaddr) { -- list_del(&vi->probe_list); -- kfree(vi); -- up_read(&mm->mmap_sem); -- mmput(mm); -- continue; -- } -- -- if (is_register) -- ret = install_breakpoint(uprobe, mm, vma, vi->vaddr); -- else -- remove_breakpoint(uprobe, mm, vi->vaddr); -+ vma_address(vma, uprobe->offset) != info->vaddr) -+ goto unlock; - -- up_read(&mm->mmap_sem); -- mmput(mm); - if (is_register) { -- if (ret && ret == -EEXIST) -- ret = 0; -- if (ret) -- break; -+ err = install_breakpoint(uprobe, mm, vma, info->vaddr); -+ /* -+ * We can race against uprobe_mmap(), see the -+ * comment near uprobe_hash(). -+ */ -+ if (err == -EEXIST) -+ err = 0; -+ } else { -+ remove_breakpoint(uprobe, mm, info->vaddr); - } -+ unlock: -+ up_write(&mm->mmap_sem); -+ free: -+ mmput(mm); -+ info = free_map_info(info); - } - -- list_for_each_entry_safe(vi, tmpvi, &try_list, probe_list) { -- list_del(&vi->probe_list); -- kfree(vi); -- } -- -- return ret; -+ return err; - } - - static int __uprobe_register(struct uprobe *uprobe) -@@ -945,6 +929,7 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer * - - return ret; - } -+EXPORT_SYMBOL_GPL(uprobe_register); - - /* - * uprobe_unregister - unregister a already registered probe. -@@ -976,6 +961,7 @@ void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consume - if (uprobe) - put_uprobe(uprobe); - } -+EXPORT_SYMBOL_GPL(uprobe_unregister); - - /* - * Of all the nodes that correspond to the given inode, return the node -@@ -1048,7 +1034,7 @@ static void build_probe_list(struct inode *inode, struct list_head *head) - int uprobe_mmap(struct vm_area_struct *vma) - { - struct list_head tmp_list; -- struct uprobe *uprobe, *u; -+ struct uprobe *uprobe; - struct inode *inode; - int ret, count; - -@@ -1066,12 +1052,9 @@ int uprobe_mmap(struct vm_area_struct *vma) - ret = 0; - count = 0; - -- list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) { -- loff_t vaddr; -- -- list_del(&uprobe->pending_list); -+ list_for_each_entry(uprobe, &tmp_list, pending_list) { - if (!ret) { -- vaddr = vma_address(vma, uprobe->offset); -+ loff_t vaddr = vma_address(vma, uprobe->offset); - - if (vaddr < vma->vm_start || vaddr >= vma->vm_end) { - put_uprobe(uprobe); -@@ -1079,8 +1062,10 @@ int uprobe_mmap(struct vm_area_struct *vma) - } - - ret = install_breakpoint(uprobe, vma->vm_mm, vma, vaddr); -- -- /* Ignore double add: */ -+ /* -+ * We can race against uprobe_register(), see the -+ * comment near uprobe_hash(). -+ */ - if (ret == -EEXIST) { - ret = 0; - -@@ -1115,7 +1100,7 @@ int uprobe_mmap(struct vm_area_struct *vma) - void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) - { - struct list_head tmp_list; -- struct uprobe *uprobe, *u; -+ struct uprobe *uprobe; - struct inode *inode; - - if (!atomic_read(&uprobe_events) || !valid_vma(vma, false)) -@@ -1132,11 +1117,8 @@ void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned lon - mutex_lock(uprobes_mmap_hash(inode)); - build_probe_list(inode, &tmp_list); - -- list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) { -- loff_t vaddr; -- -- list_del(&uprobe->pending_list); -- vaddr = vma_address(vma, uprobe->offset); -+ list_for_each_entry(uprobe, &tmp_list, pending_list) { -+ loff_t vaddr = vma_address(vma, uprobe->offset); - - if (vaddr >= start && vaddr < end) { - /* -@@ -1378,9 +1360,6 @@ void uprobe_free_utask(struct task_struct *t) - { - struct uprobe_task *utask = t->utask; - -- if (t->uprobe_srcu_id != -1) -- srcu_read_unlock_raw(&uprobes_srcu, t->uprobe_srcu_id); -- - if (!utask) - return; - -@@ -1398,7 +1377,6 @@ void uprobe_free_utask(struct task_struct *t) - void uprobe_copy_process(struct task_struct *t) - { - t->utask = NULL; -- t->uprobe_srcu_id = -1; - } - - /* -@@ -1417,7 +1395,6 @@ static struct uprobe_task *add_utask(void) - if (unlikely(!utask)) - return NULL; - -- utask->active_uprobe = NULL; - current->utask = utask; - return utask; - } -@@ -1479,41 +1456,64 @@ static bool can_skip_sstep(struct uprobe *uprobe, struct pt_regs *regs) - return false; - } - -+static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) -+{ -+ struct mm_struct *mm = current->mm; -+ struct uprobe *uprobe = NULL; -+ struct vm_area_struct *vma; -+ -+ down_read(&mm->mmap_sem); -+ vma = find_vma(mm, bp_vaddr); -+ if (vma && vma->vm_start <= bp_vaddr) { -+ if (valid_vma(vma, false)) { -+ struct inode *inode; -+ loff_t offset; -+ -+ inode = vma->vm_file->f_mapping->host; -+ offset = bp_vaddr - vma->vm_start; -+ offset += (vma->vm_pgoff << PAGE_SHIFT); -+ uprobe = find_uprobe(inode, offset); -+ } -+ -+ if (!uprobe) -+ *is_swbp = is_swbp_at_addr(mm, bp_vaddr); -+ } else { -+ *is_swbp = -EFAULT; -+ } -+ up_read(&mm->mmap_sem); -+ -+ return uprobe; -+} -+ - /* - * Run handler and ask thread to singlestep. - * Ensure all non-fatal signals cannot interrupt thread while it singlesteps. - */ - static void handle_swbp(struct pt_regs *regs) - { -- struct vm_area_struct *vma; - struct uprobe_task *utask; - struct uprobe *uprobe; -- struct mm_struct *mm; - unsigned long bp_vaddr; -+ int uninitialized_var(is_swbp); - -- uprobe = NULL; - bp_vaddr = uprobe_get_swbp_addr(regs); -- mm = current->mm; -- down_read(&mm->mmap_sem); -- vma = find_vma(mm, bp_vaddr); -- -- if (vma && vma->vm_start <= bp_vaddr && valid_vma(vma, false)) { -- struct inode *inode; -- loff_t offset; -- -- inode = vma->vm_file->f_mapping->host; -- offset = bp_vaddr - vma->vm_start; -- offset += (vma->vm_pgoff << PAGE_SHIFT); -- uprobe = find_uprobe(inode, offset); -- } -- -- srcu_read_unlock_raw(&uprobes_srcu, current->uprobe_srcu_id); -- current->uprobe_srcu_id = -1; -- up_read(&mm->mmap_sem); -+ uprobe = find_active_uprobe(bp_vaddr, &is_swbp); - - if (!uprobe) { -- /* No matching uprobe; signal SIGTRAP. */ -- send_sig(SIGTRAP, current, 0); -+ if (is_swbp > 0) { -+ /* No matching uprobe; signal SIGTRAP. */ -+ send_sig(SIGTRAP, current, 0); -+ } else { -+ /* -+ * Either we raced with uprobe_unregister() or we can't -+ * access this memory. The latter is only possible if -+ * another thread plays with our ->mm. In both cases -+ * we can simply restart. If this vma was unmapped we -+ * can pretend this insn was not executed yet and get -+ * the (correct) SIGSEGV after restart. -+ */ -+ instruction_pointer_set(regs, bp_vaddr); -+ } - return; - } - -@@ -1620,7 +1620,6 @@ int uprobe_pre_sstep_notifier(struct pt_regs *regs) - utask->state = UTASK_BP_HIT; - - set_thread_flag(TIF_UPROBE); -- current->uprobe_srcu_id = srcu_read_lock_raw(&uprobes_srcu); - - return 1; - } -@@ -1655,7 +1654,6 @@ static int __init init_uprobes(void) - mutex_init(&uprobes_mutex[i]); - mutex_init(&uprobes_mmap_mutex[i]); - } -- init_srcu_struct(&uprobes_srcu); - - return register_die_notifier(&uprobe_exception_nb); - } diff --git a/freed-ora/current/master/vmbugon-warnon.patch b/freed-ora/current/master/vmbugon-warnon.patch new file mode 100644 index 000000000..fd8efc769 --- /dev/null +++ b/freed-ora/current/master/vmbugon-warnon.patch @@ -0,0 +1,20 @@ +diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h +index 580bd58..3d908e9 100644 +--- a/include/linux/mmdebug.h ++++ b/include/linux/mmdebug.h +@@ -2,13 +2,13 @@ + #define LINUX_MM_DEBUG_H 1 + + #ifdef CONFIG_DEBUG_VM +-#define VM_BUG_ON(cond) BUG_ON(cond) ++#define VM_BUG_ON(cond) WARN_ON(cond) + #else + #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) + #endif + + #ifdef CONFIG_DEBUG_VIRTUAL +-#define VIRTUAL_BUG_ON(cond) BUG_ON(cond) ++#define VIRTUAL_BUG_ON(cond) WARN_ON(cond) + #else + #define VIRTUAL_BUG_ON(cond) do { } while (0) + #endif diff --git a/freed-ora/current/master/vt-Drop-K_OFF-for-VC_MUTE.patch b/freed-ora/current/master/vt-Drop-K_OFF-for-VC_MUTE.patch new file mode 100644 index 000000000..e9bc4fffa --- /dev/null +++ b/freed-ora/current/master/vt-Drop-K_OFF-for-VC_MUTE.patch @@ -0,0 +1,250 @@ +Path: news.gmane.org!not-for-mail +From: Adam Jackson <ajax@redhat.com> +Newsgroups: gmane.linux.kernel +Subject: [PATCH] vt: Drop K_OFF for VC_MUTE +Date: Fri, 16 Nov 2012 13:32:34 -0500 +Lines: 205 +Approved: news@gmane.org +Message-ID: <1353090754-30233-1-git-send-email-ajax@redhat.com> +NNTP-Posting-Host: plane.gmane.org +X-Trace: ger.gmane.org 1353090772 20663 80.91.229.3 (16 Nov 2012 18:32:52 GMT) +X-Complaints-To: usenet@ger.gmane.org +NNTP-Posting-Date: Fri, 16 Nov 2012 18:32:52 +0000 (UTC) +Cc: Arthur Taylor <art@ified.ca>, + Greg Kroah-Hartman <gregkh@linuxfoundation.org> +To: linux-kernel@vger.kernel.org +Original-X-From: linux-kernel-owner@vger.kernel.org Fri Nov 16 19:33:03 2012 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@plane.gmane.org +Original-Received: from vger.kernel.org ([209.132.180.67]) + by plane.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1TZQim-0000aG-BI + for glk-linux-kernel-3@plane.gmane.org; Fri, 16 Nov 2012 19:32:56 +0100 +Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753232Ab2KPSck (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 16 Nov 2012 13:32:40 -0500 +Original-Received: from mx1.redhat.com ([209.132.183.28]:32172 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752810Ab2KPSci (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Fri, 16 Nov 2012 13:32:38 -0500 +Original-Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAGIWaM7020116 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 16 Nov 2012 13:32:36 -0500 +Original-Received: from ihatethathostname.lab.bos.redhat.com (ihatethathostname.lab.bos.redhat.com [10.16.43.238]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qAGIWZD7010099; + Fri, 16 Nov 2012 13:32:35 -0500 +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Original-Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Xref: news.gmane.org gmane.linux.kernel:1395620 +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1395620> + +The "don't enqueue stuff" semantics of K_OFF shouldn't be a function of +the keyboard map state; we should be able to switch among cooked/raw/ +unicode without changing whether events are delivered. Otherwise - if +changing to K_UNICODE undoes K_OFF - then suddenly Alt-F2 under +Gnome will switch VT instead of summoning the "run command" dialog. + +Drop the K_OFF handling and replace it with a new "mute" ioctl pair. +Anybody using K_OFF would already need to be prepared to handle it +throwing -EINVAL for old kernel compatibility, so userspace will degrade +gracefully. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=859485 +Cc: Arthur Taylor <art@ified.ca> +Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Tested-by: Josh Boyer <jwboyer@redhat.com> +Signed-off-by: Adam Jackson <ajax@redhat.com> +--- + drivers/tty/vt/keyboard.c | 40 +++++++++++++++++++++++++++++++++------- + drivers/tty/vt/vt_ioctl.c | 13 +++++++++++++ + include/linux/kbd_kern.h | 6 +++--- + include/linux/vt_kern.h | 2 ++ + include/uapi/linux/kd.h | 5 +++++ + 5 files changed, 56 insertions(+), 10 deletions(-) + +diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c +index 681765b..08d1d57 100644 +--- a/drivers/tty/vt/keyboard.c ++++ b/drivers/tty/vt/keyboard.c +@@ -657,7 +657,7 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag) + return; + if ((kbd->kbdmode == VC_RAW || + kbd->kbdmode == VC_MEDIUMRAW || +- kbd->kbdmode == VC_OFF) && ++ vc_kbd_mode(kbd, VC_MUTE)) && + value != KVAL(K_SAK)) + return; /* SAK is allowed even in raw mode */ + fn_handler[value](vc); +@@ -1381,7 +1381,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) + if (rc == NOTIFY_STOP) + return; + +- if ((raw_mode || kbd->kbdmode == VC_OFF) && type != KT_SPEC && type != KT_SHIFT) ++ if ((raw_mode || vc_kbd_mode(kbd, VC_MUTE)) && type != KT_SPEC && type != KT_SHIFT) + return; + + (*k_handler[type])(vc, keysym & 0xff, !down); +@@ -1731,9 +1731,6 @@ int vt_do_kdskbmode(int console, unsigned int arg) + kbd->kbdmode = VC_UNICODE; + do_compute_shiftstate(); + break; +- case K_OFF: +- kbd->kbdmode = VC_OFF; +- break; + default: + ret = -EINVAL; + } +@@ -1742,6 +1739,30 @@ int vt_do_kdskbmode(int console, unsigned int arg) + } + + /** ++ * vt_do_kdskbmute - set keyboard event mute ++ * @console: the console to use ++ * @arg: the requested mode ++ * ++ * Update the keyboard mute state while holding the correct locks. ++ * Return 0 for success or an error code. ++ */ ++int vt_do_kdskbmute(int console, unsigned int arg) ++{ ++ struct kbd_struct * kbd = kbd_table + console; ++ int ret = 0; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&kbd_event_lock, flags); ++ if (arg) ++ set_vc_kbd_mode(kbd, VC_MUTE); ++ else ++ clr_vc_kbd_mode(kbd, VC_MUTE); ++ spin_unlock_irqrestore(&kbd_event_lock, flags); ++ return ret; ++} ++ ++ ++/** + * vt_do_kdskbmeta - set keyboard meta state + * @console: the console to use + * @arg: the requested meta state +@@ -2068,13 +2089,18 @@ int vt_do_kdgkbmode(int console) + return K_MEDIUMRAW; + case VC_UNICODE: + return K_UNICODE; +- case VC_OFF: +- return K_OFF; + default: + return K_XLATE; + } + } + ++int vt_do_kdgkbmute(int console) ++{ ++ struct kbd_struct * kbd = kbd_table + console; ++ /* This is a spot read so needs no locking */ ++ return vc_kbd_mode(kbd, VC_MUTE); ++} ++ + /** + * vt_do_kdgkbmeta - report meta status + * @console: console to report +diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c +index b841f56..f0951e2 100644 +--- a/drivers/tty/vt/vt_ioctl.c ++++ b/drivers/tty/vt/vt_ioctl.c +@@ -477,6 +477,19 @@ int vt_ioctl(struct tty_struct *tty, + ret = put_user(uival, (int __user *)arg); + break; + ++ case KDSKBMUTE: ++ if (!perm) ++ return -EPERM; ++ ret = vt_do_kdskbmute(console, arg); ++ if (ret == 0) ++ tty_ldisc_flush(tty); ++ break; ++ ++ case KDGKBMUTE: ++ uival = vt_do_kdgkbmute(console); ++ ret = put_user(uival, (int __user *)arg); ++ break; ++ + /* this could be folded into KDSKBMODE, but for compatibility + reasons it is not so easy to fold KDGKBMETA into KDGKBMODE */ + case KDSKBMETA: +diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h +index b7c8cdc..9386143 100644 +--- a/include/linux/kbd_kern.h ++++ b/include/linux/kbd_kern.h +@@ -48,19 +48,19 @@ struct kbd_struct { + #define VC_CAPSLOCK 2 /* capslock mode */ + #define VC_KANALOCK 3 /* kanalock mode */ + +- unsigned char kbdmode:3; /* one 3-bit value */ ++ unsigned char kbdmode:2; /* one 2-bit value */ + #define VC_XLATE 0 /* translate keycodes using keymap */ + #define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */ + #define VC_RAW 2 /* raw (scancode) mode */ + #define VC_UNICODE 3 /* Unicode mode */ +-#define VC_OFF 4 /* disabled mode */ + +- unsigned char modeflags:5; ++ unsigned char modeflags:6; + #define VC_APPLIC 0 /* application key mode */ + #define VC_CKMODE 1 /* cursor key mode */ + #define VC_REPEAT 2 /* keyboard repeat */ + #define VC_CRLF 3 /* 0 - enter sends CR, 1 - enter sends CRLF */ + #define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */ ++#define VC_MUTE 5 /* don't generate events */ + }; + + extern int kbd_init(void); +diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h +index 50ae7d0..a886915 100644 +--- a/include/linux/vt_kern.h ++++ b/include/linux/vt_kern.h +@@ -168,6 +168,7 @@ extern void hide_boot_cursor(bool hide); + + /* keyboard provided interfaces */ + extern int vt_do_diacrit(unsigned int cmd, void __user *up, int eperm); ++extern int vt_do_kdskbmute(int console, unsigned int arg); + extern int vt_do_kdskbmode(int console, unsigned int arg); + extern int vt_do_kdskbmeta(int console, unsigned int arg); + extern int vt_do_kbkeycode_ioctl(int cmd, struct kbkeycode __user *user_kbkc, +@@ -177,6 +178,7 @@ extern int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, + extern int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, + int perm); + extern int vt_do_kdskled(int console, int cmd, unsigned long arg, int perm); ++extern int vt_do_kdgkbmute(int console); + extern int vt_do_kdgkbmode(int console); + extern int vt_do_kdgkbmeta(int console); + extern void vt_reset_unicode(int console); +diff --git a/include/uapi/linux/kd.h b/include/uapi/linux/kd.h +index 87b7cc4..c3de63c 100644 +--- a/include/uapi/linux/kd.h ++++ b/include/uapi/linux/kd.h +@@ -81,6 +81,7 @@ struct unimapinit { + #define K_XLATE 0x01 + #define K_MEDIUMRAW 0x02 + #define K_UNICODE 0x03 ++/* K_OFF is no longer implemented, but preserved for source compatibility */ + #define K_OFF 0x04 + #define KDGKBMODE 0x4B44 /* gets current keyboard mode */ + #define KDSKBMODE 0x4B45 /* sets current keyboard mode */ +@@ -150,6 +151,10 @@ struct kbd_repeat { + /* earlier this field was misnamed "rate" */ + }; + ++/* get/set event mute */ ++#define KDGKBMUTE 0x4B50 ++#define KDSKBMUTE 0x4B51 ++ + #define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate; + * actually used values are returned */ + +-- +1.7.11.7 + diff --git a/freed-ora/current/master/x509.genkey b/freed-ora/current/master/x509.genkey new file mode 100644 index 000000000..2f90e1bce --- /dev/null +++ b/freed-ora/current/master/x509.genkey @@ -0,0 +1,16 @@ +[ req ] +default_bits = 4096 +distinguished_name = req_distinguished_name +prompt = no +x509_extensions = myexts + +[ req_distinguished_name ] +O = Fedora +CN = Fedora kernel signing key +emailAddress = kernel-team@fedoraproject.org + +[ myexts ] +basicConstraints=critical,CA:FALSE +keyUsage=digitalSignature +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid |