kernel: ltq-vdsl-vr9-mei: fix warning about field-spanning write
authorMartin Schiller <ms@dev.tdt.de>
Thu, 11 Apr 2024 18:31:01 +0000 (20:31 +0200)
committerMartin Schiller <ms@dev.tdt.de>
Wed, 15 May 2024 06:54:58 +0000 (08:54 +0200)
We need to use unsafe_memcpy() here, because the code do the field-
spanning write intentionally.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/401-use-unsafe_memcpy-for-intentional-field-spanning-write.patch [new file with mode: 0644]

diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/401-use-unsafe_memcpy-for-intentional-field-spanning-write.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/401-use-unsafe_memcpy-for-intentional-field-spanning-write.patch
new file mode 100644 (file)
index 0000000..1542ace
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/src/drv_mei_cpe_msg_process.c
++++ b/src/drv_mei_cpe_msg_process.c
+@@ -3524,7 +3524,12 @@ IFX_int32_t MEI_IoctlCmdMsgWrite(
+    {
+       if (bInternCall)
+       {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0))
+          memcpy(pDestPtr, pUserMsg->pPayload, pUserMsg->paylSize_byte);
++#else
++         unsafe_memcpy(pDestPtr, pUserMsg->pPayload, pUserMsg->paylSize_byte,
++                       /* field-spanning writing is used here intentionally */);
++#endif
+       }
+       else
+       {