linux-stable/samples
Matteo Croce 3c24a931e9 samples, bpf: suppress compiler warning
[ Upstream commit a195cefff4 ]

GCC 9 fails to calculate the size of local constant strings and produces a
false positive:

samples/bpf/task_fd_query_user.c: In function ‘test_debug_fs_uprobe’:
samples/bpf/task_fd_query_user.c:242:67: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 215 [-Wformat-truncation=]
  242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
      |                                                                   ^~
  243 |    event_type, event_alias);
      |                ~~~~~~~~~~~
samples/bpf/task_fd_query_user.c:242:2: note: ‘snprintf’ output between 45 and 300 bytes into a destination of size 256
  242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243 |    event_type, event_alias);
      |    ~~~~~~~~~~~~~~~~~~~~~~~~

Workaround this by lowering the buffer size to a reasonable value.
Related GCC Bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83431

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-14 08:11:04 +02:00
..
auxdisplay auxdisplay: Replace licenses with SPDX identifiers 2018-04-12 19:02:45 +02:00
bpf samples, bpf: suppress compiler warning 2019-07-14 08:11:04 +02:00
configfs
connector A relatively calm cycle for the docs tree again. 2017-11-13 08:25:06 -08:00
hidraw kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
hw_breakpoint
kdb
kfifo
kobject kobject: Remove redundant license text 2017-12-07 18:36:43 +01:00
kprobes arch: remove tile port 2018-03-16 10:56:03 +01:00
livepatch livepatch: check kzalloc return values 2019-02-12 19:47:12 +01:00
mei samples: mei: use /dev/mei0 instead of /dev/mei 2019-02-15 08:10:11 +01:00
mic/mpssd Merge branch 'linus' into locking/core, to resolve conflicts 2017-11-07 10:32:44 +01:00
pktgen Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
qmi samples: Introduce Qualcomm QMI sample client 2018-02-12 16:57:22 -08:00
rpmsg
seccomp kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS 2018-07-18 01:18:05 +09:00
statx kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
timers
trace_events Merge branch 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-11-15 10:14:11 -08:00
trace_printk
uhid kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
v4l
vfio-mdev sample: vfio-mdev: avoid deadlock in mdev_access() 2018-07-11 13:22:41 -06:00
watchdog
Kconfig samples: disable CONFIG_SAMPLES for UML 2018-10-11 02:15:46 +09:00
Makefile remoteproc updates for v4.17 2018-04-10 12:09:27 -07:00