MoonBit月兔编程语言 现代编程思想 第六课 泛型与高阶函数
泛型和函数是⼀等公⺠的概念 数据结构堆栈与队列的实现 推荐阅读 Software Foundations 第四章 或 Programming Language Foundations in Agda 第⼗章 270 码力 | 27 页 | 2.56 MB | 1 年前3
MoonBit月兔编程语言 现代编程思想 第三课 函数, 列表与递归 数据结构:列表的定义与模式匹配 算法:递归的含义与运算,以及动态规划 拓展阅读 Software Foundations 前三章 或 Programming Language Foundations in Agda 前三章 《算法导论》第⼗四章 420 码力 | 42 页 | 587.59 KB | 1 年前3
Idris 语言文档 Version 1.3.1奤 奩 奮 奩 奴 奩 奡奬 奩 女 奥 奡 奷 奯奲 奤 奬 奩 女 奴 奡女 奦 奯奬 奬 奯奷 女 夺 words : ?wtype words = with Vect ["idris","agda","haskell","miranda", "java","javascript","fortran","basic", "coffeescript","rust"] wtype = proof0 码力 | 224 页 | 2.06 MB | 1 年前3
Bootarmor 入门教程和用户手册 0.1.0btarmor boot --status btarmor make -i, --inplace -O, --output PATH -sys, --share -sh, --safe-heap -ss, --safe-stack -f FILE 子命令 make 用于将可执行文件,动态库和数据文件等,转换成为 Bootarmor 保护的 安全文件,转换后生成的文件是经过加密处理的,只能在 使用该选项加密的文件允许内核访问,同时这个 可执行文件也只能运行在应用程序层,而没 有运行在安全应用层。 选项 --safe-heap 用于保护内存堆,这里面一般是程序使用 malloc 申请的内存 空间,默认情况下是允许内核访问的。如果这些数据不需要被内核访问,使用 该选项可以提 高安全性。 选项 --safe-stack 用于保护运行栈,这里面一般是程序的调用框架和局部变 量,默认 情况下是允许内核访问的。如果这些数据不需要被内核访问,使用 BTPS(>); syscall(20, >); BTPE(>); 备注 宏 BTS 和 BTPS/BTPE 都使用通过把数据拷贝到运行栈来实现和内核共享,如 果应用程序使用 --safe-stack 对运行栈进行了保护,那么这些宏是无法共享 数据 到内核的。 保护内存堆 如果需要保护内存堆中的数据,可以使用下面的方式 1. 使用宏 mmap 分配空间,并使用 MAP_BTMDATA0 码力 | 25 页 | 30.29 KB | 1 年前3
Bootarmor 入门教程和用户手册 0.1.0--output PATH 生成的文件保存在另外一个路径,默认是 dist -sys, --share 使用共享模式进行保护,一般用于保护系统动态库 -sh, --safe-heap 不允许内核访问应用程序申请的堆空间 -ss, --safe-stack 不允许内核访问运行栈(局部变量) -f FILE 从文件里面读取需要处理的文件名称 10 Chapter 3. btarmor Bootarmor 件允许内核访 问,同时这个可执行文件也只能运行在应用程序层,而没有运行在安全应用层。 选项 --safe-heap 用于保护内存堆,这里面一般是程序使用 malloc 申请的内存空间,默认情况下是允许 内核访问的。如果这些数据不需要被内核访问,使用该选项可以提高安全性。 选项 --safe-stack 用于保护运行栈,这里面一般是程序的调用框架和局部变量,默认情况下是允许内核 访问的。如 BTPS(>); syscall(20, >); BTPE(>); 备注: 宏 BTS 和 BTPS/BTPE 都使用通过把数据拷贝到运行栈来实现和内核共享,如果应用程序使用 --safe-stack 对运行栈进行了保护,那么这些宏是无法共享数据到内核的。 4.3 保护内存堆 如果需要保护内存堆中的数据,可以使用下面的方式 1. 使用宏 mmap 分配空间,并使用 MAP_BTMDATA0 码力 | 29 页 | 300.11 KB | 1 年前3
基于静态分析的Rust内存安全缺陷检测研究Rust的安全哲学 ❑ Safe API无论如何被使用都不应带来未定义行为 ❑ 程序员应避免直接使用unsafe code ❑ Interior unsafe:将unsafe code封装为safe API Safe APIs Safe API Unsafe APIs and FFIs call User Programs call call Safe Rust Unsafe Unsafe Rust Safe API access Memory Unsafe APIs Unsafe API call Unsafe API access call Rust实际表现如何? ❑ 调研了2020年12月31日前报告的185个内存安全漏洞[TOSEM'21] ▪ Rust在内存安全防护方面效果不错 ▪ 所有的漏洞(除了1个编译器漏洞)都需要unsafe code study with all Rust CVEs”, TOSEM, 2021. PoC #![forbid(unsafe_code)] Libraries unsafe code call safe (unsound) APIs Unsound Mem-Safety Problem Executable Libraries escalation of unsoundness Developer0 码力 | 28 页 | 1.55 MB | 1 年前3
Rust 程序设计语言简体中文版an object-oriented language. My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put one_result() { let query = "duct"; let contents = "\ Rust: safe, fast, productive. Pick three."; assert_eq!(vec!["safe, fast, productive."], search(query, contents)); } } 示例 12-15:创建一个我们期望的 的原则,我们将增加足够的代码来使其能够编译:一个总是会返回空 vector 的 search 函数定义,如示例 12-16 所示。然后这个测试应该能够编译并因为空 vector 并不匹配 一个包含一行 "safe, fast, productive." 的 vector 而失败。 文件名:src/lib.rs # use std::error::Error; # use std::fs; # # pub0 码力 | 600 页 | 12.99 MB | 1 年前3
httpd 2.2.29 中文文档exception to this rule. Putting configuration restrictions in asection is perfectly safe because this section will apply to all requests regardless of the specific URL. Virtual Hosts The anything the server user can. Some scripting engines may provide restrictions, but it is better to be safe and assume not. Protecting System Settings To run a really tight ship, you'll want to stop users launch CGI scripts, the environment will be cleaned down to a set of safe variables before CGI scripts are launched. The list of safe variables is defined at compile-time in suexec.c. For portability reasons 0 码力 | 1854 页 | 1.48 MB | 1 年前3
httpd 2.2.27 中文文档exception to this rule. Putting configuration restrictions in asection is perfectly safe because this section will apply to all requests regardless of the specific URL. Virtual Hosts The anything the server user can. Some scripting engines may provide restrictions, but it is better to be safe and assume not. Protecting System Settings To run a really tight ship, you'll want to stop users launch CGI scripts, the environment will be cleaned down to a set of safe variables before CGI scripts are launched. The list of safe variables is defined at compile-time in suexec.c. For portability reasons 0 码力 | 1849 页 | 1.47 MB | 1 年前3
httpd 2.2.31 中文文档exception to this rule. Putting configuration restrictions in asection is perfectly safe because this section will apply to all requests regardless of the specific URL. Virtual Hosts The anything the server user can. Some scripting engines may provide restrictions, but it is better to be safe and assume not. Protecting System Settings To run a really tight ship, you'll want to stop users launch CGI scripts, the environment will be cleaned down to a set of safe variables before CGI scripts are launched. The list of safe variables is defined at compile-time in suexec.c. For portability reasons 0 码力 | 1860 页 | 1.48 MB | 1 年前3
共 266 条
- 1
- 2
- 3
- 4
- 5
- 6
- 27













