Page MenuHomeFreeBSD

tftpd:capsicumize tftpd
Needs ReviewPublic

Authored by hanslu952_gmail.com on Aug 13 2024, 11:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 9, 4:34 AM
Unknown Object (File)
Wed, Nov 5, 11:15 AM
Unknown Object (File)
Wed, Nov 5, 4:54 AM
Unknown Object (File)
Wed, Nov 5, 4:05 AM
Unknown Object (File)
Wed, Nov 5, 2:22 AM
Unknown Object (File)
Thu, Oct 30, 7:35 AM
Unknown Object (File)
Wed, Oct 29, 1:43 AM
Unknown Object (File)
Oct 27 2025, 3:30 AM
Subscribers

Details

Reviewers
oshogbo
lwhsu
Summary

Enter libcasper service to enter capability mode,and adjust how tftpd interacts with
socket,because it violates capability.
I reimplemented the underlying file operation with cap_fileargs.

Sponsored by: Google, Inc. (GSoC 2024)

Test Plan

Trivial:

$ mkdir /tftproot
$ cd /tftproot
$ vim testfile
$ tftp localhost

tftp> get testfile

Normal:

$ cd /usr/tests/libexec/tftpd
$ kyua test -k Kyuafile
one case testing
$ kyua debug -k Kyuafile functional:testcase

Set up enotcapable to get coredump

sysctl kern.trap_enotcap=1
sysctl kern.corefile= /tmp/coredumps/%N.core
gdb executable corefile

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59001
Build 55888: arc lint + arc unit

Event Timeline

hanslu952_gmail.com edited the test plan for this revision. (Show Details)
libexec/tftpd/tftpd.c
247

Are we in a capability mode?
Why we need casper?

579

Style.

720

Wy style change?

735

Style.

745

Please reformat this whole section.

747

Do we expect function validate_access to enter capability mode? We don't have a better place?