netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Chen Yufeng <chenyufeng@iie.ac.cn>
Cc: paul@paul-moore.com, davem@davemloft.net, dsahern@kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net: ipv4: Potential null pointer dereference in cipso_v4_parsetag_enum
Date: Tue, 9 Sep 2025 17:09:39 -0700	[thread overview]
Message-ID: <20250909170939.38ec1a33@kernel.org> (raw)
In-Reply-To: <20250908080315.174-1-chenyufeng@iie.ac.cn>

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.

      parent reply	other threads:[~2025-09-10  0:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08  8:03 [PATCH] net: ipv4: Potential null pointer dereference in cipso_v4_parsetag_enum Chen Yufeng
2025-09-08 10:09 ` Vadim Fedorenko
2025-09-08 14:56 ` Paul Moore
2025-09-09 12:47 ` Simon Horman
2025-09-10  0:09 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250909170939.38ec1a33@kernel.org \
    --to=kuba@kernel.org \
    --cc=chenyufeng@iie.ac.cn \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).