Re: [PATCH] selftests/capabilities: Fix possible file leak in copy_fromat_to

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

 



>                                        … openat() and open() initialize
> 'from' and 'to', and only 'from' validated with 'if' statement.

Why do find such information helpful?


>                                                                 If the
> initialization of variable 'to' fails,

The variable assignment will usually succeed.
A stored return value would eventually indicate a failed function call.


>                                        we should better check the value
> of 'to' and close 'from' to avoid possible file leak.

Please improve the change description with an imperative wording.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc5#n94


How do you think about to use a summary phrase like “Complete error handling
in copy_fromat_to()”?


…
> ---
> Found this error through static analysis.
> ---

* Were any special tools involved?

* Would you like to replace a duplicate marker line by a blank line?

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