Re: [PATCH v2] fuse: prevent possible NULL pointer dereference in fuse_iomap_writeback_{range,submit}()

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

 



On Thu, 4 Sept 2025 at 10:24, Luis Henriques <luis@xxxxxxxxxx> wrote:

> I don't have a preference between v1 and v2 of this patch.  v1 removed the
> WARNs because I don't think they are useful:
>
> 1. the assertions are never true, but
> 2. if they are, they are useless because we'll hit a NULL pointer
>    dereference anyway.
>
> v2 tries to fix the code assuming the assertions can be triggered.
>
> So, yeah I'll just leave the 3 options (v1, v2, or do nothing) on the
> table :-)

WARN_ON is a useful tool to document interface constrains.  But so is
dereferencing of a pointer.

V2 style WARN_ON should only be used if it's difficult to prove that
the condition will evaluate to false and we don't want the kernel to
crash in some unknown corner case.  AFAICS it is not the case here, so
I'd opt for v1.

Thanks,
Miklos




[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