Revision dec24b3b339487e58ce2da2875e9ee0316cc7e70 authored by Kees Cook on 20 June 2023, 19:42:38 UTC, committed by Paolo Abeni on 22 June 2023, 09:27:47 UTC
struct mux_adth actually ends with multiple struct mux_adth_dg members.
This is seen both in the comments about the member:

/**
 * struct mux_adth - Structure of the Aggregated Datagram Table Header.
 ...
 * @dg:		datagramm table with variable length
 */

and in the preparation for populating it:

                        adth_dg_size = offsetof(struct mux_adth, dg) +
                                        ul_adb->dg_count[i] * sizeof(*dg);
			...
                        adth_dg_size -= offsetof(struct mux_adth, dg);
                        memcpy(&adth->dg, ul_adb->dg[i], adth_dg_size);

This was reported as a run-time false positive warning:

memcpy: detected field-spanning write (size 16) of single field "&adth->dg" at drivers/net/wwan/iosm/iosm_ipc_mux_codec.c:852 (size 8)

Adjust the struct mux_adth definition and associated sizeof() math; no binary
output differences are observed in the resulting object file.

Reported-by: Florian Klink <flokli@flokli.de>
Closes: https://lore.kernel.org/lkml/dbfa25f5-64c8-5574-4f5d-0151ba95d232@gmail.com/
Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
Cc: M Chetan Kumar <m.chetan.kumar@intel.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Intel Corporation <linuxwwan@intel.com>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230620194234.never.023-kees@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 2174a08
History
File Mode Size
partitions
Kconfig -rw-r--r-- 6.8 KB
Kconfig.iosched -rw-r--r-- 1.4 KB
Makefile -rw-r--r-- 1.7 KB
badblocks.c -rw-r--r-- 14.1 KB
bdev.c -rw-r--r-- 25.7 KB
bfq-cgroup.c -rw-r--r-- 40.0 KB
bfq-iosched.c -rw-r--r-- 264.2 KB
bfq-iosched.h -rw-r--r-- 40.5 KB
bfq-wf2q.c -rw-r--r-- 52.4 KB
bio-integrity.c -rw-r--r-- 12.3 KB
bio.c -rw-r--r-- 48.9 KB
blk-cgroup-fc-appid.c -rw-r--r-- 1.4 KB
blk-cgroup-rwstat.c -rw-r--r-- 3.4 KB
blk-cgroup-rwstat.h -rw-r--r-- 3.9 KB
blk-cgroup.c -rw-r--r-- 55.1 KB
blk-cgroup.h -rw-r--r-- 15.3 KB
blk-core.c -rw-r--r-- 33.0 KB
blk-crypto-fallback.c -rw-r--r-- 18.7 KB
blk-crypto-internal.h -rw-r--r-- 6.1 KB
blk-crypto-profile.c -rw-r--r-- 16.1 KB
blk-crypto-sysfs.c -rw-r--r-- 4.5 KB
blk-crypto.c -rw-r--r-- 12.7 KB
blk-flush.c -rw-r--r-- 15.5 KB
blk-ia-ranges.c -rw-r--r-- 8.5 KB
blk-integrity.c -rw-r--r-- 10.4 KB
blk-ioc.c -rw-r--r-- 10.5 KB
blk-iocost.c -rw-r--r-- 97.8 KB
blk-iolatency.c -rw-r--r-- 29.6 KB
blk-ioprio.c -rw-r--r-- 5.5 KB
blk-ioprio.h -rw-r--r-- 540 bytes
blk-lib.c -rw-r--r-- 9.0 KB
blk-map.c -rw-r--r-- 18.0 KB
blk-merge.c -rw-r--r-- 31.4 KB
blk-mq-cpumap.c -rw-r--r-- 1.3 KB
blk-mq-debugfs-zoned.c -rw-r--r-- 453 bytes
blk-mq-debugfs.c -rw-r--r-- 20.9 KB
blk-mq-debugfs.h -rw-r--r-- 2.4 KB
blk-mq-pci.c -rw-r--r-- 1.2 KB
blk-mq-sched.c -rw-r--r-- 13.9 KB
blk-mq-sched.h -rw-r--r-- 2.3 KB
blk-mq-sysfs.c -rw-r--r-- 6.4 KB
blk-mq-tag.c -rw-r--r-- 18.4 KB
blk-mq-virtio.c -rw-r--r-- 1.3 KB
blk-mq.c -rw-r--r-- 120.1 KB
blk-mq.h -rw-r--r-- 12.9 KB
blk-pm.c -rw-r--r-- 6.6 KB
blk-pm.h -rw-r--r-- 763 bytes
blk-rq-qos.c -rw-r--r-- 8.3 KB
blk-rq-qos.h -rw-r--r-- 4.6 KB
blk-settings.c -rw-r--r-- 30.4 KB
blk-stat.c -rw-r--r-- 5.2 KB
blk-stat.h -rw-r--r-- 4.8 KB
blk-sysfs.c -rw-r--r-- 22.9 KB
blk-throttle.c -rw-r--r-- 66.9 KB
blk-throttle.h -rw-r--r-- 6.4 KB
blk-timeout.c -rw-r--r-- 4.1 KB
blk-wbt.c -rw-r--r-- 22.3 KB
blk-wbt.h -rw-r--r-- 1.1 KB
blk-zoned.c -rw-r--r-- 16.4 KB
blk.h -rw-r--r-- 14.4 KB
bounce.c -rw-r--r-- 6.8 KB
bsg-lib.c -rw-r--r-- 9.8 KB
bsg.c -rw-r--r-- 6.2 KB
disk-events.c -rw-r--r-- 12.9 KB
elevator.c -rw-r--r-- 18.4 KB
elevator.h -rw-r--r-- 5.6 KB
fops.c -rw-r--r-- 17.2 KB
genhd.c -rw-r--r-- 38.1 KB
holder.c -rw-r--r-- 3.8 KB
ioctl.c -rw-r--r-- 16.4 KB
ioprio.c -rw-r--r-- 5.8 KB
kyber-iosched.c -rw-r--r-- 27.9 KB
mq-deadline.c -rw-r--r-- 33.5 KB
opal_proto.h -rw-r--r-- 9.7 KB
sed-opal.c -rw-r--r-- 71.5 KB
t10-pi.c -rw-r--r-- 12.5 KB

back to top