Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-46558

python3-libselinux generate segmentation fault

    • libselinux-3.7-2.el10
    • None
    • Critical
    • 1
    • rhel-sst-security-selinux
    • ssg_security
    • 21
    • 3
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • No
    • CY24Q3
    • Unspecified Release Note Type - Unknown
    • None

      https://bugzilla.redhat.com/show_bug.cgi?id=2295428

      • reproducer:

      $ toolbox create --release 41
      $ toolbox enter fedora-toolbox-41

      toolbox $ sudo dnf install python3-libselinux
      toolbox $ python3
      >>> import selinux
      >>> selinux.matchpathcon("/dev", 16384)
      Segmentation fault (core dumped)

      • workaround:

      $ sudo dnf install selinux-policy-targeted

      • (gdb) bt
        #0 closef (rec=<optimized out>) at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/label_file.c:915
        #1 0x00007f215fb59e5e in selabel_close (rec=0x563b58589860) at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/label.c:364
        #2 0x00007f215fb5a01b in selabel_open (backend=<optimized out>, opts=0x7f21703d18f8, nopts=6) at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/label.c:228
        #3 0x00007f215fb67630 in matchpathcon_init_prefix (path=0x0, subset=0x0) at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/matchpathcon.c:364
        #4 0x00007f215fb67811 in matchpathcon_internal (path=path@entry=0x7f214e7e1888 "/dev", mode=mode@entry=16384, con=con@entry=0x7ffcc5e533e0)
        at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/matchpathcon.c:443
        #5 0x00007f215fb67839 in matchpathcon (path=path@entry=0x7f214e7e1888 "/dev", mode=mode@entry=16384, con=con@entry=0x7ffcc5e533e0)
        at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/matchpathcon.c:461
        #6 0x00007f2161e0ce3e in _wrap_matchpathcon (self=<optimized out>, args=<optimized out>) at /usr/src/debug/libselinux-3.7-1.fc41.x86_64/src/selinuxswig_python_wrap.c:13202
        #7 0x00007f2170851f4a in cfunction_call (func=0x7f215fbc16c0, args=0x7f214e7a35c0, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/methodobject.c:551
        #8 0x00007f2170819eeb in _PyObject_MakeTpCall (tstate=0x7f2170be07a0 <_PyRuntime+282784>, callable=0x7f215fbc16c0, args=<optimized out>, nargs=2, keywords=0x0)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:242
        #9 0x00007f217082fffd in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Python/generated_cases.c.h:813
        #10 0x00007f21708880b7 in _PyEval_EvalFrame (tstate=0x7f2170be07a0 <_PyRuntime+282784>, frame=<optimized out>, throwflag=0)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Include/internal/pycore_ceval.h:119
        #11 _PyEval_Vector (tstate=0x7f2170be07a0 <_PyRuntime+282784>, func=0x7f215d161800, locals=0x0, args=0x7f214e91c2d0, argcount=1, kwnames=0x1)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Python/ceval.c:1819
        #12 _PyFunction_Vectorcall (func=0x7f215d161800, stack=0x7f214e91c2d0, nargsf=1, kwnames=0x1) at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:413
        #13 _PyObject_VectorcallTstate (tstate=0x7f2170be07a0 <_PyRuntime+282784>, callable=0x7f215d161800, args=0x7f214e91c2d0, nargsf=1, kwnames=0x1)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Include/internal/pycore_call.h:168
        #14 method_vectorcall (method=method@entry=0x7f214f002ac0, args=args@entry=0x7f214e91c2d8, nargsf=<optimized out>, kwnames=kwnames@entry=0x7f214e3e8880)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/classobject.c:62
        #15 0x00007f217090afe8 in _PyVectorcall_Call
        (tstate=0x7f2170be07a0 <_PyRuntime+282784>, func=0x7f2170887d00 <method_vectorcall>, callable=0x7f214f002ac0, tuple=<optimized out>, kwargs=<optimized out>)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:285
        #16 _PyObject_Call (tstate=0x7f2170be07a0 <_PyRuntime+282784>, callable=0x7f214f002ac0, args=<optimized out>, kwargs=<optimized out>)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:348
        #17 0x00007f2170834b3a in PyObject_Call (callable=0x7f214f002ac0, args=0x7f2170bb0ef8 <_PyRuntime+88056>, kwargs=0x7f214e7a1b40)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:373
        #18 PyCFunction_Call (callable=0x7f214f002ac0, args=0x7f2170bb0ef8 <_PyRuntime+88056>, kwargs=0x7f214e7a1b40) at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:381
        #19 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Python/generated_cases.c.h:1353
        #20 0x00007f21708880b7 in _PyEval_EvalFrame (tstate=0x7f2170be07a0 <_PyRuntime+282784>, frame=<optimized out>, throwflag=0)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Include/internal/pycore_ceval.h:119
        #21 _PyEval_Vector (tstate=0x7f2170be07a0 <_PyRuntime+282784>, func=0x7f2161ad8040, locals=0x0, args=0x7f214f2a8ec0, argcount=1, kwnames=0x1)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Python/ceval.c:1819
        #22 _PyFunction_Vectorcall (func=0x7f2161ad8040, stack=0x7f214f2a8ec0, nargsf=1, kwnames=0x1) at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:413
        #23 _PyObject_VectorcallTstate (tstate=0x7f2170be07a0 <_PyRuntime+282784>, callable=0x7f2161ad8040, args=0x7f214f2a8ec0, nargsf=1, kwnames=0x1)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Include/internal/pycore_call.h:168
        #24 method_vectorcall (method=method@entry=0x7f214f2b38c0, args=args@entry=0x7f214f2a8ec8, nargsf=<optimized out>, kwnames=kwnames@entry=0x7f214ec65840)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/classobject.c:62
        #25 0x00007f217090afe8 in _PyVectorcall_Call
        (tstate=0x7f2170be07a0 <_PyRuntime+282784>, func=0x7f2170887d00 <method_vectorcall>, callable=0x7f214f2b38c0, tuple=<optimized out>, kwargs=<optimized out>)
        at /usr/src/debug/python3.13-3.13.0~b3-1.fc41.x86_64/Objects/call.c:285

              rhn-engineering-plautrba Petr Lautrbach
              rhn-engineering-plautrba Petr Lautrbach
              Vit Mojzis Vit Mojzis
              Milos Malik Milos Malik
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: