Netdev List
 help / color / mirror / Atom feed
* [PATCH 7/7] kbuild: compile-test kernel headers to ensure they are self-contained
From: Masahiro Yamada @ 2019-07-01  0:58 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Joel Fernandes, Masahiro Yamada, Tony Luck,
	John Fastabend, Jakub Kicinski, Daniel Borkmann, xdp-newbies,
	Anton Vorontsov, Matthias Brugger, Song Liu, Yonghong Song,
	Michal Marek, Jesper Dangaard Brouer, Martin KaFai Lau,
	linux-mediatek, linux-arm-kernel, Colin Cross, David S. Miller,
	Kees Cook, Alexei Starovoitov, netdev, linux-kernel, bpf
In-Reply-To: <20190701005845.12475-1-yamada.masahiro@socionext.com>

The headers in include/ are globally used in the kernel source tree
to provide common APIs. They are included from external modules, too.

It will be useful to make as many headers self-contained as possible
so that we do not have to rely on a specific include order.

There are more than 4000 headers in include/. In my rough analysis,
70% of them are already self-contained. With efforts, most of them
can be self-contained.

For now, we must exclude more than 1000 headers just because they
cannot be compiled as standalone units. I added them to header-test-.
The blacklist was mostly generated by a script, so the reason of the
breakage should be checked later.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Jani Nikula <jani.nikula@intel.com>
---

Changes in v4:
  - Fix vmlinux build error
  - Exclude more headers for sparc

Changes in v3:
  - Exclude more headers
   (Tested for allnoconfig + CONFIG_HEADER_TEST=y)

Changes in v2:
  - Add everything to test coverage, and exclude broken ones
  - Rename 'Makefile' to 'Kbuild'
  - Add CONFIG_KERNEL_HEADER_TEST option

 Makefile       |    1 +
 include/Kbuild | 1253 ++++++++++++++++++++++++++++++++++++++++++++++++
 init/Kconfig   |   11 +
 3 files changed, 1265 insertions(+)
 create mode 100644 include/Kbuild

diff --git a/Makefile b/Makefile
index 7f293b0431fe..d20e9d2725b8 100644
--- a/Makefile
+++ b/Makefile
@@ -609,6 +609,7 @@ ifeq ($(KBUILD_EXTMOD),)
 init-y		:= init/
 drivers-y	:= drivers/ sound/
 drivers-$(CONFIG_SAMPLES) += samples/
+drivers-$(CONFIG_KERNEL_HEADER_TEST) += include/
 net-y		:= net/
 libs-y		:= lib/
 core-y		:= usr/
diff --git a/include/Kbuild b/include/Kbuild
new file mode 100644
index 000000000000..4f9524d92a75
--- /dev/null
+++ b/include/Kbuild
@@ -0,0 +1,1253 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+# The following are excluded for now because they fail to build.
+#
+# Do not add a new header to the blacklist without legitimate reason.
+# Please consider to fix the header first.
+#
+# Sorted alphabetically.
+header-test-			+= acpi/acbuffer.h
+header-test-			+= acpi/acpi.h
+header-test-			+= acpi/acpi_bus.h
+header-test-			+= acpi/acpi_drivers.h
+header-test-			+= acpi/acpi_io.h
+header-test-			+= acpi/acpi_lpat.h
+header-test-			+= acpi/acpiosxf.h
+header-test-			+= acpi/acpixf.h
+header-test-			+= acpi/acrestyp.h
+header-test-			+= acpi/actbl.h
+header-test-			+= acpi/actbl1.h
+header-test-			+= acpi/actbl2.h
+header-test-			+= acpi/actbl3.h
+header-test-			+= acpi/actypes.h
+header-test-			+= acpi/battery.h
+header-test-			+= acpi/cppc_acpi.h
+header-test-			+= acpi/nfit.h
+header-test-			+= acpi/platform/acenv.h
+header-test-			+= acpi/platform/acenvex.h
+header-test-			+= acpi/platform/acintel.h
+header-test-			+= acpi/platform/aclinux.h
+header-test-			+= acpi/platform/aclinuxex.h
+header-test-			+= acpi/processor.h
+header-test-			+= clocksource/timer-sp804.h
+header-test-			+= crypto/cast_common.h
+header-test-			+= crypto/internal/cryptouser.h
+header-test-			+= crypto/pkcs7.h
+header-test-			+= crypto/poly1305.h
+header-test-			+= crypto/sha3.h
+header-test-			+= drm/ati_pcigart.h
+header-test-			+= drm/bridge/dw_hdmi.h
+header-test-			+= drm/bridge/dw_mipi_dsi.h
+header-test-			+= drm/drm_audio_component.h
+header-test-			+= drm/drm_auth.h
+header-test-			+= drm/drm_debugfs.h
+header-test-			+= drm/drm_debugfs_crc.h
+header-test-			+= drm/drm_displayid.h
+header-test-			+= drm/drm_encoder_slave.h
+header-test-			+= drm/drm_fb_cma_helper.h
+header-test-			+= drm/drm_fixed.h
+header-test-			+= drm/drm_format_helper.h
+header-test-			+= drm/drm_lease.h
+header-test-			+= drm/drm_legacy.h
+header-test-			+= drm/drm_panel.h
+header-test-			+= drm/drm_plane_helper.h
+header-test-			+= drm/drm_rect.h
+header-test-			+= drm/i915_component.h
+header-test-			+= drm/intel-gtt.h
+header-test-			+= drm/tinydrm/tinydrm-helpers.h
+header-test-			+= drm/ttm/ttm_debug.h
+header-test-			+= keys/asymmetric-parser.h
+header-test-			+= keys/asymmetric-subtype.h
+header-test-			+= keys/asymmetric-type.h
+header-test-			+= keys/big_key-type.h
+header-test-			+= keys/request_key_auth-type.h
+header-test-			+= keys/trusted.h
+header-test-			+= kvm/arm_arch_timer.h
+header-test-			+= kvm/arm_pmu.h
+header-test-$(CONFIG_ARM)	+= kvm/arm_psci.h
+header-test-$(CONFIG_ARM64)	+= kvm/arm_psci.h
+header-test-			+= kvm/arm_vgic.h
+header-test-			+= linux/8250_pci.h
+header-test-			+= linux/a.out.h
+header-test-			+= linux/adxl.h
+header-test-			+= linux/agpgart.h
+header-test-			+= linux/alcor_pci.h
+header-test-			+= linux/amba/clcd.h
+header-test-			+= linux/amba/pl080.h
+header-test-			+= linux/amd-iommu.h
+header-test-$(CONFIG_ARM)	+= linux/arm-cci.h
+header-test-$(CONFIG_ARM64)	+= linux/arm-cci.h
+header-test-			+= linux/arm_sdei.h
+header-test-			+= linux/asn1_decoder.h
+header-test-			+= linux/ata_platform.h
+header-test-			+= linux/ath9k_platform.h
+header-test-			+= linux/atm_tcp.h
+header-test-			+= linux/atomic-fallback.h
+header-test-			+= linux/avf/virtchnl.h
+header-test-			+= linux/bcm47xx_sprom.h
+header-test-			+= linux/bcma/bcma_driver_gmac_cmn.h
+header-test-			+= linux/bcma/bcma_driver_mips.h
+header-test-			+= linux/bcma/bcma_driver_pci.h
+header-test-			+= linux/bcma/bcma_driver_pcie2.h
+header-test-			+= linux/bit_spinlock.h
+header-test-			+= linux/blk-mq-rdma.h
+header-test-			+= linux/blk-mq.h
+header-test-			+= linux/blktrace_api.h
+header-test-			+= linux/blockgroup_lock.h
+header-test-			+= linux/bma150.h
+header-test-			+= linux/bpf_lirc.h
+header-test-			+= linux/bpf_types.h
+header-test-			+= linux/bsg-lib.h
+header-test-			+= linux/bsg.h
+header-test-			+= linux/btf.h
+header-test-			+= linux/btree-128.h
+header-test-			+= linux/btree-type.h
+header-test-$(CONFIG_CPU_BIG_ENDIAN) += linux/byteorder/big_endian.h
+header-test-			+= linux/byteorder/generic.h
+header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h
+header-test-			+= linux/c2port.h
+header-test-			+= linux/can/dev/peak_canfd.h
+header-test-			+= linux/can/platform/cc770.h
+header-test-			+= linux/can/platform/sja1000.h
+header-test-			+= linux/ceph/ceph_features.h
+header-test-			+= linux/ceph/ceph_frag.h
+header-test-			+= linux/ceph/ceph_fs.h
+header-test-			+= linux/ceph/debugfs.h
+header-test-			+= linux/ceph/msgr.h
+header-test-			+= linux/ceph/rados.h
+header-test-			+= linux/cgroup_subsys.h
+header-test-			+= linux/clk/sunxi-ng.h
+header-test-			+= linux/clk/ti.h
+header-test-			+= linux/cn_proc.h
+header-test-			+= linux/coda_psdev.h
+header-test-			+= linux/compaction.h
+header-test-			+= linux/console_struct.h
+header-test-			+= linux/count_zeros.h
+header-test-			+= linux/cs5535.h
+header-test-			+= linux/cuda.h
+header-test-			+= linux/cyclades.h
+header-test-			+= linux/dcookies.h
+header-test-			+= linux/delayacct.h
+header-test-			+= linux/delayed_call.h
+header-test-			+= linux/device-mapper.h
+header-test-			+= linux/devpts_fs.h
+header-test-			+= linux/dio.h
+header-test-			+= linux/dirent.h
+header-test-			+= linux/dlm_plock.h
+header-test-			+= linux/dm-dirty-log.h
+header-test-			+= linux/dm-region-hash.h
+header-test-			+= linux/dma-debug.h
+header-test-			+= linux/dma/mmp-pdma.h
+header-test-			+= linux/dma/sprd-dma.h
+header-test-			+= linux/dns_resolver.h
+header-test-			+= linux/drbd_genl.h
+header-test-			+= linux/drbd_genl_api.h
+header-test-			+= linux/dw_apb_timer.h
+header-test-			+= linux/dynamic_debug.h
+header-test-			+= linux/dynamic_queue_limits.h
+header-test-			+= linux/ecryptfs.h
+header-test-			+= linux/edma.h
+header-test-			+= linux/eeprom_93cx6.h
+header-test-			+= linux/efs_vh.h
+header-test-			+= linux/elevator.h
+header-test-			+= linux/elfcore-compat.h
+header-test-			+= linux/error-injection.h
+header-test-			+= linux/errseq.h
+header-test-			+= linux/eventpoll.h
+header-test-			+= linux/ext2_fs.h
+header-test-			+= linux/f75375s.h
+header-test-			+= linux/falloc.h
+header-test-			+= linux/fault-inject.h
+header-test-			+= linux/fbcon.h
+header-test-			+= linux/firmware/intel/stratix10-svc-client.h
+header-test-			+= linux/firmware/meson/meson_sm.h
+header-test-			+= linux/firmware/trusted_foundations.h
+header-test-			+= linux/firmware/xlnx-zynqmp.h
+header-test-			+= linux/fixp-arith.h
+header-test-			+= linux/flat.h
+header-test-			+= linux/fs_types.h
+header-test-			+= linux/fs_uart_pd.h
+header-test-			+= linux/fsi-occ.h
+header-test-			+= linux/fsi-sbefifo.h
+header-test-			+= linux/fsl/bestcomm/ata.h
+header-test-			+= linux/fsl/bestcomm/bestcomm.h
+header-test-			+= linux/fsl/bestcomm/bestcomm_priv.h
+header-test-			+= linux/fsl/bestcomm/fec.h
+header-test-			+= linux/fsl/bestcomm/gen_bd.h
+header-test-			+= linux/fsl/bestcomm/sram.h
+header-test-			+= linux/fsl_hypervisor.h
+header-test-			+= linux/fsldma.h
+header-test-			+= linux/ftrace_irq.h
+header-test-			+= linux/genl_magic_func.h
+header-test-			+= linux/genl_magic_struct.h
+header-test-			+= linux/gpio/aspeed.h
+header-test-			+= linux/gpio/gpio-reg.h
+header-test-			+= linux/hid-debug.h
+header-test-			+= linux/hiddev.h
+header-test-			+= linux/hippidevice.h
+header-test-			+= linux/hmm.h
+header-test-			+= linux/hp_sdc.h
+header-test-			+= linux/huge_mm.h
+header-test-			+= linux/hugetlb_cgroup.h
+header-test-			+= linux/hugetlb_inline.h
+header-test-			+= linux/hwmon-vid.h
+header-test-			+= linux/i2c-algo-pca.h
+header-test-			+= linux/i2c-algo-pcf.h
+header-test-			+= linux/i3c/ccc.h
+header-test-			+= linux/i3c/device.h
+header-test-			+= linux/i3c/master.h
+header-test-			+= linux/i8042.h
+header-test-			+= linux/ide.h
+header-test-			+= linux/idle_inject.h
+header-test-			+= linux/if_frad.h
+header-test-			+= linux/if_rmnet.h
+header-test-			+= linux/if_tap.h
+header-test-			+= linux/iio/accel/kxcjk_1013.h
+header-test-			+= linux/iio/adc/ad_sigma_delta.h
+header-test-			+= linux/iio/buffer-dma.h
+header-test-			+= linux/iio/buffer_impl.h
+header-test-			+= linux/iio/common/st_sensors.h
+header-test-			+= linux/iio/common/st_sensors_i2c.h
+header-test-			+= linux/iio/common/st_sensors_spi.h
+header-test-			+= linux/iio/dac/ad5421.h
+header-test-			+= linux/iio/dac/ad5504.h
+header-test-			+= linux/iio/dac/ad5791.h
+header-test-			+= linux/iio/dac/max517.h
+header-test-			+= linux/iio/dac/mcp4725.h
+header-test-			+= linux/iio/frequency/ad9523.h
+header-test-			+= linux/iio/frequency/adf4350.h
+header-test-			+= linux/iio/hw-consumer.h
+header-test-			+= linux/iio/imu/adis.h
+header-test-			+= linux/iio/sysfs.h
+header-test-			+= linux/iio/timer/stm32-timer-trigger.h
+header-test-			+= linux/iio/trigger.h
+header-test-			+= linux/iio/triggered_event.h
+header-test-			+= linux/imx-media.h
+header-test-			+= linux/inet_diag.h
+header-test-			+= linux/init_ohci1394_dma.h
+header-test-			+= linux/initrd.h
+header-test-			+= linux/input/adp5589.h
+header-test-			+= linux/input/bu21013.h
+header-test-			+= linux/input/cma3000.h
+header-test-			+= linux/input/kxtj9.h
+header-test-			+= linux/input/lm8333.h
+header-test-			+= linux/input/sparse-keymap.h
+header-test-			+= linux/input/touchscreen.h
+header-test-			+= linux/input/tps6507x-ts.h
+header-test-$(CONFIG_X86)	+= linux/intel-iommu.h
+header-test-			+= linux/intel-ish-client-if.h
+header-test-			+= linux/intel-pti.h
+header-test-			+= linux/intel-svm.h
+header-test-			+= linux/interconnect-provider.h
+header-test-			+= linux/ioc3.h
+header-test-			+= linux/ipack.h
+header-test-			+= linux/irq_cpustat.h
+header-test-			+= linux/irq_poll.h
+header-test-			+= linux/irqchip/arm-gic-v3.h
+header-test-			+= linux/irqchip/arm-gic-v4.h
+header-test-			+= linux/irqchip/irq-madera.h
+header-test-			+= linux/irqchip/irq-sa11x0.h
+header-test-			+= linux/irqchip/mxs.h
+header-test-			+= linux/irqchip/versatile-fpga.h
+header-test-			+= linux/irqdesc.h
+header-test-			+= linux/irqflags.h
+header-test-			+= linux/iscsi_boot_sysfs.h
+header-test-			+= linux/isdn/capiutil.h
+header-test-			+= linux/isdn/hdlc.h
+header-test-			+= linux/isdn_ppp.h
+header-test-			+= linux/jbd2.h
+header-test-			+= linux/jz4740-adc.h
+header-test-			+= linux/kasan.h
+header-test-			+= linux/kcore.h
+header-test-			+= linux/kdev_t.h
+header-test-			+= linux/kernelcapi.h
+header-test-			+= linux/khugepaged.h
+header-test-			+= linux/kobj_map.h
+header-test-			+= linux/kobject_ns.h
+header-test-			+= linux/kvm_host.h
+header-test-			+= linux/kvm_irqfd.h
+header-test-			+= linux/kvm_para.h
+header-test-			+= linux/lantiq.h
+header-test-			+= linux/lapb.h
+header-test-			+= linux/latencytop.h
+header-test-			+= linux/led-lm3530.h
+header-test-			+= linux/leds-bd2802.h
+header-test-			+= linux/leds-lp3944.h
+header-test-			+= linux/leds-lp3952.h
+header-test-			+= linux/leds_pwm.h
+header-test-			+= linux/libata.h
+header-test-			+= linux/license.h
+header-test-			+= linux/lightnvm.h
+header-test-			+= linux/lis3lv02d.h
+header-test-			+= linux/list_bl.h
+header-test-			+= linux/list_lru.h
+header-test-			+= linux/list_nulls.h
+header-test-			+= linux/lockd/share.h
+header-test-			+= linux/lzo.h
+header-test-			+= linux/mailbox/zynqmp-ipi-message.h
+header-test-			+= linux/maple.h
+header-test-			+= linux/mbcache.h
+header-test-			+= linux/mbus.h
+header-test-			+= linux/mc146818rtc.h
+header-test-			+= linux/mc6821.h
+header-test-			+= linux/mdev.h
+header-test-			+= linux/mem_encrypt.h
+header-test-			+= linux/memfd.h
+header-test-			+= linux/mfd/88pm80x.h
+header-test-			+= linux/mfd/88pm860x.h
+header-test-			+= linux/mfd/abx500/ab8500-bm.h
+header-test-			+= linux/mfd/abx500/ab8500-gpadc.h
+header-test-			+= linux/mfd/adp5520.h
+header-test-			+= linux/mfd/arizona/pdata.h
+header-test-			+= linux/mfd/as3711.h
+header-test-			+= linux/mfd/as3722.h
+header-test-			+= linux/mfd/cros_ec_commands.h
+header-test-			+= linux/mfd/da903x.h
+header-test-			+= linux/mfd/da9055/pdata.h
+header-test-			+= linux/mfd/da9063/pdata.h
+header-test-			+= linux/mfd/db8500-prcmu.h
+header-test-			+= linux/mfd/dbx500-prcmu.h
+header-test-			+= linux/mfd/dln2.h
+header-test-			+= linux/mfd/dm355evm_msp.h
+header-test-			+= linux/mfd/ds1wm.h
+header-test-			+= linux/mfd/ezx-pcap.h
+header-test-			+= linux/mfd/intel_msic.h
+header-test-			+= linux/mfd/janz.h
+header-test-			+= linux/mfd/kempld.h
+header-test-			+= linux/mfd/lm3533.h
+header-test-			+= linux/mfd/lp8788-isink.h
+header-test-			+= linux/mfd/lpc_ich.h
+header-test-			+= linux/mfd/max77693.h
+header-test-			+= linux/mfd/max8998-private.h
+header-test-			+= linux/mfd/menelaus.h
+header-test-			+= linux/mfd/mt6397/core.h
+header-test-			+= linux/mfd/palmas.h
+header-test-			+= linux/mfd/pcf50633/backlight.h
+header-test-			+= linux/mfd/rc5t583.h
+header-test-			+= linux/mfd/retu.h
+header-test-			+= linux/mfd/samsung/core.h
+header-test-			+= linux/mfd/si476x-platform.h
+header-test-			+= linux/mfd/si476x-reports.h
+header-test-			+= linux/mfd/sky81452.h
+header-test-			+= linux/mfd/smsc.h
+header-test-			+= linux/mfd/sta2x11-mfd.h
+header-test-			+= linux/mfd/stmfx.h
+header-test-			+= linux/mfd/tc3589x.h
+header-test-			+= linux/mfd/tc6387xb.h
+header-test-			+= linux/mfd/tc6393xb.h
+header-test-			+= linux/mfd/tps65090.h
+header-test-			+= linux/mfd/tps6586x.h
+header-test-			+= linux/mfd/tps65910.h
+header-test-			+= linux/mfd/tps80031.h
+header-test-			+= linux/mfd/ucb1x00.h
+header-test-			+= linux/mfd/viperboard.h
+header-test-			+= linux/mfd/wm831x/core.h
+header-test-			+= linux/mfd/wm831x/otp.h
+header-test-			+= linux/mfd/wm831x/pdata.h
+header-test-			+= linux/mfd/wm8994/core.h
+header-test-			+= linux/mfd/wm8994/pdata.h
+header-test-			+= linux/mlx4/doorbell.h
+header-test-			+= linux/mlx4/srq.h
+header-test-			+= linux/mlx5/doorbell.h
+header-test-			+= linux/mlx5/eq.h
+header-test-			+= linux/mlx5/fs_helpers.h
+header-test-			+= linux/mlx5/mlx5_ifc.h
+header-test-			+= linux/mlx5/mlx5_ifc_fpga.h
+header-test-			+= linux/mm-arch-hooks.h
+header-test-			+= linux/mm_inline.h
+header-test-			+= linux/mmu_context.h
+header-test-			+= linux/mpage.h
+header-test-			+= linux/mtd/bbm.h
+header-test-			+= linux/mtd/cfi.h
+header-test-			+= linux/mtd/doc2000.h
+header-test-			+= linux/mtd/flashchip.h
+header-test-			+= linux/mtd/ftl.h
+header-test-			+= linux/mtd/gen_probe.h
+header-test-			+= linux/mtd/jedec.h
+header-test-			+= linux/mtd/nand_bch.h
+header-test-			+= linux/mtd/nand_ecc.h
+header-test-			+= linux/mtd/ndfc.h
+header-test-			+= linux/mtd/onenand.h
+header-test-			+= linux/mtd/pismo.h
+header-test-			+= linux/mtd/plat-ram.h
+header-test-			+= linux/mtd/spi-nor.h
+header-test-			+= linux/mv643xx.h
+header-test-			+= linux/mv643xx_eth.h
+header-test-			+= linux/mvebu-pmsu.h
+header-test-			+= linux/mxm-wmi.h
+header-test-			+= linux/n_r3964.h
+header-test-			+= linux/ndctl.h
+header-test-			+= linux/netfilter/ipset/ip_set.h
+header-test-			+= linux/netfilter/ipset/ip_set_bitmap.h
+header-test-			+= linux/netfilter/ipset/ip_set_comment.h
+header-test-			+= linux/netfilter/ipset/ip_set_counter.h
+header-test-			+= linux/netfilter/ipset/ip_set_getport.h
+header-test-			+= linux/netfilter/ipset/ip_set_hash.h
+header-test-			+= linux/netfilter/ipset/ip_set_list.h
+header-test-			+= linux/netfilter/ipset/ip_set_skbinfo.h
+header-test-			+= linux/netfilter/ipset/ip_set_timeout.h
+header-test-			+= linux/netfilter/nf_conntrack_amanda.h
+header-test-			+= linux/netfilter/nf_conntrack_ftp.h
+header-test-			+= linux/netfilter/nf_conntrack_h323.h
+header-test-			+= linux/netfilter/nf_conntrack_h323_asn1.h
+header-test-			+= linux/netfilter/nf_conntrack_irc.h
+header-test-			+= linux/netfilter/nf_conntrack_pptp.h
+header-test-			+= linux/netfilter/nf_conntrack_proto_gre.h
+header-test-			+= linux/netfilter/nf_conntrack_sip.h
+header-test-			+= linux/netfilter/nf_conntrack_snmp.h
+header-test-			+= linux/netfilter/nf_conntrack_tftp.h
+header-test-			+= linux/netfilter/x_tables.h
+header-test-			+= linux/netfilter_arp/arp_tables.h
+header-test-			+= linux/netfilter_bridge/ebtables.h
+header-test-			+= linux/netfilter_ipv4/ip4_tables.h
+header-test-			+= linux/netfilter_ipv4/ip_tables.h
+header-test-			+= linux/netfilter_ipv6/ip6_tables.h
+header-test-			+= linux/nfs.h
+header-test-			+= linux/nfs_fs_i.h
+header-test-			+= linux/nfs_fs_sb.h
+header-test-			+= linux/nfs_page.h
+header-test-			+= linux/nfs_xdr.h
+header-test-			+= linux/nfsacl.h
+header-test-			+= linux/nl802154.h
+header-test-			+= linux/ns_common.h
+header-test-			+= linux/nsc_gpio.h
+header-test-			+= linux/ntb_transport.h
+header-test-			+= linux/nubus.h
+header-test-			+= linux/nvme-fc-driver.h
+header-test-			+= linux/nvme-fc.h
+header-test-			+= linux/nvme-rdma.h
+header-test-			+= linux/nvram.h
+header-test-			+= linux/objagg.h
+header-test-			+= linux/of_clk.h
+header-test-			+= linux/of_net.h
+header-test-			+= linux/of_pdt.h
+header-test-			+= linux/olpc-ec.h
+header-test-			+= linux/omap-dma.h
+header-test-			+= linux/omap-dmaengine.h
+header-test-			+= linux/omap-gpmc.h
+header-test-			+= linux/omap-iommu.h
+header-test-			+= linux/omap-mailbox.h
+header-test-			+= linux/osq_lock.h
+header-test-			+= linux/overflow.h
+header-test-			+= linux/page-flags-layout.h
+header-test-			+= linux/page-isolation.h
+header-test-			+= linux/page_ext.h
+header-test-			+= linux/page_owner.h
+header-test-			+= linux/parport_pc.h
+header-test-			+= linux/parser.h
+header-test-			+= linux/pci-acpi.h
+header-test-			+= linux/pci-dma-compat.h
+header-test-			+= linux/pci_hotplug.h
+header-test-			+= linux/pda_power.h
+header-test-			+= linux/perf/arm_pmu.h
+header-test-			+= linux/perf_regs.h
+header-test-			+= linux/phy/omap_control_phy.h
+header-test-			+= linux/phy/tegra/xusb.h
+header-test-			+= linux/phy/ulpi_phy.h
+header-test-			+= linux/phy_fixed.h
+header-test-			+= linux/pinctrl/pinconf-generic.h
+header-test-			+= linux/pinctrl/pinconf.h
+header-test-			+= linux/pinctrl/pinctrl.h
+header-test-			+= linux/pipe_fs_i.h
+header-test-			+= linux/pktcdvd.h
+header-test-			+= linux/pl320-ipc.h
+header-test-			+= linux/pl353-smc.h
+header-test-			+= linux/platform_data/ad5449.h
+header-test-			+= linux/platform_data/ad5755.h
+header-test-			+= linux/platform_data/ad7266.h
+header-test-			+= linux/platform_data/ad7291.h
+header-test-			+= linux/platform_data/ad7298.h
+header-test-			+= linux/platform_data/ad7303.h
+header-test-			+= linux/platform_data/ad7791.h
+header-test-			+= linux/platform_data/ad7793.h
+header-test-			+= linux/platform_data/ad7887.h
+header-test-			+= linux/platform_data/adau17x1.h
+header-test-			+= linux/platform_data/adp8870.h
+header-test-			+= linux/platform_data/ads1015.h
+header-test-			+= linux/platform_data/ads7828.h
+header-test-			+= linux/platform_data/apds990x.h
+header-test-			+= linux/platform_data/arm-ux500-pm.h
+header-test-			+= linux/platform_data/asoc-s3c.h
+header-test-			+= linux/platform_data/at91_adc.h
+header-test-			+= linux/platform_data/ata-pxa.h
+header-test-			+= linux/platform_data/atmel.h
+header-test-			+= linux/platform_data/bh1770glc.h
+header-test-			+= linux/platform_data/brcmfmac.h
+header-test-			+= linux/platform_data/clk-u300.h
+header-test-			+= linux/platform_data/cyttsp4.h
+header-test-			+= linux/platform_data/dma-coh901318.h
+header-test-			+= linux/platform_data/dma-imx-sdma.h
+header-test-			+= linux/platform_data/dma-mcf-edma.h
+header-test-			+= linux/platform_data/dma-s3c24xx.h
+header-test-			+= linux/platform_data/dmtimer-omap.h
+header-test-			+= linux/platform_data/dsa.h
+header-test-			+= linux/platform_data/edma.h
+header-test-			+= linux/platform_data/elm.h
+header-test-			+= linux/platform_data/emif_plat.h
+header-test-			+= linux/platform_data/fsa9480.h
+header-test-			+= linux/platform_data/g762.h
+header-test-			+= linux/platform_data/gpio-ath79.h
+header-test-			+= linux/platform_data/gpio-davinci.h
+header-test-			+= linux/platform_data/gpio-dwapb.h
+header-test-			+= linux/platform_data/gpio-htc-egpio.h
+header-test-			+= linux/platform_data/gpmc-omap.h
+header-test-			+= linux/platform_data/hsmmc-omap.h
+header-test-			+= linux/platform_data/hwmon-s3c.h
+header-test-			+= linux/platform_data/i2c-davinci.h
+header-test-			+= linux/platform_data/i2c-imx.h
+header-test-			+= linux/platform_data/i2c-mux-reg.h
+header-test-			+= linux/platform_data/i2c-ocores.h
+header-test-			+= linux/platform_data/i2c-xiic.h
+header-test-			+= linux/platform_data/intel-spi.h
+header-test-			+= linux/platform_data/invensense_mpu6050.h
+header-test-			+= linux/platform_data/irda-pxaficp.h
+header-test-			+= linux/platform_data/irda-sa11x0.h
+header-test-			+= linux/platform_data/itco_wdt.h
+header-test-			+= linux/platform_data/jz4740/jz4740_nand.h
+header-test-			+= linux/platform_data/keyboard-pxa930_rotary.h
+header-test-			+= linux/platform_data/keypad-omap.h
+header-test-			+= linux/platform_data/leds-lp55xx.h
+header-test-			+= linux/platform_data/leds-omap.h
+header-test-			+= linux/platform_data/lp855x.h
+header-test-			+= linux/platform_data/lp8727.h
+header-test-			+= linux/platform_data/max197.h
+header-test-			+= linux/platform_data/max3421-hcd.h
+header-test-			+= linux/platform_data/max732x.h
+header-test-			+= linux/platform_data/mcs.h
+header-test-			+= linux/platform_data/mdio-bcm-unimac.h
+header-test-			+= linux/platform_data/mdio-gpio.h
+header-test-			+= linux/platform_data/media/si4713.h
+header-test-			+= linux/platform_data/mlxreg.h
+header-test-			+= linux/platform_data/mmc-omap.h
+header-test-			+= linux/platform_data/mmc-sdhci-s3c.h
+header-test-			+= linux/platform_data/mmp_audio.h
+header-test-			+= linux/platform_data/mtd-orion_nand.h
+header-test-			+= linux/platform_data/mv88e6xxx.h
+header-test-			+= linux/platform_data/net-cw1200.h
+header-test-			+= linux/platform_data/omap-twl4030.h
+header-test-			+= linux/platform_data/omapdss.h
+header-test-			+= linux/platform_data/pcf857x.h
+header-test-			+= linux/platform_data/pixcir_i2c_ts.h
+header-test-			+= linux/platform_data/pwm_omap_dmtimer.h
+header-test-			+= linux/platform_data/pxa2xx_udc.h
+header-test-			+= linux/platform_data/pxa_sdhci.h
+header-test-			+= linux/platform_data/remoteproc-omap.h
+header-test-			+= linux/platform_data/sa11x0-serial.h
+header-test-			+= linux/platform_data/sc18is602.h
+header-test-			+= linux/platform_data/sdhci-pic32.h
+header-test-			+= linux/platform_data/serial-sccnxp.h
+header-test-			+= linux/platform_data/sht3x.h
+header-test-			+= linux/platform_data/shtc1.h
+header-test-			+= linux/platform_data/si5351.h
+header-test-			+= linux/platform_data/sky81452-backlight.h
+header-test-			+= linux/platform_data/spi-davinci.h
+header-test-			+= linux/platform_data/spi-ep93xx.h
+header-test-			+= linux/platform_data/spi-mt65xx.h
+header-test-			+= linux/platform_data/spi-nuc900.h
+header-test-			+= linux/platform_data/st_sensors_pdata.h
+header-test-			+= linux/platform_data/ti-sysc.h
+header-test-			+= linux/platform_data/timer-ixp4xx.h
+header-test-			+= linux/platform_data/touchscreen-s3c2410.h
+header-test-			+= linux/platform_data/tsc2007.h
+header-test-			+= linux/platform_data/tsl2772.h
+header-test-			+= linux/platform_data/uio_pruss.h
+header-test-			+= linux/platform_data/usb-davinci.h
+header-test-			+= linux/platform_data/usb-ehci-mxc.h
+header-test-			+= linux/platform_data/usb-ehci-orion.h
+header-test-			+= linux/platform_data/usb-mx2.h
+header-test-			+= linux/platform_data/usb-ohci-s3c2410.h
+header-test-			+= linux/platform_data/usb-omap.h
+header-test-			+= linux/platform_data/usb-s3c2410_udc.h
+header-test-			+= linux/platform_data/usb3503.h
+header-test-			+= linux/platform_data/ux500_wdt.h
+header-test-			+= linux/platform_data/video-clcd-versatile.h
+header-test-			+= linux/platform_data/video-imxfb.h
+header-test-			+= linux/platform_data/video-nuc900fb.h
+header-test-			+= linux/platform_data/video-pxafb.h
+header-test-			+= linux/platform_data/video_s3c.h
+header-test-			+= linux/platform_data/voltage-omap.h
+header-test-			+= linux/platform_data/x86/apple.h
+header-test-			+= linux/platform_data/x86/clk-pmc-atom.h
+header-test-			+= linux/platform_data/x86/pmc_atom.h
+header-test-			+= linux/platform_data/xtalk-bridge.h
+header-test-			+= linux/pm2301_charger.h
+header-test-			+= linux/pm_wakeirq.h
+header-test-			+= linux/pm_wakeup.h
+header-test-			+= linux/pmbus.h
+header-test-			+= linux/pmu.h
+header-test-			+= linux/posix_acl.h
+header-test-			+= linux/posix_acl_xattr.h
+header-test-			+= linux/power/ab8500.h
+header-test-			+= linux/power/bq27xxx_battery.h
+header-test-			+= linux/power/generic-adc-battery.h
+header-test-			+= linux/power/jz4740-battery.h
+header-test-			+= linux/power/max17042_battery.h
+header-test-			+= linux/power/max8903_charger.h
+header-test-			+= linux/ppp-comp.h
+header-test-			+= linux/pps-gpio.h
+header-test-			+= linux/pr.h
+header-test-			+= linux/proc_ns.h
+header-test-			+= linux/processor.h
+header-test-			+= linux/psi.h
+header-test-			+= linux/psp-sev.h
+header-test-			+= linux/pstore.h
+header-test-			+= linux/ptr_ring.h
+header-test-			+= linux/qcom-geni-se.h
+header-test-			+= linux/qed/eth_common.h
+header-test-			+= linux/qed/fcoe_common.h
+header-test-			+= linux/qed/iscsi_common.h
+header-test-			+= linux/qed/iwarp_common.h
+header-test-			+= linux/qed/qed_eth_if.h
+header-test-			+= linux/qed/qed_fcoe_if.h
+header-test-			+= linux/qed/rdma_common.h
+header-test-			+= linux/qed/storage_common.h
+header-test-			+= linux/qed/tcp_common.h
+header-test-			+= linux/qnx6_fs.h
+header-test-			+= linux/quicklist.h
+header-test-			+= linux/ramfs.h
+header-test-			+= linux/range.h
+header-test-			+= linux/rcu_node_tree.h
+header-test-			+= linux/rculist_bl.h
+header-test-			+= linux/rculist_nulls.h
+header-test-			+= linux/rcutiny.h
+header-test-			+= linux/rcutree.h
+header-test-			+= linux/reboot-mode.h
+header-test-			+= linux/regulator/fixed.h
+header-test-			+= linux/regulator/gpio-regulator.h
+header-test-			+= linux/regulator/max8973-regulator.h
+header-test-			+= linux/regulator/of_regulator.h
+header-test-			+= linux/regulator/tps51632-regulator.h
+header-test-			+= linux/regulator/tps62360.h
+header-test-			+= linux/regulator/tps6507x.h
+header-test-			+= linux/regulator/userspace-consumer.h
+header-test-			+= linux/remoteproc/st_slim_rproc.h
+header-test-			+= linux/reset/socfpga.h
+header-test-			+= linux/reset/sunxi.h
+header-test-			+= linux/rtc/m48t59.h
+header-test-			+= linux/rtc/rtc-omap.h
+header-test-			+= linux/rtc/sirfsoc_rtciobrg.h
+header-test-			+= linux/rwlock.h
+header-test-			+= linux/rwlock_types.h
+header-test-			+= linux/scc.h
+header-test-			+= linux/sched/deadline.h
+header-test-			+= linux/sched/sysctl.h
+header-test-			+= linux/sched_clock.h
+header-test-			+= linux/scpi_protocol.h
+header-test-			+= linux/scx200_gpio.h
+header-test-			+= linux/seccomp.h
+header-test-			+= linux/sed-opal.h
+header-test-			+= linux/seg6_iptunnel.h
+header-test-			+= linux/selection.h
+header-test-			+= linux/set_memory.h
+header-test-			+= linux/shrinker.h
+header-test-			+= linux/sirfsoc_dma.h
+header-test-			+= linux/skb_array.h
+header-test-			+= linux/slab_def.h
+header-test-			+= linux/slub_def.h
+header-test-			+= linux/sm501.h
+header-test-			+= linux/smc91x.h
+header-test-			+= linux/soc/actions/owl-sps.h
+header-test-			+= linux/soc/amlogic/meson-canvas.h
+header-test-			+= linux/soc/brcmstb/brcmstb.h
+header-test-			+= linux/soc/ixp4xx/npe.h
+header-test-			+= linux/soc/mediatek/infracfg.h
+header-test-			+= linux/soc/qcom/smd-rpm.h
+header-test-			+= linux/soc/qcom/smem.h
+header-test-			+= linux/soc/qcom/smem_state.h
+header-test-			+= linux/soc/qcom/wcnss_ctrl.h
+header-test-			+= linux/soc/renesas/rcar-rst.h
+header-test-			+= linux/soc/samsung/exynos-pmu.h
+header-test-			+= linux/soc/sunxi/sunxi_sram.h
+header-test-			+= linux/soc/ti/ti-msgmgr.h
+header-test-			+= linux/soc/ti/ti_sci_inta_msi.h
+header-test-			+= linux/soc/ti/ti_sci_protocol.h
+header-test-			+= linux/soundwire/sdw.h
+header-test-			+= linux/soundwire/sdw_intel.h
+header-test-			+= linux/soundwire/sdw_type.h
+header-test-			+= linux/spi/ad7877.h
+header-test-			+= linux/spi/ads7846.h
+header-test-			+= linux/spi/at86rf230.h
+header-test-			+= linux/spi/ds1305.h
+header-test-			+= linux/spi/libertas_spi.h
+header-test-			+= linux/spi/lms283gf05.h
+header-test-			+= linux/spi/max7301.h
+header-test-			+= linux/spi/mcp23s08.h
+header-test-			+= linux/spi/rspi.h
+header-test-			+= linux/spi/s3c24xx.h
+header-test-			+= linux/spi/sh_msiof.h
+header-test-			+= linux/spi/spi-fsl-dspi.h
+header-test-			+= linux/spi/spi_bitbang.h
+header-test-			+= linux/spi/spi_gpio.h
+header-test-			+= linux/spi/xilinx_spi.h
+header-test-			+= linux/spinlock_api_smp.h
+header-test-			+= linux/spinlock_api_up.h
+header-test-			+= linux/spinlock_types.h
+header-test-			+= linux/splice.h
+header-test-			+= linux/sram.h
+header-test-			+= linux/srcutiny.h
+header-test-			+= linux/srcutree.h
+header-test-			+= linux/ssb/ssb_driver_chipcommon.h
+header-test-			+= linux/ssb/ssb_driver_extif.h
+header-test-			+= linux/ssb/ssb_driver_mips.h
+header-test-			+= linux/ssb/ssb_driver_pci.h
+header-test-			+= linux/ssbi.h
+header-test-			+= linux/stackdepot.h
+header-test-			+= linux/stmp3xxx_rtc_wdt.h
+header-test-			+= linux/string_helpers.h
+header-test-			+= linux/sungem_phy.h
+header-test-			+= linux/sunrpc/msg_prot.h
+header-test-			+= linux/sunrpc/rpc_pipe_fs.h
+header-test-			+= linux/sunrpc/xprtmultipath.h
+header-test-			+= linux/sunrpc/xprtsock.h
+header-test-			+= linux/sunxi-rsb.h
+header-test-			+= linux/svga.h
+header-test-			+= linux/sw842.h
+header-test-			+= linux/swapfile.h
+header-test-			+= linux/swapops.h
+header-test-			+= linux/swiotlb.h
+header-test-			+= linux/sysv_fs.h
+header-test-			+= linux/t10-pi.h
+header-test-			+= linux/task_io_accounting.h
+header-test-			+= linux/tick.h
+header-test-			+= linux/timb_dma.h
+header-test-			+= linux/timekeeping.h
+header-test-			+= linux/timekeeping32.h
+header-test-			+= linux/ts-nbus.h
+header-test-			+= linux/tsacct_kern.h
+header-test-			+= linux/tty_flip.h
+header-test-			+= linux/tty_ldisc.h
+header-test-			+= linux/ucb1400.h
+header-test-			+= linux/usb/association.h
+header-test-			+= linux/usb/cdc-wdm.h
+header-test-			+= linux/usb/cdc_ncm.h
+header-test-			+= linux/usb/ezusb.h
+header-test-			+= linux/usb/gadget_configfs.h
+header-test-			+= linux/usb/gpio_vbus.h
+header-test-			+= linux/usb/hcd.h
+header-test-			+= linux/usb/iowarrior.h
+header-test-			+= linux/usb/irda.h
+header-test-			+= linux/usb/isp116x.h
+header-test-			+= linux/usb/isp1362.h
+header-test-			+= linux/usb/musb.h
+header-test-			+= linux/usb/net2280.h
+header-test-			+= linux/usb/ohci_pdriver.h
+header-test-			+= linux/usb/otg-fsm.h
+header-test-			+= linux/usb/pd_ado.h
+header-test-			+= linux/usb/r8a66597.h
+header-test-			+= linux/usb/rndis_host.h
+header-test-			+= linux/usb/serial.h
+header-test-			+= linux/usb/sl811.h
+header-test-			+= linux/usb/storage.h
+header-test-			+= linux/usb/uas.h
+header-test-			+= linux/usb/usb338x.h
+header-test-			+= linux/usb/usbnet.h
+header-test-			+= linux/usb/wusb-wa.h
+header-test-			+= linux/usb/xhci-dbgp.h
+header-test-			+= linux/usb_usual.h
+header-test-			+= linux/user-return-notifier.h
+header-test-			+= linux/userfaultfd_k.h
+header-test-			+= linux/verification.h
+header-test-			+= linux/via_core.h
+header-test-			+= linux/via_i2c.h
+header-test-			+= linux/virtio_byteorder.h
+header-test-			+= linux/virtio_ring.h
+header-test-			+= linux/visorbus.h
+header-test-			+= linux/vme.h
+header-test-			+= linux/vmstat.h
+header-test-			+= linux/vmw_vmci_api.h
+header-test-			+= linux/vmw_vmci_defs.h
+header-test-			+= linux/vringh.h
+header-test-			+= linux/vt_buffer.h
+header-test-			+= linux/zorro.h
+header-test-			+= linux/zpool.h
+header-test-			+= math-emu/double.h
+header-test-			+= math-emu/op-common.h
+header-test-			+= math-emu/quad.h
+header-test-			+= math-emu/single.h
+header-test-			+= math-emu/soft-fp.h
+header-test-			+= media/davinci/dm355_ccdc.h
+header-test-			+= media/davinci/dm644x_ccdc.h
+header-test-			+= media/davinci/isif.h
+header-test-			+= media/davinci/vpbe_osd.h
+header-test-			+= media/davinci/vpbe_types.h
+header-test-			+= media/davinci/vpif_types.h
+header-test-			+= media/demux.h
+header-test-			+= media/drv-intf/soc_mediabus.h
+header-test-			+= media/dvb_net.h
+header-test-			+= media/fwht-ctrls.h
+header-test-			+= media/i2c/ad9389b.h
+header-test-			+= media/i2c/adv7343.h
+header-test-			+= media/i2c/adv7511.h
+header-test-			+= media/i2c/adv7842.h
+header-test-			+= media/i2c/m5mols.h
+header-test-			+= media/i2c/mt9m032.h
+header-test-			+= media/i2c/mt9t112.h
+header-test-			+= media/i2c/mt9v032.h
+header-test-			+= media/i2c/ov2659.h
+header-test-			+= media/i2c/ov7670.h
+header-test-			+= media/i2c/rj54n1cb0c.h
+header-test-			+= media/i2c/saa6588.h
+header-test-			+= media/i2c/saa7115.h
+header-test-			+= media/i2c/sr030pc30.h
+header-test-			+= media/i2c/tc358743.h
+header-test-			+= media/i2c/tda1997x.h
+header-test-			+= media/i2c/ths7303.h
+header-test-			+= media/i2c/tvaudio.h
+header-test-			+= media/i2c/tvp514x.h
+header-test-			+= media/i2c/tvp7002.h
+header-test-			+= media/i2c/wm8775.h
+header-test-			+= media/imx.h
+header-test-			+= media/media-dev-allocator.h
+header-test-			+= media/mpeg2-ctrls.h
+header-test-			+= media/rcar-fcp.h
+header-test-			+= media/tuner-types.h
+header-test-			+= media/tveeprom.h
+header-test-			+= media/v4l2-flash-led-class.h
+header-test-			+= misc/altera.h
+header-test-			+= misc/cxl-base.h
+header-test-			+= misc/cxllib.h
+header-test-			+= net/9p/9p.h
+header-test-			+= net/9p/client.h
+header-test-			+= net/9p/transport.h
+header-test-			+= net/af_vsock.h
+header-test-			+= net/ax88796.h
+header-test-			+= net/bluetooth/hci.h
+header-test-			+= net/bluetooth/hci_core.h
+header-test-			+= net/bluetooth/hci_mon.h
+header-test-			+= net/bluetooth/hci_sock.h
+header-test-			+= net/bluetooth/l2cap.h
+header-test-			+= net/bluetooth/mgmt.h
+header-test-			+= net/bluetooth/rfcomm.h
+header-test-			+= net/bluetooth/sco.h
+header-test-			+= net/bond_options.h
+header-test-			+= net/caif/cfsrvl.h
+header-test-			+= net/codel_impl.h
+header-test-			+= net/codel_qdisc.h
+header-test-			+= net/compat.h
+header-test-			+= net/datalink.h
+header-test-			+= net/dcbevent.h
+header-test-			+= net/dcbnl.h
+header-test-			+= net/dn_dev.h
+header-test-			+= net/dn_fib.h
+header-test-			+= net/dn_neigh.h
+header-test-			+= net/dn_nsp.h
+header-test-			+= net/dn_route.h
+header-test-			+= net/erspan.h
+header-test-			+= net/esp.h
+header-test-			+= net/ethoc.h
+header-test-			+= net/firewire.h
+header-test-			+= net/flow_offload.h
+header-test-			+= net/fq.h
+header-test-			+= net/fq_impl.h
+header-test-			+= net/garp.h
+header-test-			+= net/gtp.h
+header-test-			+= net/gue.h
+header-test-			+= net/hwbm.h
+header-test-			+= net/ila.h
+header-test-			+= net/inet6_connection_sock.h
+header-test-			+= net/inet_common.h
+header-test-			+= net/inet_frag.h
+header-test-			+= net/ip6_route.h
+header-test-			+= net/ip_vs.h
+header-test-			+= net/ipcomp.h
+header-test-			+= net/ipconfig.h
+header-test-			+= net/iucv/af_iucv.h
+header-test-			+= net/iucv/iucv.h
+header-test-			+= net/lapb.h
+header-test-			+= net/llc_c_ac.h
+header-test-			+= net/llc_c_st.h
+header-test-			+= net/llc_s_ac.h
+header-test-			+= net/llc_s_ev.h
+header-test-			+= net/llc_s_st.h
+header-test-			+= net/mpls_iptunnel.h
+header-test-			+= net/mrp.h
+header-test-			+= net/ncsi.h
+header-test-			+= net/netevent.h
+header-test-			+= net/netfilter/br_netfilter.h
+header-test-			+= net/netfilter/ipv4/nf_dup_ipv4.h
+header-test-			+= net/netfilter/ipv6/nf_defrag_ipv6.h
+header-test-			+= net/netfilter/ipv6/nf_dup_ipv6.h
+header-test-			+= net/netfilter/nf_conntrack.h
+header-test-			+= net/netfilter/nf_conntrack_acct.h
+header-test-			+= net/netfilter/nf_conntrack_bridge.h
+header-test-			+= net/netfilter/nf_conntrack_core.h
+header-test-			+= net/netfilter/nf_conntrack_count.h
+header-test-			+= net/netfilter/nf_conntrack_ecache.h
+header-test-			+= net/netfilter/nf_conntrack_expect.h
+header-test-			+= net/netfilter/nf_conntrack_extend.h
+header-test-			+= net/netfilter/nf_conntrack_helper.h
+header-test-			+= net/netfilter/nf_conntrack_l4proto.h
+header-test-			+= net/netfilter/nf_conntrack_labels.h
+header-test-			+= net/netfilter/nf_conntrack_seqadj.h
+header-test-			+= net/netfilter/nf_conntrack_synproxy.h
+header-test-			+= net/netfilter/nf_conntrack_timeout.h
+header-test-			+= net/netfilter/nf_conntrack_timestamp.h
+header-test-			+= net/netfilter/nf_conntrack_tuple.h
+header-test-			+= net/netfilter/nf_dup_netdev.h
+header-test-			+= net/netfilter/nf_flow_table.h
+header-test-			+= net/netfilter/nf_nat.h
+header-test-			+= net/netfilter/nf_nat_helper.h
+header-test-			+= net/netfilter/nf_nat_masquerade.h
+header-test-			+= net/netfilter/nf_nat_redirect.h
+header-test-			+= net/netfilter/nf_queue.h
+header-test-			+= net/netfilter/nf_reject.h
+header-test-			+= net/netfilter/nf_synproxy.h
+header-test-			+= net/netfilter/nf_tables.h
+header-test-			+= net/netfilter/nf_tables_core.h
+header-test-			+= net/netfilter/nf_tables_ipv4.h
+header-test-			+= net/netfilter/nf_tables_ipv6.h
+header-test-			+= net/netfilter/nft_fib.h
+header-test-			+= net/netfilter/nft_reject.h
+header-test-			+= net/netns/can.h
+header-test-			+= net/netns/generic.h
+header-test-			+= net/netns/ieee802154_6lowpan.h
+header-test-			+= net/netns/ipv4.h
+header-test-			+= net/netns/ipv6.h
+header-test-			+= net/netns/mpls.h
+header-test-			+= net/netns/nftables.h
+header-test-			+= net/netns/sctp.h
+header-test-			+= net/netrom.h
+header-test-			+= net/p8022.h
+header-test-			+= net/phonet/pep.h
+header-test-			+= net/phonet/phonet.h
+header-test-			+= net/phonet/pn_dev.h
+header-test-			+= net/pptp.h
+header-test-			+= net/psample.h
+header-test-			+= net/psnap.h
+header-test-			+= net/regulatory.h
+header-test-			+= net/rose.h
+header-test-			+= net/sctp/auth.h
+header-test-			+= net/sctp/stream_interleave.h
+header-test-			+= net/sctp/stream_sched.h
+header-test-			+= net/sctp/tsnmap.h
+header-test-			+= net/sctp/ulpevent.h
+header-test-			+= net/sctp/ulpqueue.h
+header-test-			+= net/secure_seq.h
+header-test-			+= net/smc.h
+header-test-			+= net/stp.h
+header-test-			+= net/transp_v6.h
+header-test-			+= net/tun_proto.h
+header-test-			+= net/udplite.h
+header-test-			+= net/xdp.h
+header-test-			+= net/xdp_priv.h
+header-test-			+= pcmcia/cistpl.h
+header-test-			+= pcmcia/ds.h
+header-test-			+= rdma/ib.h
+header-test-			+= rdma/iw_portmap.h
+header-test-			+= rdma/opa_port_info.h
+header-test-			+= rdma/rdmavt_cq.h
+header-test-			+= rdma/restrack.h
+header-test-			+= rdma/signature.h
+header-test-			+= rdma/tid_rdma_defs.h
+header-test-			+= scsi/fc/fc_encaps.h
+header-test-			+= scsi/fc/fc_fc2.h
+header-test-			+= scsi/fc/fc_fcoe.h
+header-test-			+= scsi/fc/fc_fip.h
+header-test-			+= scsi/fc_encode.h
+header-test-			+= scsi/fc_frame.h
+header-test-			+= scsi/iser.h
+header-test-			+= scsi/libfc.h
+header-test-			+= scsi/libfcoe.h
+header-test-			+= scsi/libsas.h
+header-test-			+= scsi/sas_ata.h
+header-test-			+= scsi/scsi_cmnd.h
+header-test-			+= scsi/scsi_dbg.h
+header-test-			+= scsi/scsi_device.h
+header-test-			+= scsi/scsi_dh.h
+header-test-			+= scsi/scsi_eh.h
+header-test-			+= scsi/scsi_host.h
+header-test-			+= scsi/scsi_ioctl.h
+header-test-			+= scsi/scsi_request.h
+header-test-			+= scsi/scsi_tcq.h
+header-test-			+= scsi/scsi_transport.h
+header-test-			+= scsi/scsi_transport_fc.h
+header-test-			+= scsi/scsi_transport_sas.h
+header-test-			+= scsi/scsi_transport_spi.h
+header-test-			+= scsi/scsi_transport_srp.h
+header-test-			+= scsi/scsicam.h
+header-test-			+= scsi/sg.h
+header-test-			+= soc/arc/aux.h
+header-test-			+= soc/arc/mcip.h
+header-test-			+= soc/arc/timers.h
+header-test-			+= soc/brcmstb/common.h
+header-test-			+= soc/fsl/bman.h
+header-test-			+= soc/fsl/qe/qe.h
+header-test-			+= soc/fsl/qe/qe_ic.h
+header-test-			+= soc/fsl/qe/qe_tdm.h
+header-test-			+= soc/fsl/qe/ucc.h
+header-test-			+= soc/fsl/qe/ucc_fast.h
+header-test-			+= soc/fsl/qe/ucc_slow.h
+header-test-			+= soc/fsl/qman.h
+header-test-			+= soc/nps/common.h
+header-test-$(CONFIG_ARC)	+= soc/nps/mtm.h
+header-test-			+= soc/qcom/cmd-db.h
+header-test-			+= soc/qcom/rpmh.h
+header-test-			+= soc/qcom/tcs.h
+header-test-			+= soc/tegra/ahb.h
+header-test-			+= soc/tegra/bpmp-abi.h
+header-test-			+= soc/tegra/common.h
+header-test-			+= soc/tegra/flowctrl.h
+header-test-			+= soc/tegra/fuse.h
+header-test-			+= soc/tegra/mc.h
+header-test-			+= sound/ac97/compat.h
+header-test-			+= sound/aci.h
+header-test-			+= sound/ad1843.h
+header-test-			+= sound/adau1373.h
+header-test-			+= sound/ak4113.h
+header-test-			+= sound/ak4114.h
+header-test-			+= sound/ak4117.h
+header-test-			+= sound/cs35l33.h
+header-test-			+= sound/cs35l34.h
+header-test-			+= sound/cs35l35.h
+header-test-			+= sound/cs35l36.h
+header-test-			+= sound/cs4271.h
+header-test-			+= sound/cs42l52.h
+header-test-			+= sound/cs8427.h
+header-test-			+= sound/da7218.h
+header-test-			+= sound/da7219-aad.h
+header-test-			+= sound/da7219.h
+header-test-			+= sound/da9055.h
+header-test-			+= sound/emu8000.h
+header-test-			+= sound/emux_synth.h
+header-test-			+= sound/hda_component.h
+header-test-			+= sound/hda_hwdep.h
+header-test-			+= sound/hda_i915.h
+header-test-			+= sound/hwdep.h
+header-test-			+= sound/i2c.h
+header-test-			+= sound/l3.h
+header-test-			+= sound/max98088.h
+header-test-			+= sound/max98095.h
+header-test-			+= sound/mixer_oss.h
+header-test-			+= sound/omap-hdmi-audio.h
+header-test-			+= sound/pcm_drm_eld.h
+header-test-			+= sound/pcm_iec958.h
+header-test-			+= sound/pcm_oss.h
+header-test-			+= sound/pxa2xx-lib.h
+header-test-			+= sound/rt286.h
+header-test-			+= sound/rt298.h
+header-test-			+= sound/rt5645.h
+header-test-			+= sound/rt5659.h
+header-test-			+= sound/rt5660.h
+header-test-			+= sound/rt5665.h
+header-test-			+= sound/rt5670.h
+header-test-			+= sound/s3c24xx_uda134x.h
+header-test-			+= sound/seq_device.h
+header-test-			+= sound/seq_kernel.h
+header-test-			+= sound/seq_midi_emul.h
+header-test-			+= sound/seq_oss.h
+header-test-			+= sound/soc-acpi-intel-match.h
+header-test-			+= sound/soc-dai.h
+header-test-			+= sound/soc-dapm.h
+header-test-			+= sound/soc-dpcm.h
+header-test-			+= sound/sof/control.h
+header-test-			+= sound/sof/dai-intel.h
+header-test-			+= sound/sof/dai.h
+header-test-			+= sound/sof/header.h
+header-test-			+= sound/sof/info.h
+header-test-			+= sound/sof/pm.h
+header-test-			+= sound/sof/stream.h
+header-test-			+= sound/sof/topology.h
+header-test-			+= sound/sof/trace.h
+header-test-			+= sound/sof/xtensa.h
+header-test-			+= sound/spear_spdif.h
+header-test-			+= sound/sta32x.h
+header-test-			+= sound/sta350.h
+header-test-			+= sound/tea6330t.h
+header-test-			+= sound/tlv320aic32x4.h
+header-test-			+= sound/tlv320dac33-plat.h
+header-test-			+= sound/uda134x.h
+header-test-			+= sound/wavefront.h
+header-test-			+= sound/wm8903.h
+header-test-			+= sound/wm8904.h
+header-test-			+= sound/wm8960.h
+header-test-			+= sound/wm8962.h
+header-test-			+= sound/wm8993.h
+header-test-			+= sound/wm8996.h
+header-test-			+= sound/wm9081.h
+header-test-			+= sound/wm9090.h
+header-test-			+= target/iscsi/iscsi_target_stat.h
+header-test-			+= trace/bpf_probe.h
+header-test-			+= trace/events/9p.h
+header-test-			+= trace/events/afs.h
+header-test-			+= trace/events/asoc.h
+header-test-			+= trace/events/bcache.h
+header-test-			+= trace/events/block.h
+header-test-			+= trace/events/cachefiles.h
+header-test-			+= trace/events/cgroup.h
+header-test-			+= trace/events/clk.h
+header-test-			+= trace/events/cma.h
+header-test-			+= trace/events/ext4.h
+header-test-			+= trace/events/f2fs.h
+header-test-			+= trace/events/fs_dax.h
+header-test-			+= trace/events/fscache.h
+header-test-			+= trace/events/fsi.h
+header-test-			+= trace/events/fsi_master_ast_cf.h
+header-test-			+= trace/events/fsi_master_gpio.h
+header-test-			+= trace/events/huge_memory.h
+header-test-			+= trace/events/ib_mad.h
+header-test-			+= trace/events/ib_umad.h
+header-test-			+= trace/events/iscsi.h
+header-test-			+= trace/events/jbd2.h
+header-test-			+= trace/events/kvm.h
+header-test-			+= trace/events/kyber.h
+header-test-			+= trace/events/libata.h
+header-test-			+= trace/events/mce.h
+header-test-			+= trace/events/mdio.h
+header-test-			+= trace/events/migrate.h
+header-test-			+= trace/events/mmflags.h
+header-test-			+= trace/events/nbd.h
+header-test-			+= trace/events/nilfs2.h
+header-test-			+= trace/events/pwc.h
+header-test-			+= trace/events/rdma.h
+header-test-			+= trace/events/rpcgss.h
+header-test-			+= trace/events/rpcrdma.h
+header-test-			+= trace/events/rxrpc.h
+header-test-			+= trace/events/scsi.h
+header-test-			+= trace/events/siox.h
+header-test-			+= trace/events/spi.h
+header-test-			+= trace/events/swiotlb.h
+header-test-			+= trace/events/syscalls.h
+header-test-			+= trace/events/target.h
+header-test-			+= trace/events/thermal_power_allocator.h
+header-test-			+= trace/events/timer.h
+header-test-			+= trace/events/wbt.h
+header-test-			+= trace/events/xen.h
+header-test-			+= trace/perf.h
+header-test-			+= trace/trace_events.h
+header-test-			+= uapi/drm/vmwgfx_drm.h
+header-test-			+= uapi/linux/a.out.h
+header-test-			+= uapi/linux/coda.h
+header-test-			+= uapi/linux/coda_psdev.h
+header-test-			+= uapi/linux/errqueue.h
+header-test-			+= uapi/linux/eventpoll.h
+header-test-			+= uapi/linux/hdlc/ioctl.h
+header-test-			+= uapi/linux/input.h
+header-test-			+= uapi/linux/kvm.h
+header-test-			+= uapi/linux/kvm_para.h
+header-test-			+= uapi/linux/lightnvm.h
+header-test-			+= uapi/linux/mic_common.h
+header-test-			+= uapi/linux/mman.h
+header-test-			+= uapi/linux/netfilter/ipset/ip_set_bitmap.h
+header-test-			+= uapi/linux/netfilter/ipset/ip_set_hash.h
+header-test-			+= uapi/linux/netfilter/ipset/ip_set_list.h
+header-test-			+= uapi/linux/netfilter/nf_synproxy.h
+header-test-			+= uapi/linux/netfilter/xt_policy.h
+header-test-			+= uapi/linux/netfilter/xt_set.h
+header-test-			+= uapi/linux/netfilter_arp/arp_tables.h
+header-test-			+= uapi/linux/netfilter_arp/arpt_mangle.h
+header-test-			+= uapi/linux/netfilter_ipv4/ip_tables.h
+header-test-			+= uapi/linux/netfilter_ipv4/ipt_LOG.h
+header-test-			+= uapi/linux/netfilter_ipv6/ip6_tables.h
+header-test-			+= uapi/linux/netfilter_ipv6/ip6t_LOG.h
+header-test-			+= uapi/linux/nilfs2_ondisk.h
+header-test-			+= uapi/linux/patchkey.h
+header-test-			+= uapi/linux/scc.h
+header-test-			+= uapi/linux/seg6_iptunnel.h
+header-test-			+= uapi/linux/smc_diag.h
+header-test-			+= uapi/linux/timex.h
+header-test-			+= uapi/linux/videodev2.h
+header-test-			+= uapi/scsi/scsi_bsg_fc.h
+header-test-			+= uapi/sound/asound.h
+header-test-			+= uapi/sound/sof/eq.h
+header-test-			+= uapi/sound/sof/fw.h
+header-test-			+= uapi/sound/sof/header.h
+header-test-			+= uapi/sound/sof/manifest.h
+header-test-			+= uapi/sound/sof/trace.h
+header-test-			+= uapi/xen/evtchn.h
+header-test-			+= uapi/xen/gntdev.h
+header-test-			+= uapi/xen/privcmd.h
+header-test-			+= vdso/vsyscall.h
+header-test-			+= video/broadsheetfb.h
+header-test-			+= video/cvisionppc.h
+header-test-			+= video/gbe.h
+header-test-			+= video/kyro.h
+header-test-			+= video/maxinefb.h
+header-test-			+= video/metronomefb.h
+header-test-			+= video/neomagic.h
+header-test-			+= video/of_display_timing.h
+header-test-			+= video/omapvrfb.h
+header-test-			+= video/s1d13xxxfb.h
+header-test-			+= video/sstfb.h
+header-test-			+= video/tgafb.h
+header-test-			+= video/udlfb.h
+header-test-			+= video/uvesafb.h
+header-test-			+= video/w100fb.h
+header-test-			+= xen/acpi.h
+header-test-			+= xen/arm/hypercall.h
+header-test-			+= xen/arm/page-coherent.h
+header-test-			+= xen/arm/page.h
+header-test-			+= xen/balloon.h
+header-test-			+= xen/events.h
+header-test-			+= xen/features.h
+header-test-			+= xen/grant_table.h
+header-test-			+= xen/hvm.h
+header-test-			+= xen/interface/callback.h
+header-test-			+= xen/interface/event_channel.h
+header-test-			+= xen/interface/grant_table.h
+header-test-			+= xen/interface/hvm/dm_op.h
+header-test-			+= xen/interface/hvm/hvm_op.h
+header-test-			+= xen/interface/hvm/hvm_vcpu.h
+header-test-			+= xen/interface/hvm/params.h
+header-test-			+= xen/interface/hvm/start_info.h
+header-test-			+= xen/interface/io/9pfs.h
+header-test-			+= xen/interface/io/blkif.h
+header-test-			+= xen/interface/io/console.h
+header-test-			+= xen/interface/io/displif.h
+header-test-			+= xen/interface/io/fbif.h
+header-test-			+= xen/interface/io/kbdif.h
+header-test-			+= xen/interface/io/netif.h
+header-test-			+= xen/interface/io/pciif.h
+header-test-			+= xen/interface/io/protocols.h
+header-test-			+= xen/interface/io/pvcalls.h
+header-test-			+= xen/interface/io/ring.h
+header-test-			+= xen/interface/io/sndif.h
+header-test-			+= xen/interface/io/tpmif.h
+header-test-			+= xen/interface/io/vscsiif.h
+header-test-			+= xen/interface/io/xs_wire.h
+header-test-			+= xen/interface/memory.h
+header-test-			+= xen/interface/nmi.h
+header-test-			+= xen/interface/physdev.h
+header-test-			+= xen/interface/platform.h
+header-test-			+= xen/interface/sched.h
+header-test-			+= xen/interface/vcpu.h
+header-test-			+= xen/interface/version.h
+header-test-			+= xen/interface/xen-mca.h
+header-test-			+= xen/interface/xen.h
+header-test-			+= xen/interface/xenpmu.h
+header-test-			+= xen/mem-reservation.h
+header-test-			+= xen/page.h
+header-test-			+= xen/platform_pci.h
+header-test-			+= xen/swiotlb-xen.h
+header-test-			+= xen/xen-front-pgdir-shbuf.h
+header-test-			+= xen/xen-ops.h
+header-test-			+= xen/xen.h
+header-test-			+= xen/xenbus.h
+
+# Do not include directly
+header-test- += linux/compiler-clang.h
+header-test- += linux/compiler-gcc.h
+header-test- += linux/patchkey.h
+header-test- += linux/rwlock_api_smp.h
+header-test- += linux/spinlock_types_up.h
+header-test- += linux/spinlock_up.h
+header-test- += linux/wimax/debug.h
+header-test- += rdma/uverbs_named_ioctl.h
+
+# asm-generic/*.h is used by asm/*.h, and should not be included directly
+header-test- += asm-generic/% uapi/asm-generic/%
+
+# Timestamp files touched by Kconfig
+header-test- += config/%
+
+# Timestamp files touched by scripts/adjust_autoksyms.sh
+header-test- += ksym/%
+
+# You could compile-test these, but maybe not so useful...
+header-test- += dt-bindings/%
+
+# Do not test generated headers. Stale headers are often left over when you
+# traverse the git history without cleaning.
+header-test- += generated/%
+
+# The rest are compile-tested
+header-test-pattern-y += */*.h */*/*.h */*/*/*.h */*/*/*/*.h
diff --git a/init/Kconfig b/init/Kconfig
index 74192de8ada6..e2e99544da8d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -108,6 +108,17 @@ config HEADER_TEST
 	  If you are a developer or tester and want to ensure the requested
 	  headers are self-contained, say Y here. Otherwise, choose N.
 
+config KERNEL_HEADER_TEST
+	bool "Compile test kernel headers"
+	depends on HEADER_TEST
+	help
+	  Headers in include/ are used to build external moduls.
+	  Compile test them to ensure they are self-contained, i.e.
+	  compilable as standalone units.
+
+	  If you are a developer or tester and want to ensure the headers
+	  in include/ are self-contained, say Y here. Otherwise, choose N.
+
 config UAPI_HEADER_TEST
 	bool "Compile test UAPI headers"
 	depends on HEADER_TEST && HEADERS_INSTALL && CC_CAN_LINK
-- 
2.17.1


^ permalink raw reply related

* [PATCH 2/7] kbuild: compile-test exported headers to ensure they are self-contained
From: Masahiro Yamada @ 2019-07-01  0:58 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Joel Fernandes, Masahiro Yamada, Song Liu,
	Alexei Starovoitov, netdev, Yonghong Song, linux-kernel,
	linux-riscv, Michal Marek, Martin KaFai Lau, Palmer Dabbelt, bpf,
	Daniel Borkmann, Albert Ou
In-Reply-To: <20190701005845.12475-1-yamada.masahiro@socionext.com>

Multiple people have suggested compile-testing UAPI headers to ensure
they can be really included from user-space. "make headers_check" is
obviously not enough to catch bugs, and we often leak unresolved
references to user-space.

Use the new header-test-y syntax to implement it. Please note exported
headers are compile-tested with a completely different set of compiler
flags. The header search path is set to $(objtree)/usr/include since
exported headers should not include unexported ones.

We use -std=gnu89 for the kernel space since the kernel code highly
depends on GNU extensions. On the other hand, UAPI headers should be
written in more standardized C, so they are compiled with -std=c90.
This will emit errors if C++ style comments, the keyword 'inline', etc.
are used. Please use C style comments (/* ... */), '__inline__', etc.
in UAPI headers.

There is additional compiler requirement to enable this test because
many of UAPI headers include <stdlib.h>, <sys/ioctl.h>, <sys/time.h>,
etc. directly or indirectly. You cannot use kernel.org pre-built
toolchains [1] since they lack <stdlib.h>.

I reused CONFIG_CC_CAN_LINK to check the system header availability.
The intention is slightly different, but a compiler that can link
userspace programs provide system headers.

For now, a lot of headers need to be excluded because they cannot
be compiled standalone, but this is a good start point.

[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/index.html

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---

Changes in v4:
  - Sort the blacklist alphabetically
  - Add a little more comments
  - Remove scripts/cc-system-headers.sh and reuse CC_CAN_LINK

Changes in v3: None
Changes in v2:
 - Add CONFIG_CPU_{BIG,LITTLE}_ENDIAN guard to avoid build error
 - Use 'header-test-' instead of 'no-header-test'
 - Avoid weird 'find' warning when cleaning

 Makefile               |   2 +-
 init/Kconfig           |  10 ++++
 usr/.gitignore         |   1 -
 usr/Makefile           |   2 +
 usr/include/.gitignore |   3 +
 usr/include/Makefile   | 131 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 147 insertions(+), 2 deletions(-)
 create mode 100644 usr/include/.gitignore
 create mode 100644 usr/include/Makefile

diff --git a/Makefile b/Makefile
index 1f35aca4fe05..f23516980796 100644
--- a/Makefile
+++ b/Makefile
@@ -1363,7 +1363,7 @@ CLEAN_DIRS  += $(MODVERDIR) include/ksym
 CLEAN_FILES += modules.builtin.modinfo
 
 # Directories & files removed with 'make mrproper'
-MRPROPER_DIRS  += include/config usr/include include/generated          \
+MRPROPER_DIRS  += include/config include/generated          \
 		  arch/$(SRCARCH)/include/generated .tmp_objdiff
 MRPROPER_FILES += .config .config.old .version \
 		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
diff --git a/init/Kconfig b/init/Kconfig
index 2e9813daa2c1..74192de8ada6 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -108,6 +108,16 @@ config HEADER_TEST
 	  If you are a developer or tester and want to ensure the requested
 	  headers are self-contained, say Y here. Otherwise, choose N.
 
+config UAPI_HEADER_TEST
+	bool "Compile test UAPI headers"
+	depends on HEADER_TEST && HEADERS_INSTALL && CC_CAN_LINK
+	help
+	  Compile test headers exported to user-space to ensure they are
+	  self-contained, i.e. compilable as standalone units.
+
+	  If you are a developer or tester and want to ensure the exported
+	  headers are self-contained, say Y here. Otherwise, choose N.
+
 config LOCALVERSION
 	string "Local version - append to kernel release"
 	help
diff --git a/usr/.gitignore b/usr/.gitignore
index 8e48117a3f3d..be5eae1df7eb 100644
--- a/usr/.gitignore
+++ b/usr/.gitignore
@@ -7,4 +7,3 @@ initramfs_data.cpio.gz
 initramfs_data.cpio.bz2
 initramfs_data.cpio.lzma
 initramfs_list
-include
diff --git a/usr/Makefile b/usr/Makefile
index 4a70ae43c9cb..6a89eb019275 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -56,3 +56,5 @@ $(deps_initramfs): klibcdirs
 $(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
 	$(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
 	$(call if_changed,initfs)
+
+subdir-$(CONFIG_UAPI_HEADER_TEST) += include
diff --git a/usr/include/.gitignore b/usr/include/.gitignore
new file mode 100644
index 000000000000..a0991ff4402b
--- /dev/null
+++ b/usr/include/.gitignore
@@ -0,0 +1,3 @@
+*
+!.gitignore
+!Makefile
diff --git a/usr/include/Makefile b/usr/include/Makefile
new file mode 100644
index 000000000000..0f9f92c6016a
--- /dev/null
+++ b/usr/include/Makefile
@@ -0,0 +1,131 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+# Unlike the kernel space, exported headers are written in standard C.
+#  - Forbid C++ style comments
+#  - Use '__inline__', '__asm__' instead of 'inline', 'asm'
+#
+# -std=c90 (equivalent to -ansi) catches the violation of those.
+# We cannot go as far as adding -Wpedantic since it emits too many warnings.
+UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
+
+override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -I$(objtree)/usr/include
+
+# The following are excluded for now because they fail to build.
+#
+# Do not add a new header to the blacklist without legitimate reason.
+# Please consider to fix the header first.
+#
+# Sorted alphabetically.
+header-test- += asm/ipcbuf.h
+header-test- += asm/msgbuf.h
+header-test- += asm/sembuf.h
+header-test- += asm/shmbuf.h
+header-test- += asm/signal.h
+header-test- += asm/ucontext.h
+header-test- += drm/vmwgfx_drm.h
+header-test- += linux/am437x-vpfe.h
+header-test- += linux/android/binder.h
+header-test- += linux/android/binderfs.h
+header-test-$(CONFIG_CPU_BIG_ENDIAN) += linux/byteorder/big_endian.h
+header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h
+header-test- += linux/coda.h
+header-test- += linux/coda_psdev.h
+header-test- += linux/dvb/audio.h
+header-test- += linux/dvb/osd.h
+header-test- += linux/elfcore.h
+header-test- += linux/errqueue.h
+header-test- += linux/fsmap.h
+header-test- += linux/hdlc/ioctl.h
+header-test- += linux/ivtv.h
+header-test- += linux/jffs2.h
+header-test- += linux/kexec.h
+header-test- += linux/matroxfb.h
+header-test- += linux/netfilter_bridge/ebtables.h
+header-test- += linux/netfilter_ipv4/ipt_LOG.h
+header-test- += linux/netfilter_ipv6/ip6t_LOG.h
+header-test- += linux/nfc.h
+header-test- += linux/nilfs2_ondisk.h
+header-test- += linux/omap3isp.h
+header-test- += linux/omapfb.h
+header-test- += linux/patchkey.h
+header-test- += linux/phonet.h
+header-test- += linux/reiserfs_xattr.h
+header-test- += linux/scc.h
+header-test- += linux/sctp.h
+header-test- += linux/signal.h
+header-test- += linux/sysctl.h
+header-test- += linux/usb/audio.h
+header-test- += linux/v4l2-mediabus.h
+header-test- += linux/v4l2-subdev.h
+header-test- += linux/videodev2.h
+header-test- += linux/vm_sockets.h
+header-test- += misc/ocxl.h
+header-test- += mtd/mtd-abi.h
+header-test- += scsi/scsi_bsg_fc.h
+header-test- += scsi/scsi_netlink.h
+header-test- += scsi/scsi_netlink_fc.h
+header-test- += sound/asequencer.h
+header-test- += sound/asoc.h
+header-test- += sound/asound.h
+header-test- += sound/compress_offload.h
+header-test- += sound/emu10k1.h
+header-test- += sound/sfnt_info.h
+header-test- += sound/sof/eq.h
+header-test- += sound/sof/fw.h
+header-test- += sound/sof/header.h
+header-test- += sound/sof/manifest.h
+header-test- += sound/sof/trace.h
+header-test- += xen/evtchn.h
+header-test- += xen/gntdev.h
+header-test- += xen/privcmd.h
+
+# More headers are broken in some architectures
+
+ifeq ($(SRCARCH),arc)
+header-test- += linux/bpf_perf_event.h
+endif
+
+ifeq ($(SRCARCH),ia64)
+header-test- += asm/setup.h
+header-test- += asm/sigcontext.h
+header-test- += asm/perfmon.h
+header-test- += asm/perfmon_default_smpl.h
+header-test- += linux/if_bonding.h
+endif
+
+ifeq ($(SRCARCH),mips)
+header-test- += asm/stat.h
+endif
+
+ifeq ($(SRCARCH),powerpc)
+header-test- += asm/stat.h
+header-test- += linux/bpf_perf_event.h
+endif
+
+ifeq ($(SRCARCH),riscv)
+header-test- += linux/bpf_perf_event.h
+endif
+
+ifeq ($(SRCARCH),s390)
+header-test- += asm/runtime_instr.h
+header-test- += asm/zcrypt.h
+endif
+
+ifeq ($(SRCARCH),sparc)
+header-test- += asm/stat.h
+header-test- += asm/uctx.h
+header-test- += asm/fbio.h
+header-test- += asm/openpromio.h
+endif
+
+# asm-generic/*.h is used by asm/*.h, and should not be included directly
+header-test- += asm-generic/%
+
+# The rest are compile-tested
+header-test-y += $(filter-out $(header-test-), \
+			$(patsubst $(obj)/%,%, $(wildcard \
+			$(addprefix $(obj)/, *.h */*.h */*/*.h */*/*/*.h))))
+
+# For GNU Make <= 4.2.1, $(wildcard $(obj)/*/) matches to not only directories
+# but also regular files. Use $(filter %/, ...) just in case.
+clean-dirs += $(patsubst $(obj)/%/,%,$(filter %/, $(wildcard $(obj)/*/)))
-- 
2.17.1


^ permalink raw reply related

* [PATCH 1/7] init/Kconfig: add CONFIG_CC_CAN_LINK
From: Masahiro Yamada @ 2019-07-01  0:58 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Joel Fernandes, Masahiro Yamada, Song Liu,
	David S. Miller, Alexei Starovoitov, netdev, Yonghong Song,
	linux-kernel, Martin KaFai Lau, bpf, Daniel Borkmann
In-Reply-To: <20190701005845.12475-1-yamada.masahiro@socionext.com>

Currently, scripts/cc-can-link.sh is run just for BPFILTER_UMH, but
defining CC_CAN_LINK will be useful in other places.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v4:
 - New patch

Changes in v3: None
Changes in v2: None

 init/Kconfig         | 3 +++
 net/bpfilter/Kconfig | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index df5bba27e3fe..2e9813daa2c1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -24,6 +24,9 @@ config CLANG_VERSION
 	int
 	default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
 
+config CC_CAN_LINK
+	def_bool $(success,$(srctree)/scripts/cc-can-link.sh $(CC))
+
 config CC_HAS_ASM_GOTO
 	def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
 
diff --git a/net/bpfilter/Kconfig b/net/bpfilter/Kconfig
index 91f9d878165e..fed9290e3b41 100644
--- a/net/bpfilter/Kconfig
+++ b/net/bpfilter/Kconfig
@@ -9,7 +9,7 @@ menuconfig BPFILTER
 if BPFILTER
 config BPFILTER_UMH
 	tristate "bpfilter kernel module with user mode helper"
-	depends on $(success,$(srctree)/scripts/cc-can-link.sh $(CC))
+	depends on CC_CAN_LINK
 	default m
 	help
 	  This builds bpfilter kernel module with embedded user mode helper
-- 
2.17.1


^ permalink raw reply related

* [PATCH] net: usb: asix: init MAC address buffers
From: Phong Tran @ 2019-06-30 23:45 UTC (permalink / raw)
  To: syzbot+8a3fc6674bbc3978ed4e
  Cc: davem, glider, linux-kernel, linux-usb, lynxis, marcel.ziswiler,
	netdev, syzkaller-bugs, yang.wei9, zhang.run, skhan,
	linux-kernel-mentees, Phong Tran
In-Reply-To: <00000000000008f06d058a6e9783@google.com>

This is for fixing bug KMSAN: uninit-value in ax88772_bind

Tested by
https://groups.google.com/d/msg/syzkaller-bugs/aFQurGotng4/cFe9nxMCCwAJ

Reported-by: syzbot+8a3fc6674bbc3978ed4e@syzkaller.appspotmail.com

syzbot found the following crash on:

HEAD commit:    f75e4cfe kmsan: use kmsan_handle_urb() in urb.c
git tree:       kmsan
console output: https://syzkaller.appspot.com/x/log.txt?x=136d720ea00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=602468164ccdc30a
dashboard link:
https://syzkaller.appspot.com/bug?extid=8a3fc6674bbc3978ed4e
compiler:       clang version 9.0.0 (/home/glider/llvm/clang
06d00afa61eef8f7f501ebdb4e8612ea43ec2d78)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=12788316a00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=120359aaa00000

==================================================================
BUG: KMSAN: uninit-value in is_valid_ether_addr
include/linux/etherdevice.h:200 [inline]
BUG: KMSAN: uninit-value in asix_set_netdev_dev_addr
drivers/net/usb/asix_devices.c:73 [inline]
BUG: KMSAN: uninit-value in ax88772_bind+0x93d/0x11e0
drivers/net/usb/asix_devices.c:724
CPU: 0 PID: 3348 Comm: kworker/0:2 Not tainted 5.1.0+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x191/0x1f0 lib/dump_stack.c:113
  kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
  __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
  is_valid_ether_addr include/linux/etherdevice.h:200 [inline]
  asix_set_netdev_dev_addr drivers/net/usb/asix_devices.c:73 [inline]
  ax88772_bind+0x93d/0x11e0 drivers/net/usb/asix_devices.c:724
  usbnet_probe+0x10f5/0x3940 drivers/net/usb/usbnet.c:1728
  usb_probe_interface+0xd66/0x1320 drivers/usb/core/driver.c:361
  really_probe+0xdae/0x1d80 drivers/base/dd.c:513
  driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
  __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
  bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
  __device_attach+0x454/0x730 drivers/base/dd.c:844
  device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
  bus_probe_device+0x137/0x390 drivers/base/bus.c:514
  device_add+0x288d/0x30e0 drivers/base/core.c:2106
  usb_set_configuration+0x30dc/0x3750 drivers/usb/core/message.c:2027
  generic_probe+0xe7/0x280 drivers/usb/core/generic.c:210
  usb_probe_device+0x14c/0x200 drivers/usb/core/driver.c:266
  really_probe+0xdae/0x1d80 drivers/base/dd.c:513
  driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
  __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
  bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
  __device_attach+0x454/0x730 drivers/base/dd.c:844
  device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
  bus_probe_device+0x137/0x390 drivers/base/bus.c:514
  device_add+0x288d/0x30e0 drivers/base/core.c:2106
  usb_new_device+0x23e5/0x2ff0 drivers/usb/core/hub.c:2534
  hub_port_connect drivers/usb/core/hub.c:5089 [inline]
  hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
  port_event drivers/usb/core/hub.c:5350 [inline]
  hub_event+0x48d1/0x7290 drivers/usb/core/hub.c:5432
  process_one_work+0x1572/0x1f00 kernel/workqueue.c:2269
  process_scheduled_works kernel/workqueue.c:2331 [inline]
  worker_thread+0x189c/0x2460 kernel/workqueue.c:2417
  kthread+0x4b5/0x4f0 kernel/kthread.c:254
  ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:355

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/net/usb/asix_devices.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index c9bc96310ed4..f514d19316b1 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -230,6 +230,7 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
 	int i;
 	unsigned long gpio_bits = dev->driver_info->data;
 
+	memset(buf, 0, sizeof(buf));
 	usbnet_get_endpoints(dev,intf);
 
 	/* Toggle the GPIOs in a manufacturer/model specific way */
@@ -681,6 +682,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
 	u32 phyid;
 	struct asix_common_private *priv;
 
+	memset(buf, 0, sizeof(buf));
 	usbnet_get_endpoints(dev, intf);
 
 	/* Maybe the boot loader passed the MAC address via device tree */
@@ -1063,6 +1065,7 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
 	int ret;
 	u8 buf[ETH_ALEN];
 
+	memset(buf, 0, sizeof(buf));
 	usbnet_get_endpoints(dev,intf);
 
 	/* Get the MAC address */
-- 
2.11.0


^ permalink raw reply related

* Re: [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2019-06-28
From: David Miller @ 2019-06-30 23:05 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann
In-Reply-To: <20190628224932.3389-1-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 28 Jun 2019 15:49:17 -0700

> This series contains a smorgasbord of updates to many of the Intel
> drivers.
 ...

Pulled, thanks Jeff.

Please respond to Joe Perches's feedback on the debug macros.

Thanks.

^ permalink raw reply

* Re: [PATCH net 0/5] bnxt_en: Bug fixes.
From: David Miller @ 2019-06-30 23:01 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev
In-Reply-To: <1561821408-17418-1-git-send-email-michael.chan@broadcom.com>

From: Michael Chan <michael.chan@broadcom.com>
Date: Sat, 29 Jun 2019 11:16:43 -0400

> Miscellaneous bug fix patches, including two resource handling fixes for
> the RDMA driver, a PCI shutdown patch to add pci_disable_device(), a patch
> to fix ethtool selftest crash, and the last one suppresses an unnecessry
> error message.

Series applied.

> Please also queue patches 1, 2, and 3 for -stable.  Thanks.

Queued up.

^ permalink raw reply

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Karsten Wiborg @ 2019-06-30 22:21 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn; +Cc: nic_swsd, romieu, netdev
In-Reply-To: <de38facc-37ed-313f-cf1e-1ec6de9810c8@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

Hi Heiner,

On 30/06/2019 23:55, Heiner Kallweit wrote:
> This one shows that the vendor driver (r8168) uses a random MAC address.
> Means the driver can't read a valid MAC address from the chip, maybe due
> to a broken BIOS.
> Alternatively you could use r8169 and set a MAC address manually with
> ifconfig <if> hw ether <MAC address>
Hmm, did some more testing:
did a rmmod r8168 and (after "un"blacklisting the r8169) modprobed the
r8169. This time r8169 came up nicely but with a complete different MAC
(forgot to not than one though).
So I guess the vendor compilation did other stuff besides just compiling
the r8168 kernel module.

Did another test:
blacklisted the r8168, renamed r8168.ko to r8168.bak, depmod -a and
powercycled the system. Funny it came up with both r8168 and r8169
loaded and I got my intended IP address from. DHCP, so r8168 somewhat
got loaded and used his MAC.
Did another rmmod r8168, rmmod r8169 and then modprobe r8169.
Even though I did NOT configure a MAC address myself manually it came up
with a new MAC address and of course got a dynamich IP address.
So I don't know where the vendor somewhat changed something (with his
compiling/installing) to the effect that r8169 now works?!?

Regards,
Karsten


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4156 bytes --]

^ permalink raw reply

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Heiner Kallweit @ 2019-06-30 21:55 UTC (permalink / raw)
  To: Karsten Wiborg, Andrew Lunn; +Cc: nic_swsd, romieu, netdev
In-Reply-To: <173251e0-add7-b2f5-0701-0717ed4a9b04@web.de>

On 30.06.2019 23:29, Karsten Wiborg wrote:
> Hi Heiner,
> 
> On 30/06/2019 19:42, Heiner Kallweit wrote:
>> Vendor driver uses this code, do you see the related messages in syslog?
>>
>>         if (!is_valid_ether_addr(mac_addr)) {
>>                 netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
>>                           mac_addr);
>>                 eth_hw_addr_random(dev);
>>                 ether_addr_copy(mac_addr, dev->dev_addr);
>>                 netif_info(tp, probe, dev, "Random ether addr %pM\n",
>>                            mac_addr);
>>                 tp->random_mac = 1;
>>         }
>>
> 
> did the following:
> 
> # cat /var/log/messages |grep -i Invalid
> Jun 30 08:54:00 praktifix kernel: [    0.229213] DMAR-IR: Queued
> invalidation will be enabled to support x2apic and Intr-remapping.
> Jun 30 08:54:00 praktifix kernel: [   23.864072] Invalid pltconfig,
> ensure IPC1 device is enabled in BIOS
> Jun 30 10:17:30 praktifix kernel: [    0.228662] DMAR-IR: Queued
> invalidation will be enabled to support x2apic and Intr-remapping.
> Jun 30 10:17:30 praktifix kernel: [   24.198033] Invalid pltconfig,
> ensure IPC1 device is enabled in BIOS
> 
> But that does not relate to your error.
> 
> # cat /var/log/messages |grep -i random
> Jun 30 08:54:00 praktifix kernel: [    0.228092] random: crng done
> (trusting CPU's manufacturer)
> Jun 30 10:17:30 praktifix kernel: [    0.227534] random: crng done
> (trusting CPU's manufacturer)
> Jun 30 10:25:53 praktifix kernel: [  527.540354] r8168 0000:02:00.0
> (unnamed net_device) (uninitialized): Random ether addr 82:c2:81:10:6b:c2
> 
This one shows that the vendor driver (r8168) uses a random MAC address.
Means the driver can't read a valid MAC address from the chip, maybe due
to a broken BIOS.
Alternatively you could use r8169 and set a MAC address manually with
ifconfig <if> hw ether <MAC address>

> The last one probably results from my testing with r8169. The compiled
> r8168 went online later. That also is the only message I found.
> 
> Thank you for your help in debugging.
> 
> Regards and greetings from Hamburg,
> Karsten
> 
Heiner


^ permalink raw reply

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Karsten Wiborg @ 2019-06-30 21:44 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Heiner Kallweit, nic_swsd, romieu, netdev
In-Reply-To: <20190630175641.GB5330@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

Hi Andrew,

On 30/06/2019 19:56, Andrew Lunn wrote:
> 0x6e = 0110 1110b. Bit 1 is the Locally Administered bit. Meaning this
> is not an MAC address from a vendor pool, but one generated locally.
> 
> http://www.noah.org/wiki/MAC_address
Didn't know that. Thanks for pointing that out.

> If linux were to generate a random MAC address it would also set bit
> 1.
> 
> What is interesting is that you say you get the same value each
> time. So it most either be stored somewhere, or it is generated from
> something, the board serial number, etc.
Hmm, maybe I did make a mistake. Yes I just again got the same MAC
address again but the last poweron/offs were done with Hibernating where
I got the same IP-address with the same MAC.

Anyway I just did a complete Power-Off (shutdown) and I still got the
same MAC address and because of that the intended IP address.

I just naively did a recursive grep in /etc trying to find the MAC since
you implied that it has to be stored somewhere.
Also went through the AMI BIOS (Aptio Setup Utility) and couldn't find
anything related there. Only network-related setting seems to be:
"Network Stack Driver Support" which by default is disable. Other that
that it might of course be stored somewhere within the UEFI NVRAM.

Regards,
Karsten


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4156 bytes --]

^ permalink raw reply

* linux-next: Fixes tag needs some work in the net-next tree
From: Stephen Rothwell @ 2019-06-30 21:37 UTC (permalink / raw)
  To: David Miller, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Yonglong Liu,
	Peng Li, Huazhong Tan

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

Hi all,

In commit

  18d219b783da ("net: hns3: fix a -Wformat-nonliteral compile warning")

Fixes tag

  Fixes: 46a3df9f9718 ("Add HNS3 Acceleration Engine & Compatibility Layer Support")

has these problem(s):

  - Subject does not match target commit subject
    Just use
	git log -1 --format='Fixes: %h ("%s")'

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Karsten Wiborg @ 2019-06-30 21:29 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn; +Cc: nic_swsd, romieu, netdev
In-Reply-To: <27dfc508-dee0-9dad-1e6b-2a5df93c3977@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]

Hi Heiner,

On 30/06/2019 19:42, Heiner Kallweit wrote:
> Vendor driver uses this code, do you see the related messages in syslog?
> 
>         if (!is_valid_ether_addr(mac_addr)) {
>                 netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
>                           mac_addr);
>                 eth_hw_addr_random(dev);
>                 ether_addr_copy(mac_addr, dev->dev_addr);
>                 netif_info(tp, probe, dev, "Random ether addr %pM\n",
>                            mac_addr);
>                 tp->random_mac = 1;
>         }
> 

did the following:

# cat /var/log/messages |grep -i Invalid
Jun 30 08:54:00 praktifix kernel: [    0.229213] DMAR-IR: Queued
invalidation will be enabled to support x2apic and Intr-remapping.
Jun 30 08:54:00 praktifix kernel: [   23.864072] Invalid pltconfig,
ensure IPC1 device is enabled in BIOS
Jun 30 10:17:30 praktifix kernel: [    0.228662] DMAR-IR: Queued
invalidation will be enabled to support x2apic and Intr-remapping.
Jun 30 10:17:30 praktifix kernel: [   24.198033] Invalid pltconfig,
ensure IPC1 device is enabled in BIOS

But that does not relate to your error.

# cat /var/log/messages |grep -i random
Jun 30 08:54:00 praktifix kernel: [    0.228092] random: crng done
(trusting CPU's manufacturer)
Jun 30 10:17:30 praktifix kernel: [    0.227534] random: crng done
(trusting CPU's manufacturer)
Jun 30 10:25:53 praktifix kernel: [  527.540354] r8168 0000:02:00.0
(unnamed net_device) (uninitialized): Random ether addr 82:c2:81:10:6b:c2

The last one probably results from my testing with r8169. The compiled
r8168 went online later. That also is the only message I found.

Thank you for your help in debugging.

Regards and greetings from Hamburg,
Karsten


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4156 bytes --]

^ permalink raw reply

* メール送信の控え: Meet sexy girls in your city
From: オリジナル ユニフォーム PLUS-MARK.com @ 2019-06-30 20:34 UTC (permalink / raw)
  To: netdev

これは、あなたが「PLUS MARK 株式会社」から「オリジナル ユニフォーム PLUS-MARK.com」に送信したメッセージの控えです。

次の方から http://plus-mark.com/ 経由でお問い合わせがありました。
ClintonTum <netdev@vger.kernel.org>

Single girls want sex in your city: http://v.ht/YPiTj


^ permalink raw reply

* [PATCH net-next 2/3] macsec: remove superfluous zeroing of skb reference
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

Remove superfluous zeroing of skb pointer for the RX_HANDLER_CONSUMED
case, since in that case, __netif_receive_skb_core will simply ignore
the value.

Signed-off-by: Andreas Steinmetz <ast@domdv.de>

--- a/drivers/net/macsec.c	2019-06-30 22:04:10.003613880 +0200
+++ b/drivers/net/macsec.c	2019-06-30 22:04:22.405822436 +0200
@@ -1215,7 +1215,6 @@
 			macsec_rxsc_put(rx_sc);
 		}
 		rcu_read_unlock();
-		*pskb = NULL;
 		return RX_HANDLER_CONSUMED;
 	}
 
@@ -1239,7 +1238,6 @@
 
 	rcu_read_unlock();
 
-	*pskb = NULL;
 	return RX_HANDLER_CONSUMED;
 
 drop:
@@ -1249,7 +1247,6 @@
 	rcu_read_unlock();
 drop_direct:
 	kfree_skb(skb);
-	*pskb = NULL;
 	return RX_HANDLER_CONSUMED;
 
 nosci:


^ permalink raw reply

* [PATCH net-next 3/3] macsec: add brackets and indentation after calling macsec_decrypt
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

At this point, skb could only be a valid pointer, so this patch does
not introduce any functional change.

Signed-off-by: Andreas Steinmetz <ast@domdv.de>

--- a/drivers/net/macsec.c	2019-06-30 22:05:17.785683634 +0200
+++ b/drivers/net/macsec.c	2019-06-30 22:05:20.526171178 +0200
@@ -1205,21 +1205,22 @@
 
 	/* Disabled && !changed text => skip validation */
 	if (hdr->tci_an & MACSEC_TCI_C ||
-	    secy->validate_frames != MACSEC_VALIDATE_DISABLED)
+	    secy->validate_frames != MACSEC_VALIDATE_DISABLED) {
 		skb = macsec_decrypt(skb, dev, rx_sa, sci, secy);
 
-	if (IS_ERR(skb)) {
-		/* the decrypt callback needs the reference */
-		if (PTR_ERR(skb) != -EINPROGRESS) {
-			macsec_rxsa_put(rx_sa);
-			macsec_rxsc_put(rx_sc);
+		if (IS_ERR(skb)) {
+			/* the decrypt callback needs the reference */
+			if (PTR_ERR(skb) != -EINPROGRESS) {
+				macsec_rxsa_put(rx_sa);
+				macsec_rxsc_put(rx_sc);
+			}
+			rcu_read_unlock();
+			return RX_HANDLER_CONSUMED;
 		}
-		rcu_read_unlock();
-		return RX_HANDLER_CONSUMED;
-	}
 
-	if (!macsec_post_decrypt(skb, secy, pn))
-		goto drop;
+		if (!macsec_post_decrypt(skb, secy, pn))
+			goto drop;
+	}
 
 deliver:
 	macsec_finalize_skb(skb, secy->icv_len,


^ permalink raw reply

* [PATCH net-next 1/3] macsec: remove superfluous function calls
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

Remove superfluous skb_share_check() and skb_unshare().
macsec_decrypt is only called by macsec_handle_frame which
already does a skb_unshare().

Signed-off-by: Andreas Steinmetz <ast@domdv.de>

--- a/drivers/net/macsec.c	2019-06-30 22:02:54.906908179 +0200
+++ b/drivers/net/macsec.c	2019-06-30 22:03:07.315785186 +0200
@@ -939,9 +939,6 @@
 	u16 icv_len = secy->icv_len;
 
 	macsec_skb_cb(skb)->valid = false;
-	skb = skb_share_check(skb, GFP_ATOMIC);
-	if (!skb)
-		return ERR_PTR(-ENOMEM);
 
 	ret = skb_cow_data(skb, 0, &trailer);
 	if (unlikely(ret < 0)) {
@@ -973,11 +970,6 @@
 
 		aead_request_set_crypt(req, sg, sg, len, iv);
 		aead_request_set_ad(req, macsec_hdr_len(macsec_skb_cb(skb)->has_sci));
-		skb = skb_unshare(skb, GFP_ATOMIC);
-		if (!skb) {
-			aead_request_free(req);
-			return ERR_PTR(-ENOMEM);
-		}
 	} else {
 		/* integrity only: all headers + data authenticated */
 		aead_request_set_crypt(req, sg, sg, icv_len, iv);


^ permalink raw reply

* [PATCH net-next 0/3] macsec: a few cleanups in the receive path
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

This patchset removes some unnecessary code in the receive path of the
macsec driver, and re-indents the error handling after calling
macsec_decrypt to make the post-processing clearer.

This is a combined effort of Sabrina Dubroca <sd@queasysnail.net> and me.



^ permalink raw reply

* [PATCH net 2/2] macsec: fix checksumming after decryption
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

Fix checksumming after decryption.

Signed-off-by: Andreas Steinmetz <ast@domdv.de>

--- a/drivers/net/macsec.c	2019-06-30 22:14:10.250285314 +0200
+++ b/drivers/net/macsec.c	2019-06-30 22:15:11.931230417 +0200
@@ -869,6 +869,7 @@
 
 static void macsec_finalize_skb(struct sk_buff *skb, u8 icv_len, u8 hdr_len)
 {
+	skb->ip_summed = CHECKSUM_NONE;
 	memmove(skb->data + hdr_len, skb->data, 2 * ETH_ALEN);
 	skb_pull(skb, hdr_len);
 	pskb_trim_unique(skb, skb->len - icv_len);


^ permalink raw reply

* [PATCH net 1/2] macsec: fix use-after-free of skb during RX
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

Fix use-after-free of skb when rx_handler returns RX_HANDLER_PASS.

Signed-off-by: Andreas Steinmetz <ast@domdv.de>

--- a/drivers/net/macsec.c	2019-06-05 20:23:27.640154747 +0200
+++ b/drivers/net/macsec.c	2019-06-05 20:23:46.791565816 +0200
@@ -1103,10 +1103,9 @@ static rx_handler_result_t macsec_handle
 	}
 
 	skb = skb_unshare(skb, GFP_ATOMIC);
-	if (!skb) {
-		*pskb = NULL;
+	*pskb = skb;
+	if (!skb)
 		return RX_HANDLER_CONSUMED;
-	}
 
 	pulled_sci = pskb_may_pull(skb, macsec_extra_len(true));
 	if (!pulled_sci) {


^ permalink raw reply

* [PATCH net 0/2] macsec: fix some bugs in the receive path
From: Andreas Steinmetz @ 2019-06-30 20:46 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca

This series fixes some bugs in the receive path of macsec. The first
is a use after free when processing macsec frames with a SecTAG that
has the TCI E bit set but the C bit clear. In the 2nd bug, the driver
leaves an invalid checksumming state after decrypting the packet.

This is a combined effort of Sabrina Dubroca <sd@queasysnail.net> and me.



^ permalink raw reply

* Re: [PATCH 4/4] ipvs: reduce kernel stack usage
From: Julian Anastasov @ 2019-06-30 20:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kees Cook, Wensong Zhang, Simon Horman, David S. Miller,
	Alexey Kuznetsov, Hideaki YOSHIFUJI, Pablo Neira Ayuso,
	Jozsef Kadlecsik, Florian Westphal, James Smart, Dick Kennedy,
	James E . J . Bottomley, Martin K . Petersen, Larry Finger,
	Florian Schilhabel, Greg Kroah-Hartman, James Morris, linux-scsi,
	linux-kernel, devel, netdev, lvs-devel, netfilter-devel, coreteam,
	Ard Biesheuvel
In-Reply-To: <20190628123819.2785504-4-arnd@arndb.de>


	Hello,

On Fri, 28 Jun 2019, Arnd Bergmann wrote:

> With the new CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL option, the stack
> usage in the ipvs debug output grows because each instance of
> IP_VS_DBG_BUF() now has its own buffer of 160 bytes that add up
> rather than reusing the stack slots:
> 
> net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_sched_persist':
> net/netfilter/ipvs/ip_vs_core.c:427:1: error: the frame size of 1052 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_new_conn_out':
> net/netfilter/ipvs/ip_vs_core.c:1231:1: error: the frame size of 1048 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> net/netfilter/ipvs/ip_vs_ftp.c: In function 'ip_vs_ftp_out':
> net/netfilter/ipvs/ip_vs_ftp.c:397:1: error: the frame size of 1104 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> net/netfilter/ipvs/ip_vs_ftp.c: In function 'ip_vs_ftp_in':
> net/netfilter/ipvs/ip_vs_ftp.c:555:1: error: the frame size of 1200 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> 
> Since printk() already has a way to print IPv4/IPv6 addresses using
> the %pIS format string, use that instead, combined with a macro that
> creates a local sockaddr structure on the stack. These will still
> add up, but the stack frames are now under 200 bytes.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I'm not sure this actually does what I think it does. Someone
> needs to verify that we correctly print the addresses here.
> I've also only added three files that caused the warning messages
> to be reported. There are still a lot of other instances of
> IP_VS_DBG_BUF() that could be converted the same way after the
> basic idea is confirmed.
> ---
>  include/net/ip_vs.h             | 71 +++++++++++++++++++--------------
>  net/netfilter/ipvs/ip_vs_core.c | 44 ++++++++++----------
>  net/netfilter/ipvs/ip_vs_ftp.c  | 20 +++++-----
>  3 files changed, 72 insertions(+), 63 deletions(-)
> 
> diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
> index 3759167f91f5..3dfbeef67be6 100644
> --- a/include/net/ip_vs.h
> +++ b/include/net/ip_vs.h
> @@ -227,6 +227,16 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
>  		       sizeof(ip_vs_dbg_buf), addr,			\
>  		       &ip_vs_dbg_idx)
>  
> +#define IP_VS_DBG_SOCKADDR4(fam, addr, port)				\
> +	(struct sockaddr*)&(struct sockaddr_in)				\
> +	{ .sin_family = (fam), .sin_addr = (addr)->in, .sin_port = (port) }
> +#define IP_VS_DBG_SOCKADDR6(fam, addr, port)				\
> +	(struct sockaddr*)&(struct sockaddr_in6) \
> +	{ .sin6_family = (fam), .sin6_addr = (addr)->in6, .sin6_port = (port) }
> +#define IP_VS_DBG_SOCKADDR(fam, addr, port) (fam == AF_INET ?		\
> +			IP_VS_DBG_SOCKADDR4(fam, addr, port) :		\
> +			IP_VS_DBG_SOCKADDR6(fam, addr, port))
> +
>  #define IP_VS_DBG(level, msg, ...)					\
>  	do {								\
>  		if (level <= ip_vs_get_debug_level())			\
> @@ -251,6 +261,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
>  #else	/* NO DEBUGGING at ALL */
>  #define IP_VS_DBG_BUF(level, msg...)  do {} while (0)
>  #define IP_VS_ERR_BUF(msg...)  do {} while (0)
> +#define IP_VS_DBG_SOCKADDR(fam, addr, port) NULL
>  #define IP_VS_DBG(level, msg...)  do {} while (0)
>  #define IP_VS_DBG_RL(msg...)  do {} while (0)
>  #define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg)	do {} while (0)
> @@ -1244,31 +1255,31 @@ static inline void ip_vs_control_del(struct ip_vs_conn *cp)
>  {
>  	struct ip_vs_conn *ctl_cp = cp->control;
>  	if (!ctl_cp) {
> -		IP_VS_ERR_BUF("request control DEL for uncontrolled: "
> -			      "%s:%d to %s:%d\n",
> -			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
> -			      ntohs(cp->cport),
> -			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
> -			      ntohs(cp->vport));
> +		pr_err("request control DEL for uncontrolled: "
> +		       "%pISp to %pISp\n",

	ip_vs_dbg_addr() used compact form (%pI6c), so it would be
better to use %pISc and %pISpc everywhere in IPVS...

	Also, note that before now port was printed with %d and
ntohs() was used, now port should be in network order, so:

- ntohs() should be removed
- htons() should be added, if missing. At first look, this case
is not present in IPVS, we have only ntohs() usage

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH] ipvs: allow tunneling with gre encapsulation
From: Julian Anastasov @ 2019-06-30 20:01 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Pablo Neira Ayuso, Konstantin Khlebnikov, Wensong Zhang,
	Simon Horman, Jozsef Kadlecsik, Florian Westphal, David S. Miller,
	netdev, lvs-devel, netfilter-devel
In-Reply-To: <2caa3152-f90d-1ad6-3f98-b07960fed171@yandex-team.ru>


	Hello,

On Tue, 25 Jun 2019, Vadim Fedorenko wrote:

> windows real servers can handle gre tunnels, this patch allows
> gre encapsulation with the tunneling method, thereby letting ipvs
> be load balancer for windows-based services
> 
> Signed-off-by: Vadim Fedorenko <vfedorenko@yandex-team.ru>

	Looks like your patch is not encoded properly.
Check Documentation/process/email-clients.rst for your
mail client to avoid the format=flowed in Content-Type.
To be sure, send patch to yourself and try to apply it.
As alternative, use git send-email to send patches, for example:

git send-email --envelope-sender 'YOUR EMAIL' \
	[--suppress-from] [--confirm=always] \
	--to 'TO_EMAIL' --cc 'CC_EMAIL1' --cc 'CC_EMAIL2' \
	file_or_dir

	You can test it by sending first to yourself only.
Also, test every patch before sending for problems:

scripts/checkpatch.pl --strict file.patch

	It shows some problems you should fix.

	So, your patch works but you have to send v2 with
some changes...

> ---
>  include/uapi/linux/ip_vs.h      |  1 +
>  net/netfilter/ipvs/ip_vs_xmit.c | 76
>  +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
> 

> diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
> index 71fc6d6..fad3f33 100644
> --- a/net/netfilter/ipvs/ip_vs_xmit.c
> +++ b/net/netfilter/ipvs/ip_vs_xmit.c
> @@ -29,6 +29,7 @@
>  #include <linux/tcp.h>                  /* for tcphdr */
>  #include <net/ip.h>
>  #include <net/gue.h>
> +#include <net/gre.h>
>  #include <net/tcp.h>                    /* for csum_tcpudp_magic */
>  #include <net/udp.h>
>  #include <net/icmp.h>                   /* for icmp_send */
> @@ -389,6 +390,12 @@ static inline bool decrement_ttl(struct netns_ipvs *ipvs,
>  			    skb->ip_summed == CHECKSUM_PARTIAL)
>  				mtu -= GUE_PLEN_REMCSUM + GUE_LEN_PRIV;
>  		}
> +		if (dest->tun_type == IP_VS_CONN_F_TUNNEL_TYPE_GRE) {
> +			__be16 tflags = 0;

	Empty line needed

> +			if (dest->tun_flags & IP_VS_TUNNEL_ENCAP_FLAG_CSUM)
> +				tflags |= TUNNEL_CSUM;
> +			mtu -= gre_calc_hlen(tflags);
> +		}
>  		if (mtu < 68) {
>  			IP_VS_DBG_RL("%s(): mtu less than 68\n", __func__);
>  			goto err_put;
> @@ -549,6 +556,12 @@ static inline bool decrement_ttl(struct netns_ipvs *ipvs,
>  			    skb->ip_summed == CHECKSUM_PARTIAL)
>  				mtu -= GUE_PLEN_REMCSUM + GUE_LEN_PRIV;
>  		}
> +		if (dest->tun_type == IP_VS_CONN_F_TUNNEL_TYPE_GRE) {
> +			__be16 tflags = 0;

	Empty line needed

> +			if (dest->tun_flags & IP_VS_TUNNEL_ENCAP_FLAG_CSUM)
> +				tflags |= TUNNEL_CSUM;
> +			mtu -= gre_calc_hlen(tflags);
> +		}
>  		if (mtu < IPV6_MIN_MTU) {
>  			IP_VS_DBG_RL("%s(): mtu less than %d\n", __func__,
>  				     IPV6_MIN_MTU);
> @@ -1079,6 +1092,24 @@ static inline int __tun_gso_type_mask(int encaps_af,
> int orig_af)
>  	return 0;
>  }
> 
> +static void
> +ipvs_gre_encap(struct net *net, struct sk_buff *skb,
> +	       struct ip_vs_conn *cp, __u8 *next_protocol)
> +{
> +	size_t hdrlen;
> +	__be16 tflags = 0;
> +	__be16 proto = *next_protocol == IPPROTO_IPIP ? htons(ETH_P_IP) :
> htons(ETH_P_IPV6);

	This line is too long. You can also order the lines from long
to short.

> +
> +	if (cp->dest->tun_flags & IP_VS_TUNNEL_ENCAP_FLAG_CSUM)
> +		tflags |= TUNNEL_CSUM;

	Many empty lines are not needed...

> +
> +	hdrlen = gre_calc_hlen(tflags);
> +
> +	gre_build_header(skb, hdrlen, tflags, proto, 0, 0);
> +
> +	*next_protocol = IPPROTO_GRE;
> +}
> +
>  /*
>   *   IP Tunneling transmitter
>   *

> @@ -1328,6 +1400,10 @@ static inline int __tun_gso_type_mask(int encaps_af,
> int orig_af)
>  		udp6_set_csum(!check, skb, &saddr, &cp->daddr.in6, skb->len);
>  	}
> 
> +	if (tun_type == IP_VS_CONN_F_TUNNEL_TYPE_GRE) {
> +		ipvs_gre_encap(net, skb, cp, &next_protocol);
> +	}

	Braces are not needed, at both places where ipvs_gre_encap is 
called.

> +
>  	skb_push(skb, sizeof(struct ipv6hdr));
>  	skb_reset_network_header(skb);
>  	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));

	As part of your patch, the new tunnel type should be registered 
also in ip_vs_rs_hash(), GRE will use port 0 just like IPIP, eg:

                case IP_VS_CONN_F_TUNNEL_TYPE_IPIP:
+               case IP_VS_CONN_F_TUNNEL_TYPE_GRE:
                        port = 0;
                        break;

	Then I'll post a patch for ip_vs_in_icmp() that strips
the GRE header from ICMP errors by adding ipvs_gre_decap().
I also created ipvsadm patch for GRE.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* [RFC iproute2] netns: add mounting state file for each netns
From: Matteo Croce @ 2019-06-30 19:29 UTC (permalink / raw)
  To: netdev; +Cc: Alexander Aring, Nicolas Dichtel

When ip creates a netns, there is a small time interval between the
placeholder file creation in NETNS_RUN_DIR and the bind mount from /proc.

Add a temporary file named .mounting-$netns which gets deleted after the
bind mount, so watching for delete event matching the .mounting-* name
will notify watchers only after the bind mount has been done.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 ip/ipnetns.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index a883f210..23b95173 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -24,6 +24,8 @@
 #include "namespace.h"
 #include "json_print.h"
 
+#define TMP_PREFIX ".mounting-"
+
 static int usage(void)
 {
 	fprintf(stderr,
@@ -47,6 +49,10 @@ static struct rtnl_handle rtnsh = { .fd = -1 };
 static int have_rtnl_getnsid = -1;
 static int saved_netns = -1;
 
+static int is_mounting_stab(const char *name) {
+	return !strncmp(name, TMP_PREFIX, sizeof(TMP_PREFIX) - 1);
+}
+
 static int ipnetns_accept_msg(struct rtnl_ctrl_data *ctrl,
 			      struct nlmsghdr *n, void *arg)
 {
@@ -379,6 +385,8 @@ static int netns_list(int argc, char **argv)
 			continue;
 		if (strcmp(entry->d_name, "..") == 0)
 			continue;
+		if (is_mounting_stab(entry->d_name))
+			continue;
 
 		open_json_object(NULL);
 		print_string(PRINT_ANY, "name",
@@ -676,7 +684,7 @@ static int netns_add(int argc, char **argv, bool create)
 	 * userspace tweaks like remounting /sys, or bind mounting
 	 * a new /etc/resolv.conf can be shared between users.
 	 */
-	char netns_path[PATH_MAX], proc_path[PATH_MAX];
+	char netns_path[PATH_MAX], tmp_path[PATH_MAX], proc_path[PATH_MAX];
 	const char *name;
 	pid_t pid;
 	int fd;
@@ -701,6 +709,7 @@ static int netns_add(int argc, char **argv, bool create)
 	name = argv[0];
 
 	snprintf(netns_path, sizeof(netns_path), "%s/%s", NETNS_RUN_DIR, name);
+	snprintf(tmp_path, sizeof(tmp_path), "%s/"TMP_PREFIX"%s", NETNS_RUN_DIR, name);
 
 	if (create_netns_dir())
 		return -1;
@@ -737,6 +746,14 @@ static int netns_add(int argc, char **argv, bool create)
 	}
 	close(fd);
 
+	fd = open(tmp_path, O_RDONLY|O_CREAT|O_EXCL, 0);
+	if (fd < 0) {
+		fprintf(stderr, "Cannot create namespace file \"%s\": %s\n",
+			tmp_path, strerror(errno));
+		goto out_delete;
+	}
+	close(fd);
+
 	if (create) {
 		netns_save();
 		if (unshare(CLONE_NEWNET) < 0) {
@@ -757,6 +774,7 @@ static int netns_add(int argc, char **argv, bool create)
 		goto out_delete;
 	}
 	netns_restore();
+	unlink(tmp_path);
 
 	return 0;
 out_delete:
@@ -767,6 +785,10 @@ out_delete:
 		fprintf(stderr, "Cannot remove namespace file \"%s\": %s\n",
 			netns_path, strerror(errno));
 	}
+	if (unlink(tmp_path) < 0) {
+		fprintf(stderr, "Cannot remove namespace file \"%s\": %s\n",
+			tmp_path, strerror(errno));
+	}
 	return -1;
 }
 
@@ -849,7 +871,7 @@ static int netns_monitor(int argc, char **argv)
 	if (create_netns_dir())
 		return -1;
 
-	if (inotify_add_watch(fd, NETNS_RUN_DIR, IN_CREATE | IN_DELETE) < 0) {
+	if (inotify_add_watch(fd, NETNS_RUN_DIR, IN_DELETE) < 0) {
 		fprintf(stderr, "inotify_add_watch failed: %s\n",
 			strerror(errno));
 		return -1;
@@ -865,9 +887,9 @@ static int netns_monitor(int argc, char **argv)
 		for (event = (struct inotify_event *)buf;
 		     (char *)event < &buf[len];
 		     event = (struct inotify_event *)((char *)event + sizeof(*event) + event->len)) {
-			if (event->mask & IN_CREATE)
-				printf("add %s\n", event->name);
-			if (event->mask & IN_DELETE)
+			if (is_mounting_stab(event->name))
+				printf("add %s\n", event->name + sizeof(TMP_PREFIX) - 1);
+			else
 				printf("delete %s\n", event->name);
 		}
 	}
@@ -876,8 +898,9 @@ static int netns_monitor(int argc, char **argv)
 
 static int invalid_name(const char *name)
 {
-	return !*name || strlen(name) > NAME_MAX ||
-		strchr(name, '/') || !strcmp(name, ".") || !strcmp(name, "..");
+	return !*name || strlen(name) + sizeof(TMP_PREFIX) - 1 > NAME_MAX ||
+		strchr(name, '/') || !strcmp(name, ".") || !strcmp(name, "..") ||
+		is_mounting_stab(name);
 }
 
 int do_netns(int argc, char **argv)
-- 
2.21.0


^ permalink raw reply related

* [PATCH net-next v1] bonding: add an option to specify a delay between peer notifications
From: Vincent Bernat @ 2019-06-30 18:59 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S. Miller,
	netdev
  Cc: Vincent Bernat

Currently, gratuitous ARP/ND packets are sent every `miimon'
milliseconds. This commit allows a user to specify a custom delay
through a new option, `peer_notif_delay'.

Like for `updelay' and `downdelay', this delay should be a multiple of
`miimon' to avoid managing an additional work queue. The configuration
logic is copied from `updelay' and `downdelay'.

When setting `miimon' to 100 and `peer_notif_delay' to 500, we can
observe the 500 ms delay is respected:

    20:30:19.354693 ARP, Request who-has 203.0.113.10 tell 203.0.113.10, length 28
    20:30:19.874892 ARP, Request who-has 203.0.113.10 tell 203.0.113.10, length 28
    20:30:20.394919 ARP, Request who-has 203.0.113.10 tell 203.0.113.10, length 28
    20:30:20.914963 ARP, Request who-has 203.0.113.10 tell 203.0.113.10, length 28

In bond_mii_monitor(), I have tried to keep the lock logic readable.
The change is due to the fact we cannot rely on a notification to
lower the value of `bond->send_peer_notif' as `NETDEV_NOTIFY_PEERS' is
only triggered once every N times, while we need to decrement the
counter each time.

iproute2 also needs to be updated to be able to specify this new
attribute through `ip link'.

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
---
 drivers/net/bonding/bond_main.c    | 55 +++++++++++++++++------
 drivers/net/bonding/bond_netlink.c | 14 ++++++
 drivers/net/bonding/bond_options.c | 71 +++++++++++++++++++-----------
 drivers/net/bonding/bond_procfs.c  |  2 +
 drivers/net/bonding/bond_sysfs.c   | 13 ++++++
 include/net/bond_options.h         |  1 +
 include/net/bonding.h              |  1 +
 include/uapi/linux/if_link.h       |  1 +
 tools/include/uapi/linux/if_link.h |  1 +
 9 files changed, 119 insertions(+), 40 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4f5b3baf04c3..6ee35df482a4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -93,6 +93,7 @@ static int num_peer_notif = 1;
 static int miimon;
 static int updelay;
 static int downdelay;
+static int peer_notif_delay;
 static int use_carrier	= 1;
 static char *mode;
 static char *primary;
@@ -129,6 +130,9 @@ MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds");
 module_param(downdelay, int, 0);
 MODULE_PARM_DESC(downdelay, "Delay before considering link down, "
 			    "in milliseconds");
+module_param(peer_notif_delay, int, 0);
+MODULE_PARM_DESC(peer_notif_delay, "Delay between each peer notification on "
+				   "failover event, in milliseconds");
 module_param(use_carrier, int, 0);
 MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; "
 			      "0 for off, 1 for on (default)");
@@ -796,6 +800,8 @@ static bool bond_should_notify_peers(struct bonding *bond)
 		   slave ? slave->dev->name : "NULL");
 
 	if (!slave || !bond->send_peer_notif ||
+	    bond->send_peer_notif %
+	    max(1, bond->params.peer_notif_delay) != 0 ||
 	    !netif_carrier_ok(bond->dev) ||
 	    test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
 		return false;
@@ -886,15 +892,18 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
 
 			if (netif_running(bond->dev)) {
 				bond->send_peer_notif =
-					bond->params.num_peer_notif;
+					bond->params.num_peer_notif *
+					max(1, bond->params.peer_notif_delay);
 				should_notify_peers =
 					bond_should_notify_peers(bond);
 			}
 
 			call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev);
-			if (should_notify_peers)
+			if (should_notify_peers) {
+				bond->send_peer_notif--;
 				call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
 							 bond->dev);
+			}
 		}
 	}
 
@@ -2279,6 +2288,7 @@ static void bond_mii_monitor(struct work_struct *work)
 	struct bonding *bond = container_of(work, struct bonding,
 					    mii_work.work);
 	bool should_notify_peers = false;
+	bool commit;
 	unsigned long delay;
 	struct slave *slave;
 	struct list_head *iter;
@@ -2289,12 +2299,19 @@ static void bond_mii_monitor(struct work_struct *work)
 		goto re_arm;
 
 	rcu_read_lock();
-
 	should_notify_peers = bond_should_notify_peers(bond);
-
-	if (bond_miimon_inspect(bond)) {
+	commit = !!bond_miimon_inspect(bond);
+	if (bond->send_peer_notif) {
+		rcu_read_unlock();
+		if (rtnl_trylock()) {
+			bond->send_peer_notif--;
+			rtnl_unlock();
+		}
+	} else {
 		rcu_read_unlock();
+	}
 
+	if (commit) {
 		/* Race avoidance with bond_close cancel of workqueue */
 		if (!rtnl_trylock()) {
 			delay = 1;
@@ -2308,8 +2325,7 @@ static void bond_mii_monitor(struct work_struct *work)
 		bond_miimon_commit(bond);
 
 		rtnl_unlock();	/* might sleep, hold no other locks */
-	} else
-		rcu_read_unlock();
+	}
 
 re_arm:
 	if (bond->params.miimon)
@@ -3065,10 +3081,6 @@ static int bond_master_netdev_event(unsigned long event,
 	case NETDEV_REGISTER:
 		bond_create_proc_entry(event_bond);
 		break;
-	case NETDEV_NOTIFY_PEERS:
-		if (event_bond->send_peer_notif)
-			event_bond->send_peer_notif--;
-		break;
 	default:
 		break;
 	}
@@ -4443,6 +4455,12 @@ static int bond_check_params(struct bond_params *params)
 		downdelay = 0;
 	}
 
+	if (peer_notif_delay < 0) {
+		pr_warn("Warning: peer_notif_delay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
+			peer_notif_delay, INT_MAX);
+		peer_notif_delay = 0;
+	}
+
 	if ((use_carrier != 0) && (use_carrier != 1)) {
 		pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
 			use_carrier);
@@ -4495,12 +4513,12 @@ static int bond_check_params(struct bond_params *params)
 	}
 
 	if (!miimon) {
-		if (updelay || downdelay) {
+		if (updelay || downdelay || peer_notif_delay) {
 			/* just warn the user the up/down delay will have
 			 * no effect since miimon is zero...
 			 */
-			pr_warn("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
-				updelay, downdelay);
+			pr_warn("Warning: miimon module parameter not set and updelay (%d), downdelay (%d) or peer_notif_delay (%d) module parameter is set; updelay, downdelay have and peer_notif_delay have no effect unless miimon is set\n",
+				updelay, downdelay, peer_notif_delay);
 		}
 	} else {
 		/* don't allow arp monitoring */
@@ -4524,6 +4542,14 @@ static int bond_check_params(struct bond_params *params)
 		}
 
 		downdelay /= miimon;
+
+		if ((peer_notif_delay % miimon) != 0) {
+			pr_warn("Warning: peer_notif_delay (%d) is not a multiple of miimon (%d), peer_notif_delay rounded to %d ms\n",
+				peer_notif_delay, miimon,
+				(peer_notif_delay / miimon) * miimon);
+		}
+
+		peer_notif_delay /= miimon;
 	}
 
 	if (arp_interval < 0) {
@@ -4691,6 +4717,7 @@ static int bond_check_params(struct bond_params *params)
 	params->arp_all_targets = arp_all_targets_value;
 	params->updelay = updelay;
 	params->downdelay = downdelay;
+	params->peer_notif_delay = peer_notif_delay;
 	params->use_carrier = use_carrier;
 	params->lacp_fast = lacp_fast;
 	params->primary[0] = 0;
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index b24cce48ae35..a259860a7208 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -108,6 +108,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
 	[IFLA_BOND_AD_ACTOR_SYSTEM]	= { .type = NLA_BINARY,
 					    .len  = ETH_ALEN },
 	[IFLA_BOND_TLB_DYNAMIC_LB]	= { .type = NLA_U8 },
+	[IFLA_BOND_PEER_NOTIF_DELAY]    = { .type = NLA_U32 },
 };
 
 static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
@@ -215,6 +216,14 @@ static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
 		if (err)
 			return err;
 	}
+	if (data[IFLA_BOND_PEER_NOTIF_DELAY]) {
+		int delay = nla_get_u32(data[IFLA_BOND_PEER_NOTIF_DELAY]);
+
+		bond_opt_initval(&newval, delay);
+		err = __bond_opt_set(bond, BOND_OPT_PEER_NOTIF_DELAY, &newval);
+		if (err)
+			return err;
+	}
 	if (data[IFLA_BOND_USE_CARRIER]) {
 		int use_carrier = nla_get_u8(data[IFLA_BOND_USE_CARRIER]);
 
@@ -494,6 +503,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
 		nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_USER_PORT_KEY */
 		nla_total_size(ETH_ALEN) + /* IFLA_BOND_AD_ACTOR_SYSTEM */
 		nla_total_size(sizeof(u8)) + /* IFLA_BOND_TLB_DYNAMIC_LB */
+		nla_total_size(sizeof(u32)) +	/* IFLA_BOND_PEER_NOTIF_DELAY */
 		0;
 }
 
@@ -536,6 +546,10 @@ static int bond_fill_info(struct sk_buff *skb,
 			bond->params.downdelay * bond->params.miimon))
 		goto nla_put_failure;
 
+	if (nla_put_u32(skb, IFLA_BOND_PEER_NOTIF_DELAY,
+			bond->params.downdelay * bond->params.miimon))
+		goto nla_put_failure;
+
 	if (nla_put_u8(skb, IFLA_BOND_USE_CARRIER, bond->params.use_carrier))
 		goto nla_put_failure;
 
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 0d852fe9da7c..ddb3916d3506 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -24,6 +24,8 @@ static int bond_option_updelay_set(struct bonding *bond,
 				   const struct bond_opt_value *newval);
 static int bond_option_downdelay_set(struct bonding *bond,
 				     const struct bond_opt_value *newval);
+static int bond_option_peer_notif_delay_set(struct bonding *bond,
+					    const struct bond_opt_value *newval);
 static int bond_option_use_carrier_set(struct bonding *bond,
 				       const struct bond_opt_value *newval);
 static int bond_option_arp_interval_set(struct bonding *bond,
@@ -424,6 +426,13 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
 		.desc = "Number of peer notifications to send on failover event",
 		.values = bond_num_peer_notif_tbl,
 		.set = bond_option_num_peer_notif_set
+	},
+	[BOND_OPT_PEER_NOTIF_DELAY] = {
+		.id = BOND_OPT_PEER_NOTIF_DELAY,
+		.name = "peer_notif_delay",
+		.desc = "Delay between each peer notification on failover event, in milliseconds",
+		.values = bond_intmax_tbl,
+		.set = bond_option_peer_notif_delay_set
 	}
 };
 
@@ -841,6 +850,9 @@ static int bond_option_miimon_set(struct bonding *bond,
 	if (bond->params.downdelay)
 		netdev_dbg(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
 			   bond->params.downdelay * bond->params.miimon);
+	if (bond->params.peer_notif_delay)
+		netdev_dbg(bond->dev, "Note: Updating peer_notif_delay (to %d) since it is a multiple of the miimon value\n",
+			   bond->params.peer_notif_delay * bond->params.miimon);
 	if (newval->value && bond->params.arp_interval) {
 		netdev_dbg(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
 		bond->params.arp_interval = 0;
@@ -864,52 +876,59 @@ static int bond_option_miimon_set(struct bonding *bond,
 	return 0;
 }
 
-/* Set up and down delays. These must be multiples of the
- * MII monitoring value, and are stored internally as the multiplier.
- * Thus, we must translate to MS for the real world.
+/* Set up, down and peer notification delays. These must be multiples
+ * of the MII monitoring value, and are stored internally as the
+ * multiplier. Thus, we must translate to MS for the real world.
  */
-static int bond_option_updelay_set(struct bonding *bond,
-				   const struct bond_opt_value *newval)
+static int _bond_option_delay_set(struct bonding *bond,
+				  const struct bond_opt_value *newval,
+				  const char *name,
+				  int *target)
 {
 	int value = newval->value;
 
 	if (!bond->params.miimon) {
-		netdev_err(bond->dev, "Unable to set up delay as MII monitoring is disabled\n");
+		netdev_err(bond->dev, "Unable to set %s as MII monitoring is disabled\n",
+			   name);
 		return -EPERM;
 	}
 	if ((value % bond->params.miimon) != 0) {
-		netdev_warn(bond->dev, "up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
+		netdev_warn(bond->dev,
+			    "%s (%d) is not a multiple of miimon (%d), value rounded to %d ms\n",
+			    name,
 			    value, bond->params.miimon,
 			    (value / bond->params.miimon) *
 			    bond->params.miimon);
 	}
-	bond->params.updelay = value / bond->params.miimon;
-	netdev_dbg(bond->dev, "Setting up delay to %d\n",
-		   bond->params.updelay * bond->params.miimon);
+	*target = value / bond->params.miimon;
+	netdev_dbg(bond->dev, "Setting %s to %d\n",
+		   name,
+		   *target * bond->params.miimon);
 
 	return 0;
 }
 
+static int bond_option_updelay_set(struct bonding *bond,
+				   const struct bond_opt_value *newval)
+{
+	return _bond_option_delay_set(bond, newval, "up delay",
+				      &bond->params.updelay);
+}
+
 static int bond_option_downdelay_set(struct bonding *bond,
 				     const struct bond_opt_value *newval)
 {
-	int value = newval->value;
-
-	if (!bond->params.miimon) {
-		netdev_err(bond->dev, "Unable to set down delay as MII monitoring is disabled\n");
-		return -EPERM;
-	}
-	if ((value % bond->params.miimon) != 0) {
-		netdev_warn(bond->dev, "down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
-			    value, bond->params.miimon,
-			    (value / bond->params.miimon) *
-			    bond->params.miimon);
-	}
-	bond->params.downdelay = value / bond->params.miimon;
-	netdev_dbg(bond->dev, "Setting down delay to %d\n",
-		   bond->params.downdelay * bond->params.miimon);
+	return _bond_option_delay_set(bond, newval, "down delay",
+				      &bond->params.downdelay);
+}
 
-	return 0;
+static int bond_option_peer_notif_delay_set(struct bonding *bond,
+					    const struct bond_opt_value *newval)
+{
+	int ret = _bond_option_delay_set(bond, newval,
+					 "peer notification delay",
+					 &bond->params.peer_notif_delay);
+	return ret;
 }
 
 static int bond_option_use_carrier_set(struct bonding *bond,
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 9f7d83e827c3..fd5c9cbe45b1 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -104,6 +104,8 @@ static void bond_info_show_master(struct seq_file *seq)
 		   bond->params.updelay * bond->params.miimon);
 	seq_printf(seq, "Down Delay (ms): %d\n",
 		   bond->params.downdelay * bond->params.miimon);
+	seq_printf(seq, "Peer Notification Delay (ms): %d\n",
+		   bond->params.peer_notif_delay * bond->params.miimon);
 
 
 	/* ARP information */
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 94214eaf53c5..2d615a93685e 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -327,6 +327,18 @@ static ssize_t bonding_show_updelay(struct device *d,
 static DEVICE_ATTR(updelay, 0644,
 		   bonding_show_updelay, bonding_sysfs_store_option);
 
+static ssize_t bonding_show_peer_notif_delay(struct device *d,
+					     struct device_attribute *attr,
+					     char *buf)
+{
+	struct bonding *bond = to_bond(d);
+
+	return sprintf(buf, "%d\n",
+		       bond->params.peer_notif_delay * bond->params.miimon);
+}
+static DEVICE_ATTR(peer_notif_delay, 0644,
+		   bonding_show_peer_notif_delay, bonding_sysfs_store_option);
+
 /* Show the LACP interval. */
 static ssize_t bonding_show_lacp(struct device *d,
 				 struct device_attribute *attr,
@@ -718,6 +730,7 @@ static struct attribute *per_bond_attrs[] = {
 	&dev_attr_arp_ip_target.attr,
 	&dev_attr_downdelay.attr,
 	&dev_attr_updelay.attr,
+	&dev_attr_peer_notif_delay.attr,
 	&dev_attr_lacp_rate.attr,
 	&dev_attr_ad_select.attr,
 	&dev_attr_xmit_hash_policy.attr,
diff --git a/include/net/bond_options.h b/include/net/bond_options.h
index 2a05cc349018..9d382f2f0bc5 100644
--- a/include/net/bond_options.h
+++ b/include/net/bond_options.h
@@ -63,6 +63,7 @@ enum {
 	BOND_OPT_AD_ACTOR_SYSTEM,
 	BOND_OPT_AD_USER_PORT_KEY,
 	BOND_OPT_NUM_PEER_NOTIF_ALIAS,
+	BOND_OPT_PEER_NOTIF_DELAY,
 	BOND_OPT_LAST
 };
 
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 676e7fae05a3..f7fe45689142 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -123,6 +123,7 @@ struct bond_params {
 	int fail_over_mac;
 	int updelay;
 	int downdelay;
+	int peer_notif_delay;
 	int lacp_fast;
 	unsigned int min_links;
 	int ad_select;
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 6f75bda2c2d7..4a8c02cafa9a 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -636,6 +636,7 @@ enum {
 	IFLA_BOND_AD_USER_PORT_KEY,
 	IFLA_BOND_AD_ACTOR_SYSTEM,
 	IFLA_BOND_TLB_DYNAMIC_LB,
+	IFLA_BOND_PEER_NOTIF_DELAY,
 	__IFLA_BOND_MAX,
 };
 
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h
index 5b225ff63b48..7d113a9602f0 100644
--- a/tools/include/uapi/linux/if_link.h
+++ b/tools/include/uapi/linux/if_link.h
@@ -636,6 +636,7 @@ enum {
 	IFLA_BOND_AD_USER_PORT_KEY,
 	IFLA_BOND_AD_ACTOR_SYSTEM,
 	IFLA_BOND_TLB_DYNAMIC_LB,
+	IFLA_BOND_PEER_NOTIF_DELAY,
 	__IFLA_BOND_MAX,
 };
 
-- 
2.20.1


^ permalink raw reply related

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Andrew Lunn @ 2019-06-30 17:56 UTC (permalink / raw)
  To: Karsten Wiborg; +Cc: Heiner Kallweit, nic_swsd, romieu, netdev
In-Reply-To: <3825ebc5-15bc-2787-4d73-cccbfe96a0cc@web.de>

> The vendor part of my MAC is 6e:69:73 which is interesting because
> according to some Vendor-Lookup-pages the vendor is unknown.

0x6e = 0110 1110b. Bit 1 is the Locally Administered bit. Meaning this
is not an MAC address from a vendor pool, but one generated locally.

http://www.noah.org/wiki/MAC_address

If linux were to generate a random MAC address it would also set bit
1.

What is interesting is that you say you get the same value each
time. So it most either be stored somewhere, or it is generated from
something, the board serial number, etc.

	   Andrew

^ permalink raw reply

* Re: r8169 not working on 5.2.0rc6 with GPD MicroPC
From: Heiner Kallweit @ 2019-06-30 17:42 UTC (permalink / raw)
  To: Karsten Wiborg, Andrew Lunn; +Cc: nic_swsd, romieu, netdev
In-Reply-To: <3825ebc5-15bc-2787-4d73-cccbfe96a0cc@web.de>

On 30.06.2019 18:03, Karsten Wiborg wrote:
> Hi Andrew,
> 
> On 30/06/2019 16:55, Andrew Lunn wrote:
>> Hi Karsten
>>
>> What MAC address do you get with the vendor driver? Is it the same MAC
>> address every time you reboot, or does it look random.
>>
>> The BIOS is expected to program the MAC address into the hardware. It
>> could be that the vendor driver is checking if the MAC address is
>> valid, and if not, picking a random MAC address. The mainline driver
>> does not do this.
> 
> I programmed a static DHCP-entry on my local DHCP-server so I would
> notice if the MAC address changes. Just turned the computer back on and
> received the intended IP address, so the MAC address seems to stay the
> same with the vendor driver.
> 

Vendor driver uses this code, do you see the related messages in syslog?

        if (!is_valid_ether_addr(mac_addr)) {
                netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
                          mac_addr);
                eth_hw_addr_random(dev);
                ether_addr_copy(mac_addr, dev->dev_addr);
                netif_info(tp, probe, dev, "Random ether addr %pM\n",
                           mac_addr);
                tp->random_mac = 1;
        }

> The vendor part of my MAC is 6e:69:73 which is interesting because
> according to some Vendor-Lookup-pages the vendor is unknown.
> 
> Regards,
> Karsten
> 


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox