Re: [PATCH net-next v6 08/14] net/smc: Introduce generic netlink interface for diagnostic purposes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Nov 2020 21:39:10 +0100 Karsten Graul wrote:
> +/* SMC_GENL family definition */
> +struct genl_family smc_gen_nl_family __ro_after_init = {
> +	.hdrsize = 0,
> +	.name = SMC_GENL_FAMILY_NAME,
> +	.version = SMC_GENL_FAMILY_VERSION,
> +	.maxattr = SMC_GEN_MAX,
> +	.netnsok = true,
> +	.module = THIS_MODULE,
> +	.ops = smc_gen_nl_ops,
> +	.n_ops =  ARRAY_SIZE(smc_gen_nl_ops)
> +};

Sorry, one more spin.

Now you'll let any attribute in. We try to reject any input that won't
be acted on in the kernel these days to allow the interfaces to be
extended in the future without worrying that something that was
throwing random data in the messages will suddenly start misbehaving.

You should still declare a policy just make it empty. And you can make
the policy array size 1, and set .maxattr to 1, AFAIK. These are both
pretty much* for input validation only.

* the only exception is dumping the policy to be able to tell types in
  user space automatically, but I don't think you'll care.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux