History

Merge tag 'net-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski: "Networking fixes for 5.12-rc7, including fixes from can, ipsec, mac80211, wireless, and bpf trees. No scary regressions here or in the works, but small fixes for 5.12 changes keep coming. Current release - regressions: - virtio: do not pull payload in skb->head - virtio: ensure mac header is set in virtio_net_hdr_to_skb() - Revert "net: correct sk_acceptq_is_full()" - mptcp: revert "mptcp: provide subflow aware release function" - ethernet: lan743x: fix ethernet frame cutoff issue - dsa: fix type was not set for devlink port - ethtool: remove link_mode param and derive link params from driver - sched: htb: fix null pointer dereference on a null new_q - wireless: iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd() - wireless: iwlwifi: fw: fix notification wait locking - wireless: brcmfmac: p2p: Fix deadlock introduced by avoiding the rtnl dependency Current release - new code bugs: - napi: fix hangup on napi_disable for threaded napi - bpf: take module reference for trampoline in module - wireless: mt76: mt7921: fix airtime reporting and related tx hangs - wireless: iwlwifi: mvm: rfi: don't lock mvm->mutex when sending config command Previous releases - regressions: - rfkill: revert back to old userspace API by default - nfc: fix infinite loop, refcount & memory leaks in LLCP sockets - let skb_orphan_partial wake-up waiters - xfrm/compat: Cleanup WARN()s that can be user-triggered - vxlan, geneve: do not modify the shared tunnel info when PMTU triggers an ICMP reply - can: fix msg_namelen values depending on CAN_REQUIRED_SIZE - can: uapi: mark union inside struct can_frame packed - sched: cls: fix action overwrite reference counting - sched: cls: fix err handler in tcf_action_init() - ethernet: mlxsw: fix ECN marking in tunnel decapsulation - ethernet: nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx - ethernet: i40e: fix receiving of single packets in xsk zero-copy mode - ethernet: cxgb4: avoid collecting SGE_QBASE regs during traffic Previous releases - always broken: - bpf: Refuse non-O_RDWR flags in BPF_OBJ_GET - bpf: Refcount task stack in bpf_get_task_stack - bpf, x86: Validate computation of branch displacements - ieee802154: fix many similar syzbot-found bugs - fix NULL dereferences in netlink attribute handling - reject unsupported operations on monitor interfaces - fix error handling in llsec_key_alloc() - xfrm: make ipv4 pmtu check honor ip header df - xfrm: make hash generation lock per network namespace - xfrm: esp: delete NETIF_F_SCTP_CRC bit from features for esp offload - ethtool: fix incorrect datatype in set_eee ops - xdp: fix xdp_return_frame() kernel BUG throw for page_pool memory model - openvswitch: fix send of uninitialized stack memory in ct limit reply Misc: - udp: add get handling for UDP_GRO sockopt" * tag 'net-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (182 commits) net: fix hangup on napi_disable for threaded napi net: hns3: Trivial spell fix in hns3 driver lan743x: fix ethernet frame cutoff issue net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits net: dsa: lantiq_gswip: Don't use PHY auto polling net: sched: sch_teql: fix null-pointer dereference ipv6: report errors for iftoken via netlink extack net: sched: fix err handler in tcf_action_init() net: sched: fix action overwrite reference counting Revert "net: sched: bump refcount for new action in ACT replace mode" ice: fix memory leak of aRFS after resuming from suspend i40e: Fix sparse warning: missing error code 'err' i40e: Fix sparse error: 'vsi->netdev' could be null i40e: Fix sparse error: uninitialized symbol 'ring' i40e: Fix sparse errors in i40e_txrx.c i40e: Fix parameters in aq_get_phy_register() nl80211: fix beacon head validation bpf, x86: Validate computation of branch displacements for x86-32 bpf, x86: Validate computation of branch displacements for x86-64 ...

Linus Torvalds committed 5 years ago

Commit 4e04e752 parents 3b97843 27f0ad7179 files · +1872 −715Browse files

Showing the changes to include/uapi/linux (3 of 179 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/can.h +1 −1
  2. include/uapi/linux/ethtool.h +33 −21
  3. include/uapi/linux/rfkill.h +68 −12
include/uapi/linux/can.h+1−1
@@ -113,7 +113,7 @@ struct can_frame { · 112 unmodified lines
113113 */
114114 __u8 len;
115115 __u8 can_dlc; /* deprecated */
116− };
116+ } __attribute__((packed)); /* disable padding added in some ABIs */
117117 __u8 __pad; /* padding */
118118 __u8 __res0; /* reserved / padding */
119119 __u8 len8_dlc; /* optional DLC for 8 byte payload length (9 .. 15) */
include/uapi/linux/ethtool.h+33−21
@@ -26,6 +26,14 @@ · 25 unmodified lines
2626 * have the same layout for 32-bit and 64-bit userland.
2727 */
2828
29+/* Note on reserved space.
30+ * Reserved fields must not be accessed directly by user space because
31+ * they may be replaced by a different field in the future. They must
32+ * be initialized to zero before making the request, e.g. via memset
33+ * of the entire structure or implicitly by not being set in a structure
34+ * initializer.
35+ */
36+
2937 /**
3038 * struct ethtool_cmd - DEPRECATED, link control and status
3139 * This structure is DEPRECATED, please use struct ethtool_link_settings.
@@ -67,6 +75,7 @@ · 35 unmodified lines
6775 * and other link features that the link partner advertised
6876 * through autonegotiation; 0 if unknown or not applicable.
6977 * Read-only.
78+ * @reserved: Reserved for future use; see the note on reserved space.
7079 *
7180 * The link speed in Mbps is split between @speed and @speed_hi. Use
7281 * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
@@ -155,6 +164,7 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) · 82 unmodified lines
155164 * @bus_info: Device bus address. This should match the dev_name()
156165 * string for the underlying bus device, if there is one. May be
157166 * an empty string.
167+ * @reserved2: Reserved for future use; see the note on reserved space.
158168 * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
159169 * %ETHTOOL_SPFLAGS commands; also the number of strings in the
160170 * %ETH_SS_PRIV_FLAGS set
@@ -356,6 +366,7 @@ struct ethtool_eeprom { · 195 unmodified lines
356366 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
357367 * its tx lpi (after reaching 'idle' state). Effective only when eee
358368 * was negotiated and tx_lpi_enabled was set.
369+ * @reserved: Reserved for future use; see the note on reserved space.
359370 */
360371 struct ethtool_eee {
361372 __u32 cmd;
@@ -374,6 +385,7 @@ struct ethtool_eee { · 12 unmodified lines
374385 * @cmd: %ETHTOOL_GMODULEINFO
375386 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
376387 * @eeprom_len: Length of the eeprom
388+ * @reserved: Reserved for future use; see the note on reserved space.
377389 *
378390 * This structure is used to return the information to
379391 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
@@ -579,9 +591,7 @@ struct ethtool_pauseparam { · 199 unmodified lines
579591 __u32 tx_pause;
580592 };
581593
582−/**
583− * enum ethtool_link_ext_state - link extended state
584− */
594+/* Link extended state */
585595 enum ethtool_link_ext_state {
586596 ETHTOOL_LINK_EXT_STATE_AUTONEG,
587597 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE,
@@ -595,10 +605,7 @@ enum ethtool_link_ext_state { · 7 unmodified lines
595605 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
596606 };
597607
598−/**
599− * enum ethtool_link_ext_substate_autoneg - more information in addition to
600− * ETHTOOL_LINK_EXT_STATE_AUTONEG.
601− */
608+/* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */
602609 enum ethtool_link_ext_substate_autoneg {
603610 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1,
604611 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED,
@@ -608,9 +615,7 @@ enum ethtool_link_ext_substate_autoneg { · 3 unmodified lines
608615 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD,
609616 };
610617
611−/**
612− * enum ethtool_link_ext_substate_link_training - more information in addition to
613− * ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE.
618+/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE.
614619 */
615620 enum ethtool_link_ext_substate_link_training {
616621 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1,
@@ -619,9 +624,7 @@ enum ethtool_link_ext_substate_link_training { · 2 unmodified lines
619624 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT,
620625 };
621626
622−/**
623− * enum ethtool_link_ext_substate_logical_mismatch - more information in addition
624− * to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH.
627+/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH.
625628 */
626629 enum ethtool_link_ext_substate_link_logical_mismatch {
627630 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1,
@@ -631,19 +634,14 @@ enum ethtool_link_ext_substate_link_logical_mismatch { · 3 unmodified lines
631634 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED,
632635 };
633636
634−/**
635− * enum ethtool_link_ext_substate_bad_signal_integrity - more information in
636− * addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY.
637+/* More information in addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY.
637638 */
638639 enum ethtool_link_ext_substate_bad_signal_integrity {
639640 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1,
640641 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE,
641642 };
642643
643−/**
644− * enum ethtool_link_ext_substate_cable_issue - more information in
645− * addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE.
646− */
644+/* More information in addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE. */
647645 enum ethtool_link_ext_substate_cable_issue {
648646 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1,
649647 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE,
@@ -661,6 +659,7 @@ enum ethtool_link_ext_substate_cable_issue { · 11 unmodified lines
661659 * now deprecated
662660 * @ETH_SS_FEATURES: Device feature names
663661 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
662+ * @ETH_SS_TUNABLES: tunable names
664663 * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
665664 * @ETH_SS_PHY_TUNABLES: PHY tunable names
666665 * @ETH_SS_LINK_MODES: link mode names
@@ -670,6 +669,8 @@ enum ethtool_link_ext_substate_cable_issue { · 3 unmodified lines
670669 * @ETH_SS_TS_TX_TYPES: timestamping Tx types
671670 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
672671 * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types
672+ *
673+ * @ETH_SS_COUNT: number of defined string sets
673674 */
674675 enum ethtool_stringset {
675676 ETH_SS_TEST = 0,
@@ -715,6 +716,7 @@ struct ethtool_gstrings { · 39 unmodified lines
715716 /**
716717 * struct ethtool_sset_info - string set information
717718 * @cmd: Command number = %ETHTOOL_GSSET_INFO
719+ * @reserved: Reserved for future use; see the note on reserved space.
718720 * @sset_mask: On entry, a bitmask of string sets to query, with bits
719721 * numbered according to &enum ethtool_stringset. On return, a
720722 * bitmask of those string sets queried that are supported.
@@ -759,6 +761,7 @@ enum ethtool_test_flags { · 38 unmodified lines
759761 * @flags: A bitmask of flags from &enum ethtool_test_flags. Some
760762 * flags may be set by the user on entry; others may be set by
761763 * the driver on return.
764+ * @reserved: Reserved for future use; see the note on reserved space.
762765 * @len: On return, the number of test results
763766 * @data: Array of test results
764767 *
@@ -959,6 +962,7 @@ union ethtool_flow_union { · 194 unmodified lines
959962 * @vlan_etype: VLAN EtherType
960963 * @vlan_tci: VLAN tag control information
961964 * @data: user defined data
965+ * @padding: Reserved for future use; see the note on reserved space.
962966 *
963967 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT
964968 * is set in &struct ethtool_rx_flow_spec @flow_type.
@@ -1134,7 +1138,8 @@ struct ethtool_rxfh_indir { · 169 unmodified lines
11341138 * hardware hash key.
11351139 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
11361140 * Valid values are one of the %ETH_RSS_HASH_*.
1137− * @rsvd: Reserved for future extensions.
1141+ * @rsvd8: Reserved for future use; see the note on reserved space.
1142+ * @rsvd32: Reserved for future use; see the note on reserved space.
11381143 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
11391144 * of @indir_size __u32 elements, followed by hash key of @key_size
11401145 * bytes.
@@ -1302,7 +1307,9 @@ struct ethtool_sfeatures { · 161 unmodified lines
13021307 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
13031308 * @phc_index: device index of the associated PHC, or -1 if there is none
13041309 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
1310+ * @tx_reserved: Reserved for future use; see the note on reserved space.
13051311 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
1312+ * @rx_reserved: Reserved for future use; see the note on reserved space.
13061313 *
13071314 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
13081315 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
@@ -1958,6 +1965,11 @@ enum ethtool_reset_flags { · 649 unmodified lines
19581965 * autonegotiation; 0 if unknown or not applicable. Read-only.
19591966 * @transceiver: Used to distinguish different possible PHY types,
19601967 * reported consistently by PHYLIB. Read-only.
1968+ * @master_slave_cfg: Master/slave port mode.
1969+ * @master_slave_state: Master/slave port state.
1970+ * @reserved: Reserved for future use; see the note on reserved space.
1971+ * @reserved1: Reserved for future use; see the note on reserved space.
1972+ * @link_mode_masks: Variable length bitmaps.
19611973 *
19621974 * If autonegotiation is disabled, the speed and @duplex represent the
19631975 * fixed link mode and are writable if the driver supports multiple
include/uapi/linux/rfkill.h+68−12
@@ -86,34 +86,90 @@ enum rfkill_hard_block_reasons { · 85 unmodified lines
8686 * @op: operation code
8787 * @hard: hard state (0/1)
8888 * @soft: soft state (0/1)
89+ *
90+ * Structure used for userspace communication on /dev/rfkill,
91+ * used for events from the kernel and control to the kernel.
92+ */
93+struct rfkill_event {
94+ __u32 idx;
95+ __u8 type;
96+ __u8 op;
97+ __u8 soft;
98+ __u8 hard;
99+} __attribute__((packed));
100+
101+/**
102+ * struct rfkill_event_ext - events for userspace on /dev/rfkill
103+ * @idx: index of dev rfkill
104+ * @type: type of the rfkill struct
105+ * @op: operation code
106+ * @hard: hard state (0/1)
107+ * @soft: soft state (0/1)
89108 * @hard_block_reasons: valid if hard is set. One or several reasons from
90109 * &enum rfkill_hard_block_reasons.
91110 *
92111 * Structure used for userspace communication on /dev/rfkill,
93112 * used for events from the kernel and control to the kernel.
113+ *
114+ * See the extensibility docs below.
94115 */
95−struct rfkill_event {
116+struct rfkill_event_ext {
96117 __u32 idx;
97118 __u8 type;
98119 __u8 op;
99120 __u8 soft;
100121 __u8 hard;
122+
123+ /*
124+ * older kernels will accept/send only up to this point,
125+ * and if extended further up to any chunk marked below
126+ */
127+
101128 __u8 hard_block_reasons;
102129 } __attribute__((packed));
103130
104−/*
105− * We are planning to be backward and forward compatible with changes
106− * to the event struct, by adding new, optional, members at the end.
107− * When reading an event (whether the kernel from userspace or vice
108− * versa) we need to accept anything that's at least as large as the
109− * version 1 event size, but might be able to accept other sizes in
110− * the future.
131+/**
132+ * DOC: Extensibility
133+ *
134+ * Originally, we had planned to allow backward and forward compatible
135+ * changes by just adding fields at the end of the structure that are
136+ * then not reported on older kernels on read(), and not written to by
137+ * older kernels on write(), with the kernel reporting the size it did
138+ * accept as the result.
139+ *
140+ * This would have allowed userspace to detect on read() and write()
141+ * which kernel structure version it was dealing with, and if was just
142+ * recompiled it would have gotten the new fields, but obviously not
143+ * accessed them, but things should've continued to work.
144+ *
145+ * Unfortunately, while actually exercising this mechanism to add the
146+ * hard block reasons field, we found that userspace (notably systemd)
147+ * did all kinds of fun things not in line with this scheme:
148+ *
149+ * 1. treat the (expected) short writes as an error;
150+ * 2. ask to read sizeof(struct rfkill_event) but then compare the
151+ * actual return value to RFKILL_EVENT_SIZE_V1 and treat any
152+ * mismatch as an error.
153+ *
154+ * As a consequence, just recompiling with a new struct version caused
155+ * things to no longer work correctly on old and new kernels.
156+ *
157+ * Hence, we've rolled back &struct rfkill_event to the original version
158+ * and added &struct rfkill_event_ext. This effectively reverts to the
159+ * old behaviour for all userspace, unless it explicitly opts in to the
160+ * rules outlined here by using the new &struct rfkill_event_ext.
161+ *
162+ * Userspace using &struct rfkill_event_ext must adhere to the following
163+ * rules
111164 *
112− * One exception is the kernel -- we already have two event sizes in
113− * that we've made the 'hard' member optional since our only option
114− * is to ignore it anyway.
165+ * 1. accept short writes, optionally using them to detect that it's
166+ * running on an older kernel;
167+ * 2. accept short reads, knowing that this means it's running on an
168+ * older kernel;
169+ * 3. treat reads that are as long as requested as acceptable, not
170+ * checking against RFKILL_EVENT_SIZE_V1 or such.
115171 */
116−#define RFKILL_EVENT_SIZE_V1 8
172+#define RFKILL_EVENT_SIZE_V1 sizeof(struct rfkill_event)
117173
118174 /* ioctl for turning off rfkill-input (if present) */
119175 #define RFKILL_IOC_MAGIC 'R'