Skip to content

Fix SIOCGIFBR/SIOCSIFBR ioctl

Remi Pommarel bridge lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: bridge: fix ioctl old_deviceless bridge argumentnet/bridge/br_ioctl.c+1 -10 replies
2/2net: bridge: Get SIOCGIFBR/SIOCSIFBR ioctl working in compat modenet/bridge/br_ioctl.c net/socket.c+52 -434 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchArnd BergmannNikolay Aleksandrov
1/2R-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/2] Fix SIOCGIFBR/SIOCSIFBR ioctl

SIOC{G,S}IFBR ioctls have been broken since [0], as discussed here [1] the intent was to get them working in compat mode.

This serie is gathering patch from [2] with the one from [3].

The first patch fixes the ioctl usage so it can be backported to stable kernel while the second one adds proper support for those ioctl in compat mode.

This has been tested with busybox's brctl as below.

Before this serie

- 64-bit brctl:

  $ brctl show
  bridge name     bridge id               STP enabled     interfaces
  brctl: can't get bridge name for index 0: No such device or address

- 32-bit brctl on CONFIG_COMPAT=y kernel:

  $ brctl show
  brctl: SIOCGIFBR: Invalid argument

With first patch of this serie

- 64-bit brctl

  $ brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000000000000       no

- 32-bit brctl on CONFIG_COMPAT=y kernel

  $ brctl show
    brctl: SIOCGIFBR: Invalid argument

With both patches

- 64-bit brctl

  $ brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000000000000       no

- 32-bit brctl on CONFIG_COMPAT=y kernel

  $ brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000000000000       no

[0] commit 561d8352818f ("bridge: use ndo_siocdevprivate")
[1] https://lkml.org/lkml/2021/12/22/805
[2] https://lkml.org/lkml/2021/12/22/743
[3] https://lkml.org/lkml/2021/12/23/212

Thanks,

Remi Pommarel (2):
net: bridge: fix ioctl old_deviceless bridge argument
net: bridge: Get SIOCGIFBR/SIOCSIFBR ioctl working in compat mode

 net/bridge/br_ioctl.c | 75 ++++++++++++++++++++++++++++---------------
 net/socket.c          | 20 ++----------
 2 files changed, 52 insertions(+), 43 deletions(-)
Signature · 1 line
2.33.0