Re: [PATCH v3 08/10] perf/x86/rapl: Modify the generic variable names to *_pkg*

2024-07-01 Thread Zhang, Rui
On Mon, 2024-07-01 at 15:08 +0200, Peter Zijlstra wrote: > On Mon, Jun 24, 2024 at 05:59:05AM +, Dhananjay Ugwekar wrote: > > Prep for addition of power_per_core PMU to handle core scope energy > > consumption for AMD CPUs. > > > > Replace the generic names with *_pkg*, to differentiate betwee

Re: [PATCH v5 2/4] interconnect: qcom: sc7280: enable QoS configuration

2024-07-01 Thread Georgi Djakov
On 1.07.24 19:42, Bjorn Andersson wrote: On Fri, Jun 07, 2024 at 11:09:25PM GMT, Odelu Kukatla wrote: Enable QoS configuration for master ports with predefined values for priority and urgency forawrding. This patch causes QCS6490 RB3Gen2 to hit a bus timeout and crash during boot, unless the

[PATCH v6 6/6] mm/util: Use dedicated slab buckets for memdup_user()

2024-07-01 Thread Kees Cook
Both memdup_user() and vmemdup_user() handle allocations that are regularly used for exploiting use-after-free type confusion flaws in the kernel (e.g. prctl() PR_SET_VMA_ANON_NAME[1] and setxattr[2][3][4] respectively). Since both are designed for contents coming from userspace, it allows for use

[PATCH v6 5/6] ipc, msg: Use dedicated slab buckets for alloc_msg()

2024-07-01 Thread Kees Cook
The msg subsystem is a common target for exploiting[1][2][3][4][5][6][7] use-after-free type confusion flaws in the kernel for both read and write primitives. Avoid having a user-controlled dynamically-size allocation share the global kmalloc cache by using a separate set of kmalloc buckets via the

[PATCH v6 3/6] mm/slab: Introduce kvmalloc_buckets_node() that can take kmem_buckets argument

2024-07-01 Thread Kees Cook
Plumb kmem_buckets arguments through kvmalloc_node_noprof() so it is possible to provide an API to perform kvmalloc-style allocations with a particular set of buckets. Introduce kvmalloc_buckets_node() that takes a kmem_buckets argument. Signed-off-by: Kees Cook --- include/linux/slab.h | 4 +++-

[PATCH v6 1/6] mm/slab: Introduce kmem_buckets typedef

2024-07-01 Thread Kees Cook
Encapsulate the concept of a single set of kmem_caches that are used for the kmalloc size buckets. Redefine kmalloc_caches as an array of these buckets (for the different global cache buckets). Signed-off-by: Kees Cook --- include/linux/slab.h | 5 +++-- mm/slab_common.c | 3 +-- 2 files cha

[PATCH v6 4/6] mm/slab: Introduce kmem_buckets_create() and family

2024-07-01 Thread Kees Cook
Dedicated caches are available for fixed size allocations via kmem_cache_alloc(), but for dynamically sized allocations there is only the global kmalloc API's set of buckets available. This means it isn't possible to separate specific sets of dynamically sized allocations into a separate collection

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

2024-07-01 Thread Kees Cook
Hi, v6: - update commit logs: - update description of Kconfig default and API details - call out usage of SLAB_NO_MERGE - improve description of cross-cache attacks - fix typos - add kern-doc parsing of DECL_BUCKET_PARAMS macro - add kern-doc to kmem_buckets_create() - hav

[PATCH v6 2/6] mm/slab: Plumb kmem_buckets into __do_kmalloc_node()

2024-07-01 Thread Kees Cook
Introduce CONFIG_SLAB_BUCKETS which provides the infrastructure to support separated kmalloc buckets (in the following kmem_buckets_create() patches and future codetag-based separation). Since this will provide a mitigation for a very common case of exploits, it is recommended to enable this featur

Re: [PATCH v5 2/4] interconnect: qcom: sc7280: enable QoS configuration

2024-07-01 Thread Bjorn Andersson
On Fri, Jun 07, 2024 at 11:09:25PM GMT, Odelu Kukatla wrote: > Enable QoS configuration for master ports with predefined values > for priority and urgency forawrding. > This patch causes QCS6490 RB3Gen2 to hit a bus timeout and crash during boot, unless the associated DeviceTree change (adding cl

Re: [RFC PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-01 Thread Kees Cook
On Mon, Jul 01, 2024 at 09:02:38AM +0100, David Woodhouse wrote: > On Sun, 2024-06-30 at 14:28 +0100, Simon Horman wrote: > > > > W=1 allmodconfig builds with gcc-13 flag the following. > > Reading the documentation of strncpy() in fortify-string.h, > > I wonder if strscpy() would be more appropri

Re: [PATCH v3 08/10] perf/x86/rapl: Modify the generic variable names to *_pkg*

2024-07-01 Thread Peter Zijlstra
On Mon, Jun 24, 2024 at 05:59:05AM +, Dhananjay Ugwekar wrote: > Prep for addition of power_per_core PMU to handle core scope energy > consumption for AMD CPUs. > > Replace the generic names with *_pkg*, to differentiate between the > scopes of the two different PMUs and their variables. But

Re: [PATCH v3 05/10] perf/x86/rapl: Move cpumask variable to rapl_pmus struct

2024-07-01 Thread Peter Zijlstra
On Mon, Jun 24, 2024 at 05:59:02AM +, Dhananjay Ugwekar wrote: > This patch is in preparation for addition of per-core energy counter > support for AMD CPUs. > > Per-core energy counter PMU will need a separate cpumask. It seems like > a better approach to add the cpumask inside the rapl_pmus

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

2024-07-01 Thread Peter Zijlstra
On Mon, Jun 24, 2024 at 05:58:59AM +, Dhananjay Ugwekar wrote: > diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c > index b985ca79cf97..73be25e1f4b4 100644 > --- a/arch/x86/events/rapl.c > +++ b/arch/x86/events/rapl.c > @@ -103,6 +103,10 @@ static struct perf_pmu_events_att

Re: [PATCH] x86/hpet: Read HPET directly if panic in progress

2024-07-01 Thread Tony W Wang-oc
On 2024/5/29 06:12, Thomas Gleixner wrote: [这封邮件来自外部发件人 谨防风险] On Tue, May 28 2024 at 07:18, Dave Hansen wrote: On 5/27/24 23:38, Tony W Wang-oc wrote: ...> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index c96ae8fee95e..ecadd0698d6a 100644 --- a/arch/x86/kernel/hpet.c +++

Re: [RFC PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-01 Thread David Woodhouse
On Sun, 2024-06-30 at 14:28 +0100, Simon Horman wrote: > > W=1 allmodconfig builds with gcc-13 flag the following. > Reading the documentation of strncpy() in fortify-string.h, > I wonder if strscpy() would be more appropriate in this case. It's never going to matter in practice, as the buffer is