diff mbox series

[net] psample: Fix user API breakage

Message ID 20210324194332.153658-1-idosch@idosch.org (mailing list archive)
State Accepted
Commit e43accba9b071dcd106b5e7643b1b106a158cbb1
Delegated to: Netdev Maintainers
Headers show
Series [net] psample: Fix user API breakage | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 blamed authors not CCed: jiri@mellanox.com; 2 maintainers not CCed: linux-api@vger.kernel.org jiri@mellanox.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit fail Errors and warnings before: 12 this patch: 12
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/header_inline success Link

Commit Message

Ido Schimmel March 24, 2021, 7:43 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

Cited commit added a new attribute before the existing group reference
count attribute, thereby changing its value and breaking existing
applications on new kernels.

Before:

 # psample -l
 libpsample ERROR psample_group_foreach: failed to recv message: Operation not supported

After:

 # psample -l
 Group Num       Refcount        Group Seq
 1               1               0

Fix by restoring the value of the old attribute and remove the
misleading comments from the enumerator to avoid future bugs.

Cc: stable@vger.kernel.org
Fixes: d8bed686ab96 ("net: psample: Add tunnel support")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reported-by: Adiel Bidani <adielb@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
---
Dave, Jakub, Stephen, there might be a trivial conflict when you merge
net into net-next. If so, see resolution here:
https://github.com/jpirko/linux_mlxsw/commit/d47ac079ef169d3ab07c85e9178a925f7dffbebe.patch
---
 include/uapi/linux/psample.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 25, 2021, 12:20 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 24 Mar 2021 21:43:32 +0200 you wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> Cited commit added a new attribute before the existing group reference
> count attribute, thereby changing its value and breaking existing
> applications on new kernels.
> 
> Before:
> 
> [...]

Here is the summary with links:
  - [net] psample: Fix user API breakage
    https://git.kernel.org/netdev/net/c/e43accba9b07

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/include/uapi/linux/psample.h b/include/uapi/linux/psample.h
index aea26ab1431c..bff5032c98df 100644
--- a/include/uapi/linux/psample.h
+++ b/include/uapi/linux/psample.h
@@ -3,7 +3,6 @@ 
 #define __UAPI_PSAMPLE_H
 
 enum {
-	/* sampled packet metadata */
 	PSAMPLE_ATTR_IIFINDEX,
 	PSAMPLE_ATTR_OIFINDEX,
 	PSAMPLE_ATTR_ORIGSIZE,
@@ -11,10 +10,8 @@  enum {
 	PSAMPLE_ATTR_GROUP_SEQ,
 	PSAMPLE_ATTR_SAMPLE_RATE,
 	PSAMPLE_ATTR_DATA,
-	PSAMPLE_ATTR_TUNNEL,
-
-	/* commands attributes */
 	PSAMPLE_ATTR_GROUP_REFCOUNT,
+	PSAMPLE_ATTR_TUNNEL,
 
 	__PSAMPLE_ATTR_MAX
 };