Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
authorJakub Kicinski <kuba@kernel.org>
Tue, 29 Nov 2022 21:04:52 +0000 (13:04 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 29 Nov 2022 21:04:52 +0000 (13:04 -0800)
tools/lib/bpf/ringbuf.c
  927cbb478adf ("libbpf: Handle size overflow for ringbuf mmap")
  b486d19a0ab0 ("libbpf: checkpatch: Fixed code alignments in ringbuf.c")
https://lore.kernel.org/all/20221121122707.44d1446a@canb.auug.org.au/

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
64 files changed:
1  2 
MAINTAINERS
drivers/net/bonding/bond_main.c
drivers/net/can/m_can/m_can.c
drivers/net/ethernet/altera/altera_tse_main.c
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/freescale/fec_main.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/iavf/iavf_main.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/prestera/prestera_main.c
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/ethernet/mediatek/mtk_ppe.c
drivers/net/ethernet/mediatek/mtk_ppe.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
drivers/net/ethernet/netronome/nfp/nfp_devlink.c
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ipvlan/ipvlan_main.c
drivers/net/loopback.c
drivers/net/macsec.c
drivers/net/phy/phylink.c
drivers/net/tun.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/qmi_wwan.c
drivers/net/virtio_net.c
drivers/nfc/nfcmrvl/i2c.c
kernel/bpf/bpf_local_storage.c
kernel/trace/ftrace.c
net/core/flow_dissector.c
net/dccp/ipv6.c
net/dccp/proto.c
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c
net/mptcp/protocol.c
net/mptcp/subflow.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_tables_api.c
net/netfilter/nft_ct.c
net/nfc/nci/core.c
net/openvswitch/conntrack.c
net/packet/af_packet.c
net/rxrpc/ar-internal.h
net/rxrpc/conn_client.c
net/sched/act_ct.c
net/wireless/scan.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_probes.c
tools/lib/bpf/ringbuf.c
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
tools/testing/selftests/net/mptcp/simult_flows.sh

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/dccp/ipv6.c
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/tcp.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 51808c5f0014e0d250ab00078186c5345169d6ac,6af142953a940f51113690ba2f4fdaec5f55cc49..47855af25f3bcacf15d11863ecfbb876268ae1e6
@@@ -128,9 -128,13 +128,13 @@@ int ring_buffer__add(struct ring_buffe
        /* Map read-only producer page and data pages. We map twice as big
         * data size to allow simple reading of samples that wrap around the
         * end of a ring buffer. See kernel implementation for details.
 -       * */
 +       */
-       tmp = mmap(NULL, rb->page_size + 2 * info.max_entries, PROT_READ,
-                  MAP_SHARED, map_fd, rb->page_size);
+       mmap_sz = rb->page_size + 2 * (__u64)info.max_entries;
+       if (mmap_sz != (__u64)(size_t)mmap_sz) {
+               pr_warn("ringbuf: ring buffer size (%u) is too big\n", info.max_entries);
+               return libbpf_err(-E2BIG);
+       }
+       tmp = mmap(NULL, (size_t)mmap_sz, PROT_READ, MAP_SHARED, map_fd, rb->page_size);
        if (tmp == MAP_FAILED) {
                err = -errno;
                ringbuf_unmap_ring(rb, r);