Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp377722lqs; Tue, 5 Mar 2024 05:03:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWzFn+qOvvzh9iX0aUtmHjvYy1BG+7irJVVafcpl6a66Ut5VPPHqE+W8KUiAMAcyCpG/UCUy3QhOf45mdXNZExjLhcDY7cr36sn8nlsCg== X-Google-Smtp-Source: AGHT+IFYyQzqK7FDUzJi4ksEbUNhbHDTirlA99ce3/vpXNxzATmErm7Hk8NwRPpeaiMXVCFLOeF8 X-Received: by 2002:a17:90a:d317:b0:29a:15c0:44bd with SMTP id p23-20020a17090ad31700b0029a15c044bdmr10087562pju.23.1709643801735; Tue, 05 Mar 2024 05:03:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709643801; cv=pass; d=google.com; s=arc-20160816; b=DSCdC5wX/ar76hfy5+GIGAjSIjcE6arG9eDzorK93AicsFm1C8b5npm6wNcGjCUqcW cp7IlVRcgJlnjHrD2+w41XOgCllNcf1F03hWgTHMQr6OVYfLEGSeddu2jrQJAjRInYnm AmOQlZ8ZFPDh04VgJompYRIhubeAXxCov0KPBF9ovLw41et/t2BnvxNlUr+ODGYtMqmS xPs+fPwwG+d1dGXQgpaWpbQt7wccp7ipTJEM7WLCyI/lS+BXmmrURK3CAAvoD3ABn5qI GxIlRESgU23fIZLK23uIvVpE7RU7MtiktKWTo4Zf6etATm9X/koHHZP9TrlhLgos/Bje NWcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=Y03NzawgLsuvVK3dnh3vUuU8cb8xlgzFX71BC6/j7b8=; fh=vuZlOwETdMUaHqjLNtCNDGdJVqJYpxnyrRYx5FYU+M4=; b=mO9ChIpyHSDh8ma/UxtrBSJDYejEaqCenEXp8PrGXHJza964vw+WzbReVfAS37Pklt OBgY2KWS1N/e3BOnJBt2Z08hpDqVPxgLP8smazaW2JCHvids5ZqBdqLplZxiAvf2ykJJ dhsTSqhRwCGBfLkq5unJ10JvZZ+YaKdk/JIByJWGXYBNZIb6ndzJ7TCdAcI++sMm7DsU ZG89g51kJDsfcbDzF9NA/7RUg6fd1EOxGHWmAdieLe8HAFc73z/26tS+lbDnKAhuDz2J iwuuJLdEKG7QQ7UFgtA7J7E7e3Bp1vLsS/qFQcMcljOOmR4Ek6iy66s1aQ1LjIB+CZ6Q VE4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LZ4No1tv; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-92404-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l13-20020a635b4d000000b005d8b8ca425esi10004690pgm.308.2024.03.05.05.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 05:03:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92404-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LZ4No1tv; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-92404-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C738928315A for ; Tue, 5 Mar 2024 13:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 487718592C; Tue, 5 Mar 2024 13:03:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LZ4No1tv" Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3F5C8564F for ; Tue, 5 Mar 2024 13:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709643795; cv=none; b=SMUA1jDM49uF/t7h85iptqYNQ8CVOBl5x5vsGUdIfHHVuu/IwdgPjTeQesUpYGFCNPpvW82TJWiO+BGfX76ZIR7fwf5PLPbyG7VpNiv3Y5S0Txbk7VvnHHjLlDGB7VsVSsgS8rElFz7JGIqc1XjgnkmzU2DzVPtMJx1+KUlPF0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709643795; c=relaxed/simple; bh=FMlR3b4A7+t893mx3XssS4mADLt37ULz5EyCiwBOe4A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=g0YX1SBjgwXIYdTRVa+wHlggObLEIBBuXl7w7/sCFlqc3mi4rzX7PT49ojWc0pZNeH2Jx6DlEGh0q5w3wezduILX0aLVlgCzGE4/AerBNmehRpKqIBdhCUPodKiiET1ya/JroIRGGU8s5MJu1e4n24oOapzSCFM8ZsoyqMCh5gI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LZ4No1tv; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3c1e6c32a55so1590314b6e.2 for ; Tue, 05 Mar 2024 05:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709643793; x=1710248593; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Y03NzawgLsuvVK3dnh3vUuU8cb8xlgzFX71BC6/j7b8=; b=LZ4No1tvK71uu2tjL+dv17brKuOvcuW9vbzCz9Cp9Wu+cQrX1kJevpNmyLOqRS1cMz VJIyFjp/7iZCoL2PajFjcNTtJVYHVq5BXm3DXNAbS8ek5BLhCtwWoxL+f/bDOscjbEaD CkqP1KjDX9PjJGng0Ojp/y17lGoR2Vh+nFrm5i/GbR6mg/cMm9DoUHpyx7UjQaKP4p/5 GiBd2qjdpeWPYKnCpLlA41/BQ6CGNUYflWf5NWoLpP/NEbpc/VBePMtIKDZh8KmIi5Fl /1Zp2k4+tKQxXcAN7YeS4n127lvYUoPNMINBLPwOsgeOKFYhcX4bneIiqSLyalxA0K4Z t/Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709643793; x=1710248593; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y03NzawgLsuvVK3dnh3vUuU8cb8xlgzFX71BC6/j7b8=; b=dvyxYNY8J/v9oklhkZNf8kJAN+FMwZfzrs6ldHow7EChlbqynFUd+mVk21mq8EHYdE WmeYG7Ov5R4gR3T0ZzUcrPK7Q9y2+ddlpMw4OOH7sIcmSHW2MGtFHap6O/gQTsxm0zPJ LkmfMS8d081tqjD0SGsQrL+hPVlrf0oOMTmqtbe5F0VAL3SzHXxfAWCoEggoIMbo76km YpNdcqLorFzP4Fj6E7q53b0k8YuigROkVcyOAcfv6FHwK5wwPahuA8SID0kOjD4Y3kid moJDI7BfxqGA5tN/StiTpFIDTVYIomUwBk7G0eHMvSa6T4mUBPoqhk8sKiY0qzGlaD94 rwbg== X-Forwarded-Encrypted: i=1; AJvYcCVBwb/k/i56cor8A65QsBYz1rB9MKY6TgRbJ7Ae8gnUPW0OLNaIDfX8SAO1tq0NmB5gfDu05V4MdWMYLBOl9Tqh/vLfM1Loz6CYUM6U X-Gm-Message-State: AOJu0YwdmUk7HtcnpE6hIdLHtdiLV1OUSyqd1Zk+rQYG5HawUrfKR5qz jTZ4MJQZf2FSR2pPF1oY3GtwJLdDsBTTrkbXh8SD4U5ttONe1KK86TGzwGKI/hlmNumg8HqO8YH mWLfI6XJImXF+ucSBtifX014xGVITVIdvVVm8 X-Received: by 2002:a05:6808:1597:b0:3c1:ae52:6f91 with SMTP id t23-20020a056808159700b003c1ae526f91mr1799803oiw.58.1709643792910; Tue, 05 Mar 2024 05:03:12 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202403051032.e2f865a-lkp@intel.com> In-Reply-To: From: Marco Elver Date: Tue, 5 Mar 2024 14:02:35 +0100 Message-ID: Subject: Re: [linux-next:master] [mm,page_owner] 4bedfb314b: BUG:KASAN:null-ptr-deref_in_init_page_owner To: Oscar Salvador Cc: kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, Linux Memory Management List , Andrew Morton , Vlastimil Babka , Andrey Konovalov , Alexander Potapenko , Michal Hocko , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 5 Mar 2024 at 10:26, Oscar Salvador wrote: > > On Tue, Mar 05, 2024 at 02:08:23PM +0800, kernel test robot wrote: > > > > [ 6.582562][ T0] Node 0, zone DMA32: page owner found early allocated 0 pages > > [ 6.612136][ T0] Node 0, zone Normal: page owner found early allocated 73871 pages > > [ 6.612762][ T0] ================================================================== > > [ 6.613351][ T0] BUG: KASAN: null-ptr-deref in init_page_owner (arch/x86/include/asm/atomic.h:28) > > [ 6.613893][ T0] Write of size 4 at addr 000000000000001c by task swapper/0 > > [ 6.614434][ T0] > > [ 6.614600][ T0] CPU: 0 PID: 0 Comm: swapper Tainted: G T 6.8.0-rc5-00256-g4bedfb314bdd #1 29e70169ace75ef72d53825e983f3dcb1d5756d9 > > [ 6.615605][ T0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 > > [ 6.616367][ T0] Call Trace: > > [ 6.616604][ T0] > > [ 6.616816][ T0] ? dump_stack_lvl (lib/dump_stack.c:?) > > [ 6.617161][ T0] ? print_report (mm/kasan/report.c:?) > > [ 6.617499][ T0] ? init_page_owner (arch/x86/include/asm/atomic.h:28) > > So, we are crashing here: > > /* Initialize dummy and failure stacks and link them to stack_list */ > dummy_stack.stack_record = __stack_depot_get_stack_record(dummy_handle); > failure_stack.stack_record = __stack_depot_get_stack_record(failure_handle); > refcount_set(&dummy_stack.stack_record->count, 1); > refcount_set(&failure_stack.stack_record->count, 1); > > when trying to set the refcount. Allegedly, because dummy_handle is 0. > I thought we fixed that with > > commit 3ee34eabac2abb6b1b6fcdebffe18870719ad000 > Author: Oscar Salvador > Date: Thu Feb 15 22:59:01 2024 +0100 > > lib/stackdepot: fix first entry having a 0-handle > > > But I guess this is different. > The obvious way out is to only set the refcount and link the stacks > if their handles are not 0. > > Marco, could it be that stackdepot was too overloaded, that by the time > page_owner gets initialized, there are no more space for its stacks, and > hence return 0-handles?. That's possible. But it's unclear to me what exactly happens. Are you able to reproduce the issue? (I haven't been able to because the config enables CFI which seems to cause other issues for me, presumably toolchain related. :-/ )