Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3542237pxb; Mon, 24 Jan 2022 11:49:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFFIERE0M4wR28JR6c1wFbNDcaHhjaXpoLiWFH4tH2GrYumQ1lTr90AHObMQyZllwCZ3Uo X-Received: by 2002:a17:902:ce8e:b0:14b:3589:6c30 with SMTP id f14-20020a170902ce8e00b0014b35896c30mr9974811plg.61.1643053758812; Mon, 24 Jan 2022 11:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053758; cv=none; d=google.com; s=arc-20160816; b=1ELD2LdW0Vpbn5bqQqDjQxW/Cy9VCPa6y7qdI1I/l2fqrMOcX61u4kQscYjKB37TdE NfRtq9R3sqye2vTbi2rOS6emNcoin6xRN/qKHFV86bssp0PYSHToseQ0nYMSCJRVxNP7 KNCdSjlApQ9UurLhTJUMKP+Er0rzANqk3T+3TbQ3U4fRnOVqxOBKU76a/+/DOcckBHMW EdLyQneae5KrvL1kBfPmONdmBqFlKcOub0npFHw+RGxCIe2bBzLkhohxTjBMXAxvoUVj /tdwGGHayyHYcF55CHY6Vfaop3OM+7A6GYDAykBh43Mv+ozAG/mB8oLawSInL7kJdhm5 g6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kp+2Q3QLxWnCUmTGCUqJeVTafIKYNKQMJyZMylxx2h8=; b=roKCWBZP6/kBVkJT56EF8gzSTPh4cGH9xYKorILeEq/KEIb6fqNWDKSqgKALfcPS2G uAczCZXGw/CLEl1k6KDrIYRe7rrpa1XZsAnn91/aMvgW0V/xVqhGOKCZ7FrDIun3Wp7o bvCJ1hWIVbR8b1NIDt1XXUy5jwzcu0JrLsbuBtHfeaWKHl+E3lDS6mCC7naRZHJXRH4c HbOojfMdwKq5WgXjwwqYcUN/l1W7K1ikvTPBRmSPxfkKbvu/B8eX4Cu7HK/pRmbTpuOQ YmnMn23fSn/diLcn3vTjy6LcHXfhZzghzzsHfHz4cfXhddo9xoCi842GyJ/oFy6GP5V1 Pmyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OU7GvARn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si1039588plh.181.2022.01.24.11.49.06; Mon, 24 Jan 2022 11:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OU7GvARn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244926AbiAXSEY (ORCPT + 99 others); Mon, 24 Jan 2022 13:04:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244881AbiAXSEJ (ORCPT ); Mon, 24 Jan 2022 13:04:09 -0500 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A08C06173D for ; Mon, 24 Jan 2022 10:04:08 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1643047446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kp+2Q3QLxWnCUmTGCUqJeVTafIKYNKQMJyZMylxx2h8=; b=OU7GvARnGOLtlQZDocwMze8JHtUIBg/v2thX0JTm7vOM50wiRONN3Lgecvw2z4F8OiCNaR rUEllo3gu9hLdt5H/vImDY88hg2AbwP6AoZIFzEtEIF7ya1g8dLfgCuYWd1I5lq2mdvu6U PUVTSS2nmCMZUKA7Sa5fYJdTKYtZMCM= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v6 16/39] kasan: define KASAN_VMALLOC_INVALID for SW_TAGS Date: Mon, 24 Jan 2022 19:02:24 +0100 Message-Id: <1daaaafeb148a7ae8285265edc97d7ca07b6a07d.1643047180.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov In preparation for adding vmalloc support to SW_TAGS KASAN, provide a KASAN_VMALLOC_INVALID definition for it. HW_TAGS KASAN won't be using this value, as it falls back onto page_alloc for poisoning freed vmalloc() memory. Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko --- mm/kasan/kasan.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 952cd6f9ca46..020f3e57a03f 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -71,18 +71,19 @@ static inline bool kasan_sync_fault_possible(void) #define KASAN_PAGE_REDZONE 0xFE /* redzone for kmalloc_large allocations */ #define KASAN_KMALLOC_REDZONE 0xFC /* redzone inside slub object */ #define KASAN_KMALLOC_FREE 0xFB /* object was freed (kmem_cache_free/kfree) */ +#define KASAN_VMALLOC_INVALID 0xF8 /* unallocated space in vmapped page */ #else #define KASAN_FREE_PAGE KASAN_TAG_INVALID #define KASAN_PAGE_REDZONE KASAN_TAG_INVALID #define KASAN_KMALLOC_REDZONE KASAN_TAG_INVALID #define KASAN_KMALLOC_FREE KASAN_TAG_INVALID +#define KASAN_VMALLOC_INVALID KASAN_TAG_INVALID /* only for SW_TAGS */ #endif #ifdef CONFIG_KASAN_GENERIC #define KASAN_KMALLOC_FREETRACK 0xFA /* object was freed and has free track set */ #define KASAN_GLOBAL_REDZONE 0xF9 /* redzone for global variable */ -#define KASAN_VMALLOC_INVALID 0xF8 /* unallocated space in vmapped page */ /* * Stack redzone shadow values -- 2.25.1