No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Simon Horman feea6020aa netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS
[ Upstream commit e1f1ee0e9ad8cbe660f5c104e791c5f1a7cf4c31 ]

Only provide ctnetlink_label_size when it is used,
which is when CONFIG_NF_CONNTRACK_EVENTS is configured.

Flagged by clang-18 W=1 builds as:

.../nf_conntrack_netlink.c:385:19: warning: unused function 'ctnetlink_label_size' [-Wunused-function]
  385 | static inline int ctnetlink_label_size(const struct nf_conn *ct)
      |                   ^~~~~~~~~~~~~~~~~~~~

The condition on CONFIG_NF_CONNTRACK_LABELS being removed by
this patch guards compilation of non-trivial implementations
of ctnetlink_dump_labels() and ctnetlink_label_size().

However, this is not necessary as each of these functions
will always return 0 if CONFIG_NF_CONNTRACK_LABELS is not defined
as each function starts with the equivalent of:

	struct nf_conn_labels *labels = nf_ct_labels_find(ct);

	if (!labels)
		return 0;

And nf_ct_labels_find always returns NULL if CONFIG_NF_CONNTRACK_LABELS
is not enabled.  So I believe that the compiler optimises the code away
in such cases anyway.

Found by inspection.
Compile tested only.

Originally splitted in two patches, Pablo Neira Ayuso collapsed them and
added Fixes: tag.

Fixes: 0ceabd8387 ("netfilter: ctnetlink: deliver labels to userspace")
Link: https://lore.kernel.org/netfilter-devel/20240909151712.GZ2097826@kernel.org/
Signed-off-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-08 16:20:33 +01:00
arch riscv: Fix fp alignment bug in perf_callchain_user() 2024-11-08 16:20:32 +01:00
block block, bfq: don't break merge chain in bfq_split_bfqq() 2024-11-08 16:20:28 +01:00
certs
crypto crypto: ecrdsa - Fix module auto-load on add_key 2024-06-16 13:28:51 +02:00
Documentation ipmi: docs: don't advertise deprecated sysfs entries 2024-11-08 16:20:29 +01:00
drivers net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition 2024-11-08 16:20:33 +01:00
fs f2fs: reduce expensive checkpoint trigger frequency 2024-11-08 16:20:32 +01:00
include tcp: check skb is non-NULL in tcp_rto_delta_us() 2024-11-08 16:20:33 +01:00
init init: open /initrd.image with O_LARGEFILE 2024-04-13 12:51:36 +02:00
ipc ipc: replace costly bailout check in sysvipc_find_ipc() 2024-09-04 13:15:02 +02:00
kernel bpf: Fix bpf_strtol and bpf_strtoul helpers for 32bit 2024-11-08 16:20:31 +01:00
lib xz: cleanup CRC32 edits from 2018 2024-11-08 16:20:30 +01:00
LICENSES
mm memcg_write_event_control(): fix a user-triggerable oops 2024-09-04 13:14:50 +02:00
net netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS 2024-11-08 16:20:33 +01:00
samples media: rename VFL_TYPE_GRABBER to _VIDEO 2024-03-26 18:22:22 -04:00
scripts scripts: kconfig: merge_config: config files: add a trailing newline 2024-11-08 16:20:24 +01:00
security smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso 2024-11-08 16:20:30 +01:00
sound ASoC: tda7419: fix module autoloading 2024-11-08 16:20:25 +01:00
tools perf time-utils: Fix 32-bit nsec parsing 2024-11-08 16:20:31 +01:00
usr
virt KVM: async_pf: Cleanup kvm_setup_async_pf() 2024-05-02 16:18:32 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.284 2024-09-12 11:03:57 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.