[PATCH v2 2/2] perf/x86/rapl: Fix the energy-pkg event for AMD CPUs

2024-05-03 Thread Dhananjay Ugwekar
After commit ("x86/cpu/topology: Add support for the AMD 0x8026 leaf"), on AMD processors that support extended CPUID leaf 0x8026, the topology_die_cpumask() and topology_logical_die_id() macros, no longer return the package cpumask and package id, instead they return the CCD (Core Comple

Re: [PATCH][next] wifi: rtlwifi: Remove unused structs and avoid multiple -Wfamnae warnings

2024-05-03 Thread Ping-Ke Shih
"Gustavo A. R. Silva" wrote: > Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > So, remove unused structs and fix the following > -Wflex-array-member-not-at-end warnings: > > drivers/net/wireless/realtek/rtlwifi/btcoexist/../wifi.h:1063:30

Re: [PATCH net-next 1/2] gve: Avoid unnecessary use of comma operator

2024-05-03 Thread Dan Carpenter
On Fri, May 03, 2024 at 09:31:26PM +0100, Simon Horman wrote: > Although it does not seem to have any untoward side-effects, > the use of ';' to separate to assignments seems more appropriate than ','. > Huh. Interesting. I wrote a check for that in Smatch. The only place where it would matter

[PATCH net-next 2/2] gve: Use ethtool_sprintf/puts() to fill stats strings

2024-05-03 Thread Simon Horman
Make use of standard helpers to simplify filling in stats strings. The first two ethtool_puts() changes address the following fortification warnings flagged by W=1 builds with clang-18. (The last ethtool_puts change does not because the warning relates to writing beyond the first element of an arr

[PATCH net-next 1/2] gve: Avoid unnecessary use of comma operator

2024-05-03 Thread Simon Horman
Although it does not seem to have any untoward side-effects, the use of ';' to separate to assignments seems more appropriate than ','. Flagged by clang-18 -Wcomma No functional change intended. Compile tested only. Signed-off-by: Simon Horman --- drivers/net/ethernet/google/gve/gve_adminq.c |

[PATCH net-next 0/2] gve: Minor cleanups

2024-05-03 Thread Simon Horman
Hi, This short patchset provides two minor cleanups for the gve driver. These were found by tooling as mentioned in each patch, and otherwise by inspection. No change in run time behaviour is intended. Each patch is compile tested only. --- Simon Horman (2): gve: Avoid unnecessary use of

[PATCH] fs: WARN when f_count resurrection is attempted

2024-05-03 Thread Kees Cook
It should never happen that get_file() is called on a file with f_count equal to zero. If this happens, a use-after-free condition has happened[1], and we need to attempt a best-effort reporting of the situation to help find the root cause more easily. Additionally, this serves as a data corruption

Re: [PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread Kees Cook
On Fri, 03 May 2024 15:44:09 +0200, Thomas Weißschuh wrote: > Sysctl handlers are not supposed to modify the ctl_table passed to them. > Adapt the logic to work with a temporary > variable, similar to how it is done in other parts of the kernel. > > This is also a prerequisite to enforce the immut

Re: [PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread Kees Cook
{ .procname = "stack_erasing", .data = NULL, .maxlen = sizeof(int), -Kees > state = !!state; > if (ret || !write || state == prev_state) > return ret; > > --- > base-commit: f03359bca01bf4372cf2c118cd9a987a5951b1c8 > change-id: 20240503-sysctl-const-stackleak-af3e67bc65b0 > > Best regards, > -- > Thomas Weißschuh > -- Kees Cook

Re: [PATCH v3 0/6] slab: Introduce dedicated bucket allocator

2024-05-03 Thread Kees Cook
On Fri, May 03, 2024 at 03:39:28PM +0200, jvoisin wrote: > On 4/28/24 19:02, Kees Cook wrote: > > On Sun, Apr 28, 2024 at 01:02:36PM +0200, jvoisin wrote: > >> On 4/24/24 23:40, Kees Cook wrote: > >>> [...] > >>> While CONFIG_RANDOM_KMALLOC_CACHES provides a probabilistic defense > >>> agai

Re: [PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread linux
May 3, 2024 19:55:37 Kees Cook : > On Fri, May 03, 2024 at 03:44:09PM +0200, Thomas Weißschuh wrote: >> Sysctl handlers are not supposed to modify the ctl_table passed to them. >> Adapt the logic to work with a temporary >> variable, similar to how it is done in other parts of the kernel. >> >> Th

Re: [PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread Kees Cook
buffer, lenp, ppos); > state = !!state; > if (ret || !write || state == prev_state) > return ret; I can pick this up; thanks! -Kees > > --- > base-commit: f03359bca01bf4372cf2c118cd9a987a5951b1c8 > change-id: 20240503-sysctl-const-stackleak-af3e67bc65b0 > > Best regards, > -- > Thomas Weißschuh > -- Kees Cook

Re: [PATCH][next] Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning

2024-05-03 Thread patchwork-bot+bluetooth
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz : On Thu, 2 May 2024 10:22:00 -0600 you wrote: > Prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with > __counted_by can have t

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-03 Thread Sean Christopherson
On Fri, May 03, 2024, Mickaël Salaün wrote: > Add an interface for user space to be notified about guests' Heki policy > and related violations. > > Extend the KVM_ENABLE_CAP IOCTL with KVM_CAP_HEKI_CONFIGURE and > KVM_CAP_HEKI_DENIAL. Each one takes a bitmask as first argument that can > contains

Re: [PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread Tycho Andersen
On Fri, May 03, 2024 at 03:44:09PM +0200, Thomas Weißschuh wrote: > Sysctl handlers are not supposed to modify the ctl_table passed to them. > Adapt the logic to work with a temporary > variable, similar to how it is done in other parts of the kernel. > > This is also a prerequisite to enforce the

Re: [RFC PATCH v3 0/5] Hypervisor-Enforced Kernel Integrity - CR pinning

2024-05-03 Thread Sean Christopherson
On Fri, May 03, 2024, Mickaël Salaün wrote: > Hi, > > This patch series implements control-register (CR) pinning for KVM and > provides an hypervisor-agnostic API to protect guests. It includes the > guest interface, the host interface, and the KVM implementation. > > It's not ready for mainline

[PATCH] stackleak: don't modify ctl_table argument

2024-05-03 Thread Thomas Weißschuh
|| !write || state == prev_state) return ret; --- base-commit: f03359bca01bf4372cf2c118cd9a987a5951b1c8 change-id: 20240503-sysctl-const-stackleak-af3e67bc65b0 Best regards, -- Thomas Weißschuh

Re: [PATCH v3 0/6] slab: Introduce dedicated bucket allocator

2024-05-03 Thread jvoisin
On 4/28/24 19:02, Kees Cook wrote: > On Sun, Apr 28, 2024 at 01:02:36PM +0200, jvoisin wrote: >> On 4/24/24 23:40, Kees Cook wrote: >>> Hi, >>> >>> Series change history: >>> >>> v3: >>> - clarify rationale and purpose in commit log >>> - rebase to -next (CONFIG_CODE_TAGGING) >>> - simplify

[RFC PATCH v3 5/5] virt: Add Heki KUnit tests

2024-05-03 Thread Mickaël Salaün
The new CONFIG_HEKI_KUNIT_TEST option enables to run tests in a a kernel module. The minimal required configuration is listed in the virt/heki-test/.kunitconfig file. test_cr_disable_smep checks control-register pinning by trying to disable SMEP. This test should then failed on a non-protected k

[RFC PATCH v3 4/5] heki: Lock guest control registers at the end of guest kernel init

2024-05-03 Thread Mickaël Salaün
The hypervisor needs to provide some functions to support Heki. These form the Heki-Hypervisor API. Define a heki_hypervisor structure to house the API functions. A hypervisor that supports Heki must instantiate a heki_hypervisor structure and pass it to the Heki common code. This allows the commo

[RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-03 Thread Mickaël Salaün
Add an interface for user space to be notified about guests' Heki policy and related violations. Extend the KVM_ENABLE_CAP IOCTL with KVM_CAP_HEKI_CONFIGURE and KVM_CAP_HEKI_DENIAL. Each one takes a bitmask as first argument that can contains KVM_HEKI_EXIT_REASON_CR0 and KVM_HEKI_EXIT_REASON_CR4.

[RFC PATCH v3 2/5] KVM: x86: Add new hypercall to lock control registers

2024-05-03 Thread Mickaël Salaün
This enables guests to lock their CR0 and CR4 registers with a subset of X86_CR0_WP, X86_CR4_SMEP, X86_CR4_SMAP, X86_CR4_UMIP, X86_CR4_FSGSBASE and X86_CR4_CET flags. The new KVM_HC_LOCK_CR_UPDATE hypercall takes three arguments. The first is to identify the control register, the second is a bit

[RFC PATCH v3 1/5] virt: Introduce Hypervisor Enforced Kernel Integrity (Heki)

2024-05-03 Thread Mickaël Salaün
From: Madhavan T. Venkataraman Hypervisor Enforced Kernel Integrity (Heki) is a feature that will use the hypervisor to enhance guest virtual machine security. Implement minimal code to introduce Heki: - Define the config variables. - Define a kernel command line parameter "heki" to turn the f

[RFC PATCH v3 0/5] Hypervisor-Enforced Kernel Integrity - CR pinning

2024-05-03 Thread Mickaël Salaün
Hi, This patch series implements control-register (CR) pinning for KVM and provides an hypervisor-agnostic API to protect guests. It includes the guest interface, the host interface, and the KVM implementation. It's not ready for mainline yet (see the current limitations), but we think the overa

Re: [PATCH 2/2] perf/x86/rapl: Fix the energy-pkg event for AMD CPUs

2024-05-03 Thread Dhananjay Ugwekar
pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : >> + topology_logical_die_id(cpu); >> +} >> + >> +static inline cpumask_t *get_rapl_pmu_cpumask(int cpu) >> +{ >> +return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) : >> + topology_die_cpumask(cpu); >> +} > > Note that this breaks the build with this config: > > > https://download.01.org/0day-ci/archive/20240503/202405030828.rgfuznl9-...@intel.com/config > > I've removed the commit from perf/core for now. Sure, will fix this in v2. Regards, Dhananjay > > Thanks, > > Ingo

Re: [PATCH 2/2] perf/x86/rapl: Fix the energy-pkg event for AMD CPUs

2024-05-03 Thread Ingo Molnar
return rapl_pmu_is_pkg_scope() ? topology_logical_package_id(cpu) : > + topology_logical_die_id(cpu); > +} > + > +static inline cpumask_t *get_rapl_pmu_cpumask(int cpu) > +{ > + return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) :

Re: [PATCH v2 2/3] leds: sy7802: Add support for Silergy SY7802 flash LED controller

2024-05-03 Thread Lee Jones
On Thu, 02 May 2024, André Apitzsch wrote: > Am Donnerstag, dem 02.05.2024 um 10:10 +0100 schrieb Lee Jones: > > On Wed, 01 May 2024, André Apitzsch wrote: > > > > > > > + ret = -EBUSY; > > > > > + goto unlock; > > > > > + } > > > > > + > > > > > + if (level) > > >

Re: [PATCH v2 2/3] leds: sy7802: Add support for Silergy SY7802 flash LED controller

2024-05-03 Thread Lee Jones
On Thu, 11 Apr 2024, Lee Jones wrote: > On Mon, 01 Apr 2024, André Apitzsch via B4 Relay wrote: > > > From: André Apitzsch > > > > Add support for SY7802 flash LED controller. It can support up to 1.8A > > flash current. > > This is a very small commit message for a 500+ line change! > > Plea