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

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

    <bug>
          <bug_id>27752</bug_id>
          
          <creation_ts>2012-09-19 11:35:44 +0400</creation_ts>
          <short_desc>vsftpd does not work if seccomp sandbox is enabled</short_desc>
          <delta_ts>2021-01-15 14:47:41 +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>vsftpd</component>
          <version>unstable</version>
          <rep_platform>all</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>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="PeterVF">petervf</reporter>
          <assigned_to name="Alexey Shabalin">shaba</assigned_to>
          <cc>aspsk</cc>
    
    <cc>boyarsh</cc>
    
    <cc>kopilo4ka</cc>
    
    <cc>lav</cc>
    
    <cc>rider</cc>
    
    <cc>shaba</cc>
    
    <cc>vic_1980</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>133381</commentid>
    <comment_count>0</comment_count>
    <who name="PeterVF">petervf</who>
    <bug_when>2012-09-19 11:35:44 +0400</bug_when>
    <thetext>Система sisyphus, systemd
$ uname -r
3.5.4-std-def-alt1

$ lftp localhost
lftp localhost:~&gt; ls 123test/
-rw-r--r--    1 ftp      ftp         92699 Aug 27 13:30 whatis.jpeg   
lftp localhost:/&gt; get whatis.jpeg 
get: Ошибка доступа: 550 Failed to open file. (whatis.jpeg)
lftp localhost:/&gt; exit

$ sudo tail /var/log/vsftpd.log
[sudo] password for admin:
Wed Sep 19 11:19:31 2012 [pid 5034] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;mozilla@example.com&quot;
Wed Sep 19 11:19:34 2012 [pid 5040] CONNECT: Client &quot;127.0.0.1&quot;
Wed Sep 19 11:19:34 2012 [pid 5039] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;mozilla@example.com&quot;
Wed Sep 19 11:27:11 2012 [pid 5058] CONNECT: Client &quot;127.0.0.1&quot;
Wed Sep 19 11:27:11 2012 [pid 5057] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;lftp@&quot;
Wed Sep 19 11:28:30 2012 [pid 5083] CONNECT: Client &quot;127.0.0.1&quot;
Wed Sep 19 11:28:30 2012 [pid 5082] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;lftp@&quot;
Wed Sep 19 11:29:47 2012 [pid 5093] CONNECT: Client &quot;127.0.0.1&quot;
Wed Sep 19 11:29:47 2012 [pid 5092] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;lftp@&quot;
Wed Sep 19 11:29:56 2012 [pid 5096] [vsftpd] FAIL DOWNLOAD: Client &quot;127.0.0.1&quot;, &quot;/whatis.jpeg&quot;, 0.00Kbyte/sec

Тоже самое было с ядром 3.5.3-std-def
С ядром 3.4.8-std-def и более ранними - все работает

Возможно, это поправили в новой версии? (http://www.opennet.ru/opennews/art.shtml?num=34859)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133407</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2012-09-20 20:44:09 +0400</bug_when>
    <thetext>vsftpd-3.0.2-alt1 -&gt; sisyphus:

* Thu Sep 20 2012 Dmitry V. Levin &lt;ldv@altlinux&gt; 3.0.2-alt1
- Updated to 3.0.2 (closes: #27752).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133491</commentid>
    <comment_count>2</comment_count>
    <who name="PeterVF">petervf</who>
    <bug_when>2012-09-24 15:24:15 +0400</bug_when>
    <thetext>к сожалению, проблема осталась
vsftpd.conf:
log_ftp_protocol=YES

$ sudo tail /var/log/vsftpd.log
Mon Sep 24 14:28:23 2012 [pid 1] [vsftpd] OK LOGIN: Client &quot;127.0.0.1&quot;, anon password &quot;mozilla@example.com&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;230 Login successful.&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP command: Client &quot;127.0.0.1&quot;, &quot;SYST&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;215 UNIX Type: L8&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP command: Client &quot;127.0.0.1&quot;, &quot;PWD&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;257 &quot;/&quot;&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP command: Client &quot;127.0.0.1&quot;, &quot;TYPE I&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;200 Switching to Binary mode.&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP command: Client &quot;127.0.0.1&quot;, &quot;PASV&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;227 Entering Passive Mode (127,0,0,1,252,10).&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP command: Client &quot;127.0.0.1&quot;, &quot;CWD /123test/whatis.jpeg&quot;
Mon Sep 24 14:28:23 2012 [pid 3] [vsftpd] FTP response: Client &quot;127.0.0.1&quot;, &quot;550 Failed to change directory.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>133492</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2012-09-24 15:34:12 +0400</bug_when>
    <thetext>Если seccomp после обновления vsftpd так и не заработал, то вопрос к ядерщикам,
все ли в порядке с поддержкой seccomp в ядрах?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141429</commentid>
    <comment_count>4</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2013-07-10 14:32:42 +0400</bug_when>
    <thetext>на vsftpd-3.0.2-alt2 и ядре  3.9.8-std-def-alt1 воспроизводится.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141499</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-07-14 13:38:40 +0400</bug_when>
    <thetext>У меня на vsftpd-3.0.2-alt2 и 3.9.9-std-def-alt1 x86_64 не воспроизводится.
Какая у вас конфигурация vsftpd, на которой не работает seccomp?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141500</commentid>
    <comment_count>6</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2013-07-14 18:12:41 +0400</bug_when>
    <thetext>дефолтная, из пакета.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141505</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-07-14 20:57:55 +0400</bug_when>
    <thetext>(In reply to comment #6)
&gt; дефолтная, из пакета.

Дефолтную я проверил: vsftpd-3.0.2-alt2 на 3.9.9-std-def-alt1 x86_64 работает.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141506</commentid>
    <comment_count>8</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2013-07-14 22:05:12 +0400</bug_when>
    <thetext>да, на 3.9.9 заработало. На 3.9.8 не работало.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141507</commentid>
    <comment_count>9</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2013-07-14 22:05:33 +0400</bug_when>
    <thetext>работает на ядре 3.9.9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141520</commentid>
    <comment_count>10</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2013-07-15 17:31:48 +0400</bug_when>
    <thetext>И всё-таки оно не работает. Зависит от клиента.
Воспроизводится, когда клиент - apt
# apt-get update
Get:1 ftp://hpc1 x86_64 release [931B]
Err ftp://hpc1 x86_64 release
  Unable to fetch file, server said &apos;OOPS: priv_sock_get_cmd  &apos;
Err ftp://hpc1 noarch release
  Server closed the connection
Get:1 ftp://hpc1 x86_64/classic pkglist
Err ftp://hpc1 x86_64/classic pkglist
  Unable to fetch file, server said &apos;Failed to open file.  &apos;
Hit ftp://hpc1 x86_64/classic release
Get:2 ftp://hpc1 noarch/classic pkglist
Err ftp://hpc1 noarch/classic pkglist
  Unable to fetch file, server said &apos;Failed to open file.  &apos;
Hit ftp://hpc1 noarch/classic release
Failed to fetch ftp://hpc1/Sisyphus/x86_64/base/release  Unable to fetch file, server said &apos;OOPS: priv_sock_get_cmd  &apos;
Failed to fetch ftp://hpc1/Sisyphus/noarch/base/release  Server closed the connection
Failed to fetch ftp://hpc1/Sisyphus/x86_64/base/pkglist.classic  Unable to fetch file, server said &apos;Failed to open file.  &apos;
Failed to fetch ftp://hpc1/Sisyphus/noarch/base/pkglist.classic  Unable to fetch file, server said &apos;Failed to open file.  &apos;
Reading Package Lists... Done
Building Dependency Tree... Done
W: Release files for some repositories could not be retrieved or authenticated. Such repositories are being ignored.
W: You may want to run apt-get update to correct these problems
E: Some index files failed to download, they have been ignored, or old ones used instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141532</commentid>
    <comment_count>11</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2013-07-15 21:48:46 +0400</bug_when>
    <thetext>*** Bug 29137 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>141533</commentid>
    <comment_count>12</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2013-07-15 21:52:06 +0400</bug_when>
    <thetext>vsftpd-3.0.2-alt3 -&gt; sisyphus:

* Mon Jul 15 2013 Dmitry V. Levin &lt;ldv@altlinux&gt; 3.0.2-alt3
- Enabled fcntl F_SETFL O_RDONLY|O_LARGEFILE in seccomp sandbox
  (closes: #27752).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156870</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Shabalin">shaba</who>
    <bug_when>2016-05-20 00:13:42 +0300</bug_when>
    <thetext>по-прежнему не работает:
lftp mirror
lftp mirror:~&gt; ls
drwxr-sr-x    6 ftp      ftp          4096 May 19 05:45 ALTLinux
lftp mirror:/ALTLinux&gt; cd Sisyphus/noarch/RPMS.classic/
lftp mirror:/ALTLinux/Sisyphus/noarch/RPMS.classic&gt; ls
ls: Фатальная ошибка: 500 OOPS: priv_sock_get_cmd</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156871</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Shabalin">shaba</who>
    <bug_when>2016-05-20 00:17:21 +0300</bug_when>
    <thetext>Если добавить в конфиг seccomp_sandbox=NO, то всё начинает работать.
uname -a
Linux 4.4.10-std-def-alt1 #1 SMP Thu May 12 10:46:51 UTC 2016 x86_64 GNU/Linux</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156872</commentid>
    <comment_count>15</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2016-05-20 00:48:16 +0300</bug_when>
    <thetext>(In reply to comment #13)
&gt; по-прежнему не работает:
&gt; lftp mirror
&gt; lftp mirror:~&gt; ls
&gt; drwxr-sr-x    6 ftp      ftp          4096 May 19 05:45 ALTLinux
&gt; lftp mirror:/ALTLinux&gt; cd Sisyphus/noarch/RPMS.classic/
&gt; lftp mirror:/ALTLinux/Sisyphus/noarch/RPMS.classic&gt; ls
&gt; ls: Фатальная ошибка: 500 OOPS: priv_sock_get_cmd

Пока что не получается это воспроизвести.

(In reply to comment #14)
&gt; Если добавить в конфиг seccomp_sandbox=NO, то всё начинает работать.
&gt; uname -a
&gt; Linux 4.4.10-std-def-alt1 #1 SMP Thu May 12 10:46:51 UTC 2016 x86_64 GNU/Linux

Может, дело в новом ядре.  Надо бы это проверить...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>169814</commentid>
    <comment_count>16</comment_count>
    <who name="Vadim Gusev">kopilo4ka</who>
    <bug_when>2018-03-22 10:24:57 +0300</bug_when>
    <thetext>Воспроизводится на p8, наверно и в сизифе тоже, при:
kernel 4.9.71-std-def-alt0.M80P.1
vsftpd-3.0.3-alt1
С опцией seccomp_sandbox=NO заработало.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>195071</commentid>
    <comment_count>17</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2020-12-19 22:13:02 +0300</bug_when>
    <thetext>vsftpd-3.0.3-alt2 -&gt; sisyphus:

 Sat Dec 19 2020 Dmitry V. Levin &lt;ldv@altlinux&gt; 3.0.3-alt2
 - Updated seccomp filter (closes: #27752, #35901).
 - Fixed build with gcc-10.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>