1. 05 1月, 2016 1 次提交
  2. 27 12月, 2015 5 次提交
  3. 19 12月, 2015 1 次提交
  4. 17 12月, 2015 31 次提交
  5. 16 12月, 2015 1 次提交
    • D
      powerpc: Remove broken GregorianDay() · 00b912b0
      Daniel Axtens 提交于
      GregorianDay() is supposed to calculate the day of the week
      (tm->tm_wday) for a given day/month/year. In that calcuation it
      indexed into an array called MonthOffset using tm->tm_mon-1. However
      tm_mon is zero-based, not one-based, so this is off-by-one. It also
      means that every January, GregoiranDay() will access element -1 of
      the MonthOffset array.
      
      It also doesn't appear to be a correct algorithm either: see in
      contrast kernel/time/timeconv.c's time_to_tm function.
      
      It's been broken forever, which suggests no-one in userland uses
      this. It looks like no-one in the kernel uses tm->tm_wday either
      (see e.g. drivers/rtc/rtc-ds1305.c:319).
      
      tm->tm_wday is conventionally set to -1 when not available in
      hardware so we can simply set it to -1 and drop the function.
      (There are over a dozen other drivers in drivers/rtc that do
      this.)
      
      Found using UBSAN.
      
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andrew Morton <akpm@linux-foundation.org> # as an example of what UBSan finds.
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Cc: rtc-linux@googlegroups.com
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      00b912b0
  6. 14 12月, 2015 1 次提交
    • R
      selftests/powerpc: Add test to check if VSRs are corrupted · 5f337e3e
      Rashmica Gupta 提交于
      When a transaction is aborted, VSR values should rollback to the
      checkpointed values before the transaction began. VSRs used elsewhere in
      the kernel during a transaction, or while the transaction is suspended
      should not affect the checkpointed values.
      
      Prior to the bug fix in commit d31626f7 ("powerpc: Don't corrupt
      transactional state when using FP/VMX in kernel") when VMX was requested
      by the kernel the .vr_state (which held the checkpointed state of VSRs
      before the transaction) was overwritten with the current state from
      outside the transation. Thus if the transaction did not complete, the
      VSR values would be "rolled back" to potentially incorrect values.
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5f337e3e