On 2020-08-07 5:00 PM, Mark Brown wrote:
On Fri, Aug 07, 2020 at 01:06:44PM +0200, Cezary Rojewski wrote:
+// SPDX-License-Identifier: GPL-2.0-pcm
I'm not able to find any references to what license this is - it's not
in https://spdx.org/licenses/ for example.
Indeed. this is a mistake. Will fix in v2.
+ struct catpt_fw_version version;
+ int ret;
+
+ pm_runtime_get_sync(cdev->dev);
+
+ ret = catpt_ipc_get_fw_version(cdev, &version);
+
+ pm_runtime_mark_last_busy(cdev->dev);
+ pm_runtime_put_autosuspend(cdev->dev);
+
+ if (ret)
+ return CATPT_IPC_ERROR(ret);
+
+ memcpy(buf, &version, count);
This will copy count bytes from version regardless of the size of
version - this allows userspace to read the stack and won't truncate the
count to the size of the data read.
Good catch Mark. Ack.