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, 07 Mar 2024 16:02:22 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Sam Protsenko" <semen.protsenko@...aro.org>
Cc: "Naresh Kamboju" <naresh.kamboju@...aro.org>,
 linux-block <linux-block@...r.kernel.org>, lkft-triage@...ts.linaro.org,
 "open list" <linux-kernel@...r.kernel.org>, "Jens Axboe" <axboe@...nel.dk>,
 "Christoph Hellwig" <hch@....de>, "Christian Brauner" <brauner@...nel.org>,
 "Ulf Hansson" <ulf.hansson@...aro.org>,
 "Dan Carpenter" <dan.carpenter@...aro.org>,
 "Anders Roxell" <anders.roxell@...aro.org>,
 "jh80.chung" <jh80.chung@...sung.com>,
 "linux-mmc @ vger . kernel . org" <linux-mmc@...r.kernel.org>,
 "Oleksij Rempel" <linux@...pel-privat.de>,
 "Manuel Lauss" <manuel.lauss@...il.com>,
 "Neil Armstrong" <neil.armstrong@...aro.org>,
 "Jerome Brunet" <jbrunet@...libre.com>, yann.gautier@...s.st.com,
 ludovic.barre@...com,
 David Lanzendörfer <david.lanzendoerfer@....ch>,
 "Chen-Yu Tsai" <wens@...e.org>
Subject: Re: WinLink E850-96: WARNING: at block/blk-settings.c:204 blk_validate_limits

On Fri, Mar 1, 2024, at 22:18, Sam Protsenko wrote:
> On Fri, Mar 1, 2024 at 2:51 PM Sam Protsenko <semen.protsenko@...aro.org> wrote:
>> On Thu, Feb 29, 2024 at 8:56 AM Arnd Bergmann <arnd@...db.de> wrote:

>
> Sorry, just noticed I commented on the wrong line. Here is the change I made:
>
> -               mmc->max_seg_size = 0x1000;
> +               mmc->max_seg_size = PAGE_SIZE;

I went over all MMC drivers to see what else sets a max_seg_size
smaller than a page and found these:

drivers/mmc/host/alcor.c:       mmc->max_seg_size = AU6601_MAX_DMA_BLOCK_SIZE; // 0x1000
drivers/mmc/host/au1xmmc.c:             mmc->max_seg_size = AU1100_MMC_DESCRIPTOR_SIZE; // 64K-1
drivers/mmc/host/dw_mmc.c:              mmc->max_seg_size = 0x1000;
drivers/mmc/host/meson-gx-mmc.c:        mmc->max_seg_size = mmc->max_req_size; //  1536 bytes
drivers/mmc/host/mmci_stm32_sdmmc.c:            host->mmc->max_seg_size = host->variant->stm32_idmabsize_mask; //  GENMASK(12, 5),
drivers/mmc/host/sunxi-mmc.c:   mmc->max_seg_size       = (1 << host->cfg->idma_des_size_bits); // 1 << 13, only on arm32
drivers/mmc/host/wmt-sdmmc.c:   .max_seg_size = 65024, 

I've tried to add the maintainers to Cc here, these likely all
need attention to work with large page sizes, in case of
meson-gx-mmc it even seems like the limit is less than a 4KB
page, so it will stop working entirely.

There are also a couple of drivers that look like they have
an off-by-one error and pass a segment size of one less than
a power-off-two number, e.g.:

drivers/mmc/host/davinci_mmc.c: mmc->max_seg_size       = MAX_CCNT * rw_threshold;  // (64k-1) * 32
drivers/mmc/host/atmel-mci.c:           mmc->max_seg_size = mmc->max_blk_size * mmc->max_segs; // 4095*256

I think some of these are intentional, while others are
probably bugs.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ