[lvc-project] [PATCH v3] ssb: Fix potential NULL pointer dereference in ssb_device_uevent

Michael Büsch m at bues.ch
Thu Mar 7 21:24:05 MSK 2024


On Thu,  7 Mar 2024 16:41:42 +0300
Rand Deeb <rand.sec96 at gmail.com> wrote:

> Given that null is improbable in this context due to the calls being made 
> through uevent, we should eliminate the redundant condition. In light of 
> this, would you recommend sending a new version (v4)

No.

We should _not_ eliminate NULL checks in this code.
Ever.
There is only one reason to eliminate NULL checks:
In extremely performance critical code, if it improves performance
significantly and it is clearly documented that the pointer can never be NULL.

This is not that case here. This is not critical code.

Having NULL checks is defensive programming.
Removing NULL checks is a hazard.
Not having these checks is a big part of why security sucks in today's software.

V3 shall be applied, because it fixes a clear bug. Whether this bug can actually
be triggered or not in today's kernel doesn't matter.

-- 
Michael Büsch
https://bues.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20240307/e825adff/attachment.pgp>


More information about the lvc-project mailing list