mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: <jackie.jone@alliedtelesis.co.nz>, <davem@davemloft.net>
Cc: <jesse.brandeburg@intel.com>, <anthony.l.nguyen@intel.com>,
	<kuba@kernel.org>, <intel-wired-lan@lists.osuosl.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH] igb: Add MII write support
Date: Wed, 5 Jun 2024 13:51:24 -0700	[thread overview]
Message-ID: <ad56235d-d267-4477-9c35-210309286ff4@intel.com> (raw)
In-Reply-To: <20240604031020.2313175-1-jackie.jone@alliedtelesis.co.nz>



On 6/3/2024 8:10 PM, jackie.jone@alliedtelesis.co.nz wrote:
> From: Jackie Jone <jackie.jone@alliedtelesis.co.nz>
> 
> To facilitate running PHY parametric tests, add support for the SIOCSMIIREG
> ioctl. This allows a userspace application to write to the PHY registers
> to enable the test modes.
> 
> Signed-off-by: Jackie Jone <jackie.jone@alliedtelesis.co.nz>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 03a4da6a1447..7fbfcf01fbf9 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -8977,6 +8977,10 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
>  			return -EIO;
>  		break;
>  	case SIOCSMIIREG:
> +		if (igb_write_phy_reg(&adapter->hw, data->reg_num & 0x1F,
> +				     data->val_in))
> +			return -EIO;
> +		break;

A handful of drivers seem to expose this. What are the consequences of
exposing this ioctl? What can user space do with it?

It looks like a few drivers also check something like CAP_NET_ADMIN to
avoid allowing write access to all users. Is that enforced somewhere else?

  reply	other threads:[~2024-06-05 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  3:10 jackie.jone
2024-06-05 20:51 ` Jacob Keller [this message]
2024-06-05 21:10   ` Chris Packham
2024-06-05 21:16     ` Jacob Keller
2024-06-05 21:30       ` Chris Packham
2024-06-06  4:30       ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-06-06 15:41   ` Andrew Lunn
2024-06-06 16:56     ` Jacob Keller
2024-06-06 18:31       ` Andrew Lunn
2024-06-06 18:39         ` Jacob Keller
2024-06-11 11:08 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy

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=ad56235d-d267-4477-9c35-210309286ff4@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jackie.jone@alliedtelesis.co.nz \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®