1. 06 12月, 2015 1 次提交
  2. 03 12月, 2015 2 次提交
  3. 18 11月, 2015 1 次提交
  4. 23 10月, 2015 1 次提交
  5. 21 10月, 2015 1 次提交
  6. 15 10月, 2015 3 次提交
  7. 03 10月, 2015 1 次提交
  8. 29 9月, 2015 2 次提交
  9. 28 9月, 2015 1 次提交
  10. 26 9月, 2015 2 次提交
    • T
      EDAC: Fix sysfs dimm_label store operation · 438470b8
      Toshi Kani 提交于
      Sysfs "dimm_label" and "chX_dimm_label" nodes have the following issues
      in their store operation:
      
       1) A newline-terminated input string causes redundant newlines:
      
        # echo "test" > /sys/bus/mc0/devices/dimm0/dimm_label
        # cat  /sys/bus/mc0/devices/dimm0/dimm_label
        test
      
        #  od -bc /sys/bus/mc0/devices/dimm0/dimm_label
        0000000 164 145 163 164 012 012
                  t   e   s   t  \n  \n
        0000006
      
       2) The original label string (31 characters) cannot be stored due to
          an improper size check:
      
        # echo "CPU_SrcID#0_Ha#0_Chan#0_DIMM#0" > /sys/bus/mc0/devices/dimm0/dimm_label
        # cat /sys/bus/mc0/devices/dimm0/dimm_label
      
        # od -bc /sys/bus/mc0/devices/dimm0/dimm_label
         0000000 012 012
                  \n  \n
         0000002
      
       3) An input string longer than the buffer size results a wrong label
          info as it allows a retry with the remaining string:
      
        # echo "CPU_SrcID#0_Ha#0_Chan#0_DIMM#0_TEST" > /sys/bus/mc0/devices/dimm0/dimm_label
        # cat  /sys/bus/mc0/devices/dimm0/dimm_label
        _TEST
      
      Fix these issues by making the following changes:
       1) Replace a newline character at the end by setting a null. It also
          assures that the string is null-terminated in the label buffer.
       2) Check the label buffer size with 'sizeof(dimm->label)'.
       3) Fail a request if its string exceeds the label buffer size.
      Signed-off-by: NToshi Kani <toshi.kani@hpe.com>
      Acked-by: NTony Luck <tony.luck@intel.com>
      Cc: linux-edac <linux-edac@vger.kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Robert Elliott <elliott@hpe.com>
      Link: http://lkml.kernel.org/r/1443121564.25474.160.camel@hpe.comSigned-off-by: NBorislav Petkov <bp@suse.de>
      438470b8
    • T
      EDAC: Fix sysfs dimm_label show operation · 1ea62c59
      Toshi Kani 提交于
      After
      
        7d375bff ("sb_edac: Fix support for systems with two home agents per socket")
      
      sysfs "dimm_label" and "chX_dimm_label" show their label string without a
      newline "\n" at the end.
      
        [root@orange ~]# cat /sys/bus/mc0/devices/dimm0/dimm_label
        CPU_SrcID#0_Ha#0_Chan#0_DIMM#0[root@orange ~]#
      
        [root@orange ~]# cat /sys/devices/system/edac/mc/mc0/csrow0/ch0_dimm_label
        CPU_SrcID#0_Ha#0_Chan#0_DIMM#0[root@orange ~]#
      
      The label strings now have 31 characters, which are the same as
      EDAC_MC_LABEL_LEN. Since the snprintf()s in channel_dimm_label_show()
      and dimmdev_label_show() limit the whole length by EDAC_MC_LABEL_LEN,
      the newline in the format "%s\n" is ignored.
      
        [root@orange ~]# od -bc /sys/bus/mc0/devices/dimm0/dimm_label
        0000000 103 120 125 137 123 162 143 111 104 043 060 137 110 141 043 060
                  C   P   U   _   S   r   c   I   D   #   0   _   H   a   #   0
        0000020 137 103 150 141 156 043 060 137 104 111 115 115 043 060 000
                  _   C   h   a   n   #   0   _   D   I   M   M   #   0  \0
        0000037
      
      Fix it by using 'sizeof(dimm->label) + 1' as the whole length in the
      snprintf()s in channel_dimm_label_show() and dimmdev_label_show().
      Reported-by: NRobert Elliott <elliott@hpe.com>
      Signed-off-by: NToshi Kani <toshi.kani@hpe.com>
      Acked-by: NTony Luck <tony.luck@intel.com>
      Cc: linux-edac <linux-edac@vger.kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Link: http://lkml.kernel.org/r/1442933883-21587-2-git-send-email-toshi.kani@hpe.comSigned-off-by: NBorislav Petkov <bp@suse.de>
      1ea62c59
  11. 25 9月, 2015 4 次提交
  12. 23 9月, 2015 5 次提交
  13. 22 9月, 2015 1 次提交
  14. 09 9月, 2015 2 次提交
  15. 13 8月, 2015 4 次提交
  16. 14 7月, 2015 1 次提交
  17. 10 7月, 2015 1 次提交
  18. 02 7月, 2015 1 次提交
  19. 25 6月, 2015 6 次提交