Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7029445ybi; Thu, 13 Jun 2019 08:23:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3NrL9rNuUiXTIvIL2dcEBON4ULIQnmU9XHhqS48sJodqPZNqdSmzckVBx7G6Ln7SQ6x1k X-Received: by 2002:a63:82c7:: with SMTP id w190mr29888213pgd.444.1560439428348; Thu, 13 Jun 2019 08:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439428; cv=none; d=google.com; s=arc-20160816; b=fA1rwtScpt2wFGtX8eRtHn/e3SJ09m04RYzsiPO06dbq+VH9m7qdAEq6pURxJAJPTI DDtI04Y9ijy1FJI0iL8Z5TcxEEXXr8PxVjTts3Y0/g8DHR8rRSFNGpd/pYUpdsuscZ4k 7Xe71Ry7/uLHUqvMbDyL5cI5oVFCAVvhv1Q13nTv9IH6DmSg5ASgmfE031m8Z5BZAA88 jiuXPhcxWNaR0xtNQjBqRyHEsoDePT0EwZiYinjOUJ4NRHkOHL1zWeAQqgxfI2gRn6Hl A5UEdJN4+RfdHyKGTbCUV6i16XywOd23ONTsfIFi3CQ7inxvdCxjT7iMBds1UVG6KWwb 6XlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=E0qsmcrJYos/k4iFhlJL0+yumW9401K1TzKguzdQ+Q8=; b=b5xsCdurzjl848r8rb4Dj7Z1FN+IQY8n+lJXmQZRwVxwCQNdTtZAvnmIYVJvf+2f+n eSoEVXY96ZhJzs/rKXboR7jzFsT49KDPW5QB1uWYbixYm/o4lRfce2Rj+b9jLUx/BT00 MPeS+6+m7GJYPuf6GLKb8IHFFoTtJLIOIiRLe2VfNk317lIdNPycBL78pQhCh9f+4doh 7+KES4ZKETCKPjL9syJPmK2ZbeA/XMt2R9ZXMeVAdofWKLYnJIX1hDU7EJinse+Oh1fS rpCVjbPmen2o0Ss+4qvCmbgF37+Gpf4ZXY58uL6yJj0c1dHVTU1vCyc0HnMHPCj3MnuY GTEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v36si54079pgl.91.2019.06.13.08.23.32; Thu, 13 Jun 2019 08:23:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732861AbfFMPVZ (ORCPT + 99 others); Thu, 13 Jun 2019 11:21:25 -0400 Received: from relay.sw.ru ([185.231.240.75]:44680 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732000AbfFMMt6 (ORCPT ); Thu, 13 Jun 2019 08:49:58 -0400 Received: from [172.16.25.12] by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1hbPAv-0001HQ-RP; Thu, 13 Jun 2019 15:49:53 +0300 Subject: Re: [PATCH v4 1/3] lib/test_kasan: Add bitops tests To: Marco Elver , peterz@infradead.org, dvyukov@google.com, glider@google.com, andreyknvl@google.com, mark.rutland@arm.com, hpa@zytor.com Cc: corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, arnd@arndb.de, jpoimboe@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kasan-dev@googlegroups.com References: <20190613123028.179447-1-elver@google.com> <20190613123028.179447-2-elver@google.com> From: Andrey Ryabinin Message-ID: <6cc5e12d-1492-d9b7-3ea7-6381407439d7@virtuozzo.com> Date: Thu, 13 Jun 2019 15:50:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190613123028.179447-2-elver@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/13/19 3:30 PM, Marco Elver wrote: > This adds bitops tests to the test_kasan module. In a follow-up patch, > support for bitops instrumentation will be added. > > Signed-off-by: Marco Elver > Acked-by: Mark Rutland > --- Reviewed-by: Andrey Ryabinin > +static noinline void __init kasan_bitops(void) > +{ > + /* > + * Allocate 1 more byte, which causes kzalloc to round up to 16-bytes; > + * this way we do not actually corrupt other memory, in case > + * instrumentation is not working as intended. This sound like working instrumentation somehow save us from corrupting memory. In fact it doesn't, it only reports corruption. > + */ > + long *bits = kzalloc(sizeof(*bits) + 1, GFP_KERNEL); > + if (!bits) > + return; > +