netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	vivien.didelot@savoirfairelinux.com
Subject: Re: [PATCH net 1/2] net: dsa: bcm_sf2: Do not clobber b53_switch_ops
Date: Sun, 8 Jan 2017 18:41:05 +0100	[thread overview]
Message-ID: <20170108174105.GA21101@lunn.ch> (raw)
In-Reply-To: <20170108050157.16302-2-f.fainelli@gmail.com>

On Sat, Jan 07, 2017 at 09:01:56PM -0800, Florian Fainelli wrote:
> We make the bcm_sf2 driver override ds->ops which points to
> b53_switch_ops since b53_switch_alloc() did the assignent. This is all
> well and good until a second b53 switch comes in, and ends up using the
> bcm_sf2 operations. Make a proper local copy, substitute the ds->ops
> pointer and then override the operations.
> 
> Fixes: f458995b9ad8 ("net: dsa: bcm_sf2: Utilize core B53 driver when possible")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Hi Florian

There is a general trend of making ops structures const. It closes off
kernel exploits. This coping and then modifying prevents us making
ds->ops a pointer to a const.

You are already using b53_common.c as a library. Could you go further
with the concept, and export the ops you need for SF2, and have SF2
define its own ops structure? We can then swap to const ops dsa wide.

Thanks
	Andrew

  reply	other threads:[~2017-01-08 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08  5:01 [PATCH net 0/2] net: dsa: bcm_sf2: Couple fixes Florian Fainelli
2017-01-08  5:01 ` [PATCH net 1/2] net: dsa: bcm_sf2: Do not clobber b53_switch_ops Florian Fainelli
2017-01-08 17:41   ` Andrew Lunn [this message]
2017-01-08 19:31     ` Florian Fainelli
2017-01-08 20:16       ` Andrew Lunn
2017-01-08 20:17   ` Andrew Lunn
2017-01-08  5:01 ` [PATCH net 2/2] net: dsa: bcm_sf2: Utilize nested MDIO read/write Florian Fainelli
2017-01-08 17:41   ` Andrew Lunn
2017-01-09  3:02 ` [PATCH net 0/2] net: dsa: bcm_sf2: Couple fixes David Miller

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=20170108174105.GA21101@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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 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).