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)
Feb 8 2025, 8:37 PM
Unknown Object (File)
Feb 8 2025, 5:07 AM
Unknown Object (File)
Feb 7 2025, 9:11 PM
Unknown Object (File)
Jan 24 2025, 5:25 PM
Unknown Object (File)
Jan 18 2025, 9:32 PM
Unknown Object (File)
Jan 9 2025, 1:51 AM
Unknown Object (File)
Dec 26 2024, 6:56 PM
Unknown Object (File)
Dec 25 2024, 6:28 PM
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?