kernel: bump 4.14 to 4.14.176
[openwrt/openwrt.git] / target / linux / generic / hack-4.14 / 902-debloat_proc.patch
index a624cb1c454c3f457d7203ab37546aa45601843d..30328b87d79e98fb4dc30901d7a9deba12e01bc6 100644 (file)
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/fs/locks.c
 +++ b/fs/locks.c
-@@ -2805,6 +2805,8 @@ static const struct file_operations proc
+@@ -2812,6 +2812,8 @@ static const struct file_operations proc
  
  static int __init proc_locks_init(void)
  {
@@ -63,7 +63,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
 --- a/fs/proc/proc_tty.c
 +++ b/fs/proc/proc_tty.c
-@@ -144,7 +144,10 @@ static const struct file_operations proc
+@@ -145,7 +145,10 @@ static const struct file_operations proc
  void proc_tty_register_driver(struct tty_driver *driver)
  {
        struct proc_dir_entry *ent;
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (!driver->driver_name || driver->proc_entry ||
            !driver->ops->proc_fops)
                return;
-@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t
+@@ -162,6 +165,9 @@ void proc_tty_unregister_driver(struct t
  {
        struct proc_dir_entry *ent;
  
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        ent = driver->proc_entry;
        if (!ent)
                return;
-@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t
+@@ -176,6 +182,9 @@ void proc_tty_unregister_driver(struct t
   */
  void __init proc_tty_init(void)
  {
@@ -189,7 +189,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
 --- a/kernel/irq/proc.c
 +++ b/kernel/irq/proc.c
-@@ -396,6 +396,9 @@ void register_irq_proc(unsigned int irq,
+@@ -418,6 +418,9 @@ void register_irq_proc(unsigned int irq,
        void __maybe_unused *irqp = (void *)(unsigned long) irq;
        char name [MAX_NAMELEN];
  
@@ -199,7 +199,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))
                return;
  
-@@ -449,6 +452,9 @@ void unregister_irq_proc(unsigned int ir
+@@ -471,6 +474,9 @@ void unregister_irq_proc(unsigned int ir
  {
        char name [MAX_NAMELEN];
  
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (!root_irq_dir || !desc->dir)
                return;
  #ifdef CONFIG_SMP
-@@ -487,6 +493,9 @@ void init_irq_proc(void)
+@@ -509,6 +515,9 @@ void init_irq_proc(void)
        unsigned int irq;
        struct irq_desc *desc;
  
@@ -221,18 +221,18 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (!root_irq_dir)
 --- a/kernel/time/timer_list.c
 +++ b/kernel/time/timer_list.c
-@@ -389,6 +389,8 @@ static int __init init_timer_list_procfs
+@@ -390,6 +390,8 @@ static int __init init_timer_list_procfs
  {
        struct proc_dir_entry *pe;
  
 +      if (IS_ENABLED(CONFIG_PROC_STRIPPED))
 +              return 0;
-       pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);
+       pe = proc_create("timer_list", 0400, NULL, &timer_list_fops);
        if (!pe)
                return -ENOMEM;
 --- a/mm/vmalloc.c
 +++ b/mm/vmalloc.c
-@@ -2765,6 +2765,8 @@ static const struct file_operations proc
+@@ -2786,6 +2786,8 @@ static const struct file_operations proc
  
  static int __init proc_vmalloc_init(void)
  {
@@ -243,15 +243,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1944,10 +1944,12 @@ void __init init_mm_internals(void)
+@@ -1951,10 +1951,12 @@ void __init init_mm_internals(void)
        start_shepherd_timer();
  #endif
  #ifdef CONFIG_PROC_FS
 -      proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations);
--      proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations);
+-      proc_create("pagetypeinfo", 0400, NULL, &pagetypeinfo_file_operations);
 +      if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) {
 +              proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations);
-+              proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations);
++              proc_create("pagetypeinfo", 0400, NULL, &pagetypeinfo_file_operations);
 +              proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations);
 +      }
        proc_create("vmstat", 0444, NULL, &vmstat_file_operations);
@@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/core/sock.c
 +++ b/net/core/sock.c
-@@ -3383,6 +3383,8 @@ static __net_initdata struct pernet_oper
+@@ -3387,6 +3387,8 @@ static __net_initdata struct pernet_oper
  
  static int __init proto_init(void)
  {
@@ -338,7 +338,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/ipv4/fib_trie.c
 +++ b/net/ipv4/fib_trie.c
-@@ -2731,10 +2731,12 @@ static const struct file_operations fib_
+@@ -2743,10 +2743,12 @@ static const struct file_operations fib_
  
  int __net_init fib_proc_init(struct net *net)
  {
@@ -353,7 +353,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                         &fib_triestat_fops))
                goto out2;
  
-@@ -2744,17 +2746,21 @@ int __net_init fib_proc_init(struct net
+@@ -2756,17 +2758,21 @@ int __net_init fib_proc_init(struct net
        return 0;
  
  out3:
@@ -381,7 +381,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/ipv4/proc.c
 +++ b/net/ipv4/proc.c
-@@ -557,6 +557,9 @@ static __net_initdata struct pernet_oper
+@@ -559,6 +559,9 @@ static __net_initdata struct pernet_oper
  
  int __init ip_misc_proc_init(void)
  {
@@ -393,7 +393,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/ipv4/route.c
 +++ b/net/ipv4/route.c
-@@ -424,6 +424,9 @@ static struct pernet_operations ip_rt_pr
+@@ -428,6 +428,9 @@ static struct pernet_operations ip_rt_pr
  
  static int __init ip_rt_proc_init(void)
  {