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: Fri, 22 Dec 2023 12:35:27 +0100
From: Alexander Potapenko <glider@...gle.com>
To: Ilya Leoshkevich <iii@...ux.ibm.com>
Cc: Alexander Gordeev <agordeev@...ux.ibm.com>, Andrew Morton <akpm@...ux-foundation.org>, 
	Christoph Lameter <cl@...ux.com>, David Rientjes <rientjes@...gle.com>, Heiko Carstens <hca@...ux.ibm.com>, 
	Joonsoo Kim <iamjoonsoo.kim@....com>, Marco Elver <elver@...gle.com>, 
	Masami Hiramatsu <mhiramat@...nel.org>, Pekka Enberg <penberg@...nel.org>, 
	Steven Rostedt <rostedt@...dmis.org>, Vasily Gorbik <gor@...ux.ibm.com>, 
	Vlastimil Babka <vbabka@...e.cz>, Christian Borntraeger <borntraeger@...ux.ibm.com>, 
	Dmitry Vyukov <dvyukov@...gle.com>, Hyeonggon Yoo <42.hyeyoo@...il.com>, kasan-dev@...glegroups.com, 
	linux-kernel@...r.kernel.org, linux-mm@...ck.org, linux-s390@...r.kernel.org, 
	linux-trace-kernel@...r.kernel.org, Mark Rutland <mark.rutland@....com>, 
	Roman Gushchin <roman.gushchin@...ux.dev>, Sven Schnelle <svens@...ux.ibm.com>
Subject: Re: [PATCH v3 17/34] lib/zlib: Unpoison DFLTCC output buffers

On Thu, Dec 14, 2023 at 12:36 AM Ilya Leoshkevich <iii@...ux.ibm.com> wrote:
>
> The constraints of the DFLTCC inline assembly are not precise: they
> do not communicate the size of the output buffers to the compiler, so
> it cannot automatically instrument it.
>
> Add the manual kmsan_unpoison_memory() calls for the output buffers.
> The logic is the same as in [1].
>
> [1] https://github.com/zlib-ng/zlib-ng/commit/1f5ddcc009ac3511e99fc88736a9e1a6381168c5
>
> Reported-by: Alexander Gordeev <agordeev@...ux.ibm.com>
> Signed-off-by: Ilya Leoshkevich <iii@...ux.ibm.com>
Reviewed-by: Alexander Potapenko <glider@...gle.com>


> @@ -34,6 +37,7 @@ static inline dfltcc_cc dfltcc(
>  )
>  {
>      Byte *t2 = op1 ? *op1 : NULL;
> +    unsigned char *orig_t2 = t2;
>      size_t t3 = len1 ? *len1 : 0;
>      const Byte *t4 = op2 ? *op2 : NULL;
>      size_t t5 = len2 ? *len2 : 0;
> @@ -59,6 +63,26 @@ static inline dfltcc_cc dfltcc(
>                       : "cc", "memory");
>      t2 = r2; t3 = r3; t4 = r4; t5 = r5;
>
> +    switch (fn & DFLTCC_FN_MASK) {

It might be a good idea to add a comment explaining what this block of
code does.
(And that it is no-op in non-KMSAN builds)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ