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] [day] [month] [year] [list]
Date: Tue, 23 Apr 2024 13:39:33 +0200
From: Nam Cao <namcao@...utronix.de>
To: Thomas Zimmermann <tzimmermann@...e.de>
Cc: Jaya Kumar <jayalk@...works.biz>, Daniel Vetter <daniel@...ll.ch>,
	Helge Deller <deller@....de>,
	Javier Martinez Canillas <javierm@...hat.com>,
	linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org, tiwai@...e.de, bigeasy@...utronix.de,
	patrik.r.jakobsson@...il.com,
	Vegard Nossum <vegard.nossum@...cle.com>,
	George Kennedy <george.kennedy@...cle.com>,
	Darren Kenny <darren.kenny@...cle.com>, chuansheng.liu@...el.com,
	Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
	stable@...r.kernel.org
Subject: Re: [PATCH] fbdev: fix incorrect address computation in deferred IO

On Tue, Apr 23, 2024 at 01:27:09PM +0200, Thomas Zimmermann wrote:
> Am 23.04.24 um 11:55 schrieb Nam Cao:
..
> > > The page-fault handler at [1] use vm_fault.pgoff to retrieve the page
> > > structure. Can we do the same here and avoid that computation?
> > Yes, thanks for the suggestion.
> > 
> > It will change things a bit: offset will not be the exact value anymore,
> > but will be rounded down to multiple of PAGE_SIZE. But that doesn't matter,
> > because it will only be used to calculate the page offset later on.
> > 
> > We can clean this up and rename this "offset" to "pg_offset". But that's
> > for another day.
> 
> But can't we use struct vm_fault.pgoff directly? The page-fault handler has
> used it since forever. The look-up code for the pageref should probably do
> the same, because there's a 1:1 connection between the page and the pageref.
> The pageref structure only exists because we cannot store its data in struct
> page directly.
> 
> AFAICT pgoff is exactly the value want to compute. See [1] and  the
> calculation at [2].

Completely agree. I just wanted to point out that the value inside the
variable "offset" won't be the same as before, but it's still correct.

I just tested the patch on real hardware, will send it shortly.

Best regards,
Nam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ