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: <CACRpkdaMnphBxvqpmvNG_72O02Umny3qdxfyrKdA4BsDwZmtfg@mail.gmail.com>
Date:   Fri, 1 Dec 2023 10:28:52 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Jorge Ramirez-Ortiz <jorge@...ndries.io>
Cc:     ulf.hansson@...aro.org, CLoehle@...erstone.com,
        adrian.hunter@...el.com, jinpu.wang@...os.com, hare@...e.de,
        beanhuo@...ron.com, asuk4.q@...il.com, yangyingliang@...wei.com,
        yibin.ding@...soc.com, victor.shih@...esyslogic.com.tw,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: rpmb: fixes pause retune on all RPMB partitions.

Hi Jorge,

thanks for your patch!

On Fri, Dec 1, 2023 at 10:10 AM Jorge Ramirez-Ortiz <jorge@...ndries.io> wrote:

> When RPMB was converted to a character device, it added support for
> multiple RPMB partitions (Commit 97548575bef3 ("mmc: block: Convert RPMB
> to a character device").
>
> One of the changes in this commit was transforming the variable
> target_part defined in __mmc_blk_ioctl_cmd into a bitmask.
>
> This inadvertedly regressed the validation check done in
> mmc_blk_part_switch_pre() and mmc_blk_part_switch_post().
>
> This commit fixes that regression.
>
> Fixes: 97548575bef3 ("mmc: block: Convert RPMB to a character device")
> Signed-off-by: Jorge Ramirez-Ortiz <jorge@...ndries.io>

My bug :/
Shouldn't we also add Cc: stable@...r.kernel.org?


> +       const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
>         int ret = 0;
>
> -       if (part_type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
> +       if (part_type & mask == mask) {

That looks complex, can't we just:

if (part_type & EXT_CSD_PART_CONFIG_ACC_RPMB)?

> +       const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
>         int ret = 0;
>
> -       if (part_type == EXT_CSD_PART_CONFIG_ACC_RPMB) {
> +       if (part_type & mask == mask) {

Dito here.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ