Re: [PATCH net-next v2 01/10] lib: packing: refuse operating on bit indices which exceed size of buffer

From
Vladimir Oltean <vladimir.oltean@nxp.com>
Date
2024-10-03 15:02:42
Reply to
Jacob Keller, 2024-10-02
On Wed, Oct 02, 2024 at 02:51:50PM -0700, Jacob Keller wrote:
From: Vladimir Oltean <vladimir.oltean@nxp.com>

While reworking the implementation, it became apparent that this check
does not exist.

There is no functional issue yet, because at call sites, "startbit" and
"endbit" are always hardcoded to correct values, and never come from the
user.

Even with the upcoming support of arbitrary buffer lengths, the
"startbit >= 8 * pbuflen" check will remain correct. This is because
we intend to always interpret the packed buffer in a way that avoids
discontinuities in the available bit indices.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Thread (21 messages) 21 messages, 3 authors, last reply 2024-10-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help