diff --git a/Documentation/devicetree/bindings/thermal/qti-ddr-cdev.txt b/Documentation/devicetree/bindings/thermal/qti-ddr-cdev.txt new file mode 100644 index 000000000000..14228543615e --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/qti-ddr-cdev.txt @@ -0,0 +1,65 @@ +QTI DDR cooling device. + +The DDR cooling device will be used to place a DDR frequency vote. This +cooling device will be used in those cases where all the subsystem's are +thermally throttled and DDR has to be operated with a minimum performance +level. This cooling device vote can ensure the same. + +Properties: +- compatible: + Usage: required + Value type: + Definition: should be "qcom,ddr-cooling-device". + +Bus Scaling Data: +- qcom,msm-bus,name: + Usage: required + Value type: + Definition: String describing DDR cooling device client. It is defined + at Documentation/devicetree/bindings/arm/msm/msm_bus.txt. +- qcom,msm-bus,num-cases: + Usage: required + Value type: + Definition: This is the number of Bus Scaling use cases + defined in the vectors property. This must be set to more than + one for DDR cooling device based on different levels of DDR + frequency cooling support required. The use-case0 always should + be a vote to take off DDR cdev votes from the system. It is + defined at Documentation/devicetree/bindings/arm/msm/msm_bus.txt. +- qcom,msm-bus,active-only: + Usage: optional + Value type: + Definition: A boolean flag indicating if it is active only + bandwidth vote. It is defined at + Documentation/devicetree/bindings/arm/msm/msm_bus.txt. +- qcom,msm-bus,num-paths: + Usage: required + Value type: + Definition: This represents total number of master-slave pairs for + different usecases. It is defined at + Documentation/devicetree/bindings/arm/msm/msm_bus.txt. +- qcom,msm-bus,vectors-KBps: + Usage: required + Value type: + Definition: A series of 4 cell properties, with a format of + (src, dst, ab, ib). It is defined at + Documentation/devicetree/bindings/arm/msm/msm_bus.txt. + +Cooling Device Property: +- #cooling-cells: + Usage: required + Value type: + Definition: Must be 2. Needed for of_thermal as cooling device + identifier. Please refer to + for more + details. +Example: + qcom,ddr-cdev { + compatible = "qcom,ddr-cooling-device"; + qcom,msm-bus,name = "ddr-cdev"; + qcom,msm-bus,num-cases = <2>; + qcom,msm-bus,num-paths = <1>; + qcom,msm-bus,vectors-KBps = <1 512 0 0>, + <1 512 0 366000>; + #cooling-cells = <2>; + }; diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 559416c2034b..7fd7e8419c7f 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -678,8 +678,7 @@ allowed to execute. perf_event_paranoid: Controls use of the performance events system by unprivileged -users (without CAP_SYS_ADMIN). The default value is 3 if -CONFIG_SECURITY_PERF_EVENTS_RESTRICT is set, or 2 otherwise. +users (without CAP_SYS_ADMIN). The default value is 2. -1: Allow use of (almost) all events by all users Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK @@ -687,7 +686,6 @@ CONFIG_SECURITY_PERF_EVENTS_RESTRICT is set, or 2 otherwise. Disallow raw tracepoint access by users without CAP_SYS_ADMIN >=1: Disallow CPU event access by users without CAP_SYS_ADMIN >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN ->=3: Disallow all event access by users without CAP_SYS_ADMIN ============================================================== diff --git a/arch/arm/configs/vendor/mdm9607-128mb-perf_defconfig b/arch/arm/configs/vendor/mdm9607-128mb-perf_defconfig index d64f35cee387..364d7698d1b6 100644 --- a/arch/arm/configs/vendor/mdm9607-128mb-perf_defconfig +++ b/arch/arm/configs/vendor/mdm9607-128mb-perf_defconfig @@ -184,6 +184,7 @@ CONFIG_THERMAL_GOV_LOW_LIMITS=y CONFIG_CPU_THERMAL=y CONFIG_QTI_QMI_COOLING_DEVICE=y CONFIG_REGULATOR_COOLING_DEVICE=y +CONFIG_QTI_BUS_SCALING_COOLING_DEVICE=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_CPR=y CONFIG_REGULATOR_MEM_ACC=y diff --git a/arch/arm/configs/vendor/mdm9607-perf_defconfig b/arch/arm/configs/vendor/mdm9607-perf_defconfig index 7d244418a32e..89341248adff 100644 --- a/arch/arm/configs/vendor/mdm9607-perf_defconfig +++ b/arch/arm/configs/vendor/mdm9607-perf_defconfig @@ -215,6 +215,7 @@ CONFIG_THERMAL_TSENS=y CONFIG_QTI_QMI_COOLING_DEVICE=y CONFIG_REGULATOR_COOLING_DEVICE=y CONFIG_QTI_ADC_TM=y +CONFIG_QTI_BUS_SCALING_COOLING_DEVICE=y CONFIG_MFD_SPMI_PMIC=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_CPR=y diff --git a/arch/arm/configs/vendor/mdm9607_defconfig b/arch/arm/configs/vendor/mdm9607_defconfig index f69cdeb193ef..eb5e91ad4f1e 100644 --- a/arch/arm/configs/vendor/mdm9607_defconfig +++ b/arch/arm/configs/vendor/mdm9607_defconfig @@ -219,6 +219,7 @@ CONFIG_THERMAL_TSENS=y CONFIG_QTI_QMI_COOLING_DEVICE=y CONFIG_REGULATOR_COOLING_DEVICE=y CONFIG_QTI_ADC_TM=y +CONFIG_QTI_BUS_SCALING_COOLING_DEVICE=y CONFIG_MFD_SPMI_PMIC=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_CPR=y diff --git a/arch/arm/configs/vendor/qcs403-perf_defconfig b/arch/arm/configs/vendor/qcs403-perf_defconfig index 971d53d323b3..4563c4d6c6e1 100644 --- a/arch/arm/configs/vendor/qcs403-perf_defconfig +++ b/arch/arm/configs/vendor/qcs403-perf_defconfig @@ -351,7 +351,6 @@ CONFIG_PANIC_ON_OOPS=y CONFIG_PANIC_TIMEOUT=5 CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm/configs/vendor/qcs403_defconfig b/arch/arm/configs/vendor/qcs403_defconfig index 48a2bcc44225..67b5cf4ccc1e 100644 --- a/arch/arm/configs/vendor/qcs403_defconfig +++ b/arch/arm/configs/vendor/qcs403_defconfig @@ -561,7 +561,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm/configs/vendor/qcs405-perf_defconfig b/arch/arm/configs/vendor/qcs405-perf_defconfig index c6940696defa..ab1b4283189b 100644 --- a/arch/arm/configs/vendor/qcs405-perf_defconfig +++ b/arch/arm/configs/vendor/qcs405-perf_defconfig @@ -351,7 +351,6 @@ CONFIG_PANIC_ON_OOPS=y CONFIG_PANIC_TIMEOUT=5 CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm/configs/vendor/qcs405_defconfig b/arch/arm/configs/vendor/qcs405_defconfig index e88d885441e0..755bcd1424da 100644 --- a/arch/arm/configs/vendor/qcs405_defconfig +++ b/arch/arm/configs/vendor/qcs405_defconfig @@ -561,7 +561,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm/configs/vendor/sa515m-perf_defconfig b/arch/arm/configs/vendor/sa515m-perf_defconfig index f45e1a990e7f..906061337081 100644 --- a/arch/arm/configs/vendor/sa515m-perf_defconfig +++ b/arch/arm/configs/vendor/sa515m-perf_defconfig @@ -472,7 +472,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK_XFRM=y diff --git a/arch/arm/configs/vendor/sa515m_defconfig b/arch/arm/configs/vendor/sa515m_defconfig index b6d9ef528291..9400998fd2a6 100644 --- a/arch/arm/configs/vendor/sa515m_defconfig +++ b/arch/arm/configs/vendor/sa515m_defconfig @@ -496,7 +496,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK_XFRM=y diff --git a/arch/arm/configs/vendor/sdm429-bg-perf_defconfig b/arch/arm/configs/vendor/sdm429-bg-perf_defconfig index a39dba8448ef..ca033da861da 100644 --- a/arch/arm/configs/vendor/sdm429-bg-perf_defconfig +++ b/arch/arm/configs/vendor/sdm429-bg-perf_defconfig @@ -613,7 +613,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_SECURITY_SELINUX=y diff --git a/arch/arm/configs/vendor/sdm429-bg_defconfig b/arch/arm/configs/vendor/sdm429-bg_defconfig index 242168fda63a..8bc9db3d82a1 100644 --- a/arch/arm/configs/vendor/sdm429-bg_defconfig +++ b/arch/arm/configs/vendor/sdm429-bg_defconfig @@ -684,7 +684,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm/configs/vendor/sdxprairie-perf_defconfig b/arch/arm/configs/vendor/sdxprairie-perf_defconfig index 1a298e1b24d2..60d6e81a0c71 100644 --- a/arch/arm/configs/vendor/sdxprairie-perf_defconfig +++ b/arch/arm/configs/vendor/sdxprairie-perf_defconfig @@ -462,7 +462,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK_XFRM=y diff --git a/arch/arm/configs/vendor/sdxprairie_defconfig b/arch/arm/configs/vendor/sdxprairie_defconfig index 5f1f1cf780ae..1a73dc1bda4d 100644 --- a/arch/arm/configs/vendor/sdxprairie_defconfig +++ b/arch/arm/configs/vendor/sdxprairie_defconfig @@ -495,7 +495,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK_XFRM=y diff --git a/arch/arm/configs/vendor/trinket-perf_defconfig b/arch/arm/configs/vendor/trinket-perf_defconfig index d50f0e7098f1..b2981e099d97 100644 --- a/arch/arm/configs/vendor/trinket-perf_defconfig +++ b/arch/arm/configs/vendor/trinket-perf_defconfig @@ -649,7 +649,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_SECURITY_SELINUX=y diff --git a/arch/arm/configs/vendor/trinket_defconfig b/arch/arm/configs/vendor/trinket_defconfig index c941cc9f033c..c817111a1eb6 100644 --- a/arch/arm/configs/vendor/trinket_defconfig +++ b/arch/arm/configs/vendor/trinket_defconfig @@ -729,7 +729,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/boot/dts/qcom/mdm9607-thermal.dtsi b/arch/arm64/boot/dts/qcom/mdm9607-thermal.dtsi index 6313e3cfbce1..4d5074578ac4 100644 --- a/arch/arm64/boot/dts/qcom/mdm9607-thermal.dtsi +++ b/arch/arm64/boot/dts/qcom/mdm9607-thermal.dtsi @@ -40,6 +40,16 @@ }; }; }; + + ddr_cdev: qcom,ddr-cdev { + compatible = "qcom,ddr-cooling-device"; + qcom,msm-bus,name = "ddr-cdev"; + qcom,msm-bus,num-cases = <2>; + qcom,msm-bus,num-paths = <1>; + qcom,msm-bus,vectors-KBps = <1 512 0 0>, + <1 512 0 366000>; + #cooling-cells = <2>; + }; }; &thermal_zones { @@ -174,6 +184,12 @@ thermal-governor = "step_wise"; wake-capable-sensor; trips { + cdev_trip: cdev-trip { + temperature = <78000>; + hysteresis = <8000>; + type = "passive"; + }; + modem_pa_trip0: modem_pa_trip0 { temperature = <95000>; hysteresis = <5000>; @@ -202,6 +218,11 @@ }; cooling-maps { + ddr_cdev0 { + trip = <&cdev_trip>; + cooling-device = <&ddr_cdev 1 1>; + }; + modem_pa0_cdev { trip = <&modem_pa_trip0>; cooling-device = <&modem_pa 1 1>; diff --git a/arch/arm64/configs/cuttlefish_defconfig b/arch/arm64/configs/cuttlefish_defconfig index b753e71e4bd8..8c1f849bcb4f 100644 --- a/arch/arm64/configs/cuttlefish_defconfig +++ b/arch/arm64/configs/cuttlefish_defconfig @@ -470,7 +470,6 @@ CONFIG_SCHEDSTATS=y CONFIG_DEBUG_LIST=y CONFIG_RCU_CPU_STALL_TIMEOUT=60 CONFIG_ENABLE_DEFAULT_TRACERS=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_TEST_MEMINIT=y CONFIG_TEST_STACKINIT=y CONFIG_SECURITY=y diff --git a/arch/arm64/configs/vendor/atoll-perf_defconfig b/arch/arm64/configs/vendor/atoll-perf_defconfig index 43f173b37fa2..3725488ba327 100644 --- a/arch/arm64/configs/vendor/atoll-perf_defconfig +++ b/arch/arm64/configs/vendor/atoll-perf_defconfig @@ -725,7 +725,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/atoll_defconfig b/arch/arm64/configs/vendor/atoll_defconfig index a41b458f2876..2a26b60748e5 100644 --- a/arch/arm64/configs/vendor/atoll_defconfig +++ b/arch/arm64/configs/vendor/atoll_defconfig @@ -810,7 +810,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/gen3auto-capture_defconfig b/arch/arm64/configs/vendor/gen3auto-capture_defconfig index a7090ced2af3..ea1fc76036a5 100644 --- a/arch/arm64/configs/vendor/gen3auto-capture_defconfig +++ b/arch/arm64/configs/vendor/gen3auto-capture_defconfig @@ -713,7 +713,6 @@ CONFIG_TEST_USER_COPY=m CONFIG_MEMTEST=y CONFIG_BUG_ON_DATA_CORRUPTION=y CONFIG_ARM64_STRICT_BREAK_BEFORE_MAKE=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/gen3auto-perf_defconfig b/arch/arm64/configs/vendor/gen3auto-perf_defconfig index 2b6d31b62d11..3b12c0b32ab5 100644 --- a/arch/arm64/configs/vendor/gen3auto-perf_defconfig +++ b/arch/arm64/configs/vendor/gen3auto-perf_defconfig @@ -649,7 +649,6 @@ CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_PREEMPT is not set CONFIG_IPC_LOGGING=y CONFIG_DEBUG_ALIGN_RODATA=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/gen3auto_defconfig b/arch/arm64/configs/vendor/gen3auto_defconfig index e5ceb314d7c3..f565f54b18cd 100644 --- a/arch/arm64/configs/vendor/gen3auto_defconfig +++ b/arch/arm64/configs/vendor/gen3auto_defconfig @@ -750,7 +750,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/qcs403-perf_defconfig b/arch/arm64/configs/vendor/qcs403-perf_defconfig index c30b99e11678..88d2cc28e36c 100644 --- a/arch/arm64/configs/vendor/qcs403-perf_defconfig +++ b/arch/arm64/configs/vendor/qcs403-perf_defconfig @@ -535,7 +535,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/qcs403_defconfig b/arch/arm64/configs/vendor/qcs403_defconfig index 4d1ebdb00b84..487a82c33f22 100644 --- a/arch/arm64/configs/vendor/qcs403_defconfig +++ b/arch/arm64/configs/vendor/qcs403_defconfig @@ -585,7 +585,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/qcs405-perf_defconfig b/arch/arm64/configs/vendor/qcs405-perf_defconfig index cea1b6be7111..ef3c9ea62ab7 100644 --- a/arch/arm64/configs/vendor/qcs405-perf_defconfig +++ b/arch/arm64/configs/vendor/qcs405-perf_defconfig @@ -539,7 +539,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_HARDENED_USERCOPY=y diff --git a/arch/arm64/configs/vendor/qcs405_defconfig b/arch/arm64/configs/vendor/qcs405_defconfig index ad4bfcca98ee..8fe0a34ca212 100644 --- a/arch/arm64/configs/vendor/qcs405_defconfig +++ b/arch/arm64/configs/vendor/qcs405_defconfig @@ -588,7 +588,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_HARDENED_USERCOPY=y diff --git a/arch/arm64/configs/vendor/qcs610-minimal-perf_defconfig b/arch/arm64/configs/vendor/qcs610-minimal-perf_defconfig index ae508a225e02..77982bcbdd96 100644 --- a/arch/arm64/configs/vendor/qcs610-minimal-perf_defconfig +++ b/arch/arm64/configs/vendor/qcs610-minimal-perf_defconfig @@ -595,7 +595,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_HARDENED_USERCOPY=y diff --git a/arch/arm64/configs/vendor/sa2150p-nand-perf_defconfig b/arch/arm64/configs/vendor/sa2150p-nand-perf_defconfig index 541675328ea6..7f69a1bc3ccb 100644 --- a/arch/arm64/configs/vendor/sa2150p-nand-perf_defconfig +++ b/arch/arm64/configs/vendor/sa2150p-nand-perf_defconfig @@ -478,7 +478,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/sa2150p-nand_defconfig b/arch/arm64/configs/vendor/sa2150p-nand_defconfig index 637543955dca..997249ec14fc 100644 --- a/arch/arm64/configs/vendor/sa2150p-nand_defconfig +++ b/arch/arm64/configs/vendor/sa2150p-nand_defconfig @@ -479,7 +479,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/sa2150p-perf_defconfig b/arch/arm64/configs/vendor/sa2150p-perf_defconfig index e0eab7c0dbd7..53b0002aca48 100644 --- a/arch/arm64/configs/vendor/sa2150p-perf_defconfig +++ b/arch/arm64/configs/vendor/sa2150p-perf_defconfig @@ -490,7 +490,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/sa2150p_defconfig b/arch/arm64/configs/vendor/sa2150p_defconfig index 351559aaa7e4..6430a186601c 100644 --- a/arch/arm64/configs/vendor/sa2150p_defconfig +++ b/arch/arm64/configs/vendor/sa2150p_defconfig @@ -491,7 +491,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_LSM_MMAP_MIN_ADDR=4096 diff --git a/arch/arm64/configs/vendor/sa8155-perf_defconfig b/arch/arm64/configs/vendor/sa8155-perf_defconfig index a8dd5c765037..696a3cca5cc4 100644 --- a/arch/arm64/configs/vendor/sa8155-perf_defconfig +++ b/arch/arm64/configs/vendor/sa8155-perf_defconfig @@ -639,7 +639,6 @@ CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_PREEMPT is not set CONFIG_IPC_LOGGING=y CONFIG_DEBUG_ALIGN_RODATA=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/sa8155_defconfig b/arch/arm64/configs/vendor/sa8155_defconfig index 8e70cf7f02bc..62a6a1af41c8 100644 --- a/arch/arm64/configs/vendor/sa8155_defconfig +++ b/arch/arm64/configs/vendor/sa8155_defconfig @@ -737,7 +737,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/sdm660-perf_defconfig b/arch/arm64/configs/vendor/sdm660-perf_defconfig index 699621a225bb..a31fb6ceccd1 100644 --- a/arch/arm64/configs/vendor/sdm660-perf_defconfig +++ b/arch/arm64/configs/vendor/sdm660-perf_defconfig @@ -670,7 +670,6 @@ CONFIG_CORESIGHT_TPDM=y CONFIG_CORESIGHT_QPDI=y CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/sdm660_defconfig b/arch/arm64/configs/vendor/sdm660_defconfig index 901b1c3b70a7..e017eb599f53 100644 --- a/arch/arm64/configs/vendor/sdm660_defconfig +++ b/arch/arm64/configs/vendor/sdm660_defconfig @@ -759,7 +759,6 @@ CONFIG_CORESIGHT_HWEVENT=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/sdmshrike-perf_defconfig b/arch/arm64/configs/vendor/sdmshrike-perf_defconfig index 1e73e5fb6c3a..84a90bc3c4b2 100644 --- a/arch/arm64/configs/vendor/sdmshrike-perf_defconfig +++ b/arch/arm64/configs/vendor/sdmshrike-perf_defconfig @@ -651,7 +651,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_SECURITY_SELINUX=y diff --git a/arch/arm64/configs/vendor/sdmshrike_defconfig b/arch/arm64/configs/vendor/sdmshrike_defconfig index 992d47e11b84..22c6017185d9 100644 --- a/arch/arm64/configs/vendor/sdmshrike_defconfig +++ b/arch/arm64/configs/vendor/sdmshrike_defconfig @@ -723,7 +723,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_SECURITY_SELINUX=y diff --git a/arch/arm64/configs/vendor/sdmsteppe-auto-perf_defconfig b/arch/arm64/configs/vendor/sdmsteppe-auto-perf_defconfig index 5bdacdb1a0ec..42dd45c4119c 100644 --- a/arch/arm64/configs/vendor/sdmsteppe-auto-perf_defconfig +++ b/arch/arm64/configs/vendor/sdmsteppe-auto-perf_defconfig @@ -676,7 +676,6 @@ CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_PREEMPT is not set CONFIG_IPC_LOGGING=y CONFIG_DEBUG_ALIGN_RODATA=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/sdmsteppe-auto_defconfig b/arch/arm64/configs/vendor/sdmsteppe-auto_defconfig index fa9deae98f42..0b12db0fb847 100644 --- a/arch/arm64/configs/vendor/sdmsteppe-auto_defconfig +++ b/arch/arm64/configs/vendor/sdmsteppe-auto_defconfig @@ -786,7 +786,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/sdmsteppe-perf_defconfig b/arch/arm64/configs/vendor/sdmsteppe-perf_defconfig index 91e6a3e337d7..f0d00e44ff7d 100644 --- a/arch/arm64/configs/vendor/sdmsteppe-perf_defconfig +++ b/arch/arm64/configs/vendor/sdmsteppe-perf_defconfig @@ -703,7 +703,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/sdmsteppe_defconfig b/arch/arm64/configs/vendor/sdmsteppe_defconfig index 9166e37e6202..48dbf00e09b1 100644 --- a/arch/arm64/configs/vendor/sdmsteppe_defconfig +++ b/arch/arm64/configs/vendor/sdmsteppe_defconfig @@ -795,7 +795,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/sm8150-perf_defconfig b/arch/arm64/configs/vendor/sm8150-perf_defconfig index b09131f55f94..1b40639ad3de 100644 --- a/arch/arm64/configs/vendor/sm8150-perf_defconfig +++ b/arch/arm64/configs/vendor/sm8150-perf_defconfig @@ -711,7 +711,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/sm8150_defconfig b/arch/arm64/configs/vendor/sm8150_defconfig index b29c7fa37aa8..cc15e6f139d6 100644 --- a/arch/arm64/configs/vendor/sm8150_defconfig +++ b/arch/arm64/configs/vendor/sm8150_defconfig @@ -795,7 +795,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/arm64/configs/vendor/trinket-perf_defconfig b/arch/arm64/configs/vendor/trinket-perf_defconfig index bf10f7e5461e..14bfcefa3772 100644 --- a/arch/arm64/configs/vendor/trinket-perf_defconfig +++ b/arch/arm64/configs/vendor/trinket-perf_defconfig @@ -689,7 +689,6 @@ CONFIG_CORESIGHT_DUMMY=y CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_FORTIFY_SOURCE=y diff --git a/arch/arm64/configs/vendor/trinket_defconfig b/arch/arm64/configs/vendor/trinket_defconfig index 456b1e7520be..a529ba57fcf1 100644 --- a/arch/arm64/configs/vendor/trinket_defconfig +++ b/arch/arm64/configs/vendor/trinket_defconfig @@ -774,7 +774,6 @@ CONFIG_CORESIGHT_REMOTE_ETM=y CONFIG_CORESIGHT_REMOTE_ETM_DEFAULT_ENABLE=0 CONFIG_CORESIGHT_TGU=y CONFIG_CORESIGHT_EVENT=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_PAGESPAN=y diff --git a/arch/x86/configs/x86_64_cuttlefish_defconfig b/arch/x86/configs/x86_64_cuttlefish_defconfig index a108576ac594..d4294036b8df 100644 --- a/arch/x86/configs/x86_64_cuttlefish_defconfig +++ b/arch/x86/configs/x86_64_cuttlefish_defconfig @@ -504,7 +504,6 @@ CONFIG_TEST_STACKINIT=y CONFIG_IO_DELAY_NONE=y CONFIG_OPTIMIZE_INLINING=y CONFIG_UNWINDER_FRAME_POINTER=y -CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_PATH=y diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b8ada634c977..aff716a9ff10 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -90,7 +90,7 @@ EXPORT_SYMBOL_GPL(hid_register_report); * Register a new field for this report. */ -static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values) +static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages) { struct hid_field *field; @@ -101,7 +101,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned field = kzalloc((sizeof(struct hid_field) + usages * sizeof(struct hid_usage) + - values * sizeof(unsigned)), GFP_KERNEL); + usages * sizeof(unsigned)), GFP_KERNEL); if (!field) return NULL; @@ -280,7 +280,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign usages = max_t(unsigned, parser->local.usage_index, parser->global.report_count); - field = hid_register_field(report, usages, parser->global.report_count); + field = hid_register_field(report, usages); if (!field) return 0; diff --git a/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c index e3b5bb3d8902..c27aad7ef557 100644 --- a/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +++ b/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1462,6 +1462,8 @@ static int cam_icp_hw_mgr_create_debugfs_entry(void) goto err; } + /* Set default hang dump lvl */ + icp_hw_mgr.a5_fw_dump_lvl = HFI_FW_DUMP_ON_FAILURE; return rc; err: debugfs_remove_recursive(icp_hw_mgr.dentry); diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c index a7f9c1bfdde5..e164c2ff8247 100644 --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c @@ -808,9 +808,20 @@ static int wil_check_amsdu(struct wil6210_priv *wil, void *msg, int cid, switch (vif->wdev.iftype) { case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT: + /* check if the MSDU (a sub-frame of AMSDU) is multicast */ if (is_multicast_ether_addr(da)) return 0; + /* check if the current AMSDU (MPDU) frame is a multicast. + * If so we have unicast sub frame as part of a multicast + * AMSDU. Current frame and all sub frames should be dropped. + */ + if (wil_rx_status_get_mcast(msg)) { + wil_dbg_txrx(wil, + "Found unicast sub frame in a multicast mpdu. Drop it\n"); + goto out; + } + /* On client side, DA should be the client mac address */ ndev = vif_to_ndev(vif); if (ether_addr_equal(ndev->dev_addr, da)) @@ -831,12 +842,13 @@ static int wil_check_amsdu(struct wil6210_priv *wil, void *msg, int cid, return 0; } +out: sta->amsdu_drop_sn = seq; sta->amsdu_drop_tid = tid; sta->amsdu_drop = 1; wil_dbg_txrx(wil, - "Drop AMSDU frame, sn=%d. Drop this and all next sub frames\n", - seq); + "Drop AMSDU frame, sn=%d tid=%d. Drop this and all next sub frames\n", + seq, tid); return -EAGAIN; } diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.h b/drivers/net/wireless/ath/wil6210/txrx_edma.h index de0688265959..5328972b02ed 100644 --- a/drivers/net/wireless/ath/wil6210/txrx_edma.h +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.h @@ -378,7 +378,7 @@ static inline u16 wil_rx_status_get_flow_id(void *msg) static inline u8 wil_rx_status_get_mcast(void *msg) { return WIL_GET_BITS(((struct wil_rx_status_compressed *)msg)->d0, - 26, 26); + 25, 26); } /** diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 7ee304336e91..587042d06d4a 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -584,6 +584,13 @@ static int ipa3_send_pdn_config_msg(unsigned long usr_param) msg_meta.msg_type = pdn_info->pdn_cfg_type; + if ((pdn_info->pdn_cfg_type < IPA_PDN_DEFAULT_MODE_CONFIG) || + (pdn_info->pdn_cfg_type >= IPA_PDN_CONFIG_EVENT_MAX)) { + IPAERR_RL("invalid pdn_cfg_type =%d", pdn_info->pdn_cfg_type); + kfree(pdn_info); + return -EINVAL; + } + IPADBG("type %d, interface name: %s, enable:%d\n", msg_meta.msg_type, pdn_info->dev_name, pdn_info->enable); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c index 266734f4ba9f..3701173d7f65 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1587,7 +1587,7 @@ static void ipa3_q6_clnt_svc_arrive(struct work_struct *work) /* Initialize modem IPA-driver */ IPAWANDBG("send ipa3_qmi_init_modem_send_sync_msg to modem\n"); rc = ipa3_qmi_init_modem_send_sync_msg(); - if ((rc == -ENETRESET) || (rc == -ENODEV)) { + if ((rc == -ENETRESET) || (rc == -ENODEV) || (rc == -ECONNRESET)) { IPAWANERR( "ipa3_qmi_init_modem_send_sync_msg failed due to SSR!\n"); /* Cleanup when ipa3_wwan_remove is called */ diff --git a/drivers/soc/qcom/msm_minidump.c b/drivers/soc/qcom/msm_minidump.c index 38843f760c2e..acd3d71a7a28 100644 --- a/drivers/soc/qcom/msm_minidump.c +++ b/drivers/soc/qcom/msm_minidump.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017,2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -172,6 +172,7 @@ EXPORT_SYMBOL(msm_minidump_enabled); int msm_minidump_add_region(const struct md_region *entry) { u32 entries; + u32 toc_init; struct md_region *mdr; int ret = 0; @@ -197,6 +198,19 @@ int msm_minidump_add_region(const struct md_region *entry) return -ENOMEM; } + toc_init = 0; + if (minidump_table.md_ss_toc && + (minidump_table.md_ss_toc->md_ss_enable_status == + MD_SS_ENABLED)) { + toc_init = 1; + if (minidump_table.md_ss_toc->ss_region_count >= + MAX_NUM_ENTRIES) { + spin_unlock(&mdt_lock); + pr_err("Maximum regions in minidump table reached.\n"); + return -ENOMEM; + } + } + mdr = &minidump_table.entry[entries]; strlcpy(mdr->name, entry->name, sizeof(mdr->name)); mdr->virt_addr = entry->virt_addr; @@ -206,9 +220,7 @@ int msm_minidump_add_region(const struct md_region *entry) minidump_table.num_regions = entries + 1; - if (minidump_table.md_ss_toc && - (minidump_table.md_ss_toc->md_ss_enable_status == - MD_SS_ENABLED)) + if (toc_init) md_update_ss_toc(entry); else pendings++; diff --git a/drivers/thermal/qcom/Kconfig b/drivers/thermal/qcom/Kconfig index 0efbe21ca006..611a93acafc7 100644 --- a/drivers/thermal/qcom/Kconfig +++ b/drivers/thermal/qcom/Kconfig @@ -134,3 +134,12 @@ config QTI_RPM_SMD_COOLING_DEVICE railway at predefined voltage corner using RPM hardware. If you want this support, you should say Y here. + +config QTI_BUS_SCALING_COOLING_DEVICE + tristate "QTI DDR bus scaling cooling device driver" + depends on THERMAL_OF && QCOM_BUS_SCALING + help + This enables the QTI DDR bus scaling cooling devices. These cooling + devices will be used by QTI chipset to place a DDR state request + to meet the performance requirement under thermally constrained + conditions. diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile index 87e4a8694940..cf50284a749e 100644 --- a/drivers/thermal/qcom/Makefile +++ b/drivers/thermal/qcom/Makefile @@ -12,3 +12,4 @@ obj-$(CONFIG_QTI_BCL_SOC_DRIVER) += bcl_soc.o obj-$(CONFIG_QTI_ADC_TM) += adc-tm.o adc-tm-common.o adc-tm5.o obj-$(CONFIG_QTI_CX_IPEAK_COOLING_DEVICE) += cx_ipeak_cdev.o obj-$(CONFIG_QTI_RPM_SMD_COOLING_DEVICE) += rpm_smd_cooling_device.o +obj-$(CONFIG_QTI_BUS_SCALING_COOLING_DEVICE) += qti_bus_scaling_cdev.o diff --git a/drivers/thermal/qcom/qti_bus_scaling_cdev.c b/drivers/thermal/qcom/qti_bus_scaling_cdev.c new file mode 100644 index 000000000000..c014a72c5fcb --- /dev/null +++ b/drivers/thermal/qcom/qti_bus_scaling_cdev.c @@ -0,0 +1,227 @@ +/* Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * 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. + */ + +#define pr_fmt(fmt) "%s:%s " fmt, KBUILD_MODNAME, __func__ + +#include +#include +#include +#include +#include + +#define DDR_CDEV_NAME "ddr-bus-scaling-cdev" + +struct ddr_cdev { + uint32_t cur_state; + uint32_t max_state; + uint32_t bus_clnt_handle; + struct thermal_cooling_device *cdev; + struct msm_bus_scale_pdata *ddr_bus_pdata; + struct device *dev; +}; + +/** + * ddr_set_cur_state - callback function to set the ddr state. + * @cdev: thermal cooling device pointer. + * @state: set this variable to the current cooling state. + * + * Callback for the thermal cooling device to change the + * DDR state. + * + * Return: 0 on success, an error code otherwise. + */ +static int ddr_set_cur_state(struct thermal_cooling_device *cdev, + unsigned long state) +{ + struct ddr_cdev *ddr_cdev = cdev->devdata; + int ret = 0; + + /* Request state should be less than max_level */ + if (state > ddr_cdev->max_state) + return -EINVAL; + + /* Check if the old cooling action is same as new cooling action */ + if (ddr_cdev->cur_state == state) + return 0; + + ret = msm_bus_scale_client_update_request(ddr_cdev->bus_clnt_handle, + state); + if (ret) { + dev_err(ddr_cdev->dev, + "Error placing DDR freq for idx:%d. err:%d\n", + state, ret); + return ret; + } + ddr_cdev->cur_state = state; + + dev_dbg(ddr_cdev->dev, "Requested DDR bus scaling state:%ld for %s\n", + state, ddr_cdev->cdev->type); + + return ret; +} + +/** + * ddr_get_cur_state - callback function to get the current cooling + * state. + * @cdev: thermal cooling device pointer. + * @state: fill this variable with the current cooling state. + * + * Callback for the thermal cooling device to return the + * current DDR state request. + * + * Return: 0 on success, an error code otherwise. + */ +static int ddr_get_cur_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct ddr_cdev *ddr_cdev = cdev->devdata; + *state = ddr_cdev->cur_state; + + return 0; +} + +/** + * ddr_get_max_state - callback function to get the max cooling state. + * @cdev: thermal cooling device pointer. + * @state: fill this variable with the max cooling state. + * + * Callback for the thermal cooling device to return the DDR + * max cooling state. + * + * Return: 0 on success, an error code otherwise. + */ +static int ddr_get_max_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct ddr_cdev *ddr_cdev = cdev->devdata; + *state = ddr_cdev->max_state; + + return 0; +} + +static struct thermal_cooling_device_ops ddr_cdev_ops = { + .get_max_state = ddr_get_max_state, + .get_cur_state = ddr_get_cur_state, + .set_cur_state = ddr_set_cur_state, +}; + +static int ddr_cdev_probe(struct platform_device *pdev) +{ + int ret = 0; + struct ddr_cdev *ddr_cdev = NULL; + struct device_node *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; + char cdev_name[THERMAL_NAME_LENGTH] = DDR_CDEV_NAME; + + ddr_cdev = devm_kzalloc(dev, sizeof(*ddr_cdev), GFP_KERNEL); + if (!ddr_cdev) + return -ENOMEM; + + ddr_cdev->ddr_bus_pdata = msm_bus_cl_get_pdata(pdev); + if (!ddr_cdev->ddr_bus_pdata) { + ret = -EINVAL; + dev_err(dev, "Unable to get ddr cdev bus pdata: %d\n"); + return ret; + } + + if (ddr_cdev->ddr_bus_pdata->num_usecases < 2) { + dev_err(dev, "Invalid number of ddr cdev levels, num_path:%d\n", + ddr_cdev->ddr_bus_pdata->num_usecases); + goto err_exit; + } + + ddr_cdev->bus_clnt_handle = msm_bus_scale_register_client( + ddr_cdev->ddr_bus_pdata); + if (!ddr_cdev->bus_clnt_handle) { + dev_err(dev, "%s: Failed to register ddr cdev client", + __func__); + ret = -ENXIO; + goto err_exit; + } + + ddr_cdev->cur_state = 0; + /* max_state is index */ + ddr_cdev->max_state = ddr_cdev->ddr_bus_pdata->num_usecases - 1; + ddr_cdev->dev = dev; + + /* Set initial value */ + ret = msm_bus_scale_client_update_request(ddr_cdev->bus_clnt_handle, + ddr_cdev->cur_state); + if (ret) { + dev_err(dev, "Error placing DDR freq request, index:%d err:%d\n", + ddr_cdev->cur_state, ret); + goto err_exit; + } + + ddr_cdev->cdev = thermal_of_cooling_device_register(np, cdev_name, + ddr_cdev, &ddr_cdev_ops); + if (IS_ERR(ddr_cdev->cdev)) { + ret = PTR_ERR(ddr_cdev->cdev); + dev_err(dev, "Cdev register failed for %s, ret:%d\n", + cdev_name, ret); + ddr_cdev->cdev = NULL; + goto err_exit; + } + dev_dbg(dev, "Cooling device [%s] registered.\n", cdev_name); + dev_set_drvdata(dev, ddr_cdev); + + return 0; +err_exit: + if (ddr_cdev->bus_clnt_handle) { + msm_bus_scale_unregister_client(ddr_cdev->bus_clnt_handle); + ddr_cdev->bus_clnt_handle = 0; + } + if (ddr_cdev->ddr_bus_pdata) { + msm_bus_cl_clear_pdata(ddr_cdev->ddr_bus_pdata); + ddr_cdev->ddr_bus_pdata = NULL; + } + return ret; +} + +static int ddr_cdev_remove(struct platform_device *pdev) +{ + struct ddr_cdev *ddr_cdev = + (struct ddr_cdev *)dev_get_drvdata(&pdev->dev); + + if (ddr_cdev->cdev) { + thermal_cooling_device_unregister(ddr_cdev->cdev); + ddr_cdev->cdev = NULL; + } + if (ddr_cdev->bus_clnt_handle) { + msm_bus_scale_client_update_request( + ddr_cdev->bus_clnt_handle, 0); + msm_bus_scale_unregister_client(ddr_cdev->bus_clnt_handle); + ddr_cdev->bus_clnt_handle = 0; + } + if (ddr_cdev->ddr_bus_pdata) { + msm_bus_cl_clear_pdata(ddr_cdev->ddr_bus_pdata); + ddr_cdev->ddr_bus_pdata = NULL; + } + + return 0; +} + +static const struct of_device_id ddr_cdev_match[] = { + { .compatible = "qcom,ddr-cooling-device", }, + {}, +}; + +static struct platform_driver ddr_cdev_driver = { + .probe = ddr_cdev_probe, + .remove = ddr_cdev_remove, + .driver = { + .name = KBUILD_MODNAME, + .of_match_table = ddr_cdev_match, + }, +}; +module_platform_driver(ddr_cdev_driver); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 621342fbb3b4..eae4331bb2d0 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1207,11 +1207,6 @@ int perf_event_max_stack_handler(struct ctl_table *table, int write, #define PERF_SECURITY_KERNEL 2 #define PERF_SECURITY_TRACEPOINT 3 -static inline bool perf_paranoid_any(void) -{ - return sysctl_perf_event_paranoid > 2; -} - static inline int perf_is_paranoid(void) { return sysctl_perf_event_paranoid > -1; diff --git a/kernel/events/core.c b/kernel/events/core.c index 74eba84d363b..95239257bcf9 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -430,13 +430,8 @@ static cpumask_var_t perf_online_mask; * 0 - disallow raw tracepoint access for unpriv * 1 - disallow cpu events for unpriv * 2 - disallow kernel profiling for unpriv - * 3 - disallow all unpriv perf event use */ -#ifdef CONFIG_SECURITY_PERF_EVENTS_RESTRICT -int sysctl_perf_event_paranoid __read_mostly = 3; -#else int sysctl_perf_event_paranoid __read_mostly = 2; -#endif /* Minimum for 512 kiB + 1 user control page */ int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */ @@ -10421,9 +10416,6 @@ SYSCALL_DEFINE5(perf_event_open, if (flags & ~PERF_FLAG_ALL) return -EINVAL; - if (perf_paranoid_any() && !capable(CAP_SYS_ADMIN)) - return -EACCES; - /* Do we allow access to perf_event_open(2) ? */ err = security_perf_event_open(&attr, PERF_SECURITY_OPEN); if (err) diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c index f71f0d2558fd..e0af58b6f312 100644 --- a/net/netfilter/nf_conntrack_h323_main.c +++ b/net/netfilter/nf_conntrack_h323_main.c @@ -1223,6 +1223,7 @@ static struct nf_conntrack_helper nf_conntrack_helper_q931[] __read_mostly = { { .name = "Q.931", .me = THIS_MODULE, + .data_len = sizeof(struct nf_ct_h323_master), .tuple.src.l3num = AF_INET6, .tuple.src.u.tcp.port = cpu_to_be16(Q931_PORT), .tuple.dst.protonum = IPPROTO_TCP, diff --git a/security/Kconfig b/security/Kconfig index 8b6c5e9528e0..3a66cd8363c0 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -18,15 +18,6 @@ config SECURITY_DMESG_RESTRICT If you are unsure how to answer this question, answer N. -config SECURITY_PERF_EVENTS_RESTRICT - bool "Restrict unprivileged use of performance events" - depends on PERF_EVENTS - help - If you say Y here, the kernel.perf_event_paranoid sysctl - will be set to 3 by default, and no unprivileged use of the - perf_event_open syscall will be permitted unless it is - changed. - config SECURITY bool "Enable different security models" depends on SYSFS