On Nov 22, 2022, at 12:09 PM, Arnd Bergmann wrote:
> !! External Email
>
> On Tue, Nov 22, 2022, at 20:53, Nadav Amit wrote:
>> From: Nadav Amit
>>
>> Functions that are marked as "inline" are currently also not tracable.
>> Apparently, this has been done to prevent differences between differe
On Tue, 22 Nov 2022 21:09:08 +0100
"Arnd Bergmann" wrote:
> On Tue, Nov 22, 2022, at 20:53, Nadav Amit wrote:
> > From: Nadav Amit
> >
> > Functions that are marked as "inline" are currently also not tracable.
> > Apparently, this has been done to prevent differences between different
> > config
On Tue, Nov 22, 2022, at 20:53, Nadav Amit wrote:
> From: Nadav Amit
>
> Functions that are marked as "inline" are currently also not tracable.
> Apparently, this has been done to prevent differences between different
> configs that caused different functions to be tracable on different
> platform
On 11/22/22 07:00, Johannes Berg wrote:
> On Tue, 2022-11-22 at 08:55 -0500, Alex Deucher wrote:
>>>
>>>+ /kisskb/src/arch/um/include/asm/processor-generic.h: error: called
>>> object is not a function or function pointer: => 94:18
>>>+ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/
On Wed, Nov 16, 2022 at 05:27:12PM +0106, John Ogness wrote:
> This is v5 of a series to prepare for threaded/atomic
> printing. v4 is here [0]. This series focuses on reducing the
> scope of the BKL console_lock. It achieves this by switching to
> SRCU and a dedicated mutex for console list iterat
On 11/16/22 11:26, David Hildenbrand wrote:
> We already support reliable R/O pinning of anonymous memory. However,
> assume we end up pinning (R/O long-term) a pagecache page or the shared
> zeropage inside a writable private ("COW") mapping. The next write access
> will trigger a write-fault and
On 11/16/22 11:26, David Hildenbrand wrote:
> Extend FAULT_FLAG_UNSHARE to break COW on anything mapped into a
> COW (i.e., private writable) mapping and adjust the documentation
> accordingly.
>
> FAULT_FLAG_UNSHARE will now also break COW when encountering the shared
> zeropage, a pagecache page
On Tue, 2022-11-22 at 08:55 -0500, Alex Deucher wrote:
> >
> >+ /kisskb/src/arch/um/include/asm/processor-generic.h: error: called
> > object is not a function or function pointer: => 94:18
> >+ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:
> > error: control reaches
On 11/16/22 11:26, David Hildenbrand wrote:
> If we already have a PMD/PUD mapped write-protected in a private mapping
> and we want to break COW either due to FAULT_FLAG_WRITE or
> FAULT_FLAG_UNSHARE, there is no need to inform the file system just like on
> the PTE path.
>
> Let's just split (->
On 11/16/22 11:26, David Hildenbrand wrote:
> We want to extent FAULT_FLAG_UNSHARE support to anything mapped into a
> COW mapping (pagecache page, zeropage, PFN, ...), not just anonymous pages.
> Let's prepare for that by handling shared mappings first such that we can
> handle private mappings la
On Tue, Nov 22, 2022 at 5:56 AM Geert Uytterhoeven wrote:
>
> On Tue, 22 Nov 2022, Geert Uytterhoeven wrote:
> > JFYI, when comparing v6.1-rc6[1] to v6.1-rc5[3], the summaries are:
> > - build errors: +6/-0
>
>+ /kisskb/src/arch/sh/include/asm/io.h: error: cast to pointer from
> integer of d
On Tue, 22 Nov 2022, Geert Uytterhoeven wrote:
JFYI, when comparing v6.1-rc6[1] to v6.1-rc5[3], the summaries are:
- build errors: +6/-0
+ /kisskb/src/arch/sh/include/asm/io.h: error: cast to pointer from integer of
different size [-Werror=int-to-pointer-cast]: => 239:34
sh4-gcc11/sh-allm
From: Benjamin Berg
Further commits will require values from common-offsets.h inside
stub-data.h. Resolve the possible circular dependency and simply use
offsetof() inside stub_32.h and stub_64.h.
Signed-off-by: Benjamin Berg
---
arch/um/include/shared/common-offsets.h | 5 -
arch/x86/um/s
From: Benjamin Berg
This adds the kernel side of the seccomp based process handling.
Co-authored-by: Johannes Berg
Signed-off-by: Benjamin Berg
---
arch/um/os-Linux/skas/mem.c | 35 +-
arch/um/os-Linux/skas/process.c | 561
arch/um/os-Linux/start_up.c
From: Benjamin Berg
Rework syscall handling to be platform independent. Also create a clean
split between queueing of syscalls and flushing them out, removing the
need to keep state in the code that triggers the syscalls.
The code adds syscall_data_len to the global mm_id structure. This will
be
From: Benjamin Berg
The 64bit helper are marked to clobber the memory, but the 32bit ones
are not. Add the appropriate clobber to the 32bit helper routines so
that the compiler cannot do invalid optimizations.
Signed-off-by: Benjamin Berg
---
arch/x86/um/shared/sysdep/stub_32.h | 18 ++
From: Benjamin Berg
Doing this allows using registers as retrieved from an mcontext to be
pushed to a process using PTRACE_SETREGS.
It is not entirely clear to me why CSGSFS was masked. Doing so creates
issues when using the mcontext as process state in seccomp and simply
copying the register ap
From: Benjamin Berg
Currently UML uses ptrace in order to implement userspace processes. This
works really well, however, it requires six context switches per pagefault
(get faultinfo, run syscalls, continue process).
By switching to use SECCOMP, the whole process becomes more collaborative
as t
From: Benjamin Berg
The stub executable page is remapped to a different location in the
userland process. As these functions may be used by the stub, they
really need to be always inlined rather than permitting the compiler to
emit a function.
Signed-off-by: Benjamin Berg
---
arch/x86/um/share
From: Benjamin Berg
These features have existed since Linux 2.6.14 and can be considered
widely available at this point. Also drop the backward compatibility
code for PTRACE_SETOPTIONS.
Signed-off-by: Benjamin Berg
v2:
* Continue to define PTRACE_SYSEMU_SINGLESTEP as glibc only added it
From: Benjamin Berg
When the winch thread runs into an error condition, it would exit(1) and
never be reaped until shutdown time. Change this to write a command byte
which causes the driver to kill it, therefore reaping the child.
Signed-off-by: Benjamin Berg
---
arch/um/drivers/chan_user.c |
From: Benjamin Berg
This way we can avoid doing two extra context switches when managing
processes using seccomp.
Signed-off-by: Benjamin Berg
---
arch/um/include/shared/os.h| 1 +
arch/um/include/shared/skas/skas.h | 1 +
arch/um/kernel/skas/process.c | 8
arch/um/kernel/
From: Benjamin Berg
When we switch to use seccomp, we need both the signal stack and other
data (i.e. syscall information) to co-exist in the stub data. To
facilitate this, start by defining separate memory areas for the stack
and syscall data.
This moves the signal stack onto a new page as the
From: Benjamin Berg
For seccomp, we need all information about the original process in
copy_context_skas0. For consistency, change both copy_context_skas0 and
start_userspace to take the mm_id struct as parameter and directly set
PID in addition to returning it.
Signed-off-by: Benjamin Berg
---
From: Benjamin Berg
Add the UML_SECCOMP configuration options. The next commits will add the
support itself in smaller chunks.
Only x86_64 will be supported for now.
Signed-off-by: Benjamin Berg
---
arch/um/Kconfig | 19 +++
1 file changed, 19 insertions(+)
diff --git a/arch/
From: Benjamin Berg
This adds the stub side for the new seccomp process management code. In
this case we do register save/restore through the signal handler
mcontext. For the FS_BASE/GS_BASE register we need special handling.
Co-authored-by: Johannes Berg
Signed-off-by: Benjamin Berg
---
arch
From: Benjamin Berg
The trampoline is running in a cloned process. It is not safe to use
printk for error printing there.
Signed-off-by: Benjamin Berg
---
arch/um/os-Linux/skas/process.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/um/os-Linux/skas/proc
From: Benjamin Berg
This function will be used by the new syscall handling code.
Signed-off-by: Benjamin Berg
---
arch/x86/um/shared/sysdep/stub_32.h | 22 ++
arch/x86/um/shared/sysdep/stub_64.h | 16
2 files changed, 38 insertions(+)
diff --git a/arch/x86
From: Benjamin Berg
This detects seccomp support, sets the global using_seccomp variable and
initilizes the exec registers. For now, the implementation simply falls
through to the ptrace startup code, meaning that it is unused.
Signed-off-by: Benjamin Berg
---
arch/um/include/shared/skas/skas.
From: Benjamin Berg
When not using ptrace, we need to both save and restore registers
through the mcontext as provided by the host kernel to our signal
handlers.
Add corresponding functions to store the state to an mcontext and
helpers to access the mcontext of the subprocess through the stub da
From: Benjamin Berg
These functions were only used when calling PTRACE_ARCH_PRCTL, but this
code has been removed.
Signed-off-by: Benjamin Berg
---
arch/um/include/shared/registers.h | 2 --
arch/um/os-Linux/registers.c | 20
2 files changed, 22 deletions(-)
diff -
From: Benjamin Berg
These registers are saved/restored together with the other general
registers using ptrace. In arch_set_tls we then just need to set the
register and it will be synced back normally.
Most of this logic was introduced in commit f39cf7845 ("[PATCH] uml:
x86_64 thread fixes")
From: Benjamin Berg
The thread is running outside of the UML kernel scope and is a helper.
As such, printk cannot work and os_info must be used instead.
Signed-off-by: Benjamin Berg
---
arch/um/drivers/chan_user.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(
From: Benjamin Berg
This means having the string literal in one line and using __func__
where appropriate.
Signed-off-by: Benjamin Berg
---
arch/um/kernel/exec.c | 4 +-
arch/um/os-Linux/skas/mem.c | 19 +++--
arch/um/os-Linux/skas/process.c | 121 -
From: Benjamin Berg
When in seccomp mode, we would hang forever on the futex if a child has
died unexpectedly. In contrast, ptrace mode will notice it and kill the
corresponding thread when it fails to run it.
Fix this issue by simply printing a message and aborting. In this case
something from
From: Benjamin Berg
The segv handler is called slightly differently depending on whether
PTRACE_FULL_FAULTINFO is set or not (32bit vs. 64bit). The only
difference is that we don't try to pass the registers and instruction
pointer to the segv handler.
It would be good to either document or remov
From: Benjamin Berg
start_userspace is only called from exactly one location, and the passed
pointer for the userspace process stack cannot be NULL.
Remove the check, without changing the control flow.
Signed-off-by: Benjamin Berg
---
arch/um/os-Linux/skas/process.c | 53 +++--
From: Benjamin Berg
The threads allocated inside the kernel have only a single page of
stack. Unfortunately, the vfprintf function in standard glibc may use
too much stack-space, overflowing it.
To make os_info safe to be used by helper threads, use the kernel
vscnprintf function into a smallish
From: Benjamin Berg
This is done as preparation for seccomp support as we have no helper to
copy the registers from a plain array.
Signed-off-by: Benjamin Berg
---
arch/um/os-Linux/skas/process.c | 23 +++
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/arch
From: Benjamin Berg
For the detection code to check whether SYSEMU_SINGLESTEP works
correctly we needed some error cases while stopping to be non-fatal.
However, at this point stop_ptraced_child must always succeed, and we
can therefore simplify it slightly to exit immediately on error.
Signed-o
From: Benjamin Berg
It is only used within the same file.
Signed-off-by: Benjamin Berg
---
arch/um/kernel/tlb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index bc38f79ca3a3..3c709e6146dc 100644
--- a/arch/um/kernel/tlb.c
41 matches
Mail list logo