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, Jul 20, 10:26 PM
Unknown Object (File)
Sun, Jul 20, 4:29 AM
Unknown Object (File)
Wed, Jul 9, 8:20 PM
Unknown Object (File)
Jun 23 2025, 11:12 PM
Unknown Object (File)
Jun 22 2025, 10:39 AM
Unknown Object (File)
Jun 20 2025, 11:48 PM
Unknown Object (File)
Jun 14 2025, 9:05 PM
Unknown Object (File)
Jun 8 2025, 1:07 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?