Skip to content

sb dec drops a (deny X) when X is allowed by sbpl1.scm #1258

Description

@retsl

What happened?

When decompiling the compiled profile blob of the profile below, ipsw drops the explicit (deny file-link) deny:

(version 1)
(deny default)
(deny file-link)

That deny is not redundant because the version 1 preamble contains (allow file-link):

$ head -n 5 _sbpl1_scm
(allow consume-extension)
(allow darwin-notification-post)
(allow dynamic-code-generation)
(allow file-clone)
(allow file-link)

How can we reproduce this?

$ bash -c 'export IPSW=./ipsw
export OPS=./ops.txt
export DARWIN="25.5.0"
cat > orig.sb <<"EOF"
(version 1)
(deny default)
(deny file-link)
EOF
cat > degr.sb <<"EOF"
(version 1)
(deny default)
EOF
"$IPSW" sb cmpl orig.sb -o orig
"$IPSW" sb cmpl degr.sb -o degr
"$IPSW" sb dec --type profile -i orig/profile.bin --operations "$OPS" --darwin-version "$DARWIN" -O orig.dec.sb
"$IPSW" sb cmpl orig.dec.sb -o rt
shasum orig/profile.bin degr/profile.bin rt/profile.bin
cat orig.dec.sb | grep deny'
   • Compiling profile to orig/profile.bin
   • Compiling profile to degr/profile.bin
   • Parsing sandbox profile data
   • Compiling profile to rt/profile.bin
fb561834a8c173800125331c125d10e4d9215fe0  orig/profile.bin
eea4d9ed24c8a63dda117c0fdffa578c65909b9e  degr/profile.bin
eea4d9ed24c8a63dda117c0fdffa578c65909b9e  rt/profile.bin
(deny default)
(deny mach-lookup

ipsw version

Version: 3.1.696, BuildCommit: 343f09c8580f1774e7c0308e3ab798915c380b10

Search

  • I did search for other open and closed issues before opening this

AI assistance

Claude Code helped with creating code for roundtrip testing ipsw which identified this issue.

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I understand and agree to follow this project's AI Usage Policy

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions