lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 20 Sep 2021 14:02:35 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Mianhan Liu <liumh1@...nghaitech.edu.cn>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] net/ipv4/sysctl_net_ipv4.c: remove superfluous
 header files from sysctl_net_ipv4.c

On Mon, 20 Sep 2021 21:42:00 +0800 Mianhan Liu wrote:
> sysctl_net_ipv4.c hasn't use any macro or function declared in mm.h, module.h,
> igmp.h, inetdevice.h, swap.h, slab.h, nsproxy.h, snmp.h, route.h and inet_frag.h. 
> Thus, these files can be removed from sysctl_net_ipv4.c safely without affecting
> the compilation of the net module.

How did you arrive at this conclusion? It certainly uses linux/slab.h
as it calls kmalloc(). Please don't introduce dependencies on
second-order includes. If file uses a function, define, struct etc.
from a header it should directly include that header. Just because the
code still compiles doesn't mean the change is for good.

> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index 6f1e64d49..f8e39d00b 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -6,25 +6,15 @@
>   * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS]
>   */
>  
> -#include <linux/mm.h>
> -#include <linux/module.h>
>  #include <linux/sysctl.h>
> -#include <linux/igmp.h>
> -#include <linux/inetdevice.h>
>  #include <linux/seqlock.h>
>  #include <linux/init.h>
> -#include <linux/slab.h>
> -#include <linux/nsproxy.h>
> -#include <linux/swap.h>
> -#include <net/snmp.h>
>  #include <net/icmp.h>
>  #include <net/ip.h>
>  #include <net/ip_fib.h>
> -#include <net/route.h>
>  #include <net/tcp.h>
>  #include <net/udp.h>
>  #include <net/cipso_ipv4.h>
> -#include <net/inet_frag.h>
>  #include <net/ping.h>
>  #include <net/protocol.h>
>  #include <net/netevent.h>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ