Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mk/Uses/proccontrol.mk: add USES=proccontrol #300

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

ekhramtsov
Copy link
Contributor

@ekhramtsov ekhramtsov commented Sep 18, 2024

Base has introduced proccontrol(1) in base@7402f93ef2ea to opt-out from execution modes (e.g. protmax after base@74a1b66cf41d.

Mk/Uses/proccontrol.mk allows to set process modes for build, e.g. disable protmax and allow wxmap to build e.g. Java when host is restricted (e.g. kern.elf64.allow_wx=0 vm.imply_prot_max=1).

UPD: This is heavily WIP until I get more time to separate out elfctl changes and chase elfctl change in tree. I'll likely publish to Phabricator and close this pull request once done.

@ekhramtsov
Copy link
Contributor Author

ekhramtsov commented Sep 18, 2024

chrome* IIRC I only build tested for PoC and didn't set elfctl on resulting binary, also tested like ~year ago and things could change. I would see/test later.

ekhramtsov and others added 20 commits September 21, 2024 06:48
Ports (e.g. editors/neovim) can overwrite binary after post-build
in _STAGE_SEQ (bsd.port.mk) resulting in ELF flag loss.

Move elfctl to after post-stage so flags are set on final binary.

${INSTALL_PROGRAM} uses BINMODE (0555), so set to 0755 and do elfctl,
then restore old mode for poudriere build to succeed.

(XXX: find out how to declare and use variables inside loop to
remove hideous hack to store file mode)

Ports that need ELF flags for stage or build need proccontrol(1)
starting build or elfctl.mk needs to be changed for other stages.
PROCCONTROL_MODE allows to set process modes for port build stages,
e.g. disable protmax and allow wxmap to build www/node when jail 0
is restricted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant