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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 5 Oct 2022 21:02:37 -0700
From:   Roderick Colenbrander <thunderbird2k@...il.com>
To:     Henry Castro <hcvcastro@...il.com>
Cc:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drivers: hid: warn feature report 0x81

I see in the other email. If it doesn't support this request, it is
likely a clone device. We are about to submit a brand new DS4 driver
(for hid-playstation). It will use a different report (0x12) if I
recall which does the same thing. That's the more mainstream one we
use.

Thanks,
Roderick

On Sun, Oct 2, 2022 at 3:01 PM Henry Castro <hcvcastro@...il.com> wrote:
>
> Unfortunately, my PS DualShock 4, does not support
> the feature 0x81 to get the MAC address. Instead,
> use a unique hash to fake a MAC address, so I can
> use DS4 to play Retroarch :)
>
> Signed-off-by: Henry Castro <hcvcastro@...il.com>
> ---
>  drivers/hid/hid-sony.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index 656caa07b25f..e3e9c58887cf 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -2641,13 +2641,14 @@ static int sony_check_add(struct sony_sc *sc)
>                                 HID_REQ_GET_REPORT);
>
>                 if (ret != DS4_FEATURE_REPORT_0x81_SIZE) {
> -                       hid_err(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n");
> -                       ret = ret < 0 ? ret : -EINVAL;
> -                       goto out_free;
> +                       uint32_t hash = full_name_hash(NULL, dev_name(&sc->hdev->dev),
> +                                                      strlen(dev_name(&sc->hdev->dev)));
> +                       hid_warn(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n");
> +                       memcpy(sc->mac_address, &hash, sizeof(hash));
> +               } else {
> +                       memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address));
>                 }
>
> -               memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address));
> -
>                 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
>                          "%pMR", sc->mac_address);
>         } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
> --
> 2.20.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ