# Mentorship application to RISC-V Mentorship Program
```
Proposal Submission Guidelines:
- RISC-V Organizational members are welcome to submit a mentorship project proposal for consideration.
- Multiple mentors supervising one mentee per project would be desirable as this helps spread the workload and reduce the challenge of coverage caused by working remotely with a mentee in a different time zone.
- The mentor(s) need to be familiar with the project and is/are expected to directly supervise the hired mentee's technical work.
- The proposed project needs to be clearly scoped and structured to be suitable for a mentorship project.
- The project should be related to one of the current RISC-V technical priorities in support of the RISC-V Community, not specific to the strategy or goals of an independent RISC-V member.
- All technical and supporting deliverables will be contributed to RISC-V International and issued under acceptable open source license.
Proposal Review/Selection Process and Criteria:
RISC-V Technical Staff reviews all proposals and validates and/or selects projects to open for applications on Linux Foundation LFX Mentorship in coordination with the mentorship program admin.
General selection criteria are:
- The selected proposals have clearly scoped learning objectives and outcomes that are suitable for one mentee, either a student developer/researcher or a new contributor, to complete within 12 weeks if working full time or 24 weeks if working part time.
- The selected proposals will represent a nice mix of project difficulty levels. Some low, medium, and high difficulties.
- The selected proposals will maximize the diversity of the proposals, mentors, and mentees.
- The selected proposals are related to RISC-V technical goals.
- The mentors of the selected proposals will represent a nice mix of experienced and new mentors.
If a mentorship is not selected by RISC-V International, the organization is able to sponsor and pay for the mentorship through the LFX guidelines, paid as a sponsorship.
Submit a mentorship proposal by November 28, 2021.
```
> Mentor Name *
Jason Bacon and Mark Johnston
> Member Company *
FreeBSD Foundation
> Name of project mentorship *
Syzkaller on FreeBSD/RISC-V
> Mentorship description - Describe the project in detail. Provide two or three paragraphs describing the tasks. Include the problem/opportunity in need of effort, as well as a description of the probable implementation path and steps to explore and fix the problem or realize the opportunity. The more detail you can provide on the project page, the more likely your potential interns/mentees will understand what you are looking for. *
syzkaller is a coverage-guided operating system kernel fuzzer. It originally targeted Linux but has since expanded to support nearly a dozen other operating systems, including FreeBSD. syzkaller is sometimes described as a system call fuzzer but is flexible enough to target other operating system interfaces. For example, it has been used to fuzz Linux’s USB stack and has found dozens of bugs in the USB subsystem alone. The details are complicated but the idea is simple: generate a program which invokes one or more system calls (or injects a packet into the network, etc.), run it, and check to see if the system diagnosed an error (for example by panicking). If not, collect kernel code coverage information and decide whether to try iterating upon the previous test program, or start anew. If so, collect information about the crash and try to discover a minimal test case that triggers the crash.
Over the past several years syzkaller has been extraordinarily successful at finding severe bugs in all major operating systems, including FreeBSD. We propose a mentorship to complete the tasks necessary to get Syzkaller working on FreeBSD/RISC-V. As syzkaller is written mostly in Go, the first step of the mentorship would be to ensure that Go can be used to build syzkaller under FreeBSD/RISC-V. This will be a challenging task, however previous work can be harnessed from two projects to make this tractable. First, Go has a RISC-V port targeting GNU/Linux, and second, the CHERI project has a FreeBSD/mips port of Go. The next tast is to add FreeBSD/RISC-V support to syzkaller itself. A work-in-progress patch to add FreeBSD/arm64 support can be uses as a basis in this project. Two bonus tasks are: 1. Upstream Go support for FreeBSD/RISC-V to the Go Project, and 2. Begin fuzzing system calls under FreeBSD/RISC-V.
> Additional Information - Provide links to wiki entries, release-plan notes, and/or other web-references that would be helpful information to potential mentee applicants. *
https://wiki.freebsd.org/riscv
https://github.com/google/syzkaller
https://github.com/CTSRD-CHERI/cheri-syzkaller
https://github.com/CTSRD-CHERI/freebsd-mips-go/commits/freebsd-mips-go
> Learning Objectives - Well-developed learning objectives are an integral part of providing a positive internship/mentorship experience and demonstrate a well-organized and robust project. Introduction to open source culture and collaboration tools should be a required learning objective for all internship projects. Additional learning objectives may include soft/hard skills the mentee will learn, how the mentee will be mentored or supervised, professional or networking opportunities, and etc. *
> Expected Outcome - List the deliverable(s) (e.g. features/application(s)/report(s), etc.) to track progress *
- Set up an FreeBSD/RISC-V environment, QEMU
- Determine the status of Go on FreeBSD/RISC-V under QEMU and identify any issues
- Solve any remaining issue with Go on FreeBSD/RISC-V under QEMU
- Iterate over each of the programs in the syzkaller suite to identify and correct any issues
- Bonus: Begin fuzzing system calls under FreeBSD/RISC-V
> Relation to RISC-V -List the RISC-V Project(s) or Labs, e.g. XXXXXX that this mentorship is related to or adding features or functionalities to. *
The mentorship is likely related to many RISC-V Projects because syzkaller's flexibility means it is capable of targeting many operating system interfaces.
> Education Level - If education beyond the undergraduate level is preferred, please specify. *
- This project is suitable for someone with experience with operating system internals and systems programming. This could be a talented undergraduate or a motived graduate student.
> Skills - List the skills, abilities, technical knowledge, and training required and/or desired for successfully completing the project. *
- Experience with Operating system internals
- Expereince with Systems progrmming
- Solid C programming experience
- Assembly programming experience (parts of Go's runtime are written in their bespoke assembly language)
- Experience with the Go programming language would be an asset
> Future plans - What's the path forward for continuing the momentum of the project after the formal mentorship ends? *
With syzkaller functioning on FreeBSD/RISC-V we expect it to be valuable for identifying issues on the platform.
Future work specific to this project includes:
- Upstreaming the FreeBSD/RISC-V port of Go (there likely will not be time during this mentorship)
- Upstreaming the FreeBSD/RISC-V syzkaller target support
- Triaging and fixing bugs found by fuzzing FreeBSD/RISC-V.