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, 25 May 2022 08:18:11 +0300
From:   baskov@...ras.ru
To:     Borislav Petkov <bp@...en8.de>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] x86: Add strlcat() to compressed kernel

Sorry for delayed reply.

On 2022-05-12 14:10, Borislav Petkov wrote:
> On Thu, May 05, 2022 at 01:32:23PM +0300, Baskov Evgeniy wrote:
>> Subject: Re: [PATCH v3 1/2] x86: Add strlcat() to compressed kernel
> 
> The tip tree preferred format for patch subject prefixes is
> 'subsys/component:', e.g. 'x86/apic:', 'x86/mm/fault:', 'sched/fair:',
> 'genirq/core:'. Please do not use file names or complete file paths as
> prefix. 'git log path/to/file' should give you a reasonable hint in 
> most
> cases.
> 
> The condensed patch description in the subject line should start with a
> uppercase letter and should be written in imperative tone.
> 
> In your case, that would be x86/boot: Add...

Thank you, I'll fix that in v4.

> 
> You can add the BUG_ON() check from the kernel proper version like 
> this:
> 
> diff --git a/arch/x86/boot/compressed/string.c
> b/arch/x86/boot/compressed/string.c
> index b0635539b6f6..643fcd957527 100644
> --- a/arch/x86/boot/compressed/string.c
> +++ b/arch/x86/boot/compressed/string.c
> @@ -46,6 +46,10 @@ size_t strlcat(char *dest, const char *src, size_t 
> count)
>  	size_t len = strlen(src);
>  	size_t res = dsize + len;
> 
> +        /* This would be a bug */
> +        if (dsize >= count)
> +		error("strlcat(): destination too big\n");
> +
>  	dest += dsize;
>  	count -= dsize;
>  	if (len >= count)
> diff --git a/arch/x86/purgatory/purgatory.c 
> b/arch/x86/purgatory/purgatory.c
> index 7558139920f8..65f0cedb65ae 100644
> --- a/arch/x86/purgatory/purgatory.c
> +++ b/arch/x86/purgatory/purgatory.c
> @@ -57,3 +57,4 @@ void purgatory(void)
>   * arch/x86/boot/compressed/string.c
>   */
>  void warn(const char *msg) {}
> +void error(char *m) {}

Ok, will do.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ