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:   Tue, 7 Nov 2017 19:40:10 +0100
From:   Jonathan Neuschäfer <j.neuschaefer@....net>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Andy Gross <andy.gross@...aro.org>,
        Ohad Ben-Cohen <ohad@...ery.com>,
        Arun Kumar Neelakantam <aneela@...eaurora.org>,
        Chris Lew <clew@...eaurora.org>, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        linux-remoteproc@...r.kernel.org
Subject: Re: [PATCH v2 5/5] samples: Introduce Qualcomm QMI sample client

Hi, some small comments below.

On Mon, Nov 06, 2017 at 09:20:42PM -0800, Bjorn Andersson wrote:
> Introduce a sample driver that register for server notifications and
> spawn clients for each available test service (service 15). The spawned
> clients implements the interface for encoding "ping" and "data" requests
> and decode the responses from the remote.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> ---
[...]
> +/*
> + * ping_pong_store() - ping_pong debugfs file write handler

The function name is ping_write now.

> + * @file:	debugfs file context
> + * @user_buf:	reference to the user data
> + * @count:	number of bytes in @user_buf
> + * @ppos:	offset in @file to write
> + *
> + * Returns @count, or negative errno on failure.
> + *
> + * This function allows user space to send out a ping_pong QMI encoded message
> + * to the associated remote test service and will return with the result of the
> + * transaction. It serves as an example of how to provide a custom response
> + * handler.
> + */
> +static ssize_t ping_write(struct file *file, const char __user *user_buf,
> +			  size_t count, loff_t *ppos)

The data in user_buf is completely ignored, right? Perhaps that's worth
mentioning in the doc comment.

> +{
> +	struct qmi_handle *qmi = file->private_data;
> +	struct test_ping_req_msg_v01 req = {0};
> +	struct qmi_txn txn;
> +	int ret;
> +
> +	memcpy(req.ping, "ping", sizeof(req.ping));
> +
> +	ret = qmi_txn_init(qmi, &txn, NULL, NULL);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = qmi_send_request(qmi, NULL, &txn,
> +			       TEST_PING_REQ_MSG_ID_V01,
> +			       TEST_PING_REQ_MAX_MSG_LEN_V01,
> +			       test_ping_req_msg_v01_ei, &req);
> +	if (ret < 0) {
> +		qmi_txn_cancel(&txn);
> +		return ret;
> +	}
> +
> +	ret = qmi_txn_wait(&txn, 5 * HZ);
> +	if (ret < 0)
> +		count = ret;
> +
> +	return count;
> +}
[...]
> +
> +/*
> + * data_store() - data debugfs file write handler

data_write

> + * @file:	debugfs file context
> + * @user_buf:	reference to the user data
> + * @count:	number of bytes in @user_buf
> + * @ppos:	offset in @file to write
> + *
> + * Returns @count, or negative errno on failure.
> + *
> + * This function allows user space to send out a data QMI encoded message to
> + * the associated remote test service and will return with the result of the
> + * transaction. It serves as an example of how to have the QMI helpers decode a
> + * transaction response into a provided object automatically.
> + */
> +static ssize_t data_write(struct file *file, const char __user *user_buf,
> +			  size_t count, loff_t *ppos)



Jonathan Neuschäfer

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ