On 10.03.23 19:28, Stefan Roesch wrote:
> Patch series "mm: process/cgroup ksm support", v3.
>
> So far KSM can only be enabled by calling madvise for memory regions. To
> be able to use KSM for more workloads, KSM needs to have the ability to be
> enabled / disabled at the process / cgroup level.
>
> Use case 1:
>
> The madvise call is not available in the programming language. An
> example for this are programs with forked workloads using a garbage
> collected language without pointers. In such a language madvise cannot
> be made available.
>
> In addition the addresses of objects get moved around as they are
> garbage collected. KSM sharing needs to be enabled "from the outside"
> for these type of workloads.
I guess the interpreter could enable it (like a memory allocator could
enable it for the whole heap). But I get that it's much easier to enable
this per-process, and eventually only when a lot of the same processes
are running in that particular environment.
>
> Use case 2:
>
> The same interpreter can also be used for workloads where KSM brings
> no benefit or even has overhead. We'd like to be able to enable KSM on
> a workload by workload basis.
Agreed. A per-process control is also helpful to identidy workloads
where KSM might be beneficial (and to which degree).
>
> Use case 3:
>
> With the madvise call sharing opportunities are only enabled for the
> current process: it is a workload-local decision. A considerable number
> of sharing opportuniites may exist across multiple workloads or jobs.
> Only a higler level entity like a job scheduler or container can know
> for certain if its running one or more instances of a job. That job
> scheduler however doesn't have the necessary internal worklaod knowledge
> to make targeted madvise calls.
>
> Security concerns:
>
> In previous discussions security concerns have been brought up. The
> problem is that an individual workload does not have the knowledge about
> what else is running on a machine. Therefore it has to be very
> conservative in what memory areas can be shared or not. However, if the
> system is dedicated to running multiple jobs within the same security
> domain, its the job scheduler that has the knowledge that sharing can be
> safely enabled and is even desirable.
>
> Performance:
>
> Experiments with using UKSM have shown a capacity increase of around
> 20%.
>
As raised, it would be great to include more details about the workload
where this particulalry helps (e.g., a lot of Django processes operating
in the same domain).
>
> 1. New options for prctl system command
>
> This patch series adds two new options to the prctl system call.
> The first one allows to enable KSM at the process level and the second
> one to query the setting.
>
> The setting will be inherited by child processes.
>
> With the above setting, KSM can be enabled for the seed process of a
> cgroup and all processes in the cgroup will inherit the setting.
>
> 2. Changes to KSM processing
>
> When KSM is enabled at the process level, the KSM code will iterate
> over all the VMA's and enable KSM for the eligible VMA's.
>
> When forking a process that has KSM enabled, the setting will be
> inherited by the new child process.
>
> In addition when KSM is disabled for a process, KSM will be disabled
> for the VMA's where KSM has been enabled.
Do we want to make MADV_MERGEABLE/MADV_UNMERGEABLE fail while the new
prctl is enabled for a process?
>
> 3. Add general_profit metric
>
> The general_profit metric of KSM is specified in the documentation,
> but not calculated. This adds the general profit metric to
> /sys/kernel/debug/mm/ksm.
>
> 4. Add more metrics to ksm_stat
>
> This adds the process profit and ksm type metric to
> /proc/<pid>/ksm_stat.
>
> 5. Add more tests to ksm_tests
>
> This adds an option to specify the merge type to the ksm_tests.
> This allows to test madvise and prctl KSM. It also adds a new option
> to query if prctl KSM has been enabled. It adds a fork test to verify
> that the KSM process setting is inherited by client processes.
>
> An update to the prctl(2) manpage has been proposed at [1].
>
> This patch (of 3):
>
> This adds a new prctl to API to enable and disable KSM on a per process
> basis instead of only at the VMA basis (with madvise).
>
> 1) Introduce new MMF_VM_MERGE_ANY flag
>
> This introduces the new flag MMF_VM_MERGE_ANY flag. When this flag
> is set, kernel samepage merging (ksm) gets enabled for all vma's of a
> process.
>
> 2) add flag to __ksm_enter
>
> This change adds the flag parameter to __ksm_enter. This allows to
> distinguish if ksm was called by prctl or madvise.
>
> 3) add flag to __ksm_exit call
>
> This adds the flag parameter to the __ksm_exit() call. This allows
> to distinguish if this call is for an prctl or madvise invocation.
>
> 4) invoke madvise for all vmas in scan_get_next_rmap_item
>
> If the new flag MMF_VM_MERGE_ANY has been set for a process, iterate
> over all the vmas and enable ksm if possible. For the vmas that can be
> ksm enabled this is only done once.
>
> 5) support disabling of ksm for a process
>
> This adds the ability to disable ksm for a process if ksm has been
> enabled for the process.
>
> 6) add new prctl option to get and set ksm for a process
>
> This adds two new options to the prctl system call
> - enable ksm for all vmas of a process (if the vmas support it).
> - query if ksm has been enabled for a process.
Did you consider, instead of handling MMF_VM_MERGE_ANY in a special way,
to instead make it reuse the existing MMF_VM_MERGEABLE/VM_MERGEABLE
infrastructure. Especially:
1) During prctl(MMF_VM_MERGE_ANY), set VM_MERGABLE on all applicable
compatible. Further, set MMF_VM_MERGEABLE and enter KSM if not
already set.
2) When creating a new, compatible VMA and MMF_VM_MERGE_ANY is set, set
VM_MERGABLE?
The you can avoid all runtime checks for compatible VMAs and only look
at the VM_MERGEABLE flag. In fact, the VM_MERGEABLE will be completely
expressive then for all VMAs. You don't need vma_ksm_mergeable() then.
Another thing to consider is interaction with arch/s390/mm/gmap.c:
s390x/kvm does not support KSM and it has to disable it for all VMAs. We
have to find a way to fence the prctl (for example, fail setting the
prctl after gmap_mark_unmergeable() ran, and make
gmap_mark_unmergeable() fail if the prctl ran -- or handle it gracefully
in some other way).
>
> Link: https://lkml.kernel.org/r/20230227220206.436662-1-shr@devkernel.io [1]
> Link: https://lkml.kernel.org/r/20230224044000.3084046-1-shr@devkernel.io
> Link: https://lkml.kernel.org/r/20230224044000.3084046-2-shr@devkernel.io
> Signed-off-by: Stefan Roesch <shr(a)devkernel.io>
> Cc: David Hildenbrand <david(a)redhat.com>
> Cc: Johannes Weiner <hannes(a)cmpxchg.org>
> Cc: Michal Hocko <mhocko(a)suse.com>
> Cc: Rik van Riel <riel(a)surriel.com>
> Cc: Bagas Sanjaya <bagasdotme(a)gmail.com>
> Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
> ---
> include/linux/ksm.h | 14 ++++--
> include/linux/sched/coredump.h | 1 +
> include/uapi/linux/prctl.h | 2 +
> kernel/sys.c | 27 ++++++++++
> mm/ksm.c | 90 +++++++++++++++++++++++-----------
> 5 files changed, 101 insertions(+), 33 deletions(-)
>
> diff --git a/include/linux/ksm.h b/include/linux/ksm.h
> index 7e232ba59b86..d38a05a36298 100644
> --- a/include/linux/ksm.h
> +++ b/include/linux/ksm.h
> @@ -18,20 +18,24 @@
> #ifdef CONFIG_KSM
> int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
> unsigned long end, int advice, unsigned long *vm_flags);
> -int __ksm_enter(struct mm_struct *mm);
> -void __ksm_exit(struct mm_struct *mm);
> +int __ksm_enter(struct mm_struct *mm, int flag);
> +void __ksm_exit(struct mm_struct *mm, int flag);
>
> static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
> {
> + if (test_bit(MMF_VM_MERGE_ANY, &oldmm->flags))
> + return __ksm_enter(mm, MMF_VM_MERGE_ANY);
> if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags))
> - return __ksm_enter(mm);
> + return __ksm_enter(mm, MMF_VM_MERGEABLE);
> return 0;
> }
>
> static inline void ksm_exit(struct mm_struct *mm)
> {
> - if (test_bit(MMF_VM_MERGEABLE, &mm->flags))
> - __ksm_exit(mm);
> + if (test_bit(MMF_VM_MERGE_ANY, &mm->flags))
> + __ksm_exit(mm, MMF_VM_MERGE_ANY);
> + else if (test_bit(MMF_VM_MERGEABLE, &mm->flags))
> + __ksm_exit(mm, MMF_VM_MERGEABLE);
> }
>
> /*
> diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
> index 0e17ae7fbfd3..0ee96ea7a0e9 100644
> --- a/include/linux/sched/coredump.h
> +++ b/include/linux/sched/coredump.h
> @@ -90,4 +90,5 @@ static inline int get_dumpable(struct mm_struct *mm)
> #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
> MMF_DISABLE_THP_MASK | MMF_HAS_MDWE_MASK)
>
> +#define MMF_VM_MERGE_ANY 29
> #endif /* _LINUX_SCHED_COREDUMP_H */
> diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h
> index 1312a137f7fb..759b3f53e53f 100644
> --- a/include/uapi/linux/prctl.h
> +++ b/include/uapi/linux/prctl.h
> @@ -290,4 +290,6 @@ struct prctl_mm_map {
> #define PR_SET_VMA 0x53564d41
> # define PR_SET_VMA_ANON_NAME 0
>
> +#define PR_SET_MEMORY_MERGE 67
> +#define PR_GET_MEMORY_MERGE 68
> #endif /* _LINUX_PRCTL_H */
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 495cd87d9bf4..edc439b1cae9 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -15,6 +15,7 @@
> #include <linux/highuid.h>
> #include <linux/fs.h>
> #include <linux/kmod.h>
> +#include <linux/ksm.h>
> #include <linux/perf_event.h>
> #include <linux/resource.h>
> #include <linux/kernel.h>
> @@ -2661,6 +2662,32 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> case PR_SET_VMA:
> error = prctl_set_vma(arg2, arg3, arg4, arg5);
> break;
> +#ifdef CONFIG_KSM
> + case PR_SET_MEMORY_MERGE:
> + if (!capable(CAP_SYS_RESOURCE))
> + return -EPERM;
> +
> + if (arg2) {
> + if (mmap_write_lock_killable(me->mm))
> + return -EINTR;
> +
> + if (!test_bit(MMF_VM_MERGE_ANY, &me->mm->flags))
> + error = __ksm_enter(me->mm, MMF_VM_MERGE_ANY);
Hm, I think this might be problematic if we alread called __ksm_enter()
via madvise(). Maybe we should really consider making MMF_VM_MERGE_ANY
set MMF_VM_MERGABLE instead. Like:
error = 0;
if(test_bit(MMF_VM_MERGEABLE, &me->mm->flags))
error = __ksm_enter(me->mm);
if (!error)
set_bit(MMF_VM_MERGE_ANY, &me->mm->flags);
> + mmap_write_unlock(me->mm);
> + } else {
> + __ksm_exit(me->mm, MMF_VM_MERGE_ANY);
Hm, I'd prefer if we really only call __ksm_exit() when we really exit
the process. Is there a strong requirement to optimize disabling of KSM
or would it be sufficient to clear the MMF_VM_MERGE_ANY flag here?
Also, I wonder what happens if we have another VMA in that process that
has it enabled ..
Last but not least, wouldn't we want to do the same thing as
MADV_UNMERGEABLE and actually unmerge the KSM pages?
It smells like it could be simpler and more consistent to handle by
letting PR_SET_MEMORY_MERGE piggy-back on MMF_VM_MERGABLE/VM_MERGABLE
and mimic what ksm_madvise() does simply for all VMAs.
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -534,16 +534,58 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr,
> return (ret & VM_FAULT_OOM) ? -ENOMEM : 0;
> }
>
> +static bool vma_ksm_compatible(struct vm_area_struct *vma)
> +{
> + /*
> + * Be somewhat over-protective for now!
> + */
> + if (vma->vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE |
> + VM_PFNMAP | VM_IO | VM_DONTEXPAND |
> + VM_HUGETLB | VM_MIXEDMAP))
> + return false; /* just ignore the advice */
That comment is kind-of stale and ksm_madvise() specific.
> +
The VM_MERGEABLE check is really only used for ksm_madvise() to return
immediately. I suggest keeping it in ksm_madvise() -- "Already enabled".
Returning "false" in that case looks wrong (it's not broken because you
do an early check in vma_ksm_mergeable(), it's just semantically weird).
--
Thanks,
David / dhildenb
The va_128TBswitch selftest is designed and implemented for PowerPC and
x86 architectures which support a 128TB switch, up to 256TB of virtual
address space and hugepage sizes of 16MB and 2MB respectively. Arm64
platforms on the other hand support a 256Tb switch, up to 4PB of virtual
address space and a default hugepage size of 512MB when 64k pagesize is
enabled.
These architectural differences require introducing support for arm64
platforms, after which a more generic naming convention is suggested.
The in code comments are amended to provide a more platform independent
explanation of the working of the code and nr_hugepages are configured
as required. Finally, the file running the testcase is modified in order
to prevent skipping of hugetlb testcases of va_high_addr_switch.
This series has been tested on 6.3.0-rc3 kernel, both on arm64 and x86
platforms.
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov(a)linux.intel.com>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: linux-mm(a)kvack.org
Cc: linux-kselftest(a)vger.kernel.org
Cc: linux-kernel(a)vger.kernel.org
Chaitanya S Prakash (5):
selftests/mm: Add support for arm64 platform on va switch
selftests/mm: Rename va_128TBswitch to va_high_addr_switch
selftests/mm: Add platform independent in code comments
selftests/mm: Configure nr_hugepages for arm64
selftests/mm: Run hugetlb testcases of va switch
tools/testing/selftests/mm/Makefile | 4 +-
tools/testing/selftests/mm/run_vmtests.sh | 12 +++++-
...va_128TBswitch.c => va_high_addr_switch.c} | 41 +++++++++++++++----
..._128TBswitch.sh => va_high_addr_switch.sh} | 6 ++-
4 files changed, 49 insertions(+), 14 deletions(-)
rename tools/testing/selftests/mm/{va_128TBswitch.c => va_high_addr_switch.c} (86%)
rename tools/testing/selftests/mm/{va_128TBswitch.sh => va_high_addr_switch.sh} (89%)
--
2.30.2
Hi,
No progress on this bug report, so it is still unpatched in 6.3-rc5 so I am
submitting again.
Please see the relevant data at the bottom:
On 27. 01. 2023. 19:36, Mirsad Goran Todorovac wrote:
> Hi all,
>
> I came across a memory leak with the vanilla mainline Torvalds tree kernel
> with MGLRU and CONFIG_KMEMLEAK enabled:
>
> unreferenced object 0xffff8d7c92ad5180 (size 192):
> comm "ftracetest", pid 2738512, jiffies 4335176273 (age 4842.976s)
> hex dump (first 32 bytes):
> c0 59 ad 92 7c 8d ff ff 60 dd d7 31 7c 8d ff ff .Y..|...`..1|...
> 60 55 df 97 ff ff ff ff 09 00 02 00 00 00 00 00 `U..............
> backtrace:
> [<ffffffff965d9bf0>] __kmem_cache_alloc_node+0x1e0/0x340
> [<ffffffff96556dda>] kmalloc_trace+0x2a/0xa0
> [<ffffffff964382fc>] tracing_log_err+0x16c/0x1b0
> [<ffffffff96451963>] append_filter_err+0x113/0x1d0
> [<ffffffff96453c0a>] create_event_filter+0xba/0xe0
> [<ffffffff96454b18>] set_trigger_filter+0x98/0x160
> [<ffffffff96456554>] event_trigger_parse+0x104/0x180
> [<ffffffff96455823>] trigger_process_regex+0xc3/0x110
> [<ffffffff964558f7>] event_trigger_write+0x77/0xe0
> [<ffffffff96623a41>] vfs_write+0xd1/0x420
> [<ffffffff9662413b>] ksys_write+0x7b/0x100
> [<ffffffff966241e9>] __x64_sys_write+0x19/0x20
> [<ffffffff971c9188>] do_syscall_64+0x58/0x80
> [<ffffffff972000aa>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
> unreferenced object 0xffff8d7b076be000 (size 32):
> comm "ftracetest", pid 2738512, jiffies 4335176273 (age 4842.976s)
> hex dump (first 32 bytes):
> 0a 20 20 43 6f 6d 6d 61 6e 64 3a 20 61 0a 00 00 . Command: a...
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<ffffffff965d9bf0>] __kmem_cache_alloc_node+0x1e0/0x340
> [<ffffffff96557a8d>] __kmalloc+0x4d/0xd0
> [<ffffffff96438314>] tracing_log_err+0x184/0x1b0
> [<ffffffff96451963>] append_filter_err+0x113/0x1d0
> [<ffffffff96453c0a>] create_event_filter+0xba/0xe0
> [<ffffffff96454b18>] set_trigger_filter+0x98/0x160
> [<ffffffff96456554>] event_trigger_parse+0x104/0x180
> [<ffffffff96455823>] trigger_process_regex+0xc3/0x110
> [<ffffffff964558f7>] event_trigger_write+0x77/0xe0
> [<ffffffff96623a41>] vfs_write+0xd1/0x420
> [<ffffffff9662413b>] ksys_write+0x7b/0x100
> [<ffffffff966241e9>] __x64_sys_write+0x19/0x20
> [<ffffffff971c9188>] do_syscall_64+0x58/0x80
> [<ffffffff972000aa>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
> unreferenced object 0xffff8d7c92ad59c0 (size 192):
> comm "ftracetest", pid 2738512, jiffies 4335176280 (age 4843.088s)
> hex dump (first 32 bytes):
> c0 5c ad 92 7c 8d ff ff 80 51 ad 92 7c 8d ff ff .\..|....Q..|...
> 60 55 df 97 ff ff ff ff 01 00 0b 00 00 00 00 00 `U..............
> backtrace:
> [<ffffffff965d9bf0>] __kmem_cache_alloc_node+0x1e0/0x340
> [<ffffffff96556dda>] kmalloc_trace+0x2a/0xa0
> [<ffffffff964382fc>] tracing_log_err+0x16c/0x1b0
> [<ffffffff96451963>] append_filter_err+0x113/0x1d0
> [<ffffffff96453c0a>] create_event_filter+0xba/0xe0
> [<ffffffff96454b18>] set_trigger_filter+0x98/0x160
> [<ffffffff96456554>] event_trigger_parse+0x104/0x180
> [<ffffffff96455823>] trigger_process_regex+0xc3/0x110
> [<ffffffff964558f7>] event_trigger_write+0x77/0xe0
> [<ffffffff96623a41>] vfs_write+0xd1/0x420
> [<ffffffff9662413b>] ksys_write+0x7b/0x100
> [<ffffffff966241e9>] __x64_sys_write+0x19/0x20
> [<ffffffff971c9188>] do_syscall_64+0x58/0x80
> [<ffffffff972000aa>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
>
> The bug was noticed on Lenovo desktop 10TX000VCR (LENOVO_MT_10TX_BU_Lenovo_FM_V530S-07ICB)
> running AlmaLinux 8.7 (Stone Smilodon), a CentOS clone, with the compiler:
>
> mtodorov@domac:~/linux/kernel/linux_torvalds$ gcc --version
> gcc (Debian 8.3.0-6) 8.3.0
> Copyright (C) 2018 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> mtodorov@domac:~/linux/kernel/linux_torvalds$
>
> Bisecting gave the following culprit commit:
>
> git bisect good a92ce570c81dc0feaeb12a429b4bc65686d17967
> # good: [c6f613e5f35b0e2154d5ca12f0e8e0be0c19be9a] ipmi/watchdog: use strscpy() to instead of strncpy()
> git bisect good c6f613e5f35b0e2154d5ca12f0e8e0be0c19be9a
> # good: [90b12f423d3c8a89424c7bdde18e1923dfd0941e] Merge tag 'for-linus-6.2-1' of https://github.com/cminyard/linux-ipmi
> git bisect good 90b12f423d3c8a89424c7bdde18e1923dfd0941e
> # first bad commit: [71946a25f357a51dcce849367501d7fb04c0465b] Merge tag 'mmc-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
>
> The commit was merged on December 13th 2022.
>
> It is a huge commit.
>
> The selftests/ftrace/ftracetest triggers this leak, sometimes several times in a run.
> ftracetest requires root permission to run, but I haven't yet realised whether a non-superuser
> could devise an automated script to abuse this leak exhausting all kernel's memory.
>
> Non-root user gets a EPERM error when trying to access /proc/sys/kernel internals:
>
> [marvin@pc-mtodorov linux_torvalds]$ tools/testing/selftests/ftrace/ftracetest
> Error: this must be run by root user
> tools/testing/selftests/ftrace/ftracetest: line 46: /proc/sys/kernel/sched_rt_runtime_us: Permission denied
> [marvin@pc-mtodorov linux_torvalds]$
>
> Hope this helps.
>
> According to the Code of Conduct, I have Cc:-ed maintainers from get_maintainers.pl and
> I will add Thorsten because this is sort of a regression :-)
The debug output is like follows:
unreferenced object 0xffff93a3dc2d1e18 (size 192):
comm "ftracetest", pid 12451, jiffies 4295087353 (age 463.476s)
hex dump (first 32 bytes):
20 08 2d dc a3 93 ff ff c0 bd 5d cd a3 93 ff ff .-.......].....
c0 bf 85 b6 ff ff ff ff 09 00 02 00 00 00 00 00 ................
backtrace:
[<ffffffffb4afb23c>] slab_post_alloc_hook+0x8c/0x3e0
[<ffffffffb4b02b19>] __kmem_cache_alloc_node+0x1d9/0x2a0
[<ffffffffb4a7693e>] kmalloc_trace+0x2e/0xc0
[<ffffffffb493a8fb>] tracing_log_err+0x18b/0x1d0
[<ffffffffb4959049>] append_filter_err.isra.13+0x119/0x190
[<ffffffffb495a89f>] create_filter+0xbf/0xe0
[<ffffffffb495ab10>] create_event_filter+0x10/0x20
[<ffffffffb495c040>] set_trigger_filter+0xa0/0x180
[<ffffffffb495d745>] event_trigger_parse+0xf5/0x160
[<ffffffffb495c889>] trigger_process_regex+0xc9/0x120
[<ffffffffb495c976>] event_trigger_write+0x86/0xf0
[<ffffffffb4b52dc2>] vfs_write+0xf2/0x520
[<ffffffffb4b533d8>] ksys_write+0x68/0xe0
[<ffffffffb4b5347e>] __x64_sys_write+0x1e/0x30
[<ffffffffb586619c>] do_syscall_64+0x5c/0x90
[<ffffffffb5a000ae>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
unreferenced object 0xffff93a3873dda20 (size 32):
comm "ftracetest", pid 12451, jiffies 4295087353 (age 463.476s)
hex dump (first 32 bytes):
0a 20 20 43 6f 6d 6d 61 6e 64 3a 20 61 0a 00 00 . Command: a...
00 00 cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................
backtrace:
[<ffffffffb4afb23c>] slab_post_alloc_hook+0x8c/0x3e0
[<ffffffffb4b02b19>] __kmem_cache_alloc_node+0x1d9/0x2a0
[<ffffffffb4a77785>] __kmalloc+0x55/0x160
[<ffffffffb493a913>] tracing_log_err+0x1a3/0x1d0
[<ffffffffb4959049>] append_filter_err.isra.13+0x119/0x190
[<ffffffffb495a89f>] create_filter+0xbf/0xe0
[<ffffffffb495ab10>] create_event_filter+0x10/0x20
[<ffffffffb495c040>] set_trigger_filter+0xa0/0x180
[<ffffffffb495d745>] event_trigger_parse+0xf5/0x160
[<ffffffffb495c889>] trigger_process_regex+0xc9/0x120
[<ffffffffb495c976>] event_trigger_write+0x86/0xf0
[<ffffffffb4b52dc2>] vfs_write+0xf2/0x520
[<ffffffffb4b533d8>] ksys_write+0x68/0xe0
[<ffffffffb4b5347e>] __x64_sys_write+0x1e/0x30
[<ffffffffb586619c>] do_syscall_64+0x5c/0x90
[<ffffffffb5a000ae>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
Please find the complete debug info at the URL:
https://domac.alu.unizg.hr/~mtodorov/linux/bugreports/ftracetest/
Bisect log is [edited]:
> git bisect good a92ce570c81dc0feaeb12a429b4bc65686d17967
> # good: [c6f613e5f35b0e2154d5ca12f0e8e0be0c19be9a] ipmi/watchdog: use strscpy() to instead of strncpy()
> git bisect good c6f613e5f35b0e2154d5ca12f0e8e0be0c19be9a
> # good: [90b12f423d3c8a89424c7bdde18e1923dfd0941e] Merge tag 'for-linus-6.2-1' of https://github.com/cminyard/linux-ipmi
> git bisect good 90b12f423d3c8a89424c7bdde18e1923dfd0941e
> # first bad commit: [71946a25f357a51dcce849367501d7fb04c0465b] Merge tag 'mmc-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
>
> The commit was merged on December 13th 2022.
The amount of applied diffs in the culprit commit 71946a25f357a51dcce849367501d7fb04c0465b
prevents me from bisecting further - I do not know which changes depend of which, and which
can be tested independently.
Hopefully I might come up with a reproducer, but I need some feedback first. Maybe there
are ways to narrow down the lines of code that could have caused the leaks, yet I am
completely new to the kernel/trace subtree.
Apologies for not Cc:ing Ulf nine weeks ago, but it was an omission, not deliberate act.
Best regards,
Mirsad
--
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
"I see something approaching fast ... Will it be friends with me?"
o6irnndpcv7 writes via Kernel.org Bugzilla:
Hello and good day!
I think I found a missing dependency.
In case of setting CONFIG_FIPS_SIGNATURE_SELFTEST, CONFIG_CRYPTO_SHA256 also needs to be set. But not as module.
Failing to do so results in an early kernel panic during boot.
Tested on linux-6.1.12-gentoo and linux-6.1.19-gentoo.
Thanks,
sephora
View: https://bugzilla.kernel.org/show_bug.cgi?id=217293#c0
You can reply to this message to join the discussion.
--
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (peebz 0.1)
Hi All,
In TDX guest, the attestation process is used to verify the TDX guest
trustworthiness to other entities before provisioning secrets to the
guest.
The TDX guest attestation process consists of two steps:
1. TDREPORT generation
2. Quote generation.
The First step (TDREPORT generation) involves getting the TDX guest
measurement data in the format of TDREPORT which is further used to
validate the authenticity of the TDX guest. The second step involves
sending the TDREPORT to a Quoting Enclave (QE) server to generate a
remotely verifiable Quote. TDREPORT by design can only be verified on
the local platform. To support remote verification of the TDREPORT,
TDX leverages Intel SGX Quoting Enclave to verify the TDREPORT
locally and convert it to a remotely verifiable Quote. Although
attestation software can use communication methods like TCP/IP or
vsock to send the TDREPORT to QE, not all platforms support these
communication models. So TDX GHCI specification [1] defines a method
for Quote generation via hypercalls. Please check the discussion from
Google [2] and Alibaba [3] which clarifies the need for hypercall based
Quote generation support. This patch set adds this support.
Support for TDREPORT generation already exists in the TDX guest driver.
This patchset extends the same driver to add the Quote generation
support.
Following are the details of the patch set:
Patch 1/3 -> Adds event notification IRQ support.
Patch 2/3 -> Adds Quote generation support.
Patch 3/3 -> Adds selftest support for Quote generation feature.
[1] https://cdrdv2.intel.com/v1/dl/getContent/726790, section titled "TDG.VP.VMCALL<GetQuote>".
[2] https://lore.kernel.org/lkml/CAAYXXYxxs2zy_978GJDwKfX5Hud503gPc8=1kQ-+JwG_k…
[3] https://lore.kernel.org/lkml/a69faebb-11e8-b386-d591-dbd08330b008@linux.ali…
Kuppuswamy Sathyanarayanan (3):
x86/tdx: Add TDX Guest event notify interrupt support
virt: tdx-guest: Add Quote generation support
selftests/tdx: Test GetQuote TDX attestation feature
Documentation/virt/coco/tdx-guest.rst | 11 +
arch/x86/coco/tdx/tdx.c | 203 +++++++++++++++
arch/x86/include/asm/tdx.h | 8 +
drivers/virt/coco/tdx-guest/tdx-guest.c | 249 ++++++++++++++++++-
include/uapi/linux/tdx-guest.h | 44 ++++
tools/testing/selftests/tdx/tdx_guest_test.c | 68 ++++-
6 files changed, 575 insertions(+), 8 deletions(-)
--
2.34.1
This change fixes flakiness in the BIDIRECTIONAL test:
# [is_pkt_valid] expected length [60], got length [90]
not ok 1 FAIL: SKB BUSY-POLL BIDIRECTIONAL
When IPv6 is enabled, the interface will periodically send MLDv1 and
MLDv2 packets. These packets can cause the BIDIRECTIONAL test to fail
since it uses VETH0 for RX.
For other tests, this was not a problem since they only receive on VETH1
and IPv6 was already disabled on VETH0.
Fixes: a89052572ebb ("selftests/bpf: Xsk selftests framework")
Signed-off-by: Kal Conley <kal.conley(a)dectris.com>
---
tools/testing/selftests/bpf/test_xsk.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
index b077cf58f825..377fb157a57c 100755
--- a/tools/testing/selftests/bpf/test_xsk.sh
+++ b/tools/testing/selftests/bpf/test_xsk.sh
@@ -116,6 +116,7 @@ setup_vethPairs() {
ip link add ${VETH0} numtxqueues 4 numrxqueues 4 type veth peer name ${VETH1} numtxqueues 4 numrxqueues 4
if [ -f /proc/net/if_inet6 ]; then
echo 1 > /proc/sys/net/ipv6/conf/${VETH0}/disable_ipv6
+ echo 1 > /proc/sys/net/ipv6/conf/${VETH1}/disable_ipv6
fi
if [[ $verbose -eq 1 ]]; then
echo "setting up ${VETH1}"
--
2.39.2
All related to the pages code, and the latter are reproducible with a
simple test.
Jason Gunthorpe (4):
iommufd: Check for uptr overflow
iommufd: Fix unpinning of pages when an access is present
iommufd: Do not corrupt the pfn list when doing batch carry
iommufd/selftest: Cover domain unmap with huge pages and access
drivers/iommu/iommufd/pages.c | 16 ++++++++++--
tools/testing/selftests/iommu/iommufd.c | 34 +++++++++++++++++++++++++
2 files changed, 48 insertions(+), 2 deletions(-)
base-commit: 9c7d518b9b71f4d5ca3d12952cda3417ac6126c4
--
2.40.0
Dzień dobry,
chcielibyśmy zapewnić Państwu kompleksowe rozwiązania, jeśli chodzi o system monitoringu GPS.
Precyzyjne monitorowanie pojazdów na mapach cyfrowych, śledzenie ich parametrów eksploatacyjnych w czasie rzeczywistym oraz kontrola paliwa to kluczowe funkcjonalności naszego systemu.
Organizowanie pracy pracowników jest dzięki temu prostsze i bardziej efektywne, a oszczędności i optymalizacja w zakresie ponoszonych kosztów, mają dla każdego przedsiębiorcy ogromne znaczenie.
Dopasujemy naszą ofertę do Państwa oczekiwań i potrzeb organizacji. Czy moglibyśmy porozmawiać o naszej propozycji?
Pozdrawiam
Krystian Wieczorek