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-next>] [day] [month] [year] [list]
Date:   Fri, 20 Nov 2020 23:12:44 +0530
From:   Syed Nayyar Waris <syednwaris@...il.com>
To:     akpm@...ux-foundation.org
Cc:     andriy.shevchenko@...ux.intel.com, vilhelm.gray@...il.com,
        michal.simek@...inx.com, arnd@...db.de, rrichter@...vell.com,
        linus.walleij@...aro.org, bgolaszewski@...libre.com,
        yamada.masahiro@...ionext.com, rui.zhang@...el.com,
        daniel.lezcano@...aro.org, amit.kucheria@...durent.com,
        linux-arch@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pm@...r.kernel.org
Subject: [PATCH 0/4] Modify bitmap_set_value() to suppress compiler warning

Hi All,

The purpose of this patchset is to suppress the compiler warning (-Wtype-limits).

In function bitmap_set_value(), add explicit check to see if the value being
written into the bitmap does not fall outside the bitmap.
The situation that it is falling outside is never possible in the code 
because the boundaries are required to be correct before the function is 
called. The responsibility is on the caller for ensuring the boundaries 
are correct.
The code change is simply to silence the GCC warning messages
because GCC is not aware that the boundaries have already been checked.
As such, we're better off using __builtin_unreachable() here because we
can avoid the latency of the conditional check entirely.

Michal,
What do you think of [PATCH 4/4]? Is the conditional check needed, and also whether
returning -EINVAL looks good?

Syed Nayyar Waris (4):
  bitmap: Modify bitmap_set_value() to check bitmap length
  lib/test_bitmap.c: Modify for_each_set_clump test
  gpio: xilinx: Modify bitmap_set_value() calls
  gpio: xilinx: Add extra check if sum of widths exceed 64

 drivers/gpio/gpio-xilinx.c | 18 ++++++++++++------
 include/linux/bitmap.h     | 35 +++++++++++++++++++++--------------
 lib/test_bitmap.c          |  4 ++--
 3 files changed, 35 insertions(+), 22 deletions(-)


base-commit: b640c4e12bbe1f0b6383c3ef788a89e5427c763f
-- 
2.29.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ