Modify

Opened 7 years ago

Closed 7 years ago

#8511 closed defect (fixed)

Luci Services->Initscripts->start leaks file descriptors into servers it starts

Reported by: bruce@… Owned by: jow
Priority: normal Milestone: Backfire 10.03.1
Component: luci Version: Trunk
Keywords: luci initscripts start leakage Cc:

Description

This is the result of starting stund from Luci Services -> Initscripts. Luci had about 20 FDs open to its own files and stund inherited these. It would be proper to vfork and then close all FDs except possibly 0, 1, and 2 before exec. Also it might be worthwhile to check if these should really have been left open within luci.

Thanks

Bruce

root@Bruce:/etc/config# ps aux|grep stund
14726 root      1028 R    /usr/sbin/stund -b -h -a -p -o
15327 root      1340 S    grep stund
root@Bruce:/etc/config# cd /proc/14726/fd
root@Bruce:/proc/14726/fd# ls
0   10  12  14  16  18  2   21  23  25  4   6   8
1   11  13  15  17  19  20  22  24  3   5   7   9
root@Bruce:/proc/14726/fd# ls -l
lr-x------    1 root     root            64 Dec 23 18:07 0 -> pipe:[16802]
l-wx------    1 root     root            64 Dec 23 18:07 1 -> pipe:[16801]
lr-x------    1 root     root            64 Dec 23 18:07 10 -> /usr/lib/lua/luci/i18n/ushare.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 11 -> /usr/lib/lua/luci/i18n/ddns.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 12 -> /usr/lib/lua/luci/i18n/olsr.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 13 -> /usr/lib/lua/luci/i18n/samba.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 14 -> /usr/lib/lua/luci/i18n/polipo.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 15 -> /usr/lib/lua/luci/i18n/voice_core.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 16 -> /usr/lib/lua/luci/i18n/initmgr.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 17 -> /usr/lib/lua/luci/i18n/p910nd.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 18 -> /usr/lib/lua/luci/i18n/tinyproxy.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 19 -> /usr/lib/lua/luci/i18n/diag_core.en.lmo
lrwx------    1 root     root            64 Dec 23 18:07 2 -> /dev/null
lr-x------    1 root     root            64 Dec 23 18:07 20 -> /usr/lib/lua/luci/i18n/openvpn.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 21 -> /usr/lib/lua/luci/i18n/diag_devinfo.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 22 -> /usr/lib/lua/luci/i18n/rrdtool.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 23 -> /usr/lib/lua/luci/i18n/statistics.en.lmo
lrwx------    1 root     root            64 Dec 23 18:07 24 -> socket:[16851]
lrwx------    1 root     root            64 Dec 23 18:07 25 -> socket:[16852]
lr-x------    1 root     root            64 Dec 23 18:07 3 -> /usr/lib/lua/luci/i18n/base.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 4 -> /usr/lib/lua/luci/i18n/mmc_over_gpio.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 5 -> /usr/lib/lua/luci/i18n/hd_idle.en.lmo
l-wx------    1 root     root            64 Dec 23 18:07 6 -> pipe:[16801]
lr-x------    1 root     root            64 Dec 23 18:07 7 -> pipe:[16802]
lr-x------    1 root     root            64 Dec 23 18:07 8 -> /usr/lib/lua/luci/i18n/wol.en.lmo
lr-x------    1 root     root            64 Dec 23 18:07 9 -> /usr/lib/lua/luci/i18n/ntpc.en.lmo

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by jow

  • Owner set to jow
  • Status changed from new to accepted

Will look into it. Thanks.

comment:2 Changed 7 years ago by jow

I pushed a fix to LuCI 0.10 which avoids descriptor leakage from translation files (http://luci.subsignal.org/trac/changeset/6658). As for the pipes and sockets I have no idea where they're from right now. Which LuCI version is that exactly?

comment:3 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from accepted to closed

Timeout

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.