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]
Date:   Wed, 16 Mar 2022 13:17:16 +0800
From:   Baoquan He <bhe@...hat.com>
To:     "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, "H . Peter Anvin" <hpa@...or.com>,
        linux-kernel@...r.kernel.org, Dave Young <dyoung@...hat.com>,
        Vivek Goyal <vgoyal@...hat.com>,
        Eric Biederman <ebiederm@...ssion.com>,
        kexec@...ts.infradead.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        devicetree@...r.kernel.org, Jonathan Corbet <corbet@....net>,
        linux-doc@...r.kernel.org, Randy Dunlap <rdunlap@...radead.org>,
        Feng Zhou <zhoufeng.zf@...edance.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>,
        Chen Zhou <dingguo.cz@...group.com>,
        John Donnelly <John.p.donnelly@...cle.com>,
        Dave Kleikamp <dave.kleikamp@...cle.com>
Subject: Re: [PATCH v21 1/5] kdump: return -ENOENT if required cmdline option
 does not exist

On 03/15/22 at 09:32pm, Leizhen (ThunderTown) wrote:
> 
> 
> On 2022/3/15 20:21, Baoquan He wrote:
> > On 03/15/22 at 07:57pm, Baoquan He wrote:
> >> On 02/27/22 at 11:07am, Zhen Lei wrote:
> >>> The crashkernel=Y,low is an optional command-line option. When it doesn't
> >>> exist, kernel will try to allocate minimum required memory below 4G
> >>> automatically. Give it a unique error code to distinguish it from other
> >>> error scenarios.
> >>>
> >>> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
> >>> ---
> >>>  kernel/crash_core.c | 3 +--
> >>>  1 file changed, 1 insertion(+), 2 deletions(-)
> >>>
> >>> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
> >>> index 256cf6db573cd09..4d57c03714f4e13 100644
> >>> --- a/kernel/crash_core.c
> >>> +++ b/kernel/crash_core.c
> >>> @@ -243,9 +243,8 @@ static int __init __parse_crashkernel(char *cmdline,
> >>>  	*crash_base = 0;
> >>>  
> >>>  	ck_cmdline = get_last_crashkernel(cmdline, name, suffix);
> >>> -
> >>>  	if (!ck_cmdline)
> >>> -		return -EINVAL;
> >>> +		return -ENOENT;
> >>
> >> Firstly, I am not sure if '-ENOENT' is a right value to return. From the
> >> code comment of ENOENT, it's used for file or dir?
> >> #define ENOENT           2      /* No such file or directory */
> 
> This error code does not return to user mode, so there is no problem.
> There are a lot of places in the kernel that are used this way. For example:
> 
> int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)
> {
> 	if (!cpu_stop_queue_work(cpu, &work))
> 		return -ENOENT;

OK, it's fine to me. Thanks for the investigation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ