From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5E65C36002 for ; Wed, 9 Apr 2025 14:49:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE9C028008B; Wed, 9 Apr 2025 10:49:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9A0F28008A; Wed, 9 Apr 2025 10:49:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC53228008B; Wed, 9 Apr 2025 10:49:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 98C6228008A for ; Wed, 9 Apr 2025 10:49:51 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id ABD21AD443 for ; Wed, 9 Apr 2025 14:49:51 +0000 (UTC) X-FDA: 83314789782.09.1A74E71 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by imf07.hostedemail.com (Postfix) with ESMTP id EB8A140005 for ; Wed, 9 Apr 2025 14:49:46 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="BL2T2/Db"; dmarc=pass (policy=none) header.from=intel.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf07.hostedemail.com: domain of maciej.wieczor-retman@intel.com designates 192.198.163.16 as permitted sender) smtp.mailfrom=maciej.wieczor-retman@intel.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1744210188; a=rsa-sha256; cv=fail; b=SgJ45WezcMDEKVqNjLbMS5rKuZnxA1YhX1X5/vexmk6qrppK056FKgaTbynWOnkU/VYgNH Viig2H4X1K5P/oCDwiWqNOKV8AsYLOaIA58qkwzRsARqsh1rHNZt5jwbo8nVVDRazo3ypF 0Ib0QIQ33KSPXmeTjyNWN+Jb3v+HgjA= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="BL2T2/Db"; dmarc=pass (policy=none) header.from=intel.com; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf07.hostedemail.com: domain of maciej.wieczor-retman@intel.com designates 192.198.163.16 as permitted sender) smtp.mailfrom=maciej.wieczor-retman@intel.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744210188; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rn39Ccd9CIrVFqvj0Vnt5e9ZTklD7AiN95Rk7cnmjDw=; b=DVVvl9GZjPrWrMymoPBEuDo8hkMOaYn8gkrZ7t/xqMQSH9N9aAho5MpnPzn8XWFgjz267V /J6c0kSiTssSA85Ncwy+NEN2Luqu7HHoRtWeFvUrLu1Go9V0IKcevWOMu9TUVw6IUvfxzo LudXn78xXjDnpQ3Uc62VX5SAVwR1s/w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744210187; x=1775746187; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=2jEOSg+5YCjvgmfMeEh/tK2w2NmxGdSnnNSS5YqpaOQ=; b=BL2T2/Dbz3enbCls1hlqLbF5Kk3gonLbmxshzFBsOfaaLejx/cvz9Mnk v2OmVU22PU5NsnwULJH0RJM/jzLRJBrSGxGh/60NR7iL71JwkPls3Euza DpZLXwMfe2W19VXWUeWYQVWzqnwEffdlF14SPrBrLMD1U15cssNTlv0RV tM7ky80rPNFNpbLD5eXKlvG71/0S2b0UrVZW3LnhxxO6Ha++K+bIqiRz7 3GFmHRUP3UXsAaSqg6Hnj3/7T0pjn66eOjjG+Kui55UX1wLG0egrdsmv7 rcElZS3kKHLCnBAFcX39SlkA5+3JkOK2jFHpqRJsg0F8XmK7JpGHbMC/d A==; X-CSE-ConnectionGUID: E4D/YQ0iQjqIXVjH4Lq0+w== X-CSE-MsgGUID: zTn1mUSJROO0BHMcd5+ReA== X-IronPort-AV: E=McAfee;i="6700,10204,11399"; a="33296507" X-IronPort-AV: E=Sophos;i="6.15,200,1739865600"; d="scan'208";a="33296507" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2025 07:49:45 -0700 X-CSE-ConnectionGUID: u5odJqvvRgeBIOQHgKQwKQ== X-CSE-MsgGUID: T5RBdYERQW+b4byDn7WdWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,200,1739865600"; d="scan'208";a="159583328" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2025 07:49:43 -0700 Received: from ORSMSX902.amr.corp.intel.com (10.22.229.24) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Wed, 9 Apr 2025 07:49:43 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Wed, 9 Apr 2025 07:49:43 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.45) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Wed, 9 Apr 2025 07:49:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xx2hpfYSGWugqdX+bKg741aN6wueI/M0U314uzCqAc7QE9kBFHDDFtHPqnETLxYSw5ObuQXWHU/E2oFpsKhETDWbbP7dS8qsGeoaG/3FXyj+Zk0bDtXUA2/GFRsg5g7qhxt1RdqCvjvRg6012QrC1uyxRbSobAG+NwH4AJjYg5cwphWEj46TwyxWXQ6iNjZMQ1SFb43eMbDtkPJO2ZMfJzE9sUisgdk5G5LuDn03AcsnGov1FSRkRfUdb9FEXwbjd8rjsMLtyDrO/IO5gdzYFwFXECwFQT5b1qZ5WMok/+qABjEqoKDHWMpgjcETcMLkaNmoM75JXJKKCLkWURnlpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FzG3cYdBwO72PLSDMRXLfAigdevmFWr/6L+gdLn8tDY=; b=DUfveKKgzqGTH6hzXxgmdPY5SiV4UY6a0ISju+TDG58cIq20Wq63e8FrUuZZUs/aHSGcHARwhaENo23XbyXw/xG3sNb9RPidtf3f7xF/s5VnE2IJpt6yWBLibNO/1bfxNgP2Kece8Co40cgfY3mJXe1sbvEQkema6kbpxIFid+sKUP0o4wfIIDtLujenp9me5sA6bNahgkrozcx9wwk/SttU53Lt/kmcVtc0imJtVzLV3X7olU+PHUM/nRF3u/3Kb+qSQE72tC97ke00RBMn3p/Jqyhi31h0L4yMO19VZmZ8NC3ZrgUTWjMRmHhdfi9B5L29iuc2Li2z7B+YRYcIow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15) by IA0PR11MB7863.namprd11.prod.outlook.com (2603:10b6:208:40c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.21; Wed, 9 Apr 2025 14:49:11 +0000 Received: from MN0PR11MB6231.namprd11.prod.outlook.com ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com ([fe80::a137:ffd0:97a3:1db4%4]) with mapi id 15.20.8606.029; Wed, 9 Apr 2025 14:49:11 +0000 Date: Wed, 9 Apr 2025 16:48:58 +0200 From: Maciej Wieczor-Retman To: Dave Hansen CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 11/14] x86: Handle int3 for inline KASAN reports Message-ID: References: <012c84049b853d6853a7d6c887ce0c2323bcd80a.1743772053.git.maciej.wieczor-retman@intel.com> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DUZPR01CA0069.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c2::12) To MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|IA0PR11MB7863:EE_ X-MS-Office365-Filtering-Correlation-Id: 704d1a6b-4b64-4316-ec9f-08dd7775b04f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X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4DZF5LHl9r5ZxBSDQBYIqSox3by/x+ingA5qqJwCV9UW67wb9cTRLRzRXB?= =?iso-8859-1?Q?Eg8F5zTgYEyif+ElS6yTakTXwrKYX0ajZ0g+6vPeC0f1HIUNBom7mutHAN?= =?iso-8859-1?Q?jwl26NOuYXNMqhxqHC58seCinEsDoA3jrlCjkEZ4s9VJh0lasQwidCv8PB?= =?iso-8859-1?Q?P+x+ndUy4MXCW7qfD5+/qXOmkCCL7xHQzkIGcumq7BpSsLASB6v/mIsV9G?= =?iso-8859-1?Q?qytO8LGOXKfErLbGWXNtW6x/736DE2dRfQn3Bpdg+usCECARe0olJWTRC7?= =?iso-8859-1?Q?mVtSYC6aMZO0iuhi/oXiM+DP5iP65RslSEFl6eucA0/IYeCpG3fnGsLVXj?= =?iso-8859-1?Q?9f876Qr63b1k8xm4tL1r+VK0M7cxFrH2PIjstpJlYIz+WqqKukUHqBuMv5?= =?iso-8859-1?Q?gVpusHS1gzt/pR9sXuvRoXzBLg9Q0JN4ZPbFuxWBYZh9JpeAkdzlkmmQ8i?= =?iso-8859-1?Q?5G9xWjEYTHPyvRGFPI8SdoOf2K2N0Qn4l0+hw2J3snkT4ECboeAIHBgo8+?= =?iso-8859-1?Q?LjFvse0uZviplxE8aKghm0lT6ZUz4i4DFo1H0hiw4awNyN9Wu9hN8chjc/?= =?iso-8859-1?Q?FgBv/fA73tIHIDEkFF6Pm43dvZDHu89eiaAwhRYVF8vambH/pOFWRELb/O?= =?iso-8859-1?Q?U=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?8DTpMCOxKcC9zCHyOQn9sBmRqRE9gi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X0O4KWhuV6DHC0QGWy3Qtlq8zqEMX+iba5FaY7BRfGN6NFUFm4JLq+Ro?= =?iso-8859-1?Q?0BfFoGTKSDxTY9x3HfCKWO8PhALmpRfH/7i2h8FhSk5tx+6JLvz2RDmBCr?= =?iso-8859-1?Q?5gxdt+cYZa24TJKFdaE7iU79IppEZn7U5sZ8P25aptRJZTpxIXB7xe4pNE?= =?iso-8859-1?Q?6uR8ind0d6DGuvVmlDgh0rYdC7bpBArhRYFbCyCz8dXAZDKqIxbTg4gLyw?= =?iso-8859-1?Q?3PnreJM6Y894XeP8/SfGk9AKRGWVBhkBp2GNH0bUz+7bUBYP7ivYeOsN0j?= =?iso-8859-1?Q?csEEzfnDqTe/5k6A6and5Khx/HCOz2GNxbklxz22UQn2QZSbb+8MDtrFGr?= =?iso-8859-1?Q?5bT2IZ0ASVN1BsEMd5jl/EQBsHzNcOudYhuZUABl1U+KUHfDEF6Cippg7t?= =?iso-8859-1?Q?hd3GTrNbos42kux8eRs4fmzefMwaQZnD9zLQ2HbsKzUYd26c+DhxLuLXJT?= =?iso-8859-1?Q?cbwXgWoLTvhXMK7AVnIg2T+Lllpyv9pu0uULsk86R6YKb7flFtVjVvNqbt?= =?iso-8859-1?Q?GM62Gujd/2O6lYM7HR3CVgKUjHoeHwDOvD+dDvQodFjo9ezNUJ+sZOhBrn?= =?iso-8859-1?Q?+C06BZwVCSB0fIUfS9UBWa5GDZD4Vp/+e7pWJsbvtYJoFAfaXadcY/aJcA?= =?iso-8859-1?Q?GWkDTyT+hp6ICWfaobw9ro4d1NVYHSlt74im5TOB8nSDvuWB5eojhqWe/7?= =?iso-8859-1?Q?Xwvib7S0e2Uj+U+upuXVkLz08TUxApGMf6/I92OoduAC7P9WwbE1yhHCtx?= =?iso-8859-1?Q?Q6nuK98vtGOAusdBKk0=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 704d1a6b-4b64-4316-ec9f-08dd7775b04f X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2025 14:49:11.1393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ElTqV2GOykO6W8MNVcTeIulNL2XFhe4QRmb72/uKGyEIgqpCWH1/m67aO6zSkAtwlOjSoD6d3L0w5ciimM7mB/pauAHeyEu5MfiVb+KQSNY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7863 X-OriginatorOrg: intel.com X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EB8A140005 X-Stat-Signature: iuab4rwbx9mqyutjzd581wrqukz3drz7 X-HE-Tag: 1744210186-112317 X-HE-Meta: U2FsdGVkX19TjkebuFCNlnXROJmCPNeMnglU6/i5LTIY3chMoxWP7KemT4lEy5cF4BE1IUSVbjqACb4vnonLEM/r+3XdMwB6LVn8hjahhYZ/jme+BAGqmAMSjkBBU0g3qnZuXmpVzkuOwwXHCkUoN5lKdJEkmTUc+0G/K2zstBf0LDd9Q9PjbnBT//NGTEjg6mrSV1uVkkdtfha16LKZHcLu0AzFm/opz8MIoU84K+3YXiMRLNmEpTIYhy/CCdXqUG+UK89p7GSsx+eWlylwhDnVmD+4zVzkAKKsAoRk+Srn+eFo3qnNOivNHDyov5+DBUR9wFqM45BBefZF0TjaZwBr0hcmW5spcT4rkEzvweByh+k+e5do4rhMbM2h5DKZ40EQ+uQ0IpqopibulSN8MW9Mr4isTfSXYZlf7t3sFcbYVHBbLCjiXdbq/z/YZSLuD2izEgbefGmY1Ed/+JuygF/iPwNeWNa2djogbPeP9tQ6SVpF00UK2oHVv+b7o1PKi1HSvYn1v4mU1HU5ivQV/rOmZ8wmPOCyoO8lK0c1cA5Tj22If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ulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2025-04-04 at 10:55:09 -0700, Dave Hansen wrote: >On 4/4/25 06:14, Maciej Wieczor-Retman wrote: >> When a tag mismatch happens in inline software tag-based KASAN on x86 an >> int3 instruction is executed and needs proper handling. > >Does this mean "inline software"? Or "inline" functions? I'm not quite >parsing that. I think it needs some more background. Both software KASAN modes (generic and tag-based) have an inline and outline variant. So I was referring to the inline mode in software tag-based mode. I'm mentioning "software" since there is also the "hardware" mode. > >> Call kasan_report() from the int3 handler and pass down the proper >> information from registers - RDI should contain the problematic address >> and RAX other metadata. >> >> Also early return from the int3 selftest if inline KASAN is enabled >> since it will cause a kernel panic otherwise. >... >> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c >> index bf82c6f7d690..ba277a25b57f 100644 >> --- a/arch/x86/kernel/alternative.c >> +++ b/arch/x86/kernel/alternative.c >> @@ -1979,6 +1979,9 @@ static noinline void __init int3_selftest(void) >> }; >> unsigned int val = 0; >> >> + if (IS_ENABLED(CONFIG_KASAN_INLINE)) >> + return; > >Comments, please. This is a total non sequitur otherwise. Sure, will add. > >> BUG_ON(register_die_notifier(&int3_exception_nb)); >> >> /* >> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c >> index 9f88b8a78e50..32c81fc2d439 100644 >> --- a/arch/x86/kernel/traps.c >> +++ b/arch/x86/kernel/traps.c >... >> @@ -849,6 +850,51 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) >> cond_local_irq_disable(regs); >> } >> >> +#ifdef CONFIG_KASAN_SW_TAGS >> + >> +#define KASAN_RAX_RECOVER 0x20 >> +#define KASAN_RAX_WRITE 0x10 >> +#define KASAN_RAX_SIZE_MASK 0x0f >> +#define KASAN_RAX_SIZE(rax) (1 << ((rax) & KASAN_RAX_SIZE_MASK)) > >This ABI _looks_ like it was conjured out out of thin air. I assume it's >coming from the compiler. Any pointers to that ABI definition in or out >of the kernel would be appreciated. I'll put a comment that it's related to compilare ABI and I'll add a link to the relevant compiler file in the patch message. > >> +static bool kasan_handler(struct pt_regs *regs) >> +{ >> + int metadata = regs->ax; >> + u64 addr = regs->di; >> + u64 pc = regs->ip; >> + bool recover = metadata & KASAN_RAX_RECOVER; >> + bool write = metadata & KASAN_RAX_WRITE; >> + size_t size = KASAN_RAX_SIZE(metadata); > >"metadata" is exactly the same length as "regs->ax", so it seems a >little silly. Also, please use vertical alignment as a tool to make code >more readable. Isn't this much more readable? > > bool recover = regs->ax & KASAN_RAX_RECOVER; > bool write = regs->ax & KASAN_RAX_WRITE; > size_t size = KASAN_RAX_SIZE(regs->ax); > u64 addr = regs->di; > u64 pc = regs->ip; > Thanks, I'll apply this. >> + if (!IS_ENABLED(CONFIG_KASAN_INLINE)) >> + return false; >> + >> + if (user_mode(regs)) >> + return false; >> + >> + kasan_report((void *)addr, size, write, pc); >> + >> + /* >> + * The instrumentation allows to control whether we can proceed after >> + * a crash was detected. This is done by passing the -recover flag to >> + * the compiler. Disabling recovery allows to generate more compact >> + * code. >> + * >> + * Unfortunately disabling recovery doesn't work for the kernel right >> + * now. KASAN reporting is disabled in some contexts (for example when >> + * the allocator accesses slab object metadata; this is controlled by >> + * current->kasan_depth). All these accesses are detected by the tool, >> + * even though the reports for them are not printed. >> + * >> + * This is something that might be fixed at some point in the future. >> + */ > >Can we please find a way to do this that doesn't copy and paste a rather >verbose comment? > >What if we passed 'recover' into kasan_report() and had it do the die()? If that doesn't conflict somehow with how the kasan_report() is envisioned to work I think it's a good idea. Since risc-v will soon add this too I imagine? So it'd be copied in three places. > >> + if (!recover) >> + die("Oops - KASAN", regs, 0); >> + return true; >> +} >> + >> +#endif >> + >> static bool do_int3(struct pt_regs *regs) >> { >> int res; >> @@ -863,6 +909,12 @@ static bool do_int3(struct pt_regs *regs) >> if (kprobe_int3_handler(regs)) >> return true; >> #endif >> + >> +#ifdef CONFIG_KASAN_SW_TAGS >> + if (kasan_handler(regs)) >> + return true; >> +#endif >I won't get _too_ grumbly about ti since there's another culprit right >above, but the "no #fidefs in .c files" rule still applies. The right >way to do this is with a stub kasan_handler() in a header with the >#ifdef in the header. > >Actually, ditto on the kasan_handler() #ifdef. I suspect it can go away >too and be replaced with a IS_ENABLED(CONFIG_KASAN_SW_TAGS) check. Okay, thanks for pointing it out, I'll add the stub and IS_ENABLED(). -- Kind regards Maciej Wieczór-Retman