Re: [PATCH] exec: move warning of null argv to be next to the relevant code

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

 



On Sat, Nov 02, 2024 at 02:01:22PM +0200, nir@xxxxxxxxxxxx wrote:
> Problem: The warning is currently printed where it is detected that the
> arg count is zero but the action is only taken place later in the flow
> even though the warning is written as if the action is taken place in
> the time of print
> 
> This could be problematic since there could be a failure between the
> print and the code that takes action which would deem this warning
> misleading
> 
> Solution: Move the warning print after the action of adding an empty
> string as the first argument is successful
> 
> Signed-off-by: Nir Lichtman <nir@xxxxxxxxxxxx>
> ---
> 
> Side note: I have noticed that currently the warn once variant is used
> for reporting this problem, which I guess is to reduce clutter that
> could go to dmesg, but wouldn't it be better to have this call the
> regular warn instead to better aid catching this type of bug?

We try to avoid having trivial ways to allow userspace to spam the
kernel dmesg log, so pr_warn_once() tends to be sufficient to catch this
relatively unlikely case.

-- 
Kees Cook




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux