From 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 2 Sep 2026 15:31:14 -0700 Subject: treewide: refresh kmalloc_obj() conversions This is another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci This catches both the set of kmalloc() uses added since the first kmalloc_obj() conversions in v7.0 and adds a large group missed in the first pass due to Coccinelle not interacting well with the cleanup.h scoped_...() family of macros[1]. I worked around this with spatch's "--macro-file" argument to a file with all the scoped_...() macros mapped to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control flow indicator I could find. Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc, riscv, and s390 with no new warnings. Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1] Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2] Signed-off-by: Kees Cook --- Documentation/netlink/specs/rt-addr.yaml | 199 +++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 Documentation/netlink/specs/rt-addr.yaml (limited to 'Documentation/netlink/specs/rt-addr.yaml') diff --git a/Documentation/netlink/specs/rt-addr.yaml b/Documentation/netlink/specs/rt-addr.yaml new file mode 100644 index 000000000..0ecbd24c8 --- /dev/null +++ b/Documentation/netlink/specs/rt-addr.yaml @@ -0,0 +1,199 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) +--- +name: rt-addr +protocol: netlink-raw +uapi-header: linux/rtnetlink.h +protonum: 0 + +doc: >- + Address configuration over rtnetlink. + +definitions: + - + name: ifaddrmsg + type: struct + members: + - + name: ifa-family + type: u8 + - + name: ifa-prefixlen + type: u8 + - + name: ifa-flags + type: u8 + enum: ifa-flags + enum-as-flags: true + - + name: ifa-scope + type: u8 + - + name: ifa-index + type: u32 + - + name: ifa-cacheinfo + type: struct + members: + - + name: ifa-prefered + type: u32 + - + name: ifa-valid + type: u32 + - + name: cstamp + type: u32 + - + name: tstamp + type: u32 + + - + name: ifa-flags + type: flags + name-prefix: ifa-f- + enum-name: + entries: + - + name: secondary + - + name: nodad + - + name: optimistic + - + name: dadfailed + - + name: homeaddress + - + name: deprecated + - + name: tentative + - + name: permanent + - + name: managetempaddr + - + name: noprefixroute + - + name: mcautojoin + - + name: stable-privacy + +attribute-sets: + - + name: addr-attrs + name-prefix: ifa- + attributes: + - + name: address + type: binary + display-hint: ipv4-or-v6 + - + name: local + type: binary + display-hint: ipv4-or-v6 + - + name: label + type: string + - + name: broadcast + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: anycast + type: binary + - + name: cacheinfo + type: binary + struct: ifa-cacheinfo + - + name: multicast + type: binary + - + name: flags + type: u32 + enum: ifa-flags + enum-as-flags: true + - + name: rt-priority + type: u32 + - + name: target-netnsid + type: binary + - + name: proto + type: u8 + - + name: mc-users + type: u32 + + +operations: + fixed-header: ifaddrmsg + enum-model: directional + name-prefix: rtm- + list: + - + name: newaddr + doc: Add new address + attribute-set: addr-attrs + do: + request: + value: 20 + attributes: &ifaddr-all + - address + - label + - local + - cacheinfo + - + name: deladdr + doc: Remove address + attribute-set: addr-attrs + do: + request: + value: 21 + attributes: + - address + - local + - + name: getaddr + doc: Dump address information. + attribute-set: addr-attrs + dump: + request: + value: 22 + attributes: [] + reply: + value: 20 + attributes: *ifaddr-all + - + name: getmulticast + doc: Get / dump IPv4/IPv6 multicast addresses. + attribute-set: addr-attrs + fixed-header: ifaddrmsg + do: + request: + value: 58 + attributes: [] + reply: + value: 58 + attributes: &mcaddr-attrs + - multicast + - mc-users + - cacheinfo + dump: + request: + value: 58 + attributes: [] + reply: + value: 58 + attributes: *mcaddr-attrs + +mcast-groups: + list: + - + name: rtnlgrp-ipv4-ifaddr + value: 5 + - + name: rtnlgrp-ipv6-ifaddr + value: 9 -- cgit v1.3.1