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: <qobozhguxj5hc5oo3s7iesvznqohi2trf5os2wlpdx737opics@fkq72gprbtfd>
Date:   Wed, 5 Jul 2023 19:57:54 -0700
From:   Bjorn Andersson <andersson@...nel.org>
To:     Arnaud POULIQUEN <arnaud.pouliquen@...s.st.com>
Cc:     Sarannya S <quic_sarannya@...cinc.com>, quic_bjorande@...cinc.com,
        swboyd@...omium.org, quic_clew@...cinc.com,
        mathieu.poirier@...aro.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-remoteproc@...r.kernel.org,
        Deepak Kumar Singh <quic_deesin@...cinc.com>
Subject: Re: [PATCH V8 3/3] rpmsg: char: Add RPMSG GET/SET FLOWCONTROL IOCTL
 support

On Fri, Jun 23, 2023 at 11:11:03AM +0200, Arnaud POULIQUEN wrote:
> On 6/21/23 17:34, Sarannya S wrote:
[..]
> > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
[..]
> > +	switch (cmd) {
> > +	case RPMSG_GET_OUTGOING_FLOWCONTROL:
> > +		eptdev->remote_flow_updated = false;
> > +		ret = put_user(eptdev->remote_flow_restricted, (int __user *)arg);
> > +		break;
> > +	case RPMSG_SET_INCOMING_FLOWCONTROL:
> > +		set = !!arg;
> > +		ret = rpmsg_set_flow_control(eptdev->ept, set, eptdev->chinfo.dst);
> > +		break;
> > +	case RPMSG_DESTROY_EPT_IOCTL:
> > +		/* Don't allow to destroy a default endpoint. */
> > +		if (eptdev->default_ept) {
> > +			ret = -EINVAL;
> > +			break;
> > +		}
> > +		ret = rpmsg_chrdev_eptdev_destroy(&eptdev->dev, NULL);
> > +		break;
> > +	default:
> > +		ret = -EINVAL;
> > +	}
> >  
> > -	return rpmsg_chrdev_eptdev_destroy(&eptdev->dev, NULL);
> > +	return ret;
> >  }
> >  
> >  static const struct file_operations rpmsg_eptdev_fops = {
> > diff --git a/include/uapi/linux/rpmsg.h b/include/uapi/linux/rpmsg.h
> > index 1637e68..b0a6c17 100644
> > --- a/include/uapi/linux/rpmsg.h
> > +++ b/include/uapi/linux/rpmsg.h
> > @@ -43,4 +43,14 @@ struct rpmsg_endpoint_info {
> >   */
> >  #define RPMSG_RELEASE_DEV_IOCTL	_IOW(0xb5, 0x4, struct rpmsg_endpoint_info)
> >  
> > +/**
> > + * Set the flow control for the remote rpmsg char device.

We improved the wording elsewhere in the patch, to make the description
of what the interface controls/exposes. This would benefit from the same
attention.

And this says "Set" while the ioctl says "GET".

> > + */
> > +#define RPMSG_GET_OUTGOING_FLOWCONTROL _IOW(0xb5, 0x5, struct rpmsg_endpoint_info)
> > +
> > +/**
> > + * Set the flow control for the local rpmsg char device.
> > + */
> > +#define RPMSG_SET_INCOMING_FLOWCONTROL _IOW(0xb5, 0x6, struct rpmsg_endpoint_info)
> 
> 
> Perhaps I missed something, but you use "rpmsg_endpoint_info" as argument.
> In rpmsg_eptdev_ioctl the argument is treated as a boolean.
> Seems to me that something is wrong here.
> 

This is indeed an int in the implementation above.

Regards,
Bjorn

> regards,
> Arnaud
> 
> > +
> >  #endif

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ