netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 net 0/2] fix shared vcap_props reference
@ 2022-04-29 23:30 Colin Foster
  2022-04-29 23:30 ` [PATCH v1 net 1/2] net: ethernet: ocelot: rename vcap_props to clearly be an ocelot member Colin Foster
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Colin Foster @ 2022-04-29 23:30 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller,
	Florian Fainelli, Vivien Didelot, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean

Felix vcap_props get statically allocated at the file scope, while the
felix / ocelot instances get dynamically allocated at initialization. If
there's more than one instance, each instance will be writing over the
same vcap_props memory region, which would lead to corruption.

I don't have any hardware to confidently test the vcap portions of
Ocelot / Felix, so any testers would be appreciated.

Also, I believe the memcpy of a structure array should be
architecture-portable, but I'm not 100% confident there, so that might
be an area of extra scrutiny.


Colin Foster (2):
  net: ethernet: ocelot: rename vcap_props to clearly be an ocelot
    member
  net: mscc: ocelot: fix possible memory conflict for vcap_props

 drivers/net/dsa/ocelot/felix.c             |  3 +-
 drivers/net/dsa/ocelot/felix.h             |  2 +-
 drivers/net/dsa/ocelot/felix_vsc9959.c     |  2 +-
 drivers/net/dsa/ocelot/seville_vsc9953.c   |  2 +-
 drivers/net/ethernet/mscc/ocelot_flower.c  |  4 +-
 drivers/net/ethernet/mscc/ocelot_vcap.c    | 54 +++++++++++-----------
 drivers/net/ethernet/mscc/ocelot_vsc7514.c |  5 +-
 include/soc/mscc/ocelot.h                  | 34 +++++++++++++-
 include/soc/mscc/ocelot_vcap.h             | 32 -------------
 9 files changed, 71 insertions(+), 67 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-05-01 21:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29 23:30 [PATCH v1 net 0/2] fix shared vcap_props reference Colin Foster
2022-04-29 23:30 ` [PATCH v1 net 1/2] net: ethernet: ocelot: rename vcap_props to clearly be an ocelot member Colin Foster
2022-04-30  2:07   ` Jakub Kicinski
2022-04-30 17:36     ` Colin Foster
2022-04-29 23:30 ` [PATCH v1 net 2/2] net: mscc: ocelot: fix possible memory conflict for vcap_props Colin Foster
2022-04-30  2:06   ` Jakub Kicinski
2022-04-30 17:27     ` Colin Foster
2022-04-30 14:24   ` Vladimir Oltean
2022-04-30 17:24     ` Colin Foster
2022-04-30 21:56       ` Vladimir Oltean
2022-04-30 22:26         ` Colin Foster
2022-05-01 10:52 ` [PATCH v1 net 0/2] fix shared vcap_props reference Vladimir Oltean
2022-05-01 21:09   ` Colin Foster

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).