[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250909170939.38ec1a33@kernel.org>
Date: Tue, 9 Sep 2025 17:09:39 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Chen Yufeng <chenyufeng@....ac.cn>
Cc: paul@...l-moore.com, davem@...emloft.net, dsahern@...nel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] net: ipv4: Potential null pointer dereference in
cipso_v4_parsetag_enum
On Mon, 8 Sep 2025 16:03:15 +0800 Chen Yufeng wrote:
> While parsing CIPSO enumerated tags, secattr->flags is set to
> NETLBL_SECATTR_MLS_CAT even if secattr->attr.mls.cat is NULL.
> If subsequent code attempts to access secattr->attr.mls.cat,
> it may lead to a null pointer dereference, causing a system crash.
>
> To address this issue, we add a check to ensure that before setting
> the NETLBL_SECATTR_MLS_CAT flag, secattr->attr.mls.cat is not NULL.
>
> fixed code:
> ```
> if (secattr->attr.mls.cat)
> secattr->flags |= NETLBL_SECATTR_MLS_CAT;
> ```
>
> This patch is similar to eead1c2ea250("netlabel: cope with NULL catmap").
Please add appropriate Fixes tags indicating the earliest commit where
issue may trigger.
Powered by blists - more mailing lists