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: <20250926095419.GAaNZiy75HDdKV4LI2@fat_crate.local>
Date: Fri, 26 Sep 2025 11:54:19 +0200
From: Borislav Petkov <bp@...en8.de>
To: wangchuanguo <wangchuanguo@...pur.com>
Cc: tony.luck@...el.com, tglx@...utronix.de, mingo@...hat.com,
	dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/mce: deal with UCE when copy clean pagecache to user
 space

On Fri, Sep 26, 2025 at 01:44:02PM +0800, wangchuanguo wrote:
> Based on copy_from_user, extending the goal to unmap,discard,
> and remap when errors occur in clean pagecache.

This does not even begin to explain why this patch exists:
 
A possible way to structure the commit message is:
 
1. Prepare the context for the explanation briefly.
 
2. Explain the problem at hand.
 
3. "It happens because of <...>"
 
4. "Fix it by doing X"
 
5. "(Potentially do Y)."
 
And some of those above are optional depending on the issue being
explained.
 
For more detailed info, see
Documentation/process/submitting-patches.rst,
Section "2) Describe your changes".
 
Also, to the tone, from Documentation/process/submitting-patches.rst:
 
 "Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
  instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
  to do frotz", as if you are giving orders to the codebase to change
  its behaviour."
 
Also, do not talk about what your patch does - that should (hopefully) be
visible from the diff itself. Rather, talk about *why* you're doing what
you're doing.

> @@ -264,8 +278,14 @@ static bool is_copy_from_user(struct pt_regs *regs)
>  		return false;
>  	}
>  
> -	if (fault_in_kernel_space(addr))
> -		return false;
> +	if (fault_in_kernel_space(addr)) {
> +		if (is_clean_pagecache(addr) && !fault_in_kernel_space(regs->di)) {
> +			//is copying clean pagecache to user space

Look at the comment style in the rest of the file before you add this //

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ