<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>38694</bug_id>
          
          <creation_ts>2020-07-10 00:45:30 +0300</creation_ts>
          <short_desc>Executable stack in mpeg2desc</short_desc>
          <delta_ts>2020-07-10 16:45:12 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>dvdauthor</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dmitry V. Levin">ldv</reporter>
          <assigned_to name="Yuri N. Sedunov">aris</assigned_to>
          <cc>aris</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>191245</commentid>
    <comment_count>0</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2020-07-10 00:45:30 +0300</bug_when>
    <thetext>mpeg2desc.c:819:26: warning: trampoline generated for nested function &apos;bufread&apos; [-Wtrampolines]
verify-elf: WARNING: ./usr/bin/mpeg2desc: found executable STACK entry:   GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>191258</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2020-07-10 14:14:17 +0300</bug_when>
    <thetext>dvdauthor-0.7.2-alt4 -&gt; sisyphus:

 Fri Jul 10 2020 Yuri N. Sedunov &lt;aris@altlinux&gt; 0.7.2-alt4
 - updated to 0.7.2-9-gd5bb0bd
 - implemented &quot;magick&quot; knob (set to &quot;graphicsmagick&quot; by default)
 - built with &quot;-z noexecstack&quot; linker flags (ALT #38694)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>191259</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2020-07-10 14:31:11 +0300</bug_when>
    <thetext>(In reply to Repository Robot from comment #1)
&gt; dvdauthor-0.7.2-alt4 -&gt; sisyphus:
&gt;  - built with &quot;-z noexecstack&quot; linker flags (ALT #38694)

Я прошу прощения, но если &quot;trampoline generated for nested function &apos;bufread&apos;&quot; никуда не делось, не вызывает ли теперь этот код segfault?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>191262</commentid>
    <comment_count>3</comment_count>
    <who name="Yuri N. Sedunov">aris</who>
    <bug_when>2020-07-10 16:45:12 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #2)
&gt; (In reply to Repository Robot from comment #1)
&gt; &gt; dvdauthor-0.7.2-alt4 -&gt; sisyphus:
&gt; &gt;  - built with &quot;-z noexecstack&quot; linker flags (ALT #38694)
&gt; 
&gt; Я прошу прощения, но если &quot;trampoline generated for nested function
&gt; &apos;bufread&apos;&quot; никуда не делось, не вызывает ли теперь этот код segfault?

Уверенно вызывает. Виноват, поторопился подсмотрев у suse&apos;й.
https://build.opensuse.org/package/show/openSUSE%3ALeap%3A15.2/dvdauthor

Посоветуете ли, что делать с этим куском кода в src/mpeg2desc.c?

812 #if defined(HAVE_NESTED_ROUTINES)
    813                 if (outputenglish &amp;&amp; packetid &gt;= MPID_VIDEO_FIRST &amp;&amp; packetid &lt;= MPID_VIDEO_LAST)
    814                   {
    815                   /* look inside PES packet to report on details of video packets */
    816                     unsigned int remaining = readlen;
    817                     jmp_buf resume;
    818                   /* GCC extension! nested routine */
    819                     void bufread(void *ptr, int len, bool required)
    820                       {
    821                         const unsigned int tocopy = remaining &gt; len ? len : remaining;
    822                         if (tocopy != 0)
    823                           {
    824                             memcpy(ptr, buf + contentoffs, tocopy);
    825                             ptr = (unsigned char *)ptr + tocopy;
    826                             len -= tocopy;
    827                             contentoffs += tocopy;
    828                             remaining -= tocopy;
    829                             inputpos += tocopy;
    830                           } /*if*/
    831                         if (len != 0)
    832                           {
    833                           /* read more of packet */
    834                             const unsigned int toread = packetlen &lt; len ? packetlen : len;
    835                             readinput(ptr, toread, required);
    836                             if (dowrite)
    837                               {
    838                                 writetostream(packetid, ptr, toread);
    839                               } /*if*/
    840                             packetlen -= toread;
    841                             len -= toread;
    842                             if (len != 0)
    843                               {
    844                                 if (false /*required*/)
    845                                   {
    846                                     fprintf(stderr, &quot;Unexpected nested read EOF\n&quot;);
    847                                   } /*if*/
    848                                 longjmp(resume, 1);
    849                               } /*if*/
    850                           } /*if*/
    851                       } /*bufread*/
    852                     inputpos -= remaining; /* rewind to start of packet content */
    853                     if (!setjmp(resume))
    854                       {
    855                         process_packets(bufread, true);
    856                       } /*if*/
    857                   }
    858                 else
    859 #endif</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>