Re: [PATCH] Documentation/watchdog: Fix the file descriptor leak when no cmdline arg given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 17, 2012 at 7:43 PM, Rob Landley <rob@xxxxxxxxxxx> wrote:
> On 05/17/2012 04:36 AM, Devendra Naga wrote:
>> we start a infinite loop when user gives ./watchdog-test, and when user
>> ctrl + c's the program, we just exit immeadiately with out closing the
>> filedescriptor of the watchdog device. a signal handler is used to
>> do the job of closing the filedescriptor and exiting the program.
>
> Doesn't exiting a process close all its filehandles already?

I think kernel will take care of releasing process resources. i am not
so sure of it.
but running valgrind --track-fds=yes ./a.out as root shows a descriptor leak.

BTW, there is another miss, if the user is non-root we still leak a
file descriptor.
>
> Rob
> --
> GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
> Either it's "mere aggregation", or a license violation.  Pick one.

Thanks,
Devendra.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux