Re: [PATCH] selftests/bpf:fix a resource leak in main()

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

 



> The requested resources should be closed before return in main(), otherwise
> resource leak will occur. Add a check of cg_fd before close().
>
> Fixes: 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event notification")
> Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>

Please reconsider such information once more.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc7#n398
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/researcher-guidelines.rst?h=v6.10-rc7#n5


How many source code analysis tools should be able to point out that the return value
from the call of a function like pthread_create() should get more development attention
(also for discussed test functions)?
https://elixir.bootlin.com/linux/v6.10-rc7/source/tools/testing/selftests/bpf/test_tcpnotify_user.c#L122

See also:
* https://cwe.mitre.org/data/definitions/252.html

* https://wiki.sei.cmu.edu/confluence/display/c/POS54-C.+Detect+and+handle+POSIX+library+errors


Regards,
Markus





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux