On Mon, Jan 16, 2012 at 4:27 PM, Zdenek Styblik
<zdenek.styb...@gmail.com> wrote:
> Hi all,
>
> as I was checking CVE-2011-4339 >>
> http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4339 <<
> I've noticed other things as well.
>
> #1 As for CVE in question, I think it can be solved by using umask(022).
>
> #2 ipmievd shouldn't start at all if it is unable to create PID file.
> However, such fact is being ignored here.
>
> #3 And the last thing is, it is possible to have multiple instances of
> ipmievd running. And that's
> all fine and dandy, but rewriting the same PID file over and over
> doesn't seem fine to me.
> No, it should be reported and in case PID file exist, exit and refuse to run.
[...]
> #4 function sel_watch_wait() doesn't have return, but it is supposed to
> return int. Code is not included here.

Proposed patch/solution is attached.

I've moved check whether PID file already exists before starting
daemon. It makes more sense to me rather than start daemon first,
check whether file exists. Hmm, actually, how about moving
get-fp-on-PID-file forward as well? Wouldn't it be better? Although,
it would have to be closed in case ipmievd fails to start(fork).
I've added umask(022) to solve(?) CVE.
The only thing I'm really not sure about is bailing out when ipmievd
faild to get fp on PID file. Is use of exit() enough? Does it
kill/clean-up ipmievd daemon which is already running?

Yes, and sel_watch_wait() returns 0 now.

Thanks for comments.

Regards,
Z.

Attachment: ipmievd.c.diff
Description: Binary data

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to