Message ID | 20201222200317.GjVde9W0u%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=3xAm=F2=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23ADC433DB for <linux-mm@archiver.kernel.org>; Tue, 22 Dec 2020 20:04:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D42A20700 for <linux-mm@archiver.kernel.org>; Tue, 22 Dec 2020 20:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D42A20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 558B48D0050; Tue, 22 Dec 2020 15:03:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E3A38D004D; Tue, 22 Dec 2020 15:03:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ADFF8D0050; Tue, 22 Dec 2020 15:03:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 2133E8D004D for <linux-mm@kvack.org>; Tue, 22 Dec 2020 15:03:20 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DEDC61EE6 for <linux-mm@kvack.org>; Tue, 22 Dec 2020 20:03:19 +0000 (UTC) X-FDA: 77621992518.30.week92_4e0930927462 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id B68D9180B3C94 for <linux-mm@kvack.org>; Tue, 22 Dec 2020 20:03:19 +0000 (UTC) X-HE-Tag: week92_4e0930927462 X-Filterd-Recvd-Size: 3890 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf30.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Tue, 22 Dec 2020 20:03:19 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B031E21D1B; Tue, 22 Dec 2020 20:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608667398; bh=yp1OULphLpM+nd+iKILWI/XZeC4mNqXX649a/tA6Mm4=; h=Date:From:To:Subject:In-Reply-To:From; b=Lquvbzc4+EdHIhl/btBLVR1892D+s+BFC5QQJuR+vs8mFfEy4CwBZGQaupIWfwgpp 1la0MEN07txM4K+7ZkNAEGFeb07yXNfgjsN1GvNocM26Xiu3rZU9Qa9bG9GGaWn9ri 2fwVAIXud6xf+nDWhLV0tydS93j1eH7z/fihSzIE= Date: Tue, 22 Dec 2020 12:03:17 -0800 From: Andrew Morton <akpm@linux-foundation.org> To: akpm@linux-foundation.org, andreyknvl@google.com, aryabinin@virtuozzo.com, Branislav.Rankov@arm.com, catalin.marinas@arm.com, dvyukov@google.com, elver@google.com, eugenis@google.com, glider@google.com, gor@linux.ibm.com, kevin.brodsky@arm.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, vincenzo.frascino@arm.com, will.deacon@arm.com Subject: [patch 55/60] kasan: don't round_up too much Message-ID: <20201222200317.GjVde9W0u%akpm@linux-foundation.org> In-Reply-To: <20201222115844.d30aaef7df6f5b120d3e0c3d@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[01/60] kasan: drop unnecessary GPL text from comment headers
|
expand
|
--- a/mm/kasan/common.c~kasan-dont-round_up-too-much +++ a/mm/kasan/common.c @@ -213,9 +213,7 @@ void __kasan_unpoison_object_data(struct void __kasan_poison_object_data(struct kmem_cache *cache, void *object) { - poison_range(object, - round_up(cache->object_size, KASAN_GRANULE_SIZE), - KASAN_KMALLOC_REDZONE); + poison_range(object, cache->object_size, KASAN_KMALLOC_REDZONE); } /* @@ -288,7 +286,6 @@ static bool ____kasan_slab_free(struct k { u8 tag; void *tagged_object; - unsigned long rounded_up_size; tag = get_tag(object); tagged_object = object; @@ -309,8 +306,7 @@ static bool ____kasan_slab_free(struct k return true; } - rounded_up_size = round_up(cache->object_size, KASAN_GRANULE_SIZE); - poison_range(object, rounded_up_size, KASAN_KMALLOC_FREE); + poison_range(object, cache->object_size, KASAN_KMALLOC_FREE); if (!kasan_stack_collection_enabled()) return false; --- a/mm/kasan/shadow.c~kasan-dont-round_up-too-much +++ a/mm/kasan/shadow.c @@ -82,6 +82,7 @@ void poison_range(const void *address, s * addresses to this function. */ address = kasan_reset_tag(address); + size = round_up(size, KASAN_GRANULE_SIZE); shadow_start = kasan_mem_to_shadow(address); shadow_end = kasan_mem_to_shadow(address + size);