containers / containers/udica

python3: handle.c:336: semanage_connect: Assertion `sh != NULL' failed.

Open
#148 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
583
Forks
48
PR merge metrics
No merged PRs in 30d

Description

When trying to generate the Selinux profile the application crashes with the following error:
`[user]# udica -j container.json my_container
error parsing semanage configuration file: syntax error
python3: handle.c:336: semanage_connect: Assertion `sh != NULL' failed.
Aborted (core dumped)`

I figured it out this happens when I have this mount dir in my container container, specifically the hostPath:
` {
"containerPath": "/sys/devices",
"gidMappings": [],
"hostPath": "/sys/devices",
"propagation": "PROPAGATION_PRIVATE",
"readonly": false,
"selinuxRelabel": false,
"uidMappings": []
},`
If I change the hostPath to something else, or remove the whole mount point, The profile will be generated.

I run udica in a pod in openshift platform.
Attached core dump:
[coredump_udica.tar.gz](https://github.com/user-attachments/files/17283594/coredump_udica.tar.gz)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `udica -j container.json my_container` reproduction using the `/sys/devices` hostPath mount and inspect the attached core dump. Trace where profile generation reaches `semanage_connect` and determine why this mount triggers the assertion; done means the profile is generated without the crash while retaining the reported mount configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.