Bug 12284 - [DoS] Ulogd crashes when plaintext log size exceeds 2GB
Summary: [DoS] Ulogd crashes when plaintext log size exceeds 2GB
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: ulogd (show other bugs)
Version: unstable
Hardware: all Linux
: P2 minor
Assignee: Mikhail Efremov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-09 17:31 MSD by Konstantin Uvarin (lodin)
Modified: 2009-05-10 09:33 MSD (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Uvarin (lodin) 2007-07-09 17:31:01 MSD
When plaintext log size exceeds 2GB, ulogd may crash on certain systems, 
because it uses fopen (3) to open files.

(I had troubles after trying to DoS my own machine. )

The solution can be to use fopen64 instead of fopen, or to use compiler flag 
to force using large files everywhere (I haven't found out which yet). 

I think the latter is the best idea.
Steps to Reproduce:
1. Create a large enough "log" file (via dd for exapmle)
2. Start ulogd (so that it appends to the file)
3. Send intensive traffic. Ulogd will crash at some point, leaving an orphan 
pid file.
Comment 1 Konstantin Uvarin (lodin) 2007-07-09 17:33:50 MSD
Кстати, как обрабатывается ошибка записи в файл в последних версиях, я не знаю. 

Проверялось только на ulogd из 3.0 -- ulogd-1.02-alt0.1

Что-то могло и измениться. 

И еще, если система 64-битная, это, видимо, не должно воспроизводиться.
Comment 2 liks 2007-07-12 12:33:07 MSD
На какой версии ядра воспроизводилось?
Comment 3 Konstantin Uvarin (lodin) 2007-07-12 12:42:42 MSD
Альтовское 2.6.12, моя сборка (патчей не накладывал). 

Linux khedin.starlink.ru 2.6.12-alt-lodin #1 Sun Oct 15 12:54:44 MSD 2006 i686 
unknown unknown GNU/Linux

ulogd-1.02-alt0.1 -- древний, так что может это и починили. 
Comment 4 liks 2007-07-12 15:27:15 MSD
Действительно воспроизводилось в последнем релизе.

Переписка на эту тема шла аж в 2004-ом, но в апстрим патч так и не вошел:
https://lists.gnumonks.org/pipermail/ulogd/2004-May/000591.html

Fixed in 1.24-alt4 - только что отправил в Сизиф.