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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Mar 2017 11:59:51 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Chanwoo Choi <cw00.choi@...sung.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Hans de Goede <hdegoede@...hat.com>, chanwoo@...nel.org,
        MyungJoo Ham <myungjoo.ham@...sung.com>
Subject: Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation

On Thu, Mar 30, 2017 at 11:39 AM, Chanwoo Choi <cw00.choi@...sung.com> wrote:
> This patch just uses the BIT() macro to make the code simple.

>         for (i = 0; i < edev->max_supported; i++) {
>                 count += sprintf(buf + count, "%s=%d\n",
>                                 extcon_info[edev->supported_cable[i]].name,
> -                                !!(edev->state & (1 << i)));
> +                                !!(edev->state & BIT(i)));
>         }

While change is okay, the above code is fragile. There is a potential
buffer overflow.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ