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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPuLczt0Oo-tWZQDLe_g6JNvR9Dqa3wpKUjzMAv+goOV64DNyA@mail.gmail.com>
Date:   Fri, 28 Jan 2022 18:42:31 +1100
From:   Sami Kyostila <skyostil@...omium.org>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, dtor@...omium.org,
        evanbenn@...omium.org, arnd@...db.de, gregkh@...uxfoundation.org
Subject: Re: [PATCH 2/2] drivers/misc: add transfer ioctl for HPS

pe 28. tammik. 2022 klo 9.39 Randy Dunlap (rdunlap@...radead.org) kirjoitti:
>
>
>
> On 1/27/22 00:35, Sami Kyöstilä wrote:
> > This patch adds an ioctl operation for sending and receiving data from
> > the ChromeOS snooping protection sensor (a.k.a., HPS). This allows
> > userspace programs to perform a combined read/write I2C transaction
> > through a single syscall.
> >
> > The I2C wire protocol for the device is documented at:
> >
> > https://chromium.googlesource.com/chromiumos/platform/hps-firmware/+/
> > refs/heads/main/docs/host_device_i2c_protocol.md
> >
> > Signed-off-by: Sami Kyöstilä <skyostil@...omium.org>
> > ---
> >
> >  MAINTAINERS              |  1 +
> >  drivers/misc/hps-i2c.c   | 81 ++++++++++++++++++++++++++++++++++++++++
> >  include/uapi/linux/hps.h | 20 ++++++++++
> >  3 files changed, 102 insertions(+)
> >  create mode 100644 include/uapi/linux/hps.h
> >
>
> Hi--
>
> If your next patch version continues to use an ioctl, its magic "number"
> ('h') should be documented in Documentation/userspace-api/ioctl/ioctl-number.rst.

Ah, thanks for the pointer. Will do.


- Sami

>
> thanks.
>
> > diff --git a/include/uapi/linux/hps.h b/include/uapi/linux/hps.h
> > new file mode 100644
> > index 000000000000..2c1bd174cd02
> > --- /dev/null
> > +++ b/include/uapi/linux/hps.h
> > @@ -0,0 +1,20 @@
> > +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> > +/*
> > + *  Copyright 2022 Google LLC.
> > + */
> > +
> > +#ifndef _UAPI_HPS_H
> > +#define _UAPI_HPS_H
> > +
> > +#include <linux/types.h>
> > +
> > +#define HPS_IOC_TRANSFER     _IOWR('h', 0x01, struct hps_transfer_ioctl_data)
> > +
> > +struct hps_transfer_ioctl_data {
> > +     __u32 isize;                    /* Number of bytes to send */
> > +     unsigned char __user *ibuf;     /* Input buffer */
> > +     __u32 osize;                    /* Number of bytes to receive */
> > +     unsigned char __user *obuf;     /* Output buffer */
> > +};
> > +
> > +#endif /* _UAPI_HPS_H */
>
> --
> ~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ