01 2021 档案

gvisor 信号处理
摘要:执行一个信号处理程序是件相当复杂的任务,因为在用户态和内核态之间切换时需要谨慎地处理栈中的内容。 信号处理程序是用户态进程所定义的函数,并包含在用户态的代码段中。handle_signal( )函数运行在内核态而信号处理程序运行在用户态,这就意味着在当前进程恢复 “正常”执行之前,它必须首先执行用户 阅读全文

posted @ 2021-01-27 16:30 tycoon3 阅读(516) 评论(0) 推荐(0) 编辑

kvm hlt指令
摘要:https://david942j.blogspot.com/2018/10/note-learning-kvm-implement-your-own.html int main() { /* movabs rax, 0x0a33323144434241 push 8 pop rcx mov edx 阅读全文

posted @ 2021-01-26 17:49 tycoon3 阅读(272) 评论(0) 推荐(0) 编辑

PTI(page table isolation)--基本原理和性能开销
摘要:trampoline 页表是用于PTI(Page Table Isolation) 背景 2018,可视作CPU发展历史的重要节点,就是因为爆出了影响范围最广的源自CPU硬件设计的安全漏洞:Meltdown和Spectre,有关这两个漏洞说明,参见我的其他文章。而本文的焦点pti,即专门用于miti 阅读全文

posted @ 2021-01-26 17:38 tycoon3 阅读(1235) 评论(0) 推荐(0) 编辑

Zircon
摘要:zircon代码下载 https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/zircon/ git clone https://github.com/timniederhausen/gn.git gn的编译需要使用clang编译器, 阅读全文

posted @ 2021-01-25 11:07 tycoon3 阅读(789) 评论(0) 推荐(0) 编辑

gvisor virtual filesystem.
摘要:https://github.com/google/gvisor/tree/master/pkg/sentry/fs VFS2 addresses this by delegating path resolution to the filesystem, making it possible to 阅读全文

posted @ 2021-01-22 11:36 tycoon3 阅读(183) 评论(0) 推荐(0) 编辑

gvisor Kernel setup
摘要:Kernel setup runsc/boot/loader.go There are two kernel structs, kernel.Kernel and ring0.Kernel. kernel.Kernel contains most of kernel data structures 阅读全文

posted @ 2021-01-22 09:09 tycoon3 阅读(116) 评论(0) 推荐(0) 编辑

gvisor gofer vfs2
摘要:gVisor accesses the filesystem through a file proxy, called the Gofer. The gofer runs as a separate process, that is isolated from the sandbox. Gofer 阅读全文

posted @ 2021-01-21 20:30 tycoon3 阅读(167) 评论(0) 推荐(0) 编辑

pstree
摘要:root@cloud:~/onlyGvisor# ps -elf | grep docker 4 S root 926586 1 0 80 0 - 1393268 futex_ Jan14 ? 00:09:48 /usr/bin/dockerd -H fd:// --containerd=/run/ 阅读全文

posted @ 2021-01-21 20:02 tycoon3 阅读(194) 评论(0) 推荐(0) 编辑

gvisor vfs2
摘要:runsc --vfs2 do echo 123 123 阅读全文

posted @ 2021-01-21 19:30 tycoon3 阅读(88) 评论(0) 推荐(0) 编辑

gvisor entersyscall exitsyscall
摘要:The Sentry runs in both GR0 and HR3. The bluepill code is responsible for transparently bouncing the Sentry between these two modes, with the followin 阅读全文

posted @ 2021-01-20 19:48 tycoon3 阅读(243) 评论(0) 推荐(0) 编辑

gvisor在arm64下syscall.SIGILL信号处理
摘要:// R0 - The signal number. // R1 - Pointer to siginfo_t structure. // R2 - Pointer to ucontext structure. // TEXT ·sighandler(SB),NOSPLIT,$0 // si_sig 阅读全文

posted @ 2021-01-20 14:46 tycoon3 阅读(320) 评论(0) 推荐(0) 编辑

Golang 系统调用Syscall + RawSyscall
摘要:go源码中关于系统调用的定义如下: func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintp 阅读全文

posted @ 2021-01-20 10:43 tycoon3 阅读(5036) 评论(0) 推荐(0) 编辑

KVM Internal: How a VM is Created?
摘要:KVM is an acronym of “Kernel based Virtual Machine”, and is a virtualization infrastructure for the Linux kernel that turns it into a hypervisor.It is 阅读全文

posted @ 2021-01-20 10:18 tycoon3 阅读(285) 评论(0) 推荐(0) 编辑

gvisor netstack (二)
摘要:https://www.it610.com/article/1175051551228637184.htm TCP发送流程 third_party\golibs\github.com\google\netstack\tcpip\transport\tcp\snd.go sendData maybeS 阅读全文

posted @ 2021-01-19 19:49 tycoon3 阅读(531) 评论(0) 推荐(0) 编辑

gvisor gofer chroot
摘要:Files in the sandbox may be backed by different implementations. For host-native files (where a file descriptor is available), the Gofer may return a 阅读全文

posted @ 2021-01-19 11:45 tycoon3 阅读(133) 评论(0) 推荐(0) 编辑

gvisor proc mount
摘要:https://github.com/google/gvisor/issues/1397 #include <sys/socket.h> #include <sys/un.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #i 阅读全文

posted @ 2021-01-19 10:34 tycoon3 阅读(72) 评论(0) 推荐(0) 编辑

gvisor netstack
摘要:https://github.com/google/gvisor/issues/1397 pkg/sentry/syscalls/linux/sys_socket.go root@cloud:~/onlyGvisor/gvisor# docker exec -it test ping 8.8.8.8 阅读全文

posted @ 2021-01-19 10:19 tycoon3 阅读(238) 评论(0) 推荐(0) 编辑

2020 TSCTF hellovirtual
摘要:是一个虚拟化的题目,在2018 hitcon abyss改编的题目。这里给出了三个文件hellovirtual,hellokernel,hellousr,还给出了ld.so.2,libc.so.6。 hellovirtual是一个利用KVM api来做虚拟化的程序,它会加载一个小型的内核hellok 阅读全文

posted @ 2021-01-18 18:09 tycoon3 阅读(99) 评论(0) 推荐(0) 编辑

Delve调试器 汇编
摘要:目前Go语言支持GDB、LLDB和Delve几种调试器。其中GDB是最早支持的调试工具,LLDB是macOS系统推荐的标准调试工具。但是GDB和LLDB对Go语言的专有特性都缺乏很大支持,而只有Delve是专门为Go语言设计开发的调试工具。而且Delve本身也是采用Go语言开发,对Windows平台 阅读全文

posted @ 2021-01-15 16:43 tycoon3 阅读(260) 评论(0) 推荐(0) 编辑

linux ptrace
摘要:参考资料: Playing with ptrace, Part I Playing with ptrace, Part II 这两篇文章里的代码都是在x86平台上运行的,本文中将其移植到了x86_64平台。 ptrace提供让一个进程来控制另一个进程的能力,包括检测,修改被控制进程的代码,数据,寄存 阅读全文

posted @ 2021-01-15 15:06 tycoon3 阅读(411) 评论(0) 推荐(0) 编辑

kvm + guest kernel
摘要:KVM 基础知识 kvm是一个内核模块,它实现了一个/dev/kvm的字符设备来与用户进行交互,通过调用一系列ioctl函数可以实现qemu和kvm之间的切换。 KVM结构体 KVM结构体在 KVM的系统架构中代表一个具体的虚拟机,当通过 VM_CREATE_KVM 指令创建一个新的 KVM结构体对 阅读全文

posted @ 2021-01-15 12:03 tycoon3 阅读(241) 评论(0) 推荐(0) 编辑

Learning KVM - implement your own kernel
摘要:主要参考的文章是david942j@217的这篇博客和这篇介绍。 在做abyss这个题目的时候涉及到了很多hypervisor, kvm的内容。虚拟化这一层一般也是我们在逃逸的最后一层了。 Basic Intro KVM的全称是Kernel Base Virtual Machine,基于内核的虚拟机 阅读全文

posted @ 2021-01-15 12:00 tycoon3 阅读(238) 评论(0) 推荐(0) 编辑

KVM HOST IN A FEW LINES OF CODE
摘要:KVM is a virtualization technology that comes with the Linux kernel. In other words, it allows you to run multiple virtual machines (VMs) on a single 阅读全文

posted @ 2021-01-15 11:57 tycoon3 阅读(183) 评论(0) 推荐(0) 编辑

VM学习—实现自己的内核
摘要:一、背景知识 介绍:KVM 全称是 基于内核的虚拟机(Kernel-based Virtual Machine),它是Linux 的一个内核模块,该内核模块使得 Linux 变成了一个 Hypervisor。 KVM架构:KVM 是基于虚拟化扩展(Intel VT 或者 AMD-V)的 X86 硬件 阅读全文

posted @ 2021-01-15 11:25 tycoon3 阅读(307) 评论(0) 推荐(0) 编辑

gvisor bluepillHandler + SwitchToUser
摘要:root@cloud:~# docker exec -it test ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: seq=0 ttl=42 time=56.182 ms 64 bytes from 阅读全文

posted @ 2021-01-14 20:03 tycoon3 阅读(153) 评论(0) 推荐(0) 编辑

GO语言调试利器dlv快速上手
摘要:https://www.cnblogs.com/realjimmy/p/13418508.html golang 安装 tar -xvf go1.15.2.linux-arm64.tar.gz -C /usr/local/go [root@centos7 ~]# ls /usr/local/go g 阅读全文

posted @ 2021-01-14 16:01 tycoon3 阅读(2745) 评论(0) 推荐(0) 编辑

gvisor debug
摘要:Stack traces Debugger Profiling Docker Proxy To enable debug and system call logging, add the runtimeArgs below to your Docker configuration (/etc/doc 阅读全文

posted @ 2021-01-14 15:36 tycoon3 阅读(227) 评论(0) 推荐(0) 编辑

gvisor 系统 调用初始化
摘要:Go 中 Syscall 的实现,在汇编文件 syscall/asm_linux_amd64.s 中 // func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64); // Trap # in AX, args in DI SI D 阅读全文

posted @ 2021-01-14 10:12 tycoon3 阅读(381) 评论(0) 推荐(0) 编辑

通过更改页表权限增加系统调用
摘要:实验平台i386,linux kernel版本:2..6.22(之后版本原理都是一样) 首先上一副图: 首先知道cpu看到的都是虚拟地址,CR3寄存器,页表中都是存的物理地址,通过MMU把虚拟地址映射到页表中的物理地址,这幅图说的很清楚了,接下来要获取到sys_call_table在内核中的内存地址 阅读全文

posted @ 2021-01-14 09:24 tycoon3 阅读(284) 评论(0) 推荐(0) 编辑

KVM and Qemu as Linux Hypervisor
摘要:instruction set to provide isolation of resources at hardware level. Since Qemu is a userspace process, the kernel treats it like other processes from 阅读全文

posted @ 2021-01-13 20:31 tycoon3 阅读(167) 评论(0) 推荐(0) 编辑

Hypercall机制
摘要:在Linux中,大家应该对syscall非常的了解和熟悉,其是用户态进入内核态的一种途径或者说是一种方式,完成了两个模式之间的切换; 而在虚拟环境中,有没有一种类似于syscall这种方式,能够从no root模式切换到root模式呢?答案是肯定的,KVM提供了Hypercall机制, x86体系架 阅读全文

posted @ 2021-01-13 17:46 tycoon3 阅读(1659) 评论(0) 推荐(1) 编辑

虚拟机Dune
摘要:https://chengyi818.gitbooks.io/fat-cheng-s-xv6-journey/content/LEC_21/LEC_21.html https://www.usenix.org/conference/osdi12/technical-sessions/presenta 阅读全文

posted @ 2021-01-13 17:34 tycoon3 阅读(444) 评论(0) 推荐(0) 编辑

Dune: Safe User-level Access to Privileged CPU Features
摘要:简介 Dune是一种能为应用程序提供直接但安全访问硬件能力(比如页表、快表等等)的系统。其在现代处理器中使用虚拟化硬件来提供过程,而非机器抽象。它由一个小型内核模块组成,该模块初始化虚拟化硬件并协调与内核的交互,以及一个帮助应用程序管理特权硬件功能的用户级库。 Dune提供了一个可加载的内核模块,可 阅读全文

posted @ 2021-01-13 15:02 tycoon3 阅读(431) 评论(0) 推荐(0) 编辑

libdune VMX
摘要:gVisor 是沿着 libdune 的系统调用拦截思路发展而来的用户态内核或进程虚拟化技术。 – HW performs transiAons between modes • VM Exit -> trap to hypervisor (enter host mode) • VM Enter -> 阅读全文

posted @ 2021-01-13 14:46 tycoon3 阅读(139) 评论(0) 推荐(0) 编辑

gvisor task
摘要:https://terassyi.net/posts/2020/04/14/gvisor.html Sentry 复用了 go 语言的 GMP 模型 [3]。每个应用的线程均对应到 go 语言内置的 goroutine(参见 kernle.Task.Start 函数),即 G。go runtime 阅读全文

posted @ 2021-01-13 11:45 tycoon3 阅读(196) 评论(0) 推荐(0) 编辑

Golang调用汇编代码
摘要:今天在翻阅Golang代码时,发现了Golang调用汇编代码的方法(详见pkg/bytes)。大概要做三件事,我以用汇编实现一个判断字符串是否相等的方法Equal为例,测试一下: 准备工作,创建工程目录: asm_demo |--bin |--pkg |--src | |--strlib | |-- 阅读全文

posted @ 2021-01-13 10:07 tycoon3 阅读(926) 评论(0) 推荐(0) 编辑

gvisor overview
摘要:1. Overview: no interrupts, no devices, no io tasks are goroutines 2. syscall: sentry can run in non-root(ring0) and root(ring3). userapp's syscall ar 阅读全文

posted @ 2021-01-13 09:58 tycoon3 阅读(153) 评论(0) 推荐(0) 编辑

KK19-115 - Android on Docker Containers in a Nutshell
摘要: 阅读全文

posted @ 2021-01-11 19:26 tycoon3 阅读(72) 评论(0) 推荐(0) 编辑

gvisor 进程虚拟化 kvm
摘要:How are Sentry system calls trapped into host kernel?From How gvisor trap to syscall handler in kvm platform, “Note that the SYSCALL instruction (Wenb 阅读全文

posted @ 2021-01-11 17:56 tycoon3 阅读(629) 评论(0) 推荐(0) 编辑

The past, present and future of virtualization
摘要:The rapid pace of innovation in datacenters and the software platforms within them has transformed how companies build, deploy, and manage online appl 阅读全文

posted @ 2021-01-11 14:58 tycoon3 阅读(141) 评论(0) 推荐(0) 编辑

Get started with OSv unikernels as a Docker-alternative
摘要:Container technologies and especially Docker has become the go-to standard for how to package and deploy microservices. It makes for a lightweight, fl 阅读全文

posted @ 2021-01-11 11:59 tycoon3 阅读(329) 评论(0) 推荐(0) 编辑

KVM 虚机的创建过程
摘要:https://www.cnblogs.com/liujunjun/p/12444772.html In contrast to container, the concept Virtual Machine represents another category of isolated execut 阅读全文

posted @ 2021-01-11 10:19 tycoon3 阅读(490) 评论(0) 推荐(0) 编辑

gvisor
摘要:5 月 2 日,谷歌发布了一款新型的沙箱容器运行时 gVisor,号称能够为容器提供更安全的隔离,同时比 VM 更轻量。容器基于共享内核,安全性是大家关注的一大要点,gVisor 的发布势必将引来更多对容器隔离性的关注。那么 gVisor 在技术上如何实现隔离,其性能如何?隔壁阿里巴巴已经有人为你探 阅读全文

posted @ 2021-01-08 18:02 tycoon3 阅读(2515) 评论(0) 推荐(1) 编辑

gvisor 虚拟机
摘要:gvisor/pkg/sentry/platform/platform.go // platforms contains all available platform types. var platforms = map[string]Constructor{} // Register regist 阅读全文

posted @ 2021-01-08 16:45 tycoon3 阅读(253) 评论(0) 推荐(0) 编辑

gvisor
摘要:https://nanikgolang.netlify.app/post/runsc/ gvisor Oct 2, 2020 19 minutes read This article will explain about the container runtime called gvisor. Th 阅读全文

posted @ 2021-01-08 15:32 tycoon3 阅读(368) 评论(0) 推荐(0) 编辑

How to Use User Mode Linux
摘要:https://christine.website/blog/howto-usermode-linux-2019-07-07 https://christine.website/blog/howto-usermode-linux-2019-07-07 User Mode Linux is a por 阅读全文

posted @ 2021-01-08 15:24 tycoon3 阅读(264) 评论(0) 推荐(0) 编辑

User Mode Linux – 一个用户态的 Linux 内核
摘要:User Mode Linux 可以在用户态启动一个 Linux。这使我们能在类似 OpenVZ 虚拟化技术的系统上,使用最新的 Linux 内核;甚至可以在非 root 用户下启动。 但有些 OpenVZ VPS 的 TOS 可能不允许你这么做;另外,这样可能会有一定的性能损失。 准备 rootf 阅读全文

posted @ 2021-01-08 15:14 tycoon3 阅读(1232) 评论(0) 推荐(0) 编辑

gvisor syscall 原理
摘要:https://terassyi.net/posts/2020/04/14/gvisor.html Wenbo Shen 申文博 https://wenboshen.org/posts/2018-12-25-gvisor-inside.html System calls For Linux kern 阅读全文

posted @ 2021-01-08 14:55 tycoon3 阅读(683) 评论(0) 推荐(0) 编辑

gVisor 的设计原理
摘要:gVisor 容器 它的原理,可以用如下所示的示意图来表示清楚。 gVisor 的设计原理 gVisor 工作的核心,在于它为应用进程(用户容器),启动了一个名叫 Sentry 的进程。 而 Sentry 进程的主要职责,就是提供一个传统的操作系统内核的能力,即:运行用户程序,执行系统调用。所以说, 阅读全文

posted @ 2021-01-08 14:22 tycoon3 阅读(2315) 评论(0) 推荐(0) 编辑

gVisor中的vdso实现
摘要:什么是vdso? vdso是virtual ELF dynamic shared object的缩写,即虚拟动态共享库,其实就是“虚拟的so库”。根据linux手册https://man7.org/linux/man-pages/man7/vdso.7.html的介绍,vdso是内核中内置的一个so 阅读全文

posted @ 2021-01-08 12:03 tycoon3 阅读(464) 评论(0) 推荐(0) 编辑

linux 系统调用VDSO
摘要:以软中断或指令方式执行的系统调用,需要切换到内核空间,无论采用早期的int 0x80/iret中断,还是sysenter/sysexit指令,再到syscall/sysexit指令,是一个比较慢的操作。例如像gettimeofday()这种,若每次为了从内核读取时间值而都切换上下文的话,成本就太高了 阅读全文

posted @ 2021-01-08 12:01 tycoon3 阅读(1221) 评论(0) 推荐(0) 编辑

curl
摘要:curl https://mirrors.huaweicloud.com/bazel/3.7.1/bazel-3.7.1-linux-arm64 --output bazel-3.7.1-linux-arm64 阅读全文

posted @ 2021-01-08 11:31 tycoon3 阅读(60) 评论(0) 推荐(0) 编辑

Bazel 国内镜像源加速下载 + 编译gvisor
摘要:Bazel 国内镜像源加速下载: https://mirrors.huaweicloud.com/bazel/ root@cloud:/gvisor# bazel version Build label: 3.7.1 Build target: bazel-out/aarch64-opt/bin/s 阅读全文

posted @ 2021-01-07 20:29 tycoon3 阅读(3431) 评论(0) 推荐(0) 编辑

go proxy 代理
摘要:Go 技巧分享:Go 国内加速镜像 0 个改进 651 说明 众所周知,国内网络访问国外资源经常会出现不稳定的情况。 Go 生态系统中有着许多中国 Gopher 们无法获取的模块,比如最著名的 golang.org/x/...。并且在中国大陆从 GitHub 获取模块的速度也有点慢。 因此设置 CD 阅读全文

posted @ 2021-01-07 20:14 tycoon3 阅读(1208) 评论(0) 推荐(0) 编辑

netstack gvisor
摘要:gvisor简介 gvisor是google新推出一款沙箱运行时,他可以和docker和k8s无缝连接。 gVisor能够在保证轻量化优势的同时,提供与虚拟机类似的隔离效果。gVisor的核心为一套运行非特权普通进程的内核, 且支持大多数Linux系统调用。该内核使用Go编写,这主要是考虑到Go语言 阅读全文

posted @ 2021-01-07 19:44 tycoon3 阅读(577) 评论(0) 推荐(0) 编辑

rust libc
摘要:https://cloud.tencent.com/developer/article/1620862 // use std::thread; // fn main() { // let child = thread::spawn(move || { // println!("Hello, I am 阅读全文

posted @ 2021-01-07 19:13 tycoon3 阅读(648) 评论(0) 推荐(0) 编辑

gVisor in depth
摘要:In my previous blog post I described gVisor as 'some stuff I hardly can really understand'. Technology is not only about code, understanding where it 阅读全文

posted @ 2021-01-07 16:24 tycoon3 阅读(105) 评论(0) 推荐(0) 编辑

Unikernel
摘要:Monolithic Kernel 相信只要是接触过计算机的,一定对『内核』这两个字不会陌生。只要在使用电脑的时候,都离不开跟内核打交道。无论是Windows还是Linux等等,这些寻常使用的操作系统,都是用内核和管理和使用硬件的。 在这其中,最有名的是Linux Kernel,最早是由Linus实 阅读全文

posted @ 2021-01-05 10:38 tycoon3 阅读(780) 评论(0) 推荐(0) 编辑

Unikernel初体验
摘要:引言: 2016年1月21日,应用容器引擎 Docker 宣布收购了英国的 unikernel 实现初创企业 Unikernel System,但具体交易金额并未透露。那么unikernel到底是一种什么样的技术呢?它会对现有技术产生怎样的影响呢?Unikernel是什么:Unikernels ar 阅读全文

posted @ 2021-01-05 10:31 tycoon3 阅读(672) 评论(0) 推荐(0) 编辑

github 文本编辑
摘要:https://www.cnblogs.com/longronglang/p/8453047.html 1、编辑README文件 大标题(一级标题):在文本下面加等于号,那么上方的文字就变成了大标题,等于号的个数无限制,但一定要大于0 大标题 中标题(二级标题):在文本下面加下划线,那么上方的文本就 阅读全文

posted @ 2021-01-04 19:29 tycoon3 阅读(211) 评论(0) 推荐(0) 编辑

cloud-hypervisor coredump
摘要:gdb cloud-hypervisor /data1/core/core-virtio_rng-291579_1609745784 GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git Copyright (C) 2018 Free Software 阅读全文

posted @ 2021-01-04 15:43 tycoon3 阅读(170) 评论(0) 推荐(0) 编辑

rust test
摘要:单元测试 测试(test)是这样一种 Rust 函数:它保证其他部分的代码按照所希望的行为正常 运行。测试函数的函数体通常会进行一些配置,运行我们想要测试的代码,然后 断言(assert)结果是不是我们所期望的。 大多数单元测试都会被放到一个叫 tests 的、带有 #[cfg(test)] 属性 阅读全文

posted @ 2021-01-04 15:04 tycoon3 阅读(583) 评论(0) 推荐(0) 编辑

rust 条件编译
摘要:条件编译可以通过两种不同的操作符实现,如下: - cfg属性:在属性位置中使用#[cfg(...)] - cfg!宏:在布尔表达式中使用cfg!(...) Configuration conditional checks are possible through two different oper 阅读全文

posted @ 2021-01-04 14:41 tycoon3 阅读(433) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示