All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net 3/3] net: dsa: sja1105: fix kasan out-of-bounds warning in sja1105_table_delete_entry()
Date: Fri, 21 Mar 2025 08:17:36 +0000	[thread overview]
Message-ID: <20250321081736.GO892515@horms.kernel.org> (raw)
In-Reply-To: <20250318115716.2124395-4-vladimir.oltean@nxp.com>

On Tue, Mar 18, 2025 at 01:57:16PM +0200, Vladimir Oltean wrote:
> There are actually 2 problems:
> - deleting the last element doesn't require the memmove of elements
>   [i + 1, end) over it. Actually, element i+1 is out of bounds.
> - The memmove itself should move size - i - 1 elements, because the last
>   element is out of bounds.
> 
> The out-of-bounds element still remains out of bounds after being
> accessed, so the problem is only that we touch it, not that it becomes
> in active use. But I suppose it can lead to issues if the out-of-bounds
> element is part of an unmapped page.
> 
> Fixes: 6666cebc5e30 ("net: dsa: sja1105: Add support for VLAN operations")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2025-03-21  8:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 11:57 [PATCH net 0/3] sja1105 driver fixes Vladimir Oltean
2025-03-18 11:57 ` [PATCH net 1/3] net: dsa: sja1105: fix displaced ethtool statistics counters Vladimir Oltean
2025-03-21  8:17   ` Simon Horman
2025-03-18 11:57 ` [PATCH net 2/3] net: dsa: sja1105: reject other RX filters than HWTSTAMP_FILTER_PTP_V2_L2_EVENT Vladimir Oltean
2025-03-21  8:17   ` Simon Horman
2025-03-18 11:57 ` [PATCH net 3/3] net: dsa: sja1105: fix kasan out-of-bounds warning in sja1105_table_delete_entry() Vladimir Oltean
2025-03-21  8:17   ` Simon Horman [this message]
2025-03-24 22:30 ` [PATCH net 0/3] sja1105 driver fixes patchwork-bot+netdevbpf

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=20250321081736.GO892515@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.