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: <2024080933-jazz-supernova-9f3a@gregkh>
Date: Fri, 9 Aug 2024 07:37:49 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Martin Oliveira <martin.oliveira@...eticom.com>
Cc: linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	Artemy Kovalyov <artemyko@...dia.com>,
	Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
	Logan Gunthorpe <logang@...tatee.com>,
	Michael Guralnik <michaelgur@...dia.com>,
	Mike Marciniszyn <mike.marciniszyn@...el.com>,
	Shiraz Saleem <shiraz.saleem@...el.com>, Tejun Heo <tj@...nel.org>,
	John Hubbard <jhubbard@...dia.com>,
	Dan Williams <dan.j.williams@...el.com>,
	David Sloan <david.sloan@...eticom.com>
Subject: Re: [PATCH v5 1/4] kernfs: add a WARN_ON_ONCE if ->close is set

On Thu, Aug 08, 2024 at 12:33:37PM -0600, Martin Oliveira wrote:
> The next patch is going to remove .page_mkwrite from kernfs and will
> WARN if an mmap implementation sets .page_mkwrite.
> 
> In preparation for that change, and to make it consistent, add a WARN to
> the ->close check.
> 
> Co-developed-by: Logan Gunthorpe <logang@...tatee.com>
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
> Signed-off-by: Martin Oliveira <martin.oliveira@...eticom.com>
> ---
>  fs/kernfs/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
> index 8502ef68459b..72cc51dcf870 100644
> --- a/fs/kernfs/file.c
> +++ b/fs/kernfs/file.c
> @@ -479,7 +479,7 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
>  	 * It is not possible to successfully wrap close.
>  	 * So error if someone is trying to use close.
>  	 */
> -	if (vma->vm_ops && vma->vm_ops->close)
> +	if (WARN_ON_ONCE(vma->vm_ops && vma->vm_ops->close))

So you just rebooted a machine that hits this, loosing data everywhere.
Not nice :(


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ