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]
Message-ID: <cf70787e-5c3a-d639-1025-7fa15d935732@embeddedor.com>
Date:   Tue, 7 May 2019 10:59:38 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Richard Weinberger <richard@....at>
Cc:     Miquel Raynal <miquel.raynal@...tlin.com>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Marek Vasut <marek.vasut@...il.com>,
        linux-mtd <linux-mtd@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] mtd: cfi_util: mark expected switch fall-throughs



On 5/7/19 10:49 AM, Richard Weinberger wrote:

>> Hi all,
>>
>> Thanks a lot for this, Richard:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/log/?h=mtd%2Fnext&qt=grep&q=fall-through
>>
>> There are only two of these warnings left to be addressed in
>> MTD[1]:
>>
>>        > @@ -3280,12 +3280,14 @@ static void onenand_check_features(struct mtd_info *mtd)
>>        >                       if ((this->version_id & 0xf) == 0xe)
>>        >                               this->options |= ONENAND_HAS_NOP_1;
>>        >               }
>>        > +             /* fall through */
>>        >
>>        >       case ONENAND_DEVICE_DENSITY_2Gb:
>>        >               /* 2Gb DDP does not have 2 plane */
>>        >               if (!ONENAND_IS_DDP(this))
>>        >                       this->options |= ONENAND_HAS_2PLANE;
>>        >               this->options |= ONENAND_HAS_UNLOCK_ALL;
>>        > +             /* fall through */
>>
>>        This looks strange.
>>
>>        In ONENAND_DEVICE_DENSITY_2Gb:
>>        ONENAND_HAS_UNLOCK_ALL is set unconditionally.
>>
>>        But then, under ONENAND_DEVICE_DENSITY_1Gb, the same option is set only
>>        if process is evaluated to true.
>>
>>        Same problem with ONENAND_HAS_2PLANE:
>>        - it is set in ONENAND_DEVICE_DENSITY_4Gb only if ONENAND_IS_DDP()
>>        - it is unset in ONENAND_DEVICE_DENSITY_2Gb only if !ONENAND_IS_DDP()
>>
>>        Maybe this portion should be reworked because I am unsure if this is a
>>        missing fall through or a bug.
>>
>>
>> Thanks
>> --
>> Gustavo
>>
>> [1] https://lore.kernel.org/patchwork/patch/1036251/
> 
> Did we miss this patch? AFAICT it is in -next too.
> 

What is pending to be resolved are these warnings:

drivers/mtd/nand/onenand/onenand_base.c: In function ‘onenand_check_features’:
drivers/mtd/nand/onenand/onenand_base.c:3264:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (ONENAND_IS_DDP(this))
      ^
drivers/mtd/nand/onenand/onenand_base.c:3284:2: note: here
  case ONENAND_DEVICE_DENSITY_2Gb:
  ^~~~
drivers/mtd/nand/onenand/onenand_base.c:3288:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
   this->options |= ONENAND_HAS_UNLOCK_ALL;
drivers/mtd/nand/onenand/onenand_base.c:3290:2: note: here
  case ONENAND_DEVICE_DENSITY_1Gb:
  ^~~~

The final version of the patch in -next does not address them.

Thanks
--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ