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: <ZxEISOhaqRvHlc3U@ryzen.lan>
Date: Thu, 17 Oct 2024 14:51:20 +0200
From: Niklas Cassel <cassel@...nel.org>
To: Ryan Roberts <ryan.roberts@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Anshuman Khandual <anshuman.khandual@....com>,
	Ard Biesheuvel <ardb@...nel.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Damien Le Moal <dlemoal@...nel.org>,
	David Hildenbrand <david@...hat.com>,
	Greg Marsden <greg.marsden@...cle.com>,
	Ivan Ivanov <ivan.ivanov@...e.com>,
	Kalesh Singh <kaleshsingh@...gle.com>,
	Marc Zyngier <maz@...nel.org>, Mark Rutland <mark.rutland@....com>,
	Matthias Brugger <mbrugger@...e.com>,
	Miroslav Benes <mbenes@...e.cz>, Will Deacon <will@...nel.org>,
	linux-arm-kernel@...ts.infradead.org, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Kees Cook <kees@...nel.org>,
	"Gustavo A. R. Silva" <gustavoars@...nel.org>
Subject: Re: [RFC PATCH v1 34/57] sata_sil24: Remove PAGE_SIZE compile-time
 constant assumption

On Thu, Oct 17, 2024 at 01:42:22PM +0100, Ryan Roberts wrote:
> On 17/10/2024 10:09, Niklas Cassel wrote:

(snip)

> > As you might know, there is an effort to annotate all flexible array
> > members with their run-time size information, see commit:
> > dd06e72e68bc ("Compiler Attributes: Add __counted_by macro")
> 
> I'm vaguely aware of it. But as I understand it, __counted_by() nominates
> another member in the struct which keeps the count? In this case, there is no
> such member, it's size is implicit based on the value of PAGE_SIZE. So I'm not
> sure if it's practical to use it here?

Neither am I :)

Perhaps some of the flexible array member experts like
Kees Cook or Gustavo A. R. Silva could help us out here.

Would it make sense to add another struct member and simply initialize
it to PAGE_SIZE, in order to be able to use the __counted_by macro?


> 
> > 
> > I haven't looked at the DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST macro, but since
> 
> DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(), when doing a boot-time page size build,
> defers the initialization of the global variable to kernel init time, when
> PAGE_SIZE is known. Because SIL24_MAX_SGE is defined in terms of PAGE_SIZE, this
> deferral is required.
> 
> > sge[] now becomes a flexible array member, I think it would be nice if it
> > would be possible to somehow use the __counted_by macro.
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ