lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADkSEUgX5FN6kgs5FSZGRoF6icXmUyp67y55=sRAXzWnsHGzEQ@mail.gmail.com>
Date: Sun, 21 Dec 2025 15:50:45 -0800
From: Ethan Nelson-Moore <enelsonmoore@...il.com>
Cc: netdev@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] net: usb: sr9700: fix incorrect command used to write
 single register

Hi, Andrew,

The other two are correct because they intend to write multiple
registers - they are used with a length parameter.

Ethan

On Sun, Dec 21, 2025 at 4:34 AM Andrew Lunn <andrew@...n.ch> wrote:
>
> On Sun, Dec 21, 2025 at 12:24:00AM -0800, Ethan Nelson-Moore wrote:
> > This fixes the device failing to initialize with "error reading MAC
> > address" for me, probably because the incorrect write of NCR_RST to
> > SR_NCR is not actually resetting the device.
> >
> > Fixes: c9b37458e95629b1d1171457afdcc1bf1eb7881d ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Ethan Nelson-Moore <enelsonmoore@...il.com>
> > ---
> >  drivers/net/usb/sr9700.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
> > index 091bc2aca7e8..5d97e95a17b0 100644
> > --- a/drivers/net/usb/sr9700.c
> > +++ b/drivers/net/usb/sr9700.c
> > @@ -52,7 +52,7 @@ static int sr_read_reg(struct usbnet *dev, u8 reg, u8 *value)
> >
> >  static int sr_write_reg(struct usbnet *dev, u8 reg, u8 value)
> >  {
> > -     return usbnet_write_cmd(dev, SR_WR_REGS, SR_REQ_WR_REG,
> > +     return usbnet_write_cmd(dev, SR_WR_REG, SR_REQ_WR_REG,
> >                               value, reg, NULL, 0);
> >  }
> >
> > @@ -65,7 +65,7 @@ static void sr_write_async(struct usbnet *dev, u8 reg, u16 length,
> >
> >  static void sr_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
> >  {
> > -     usbnet_write_cmd_async(dev, SR_WR_REGS, SR_REQ_WR_REG,
> > +     usbnet_write_cmd_async(dev, SR_WR_REG, SR_REQ_WR_REG,
> >                              value, reg, NULL, 0);
> >  }
>
> I don't know anything about this hardware, but there are four calls using SR_WR_REG:
>
> https://elixir.bootlin.com/linux/v6.18.2/source/drivers/net/usb/sr9700.h#L157
>
> You only change two here? Are the other two correct?
>
> It might be worth while also changing the name of one of these:
>
> #define SR_WR_REGS              0x01
> #define SR_WR_REG               0x03
>
> to make it clearer what each is actually used for, so they don't get
> used wrongly again.
>
>         Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ