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:   Mon, 12 Jul 2021 08:09:22 +0200
From:   Christoph Hellwig <hch@....de>
To:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>
Cc:     Russell King <linux@...linux.org.uk>, Guo Ren <guoren@...nel.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Nick Hu <nickhu@...estech.com>,
        Greentime Hu <green.hu@...il.com>,
        Vincent Chen <deanbo422@...il.com>,
        Helge Deller <deller@....de>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        Geoff Levand <geoff@...radead.org>,
        Paul Cercueil <paul@...pouillou.net>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Alex Shi <alexs@...nel.org>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-parisc@...r.kernel.org,
        linux-sh@...r.kernel.org, linux-mmc@...r.kernel.org,
        linux-scsi@...r.kernel.org, linux-mm@...ck.org,
        linux-doc@...r.kernel.org
Subject: flush_kernel_dcache_page fixes and removal

Hi all,

while looking to convert the block layer away from kmap_atomic towards
kmap_local_page and prefeably the helpers that abstract it away I noticed
that a few block drivers directly or implicitly call
flush_kernel_dcache_page before kunmapping a page that has been written
to.  flush_kernel_dcache_page is documented to to be used in such cases,
but flush_dcache_page is actually required when the page could be in
the page cache and mapped to userspace, which is pretty much always the
case when kmapping an arbitrary page.  Unfortunately the documentation
doesn't exactly make that clear, which lead to this misused.  And it turns
out that only the copy_strings / copy_string_kernel in the exec code
were actually correct users of flush_kernel_dcache_page, which is why
I think we should just remove it and eat the very minor overhead in
exec rather than confusing poor driver writers.

Diffstat:
 Documentation/core-api/cachetlb.rst                    |   86 +++++++----------
 Documentation/translations/zh_CN/core-api/cachetlb.rst |    9 -
 arch/arm/include/asm/cacheflush.h                      |    4 
 arch/arm/mm/flush.c                                    |   33 ------
 arch/arm/mm/nommu.c                                    |    6 -
 arch/csky/abiv1/cacheflush.c                           |   11 --
 arch/csky/abiv1/inc/abi/cacheflush.h                   |    4 
 arch/mips/include/asm/cacheflush.h                     |    8 -
 arch/nds32/include/asm/cacheflush.h                    |    3 
 arch/nds32/mm/cacheflush.c                             |    9 -
 arch/parisc/include/asm/cacheflush.h                   |    8 -
 arch/parisc/kernel/cache.c                             |    3 
 arch/sh/include/asm/cacheflush.h                       |    8 -
 block/blk-map.c                                        |    2 
 drivers/block/ps3disk.c                                |    2 
 drivers/mmc/host/jz4740_mmc.c                          |    4 
 drivers/mmc/host/mmc_spi.c                             |    2 
 drivers/scsi/aacraid/aachba.c                          |    1 
 fs/exec.c                                              |    6 -
 include/linux/highmem.h                                |    5 
 lib/scatterlist.c                                      |    5 
 tools/testing/scatterlist/linux/mm.h                   |    1 
 22 files changed, 55 insertions(+), 165 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ