1. 13 Dec, 2018 36 commits
  2. 08 Dec, 2018 4 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.14.87 · ca48e5e3
      Greg Kroah-Hartman authored
      ca48e5e3
    • Guoqing Jiang's avatar
      tipc: use destination length for copy string · 88b58409
      Guoqing Jiang authored
      commit 29e270fc upstream.
      
      Got below warning with gcc 8.2 compiler.
      
      net/tipc/topsrv.c: In function ‘tipc_topsrv_start’:
      net/tipc/topsrv.c:660:2: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
        strncpy(srv->name, name, strlen(name) + 1);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      net/tipc/topsrv.c:660:27: note: length computed here
        strncpy(srv->name, name, strlen(name) + 1);
                                 ^~~~~~~~~~~~
      So change it to correct length and use strscpy.
      Signed-off-by: default avatarGuoqing Jiang <gqjiang@suse.com>
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      88b58409
    • Arnd Bergmann's avatar
      net: qed: use correct strncpy() size · 02dc6882
      Arnd Bergmann authored
      commit 11f71108 upstream.
      
      passing the strlen() of the source string as the destination
      length is pointless, and gcc-8 now warns about it:
      
      drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump':
      include/linux/string.h:253: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
      
      This changes qed_grc_dump_big_ram() to instead uses the length of
      the destination buffer, and use strscpy() to guarantee nul-termination.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      02dc6882
    • Roman Gushchin's avatar
      mm: hide incomplete nr_indirectly_reclaimable in /proc/zoneinfo · c29f9010
      Roman Gushchin authored
      [fixed differently upstream, this is a work-around to resolve it for 4.14.y]
      
      Yongqin reported that /proc/zoneinfo format is broken in 4.14
      due to commit 7aaf7727 ("mm: don't show nr_indirectly_reclaimable
      in /proc/vmstat")
      
      Node 0, zone      DMA
        per-node stats
            nr_inactive_anon 403
            nr_active_anon 89123
            nr_inactive_file 128887
            nr_active_file 47377
            nr_unevictable 2053
            nr_slab_reclaimable 7510
            nr_slab_unreclaimable 10775
            nr_isolated_anon 0
            nr_isolated_file 0
            <...>
            nr_vmscan_write 0
            nr_vmscan_immediate_reclaim 0
            nr_dirtied   6022
            nr_written   5985
                         74240
            ^^^^^^^^^^
        pages free     131656
      
      The problem is caused by the nr_indirectly_reclaimable counter,
      which is hidden from the /proc/vmstat, but not from the
      /proc/zoneinfo. Let's fix this inconsistency and hide the
      counter from /proc/zoneinfo exactly as from /proc/vmstat.
      
      BTW, in 4.19+ the counter has been renamed and exported by
      the commit b29940c1 ("mm: rename and change semantics of
      nr_indirectly_reclaimable_bytes"), so there is no such a problem
      anymore.
      
      Cc: <stable@vger.kernel.org> # 4.14.x-4.18.x
      Fixes: 7aaf7727 ("mm: don't show nr_indirectly_reclaimable in /proc/vmstat")
      Reported-by: default avatarYongqin Liu <yongqin.liu@linaro.org>
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c29f9010