Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1478470lqh; Mon, 6 May 2024 08:50:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUK/+vayFEjIzWG4NlLTdcMIy3l/HuAQ4i2xzdPNGYiOsMqZXtTbusJ5AmjuDaF0eVtZnmgWXkPnn99fwA3m6+KuGpW7SvVXjzvOaue7g== X-Google-Smtp-Source: AGHT+IEQkzra4ck4GEXQOrMQ2M8Yvc5Beo7X18HJ2zRxpC151ORM7ATGAktINu9EHL/kccMYXONn X-Received: by 2002:a17:90a:4096:b0:2b2:195a:d7bd with SMTP id 98e67ed59e1d1-2b5bbbe02ccmr96908a91.2.1715010635278; Mon, 06 May 2024 08:50:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715010635; cv=pass; d=google.com; s=arc-20160816; b=bwUexmAwiY10nseejWT+1iIHL9Ntip929YcAJWkaDHTOL5FQ5TrI+Es6MXxLd5r8DY pP03eYLjLmxscKGecwVXoAeeIUSDOpGHPOPt8dFZPugvZ+l9Hrhg1BqZZwvOmuU3xUps yR+se+/GoiiJpWBuJTdF+hULE0stZIoXvhedmroZ4iM1BUPVHW2a61l29kMF/r0/w5aP ulUGT3ApYwL01vmSApLTyEC33cunv67r7qrV1sWYtZh9oXSlXQv6fa7UNcRmNmkkoB9O efa4C1O1z1u58czkmGMGLv0HW6vQ0oP+I5fqRcwXTJrE0/g2+ORmm0oZT5U97R01hfXm NV1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=EX3lbGjtZr1MYyBbIkYm5Ykpw+gVZN3D98AWH25Rb0s=; fh=DeXqrHmnRjGgY1CXAIdj4LkvH50jkbSLhqfaZgNnHp8=; b=zXIMdu7gdmoF/8USyJBfGbzZ1tuLlYK19x1jzNfMUQQMkdGfKTM5w7SQSiRJpUUqzK ZX+t5MVQ8Hx+bi9f1Xb1YNDHDyWBN4KTjbfDBeD+3LwKI43XSdssXwej4iOEh4lLG8dW b1xl5Yd/TbDZj2N+Th5bAPQXjEpBjX6o3sGYc9UZpAhz9jHGEduay5kzHZy47HOaHcLa Dm+8prDj+xhf22bQcTJhzkWLXGm1HQz6xImnjzEXOWf8C28U7MN8sTHIwKrQVYffTp+7 YWqkSZWhSFO85XN76y0RQVr2uOQ8j8E+g+leU2ZAlDy46EenY8AkGzDud/0cF7yg1+dd Emww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JAGBRmiL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JAGBRmiL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-170082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y5-20020a17090ad0c500b002b2b2a25353si10959417pjw.42.2024.05.06.08.50.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:50:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JAGBRmiL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JAGBRmiL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-170082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9C6A3B22787 for ; Mon, 6 May 2024 15:41:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C48D1553A0; Mon, 6 May 2024 15:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JAGBRmiL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="BBTgObPk"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="JAGBRmiL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="BBTgObPk" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 1969A7580C for ; Mon, 6 May 2024 15:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715010097; cv=none; b=paMJnW2oZKquAc/IBjmdQeeYzdWckYkOXzQqJzPGcZcZJ6t45AC+ddGwm24NPg25w/lSswrmIfjoKTNH8B2U260/6u8+gSb5iCw5+GwQ6TIfY9CIbhTJuOaEFPhpXnHQ0ofhz/Ci3ZcbnRE5RvKNqrtFS88F75180IWp4wp85E0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715010097; c=relaxed/simple; bh=r2fKkKODx3bsbU/zHy3RqTsEzCgGVZbwURDHIJCljNM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JTYPd6F5uRp7Y0B4jpscZei1ej0YiO2cupmSaca7cPCCtygQs8LLlIgFKPDHQdXAlLa4OEfjMM0IPGmtlSjJDrwL/ZgRAPPq6nkt3VtO2LTRzr6/0po56OoAcbLWCqYCSiy1Na5zst0WC2sNOEIJp8vzww6mJdzKISa3KyDUM1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=JAGBRmiL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=BBTgObPk; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=JAGBRmiL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=BBTgObPk; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 48F4E38586; Mon, 6 May 2024 15:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715010094; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EX3lbGjtZr1MYyBbIkYm5Ykpw+gVZN3D98AWH25Rb0s=; b=JAGBRmiLG4Ca4zbRmnXhByMK7/RTX3PIOCv7Crrnf+fOxGM/Y/XcZz6/qezxRzrba+x6Kb yKKifPnPCD7/RV12EIeAxX8loQV1xrUXaEKYovxTM+zZC7uwUM8CtH6LSB9aYG1iNU1AyB cslYaA28Jz9l8On5J7Ywj4GRGduzbx8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715010094; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EX3lbGjtZr1MYyBbIkYm5Ykpw+gVZN3D98AWH25Rb0s=; b=BBTgObPkplXvYQC17Ky833tZ4QY6nmelC79vlS1v1KUs6OGWM90yKLDGOBT7Dkmp+6X3IR LlpwUPdmCBD5LLAQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715010094; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EX3lbGjtZr1MYyBbIkYm5Ykpw+gVZN3D98AWH25Rb0s=; b=JAGBRmiLG4Ca4zbRmnXhByMK7/RTX3PIOCv7Crrnf+fOxGM/Y/XcZz6/qezxRzrba+x6Kb yKKifPnPCD7/RV12EIeAxX8loQV1xrUXaEKYovxTM+zZC7uwUM8CtH6LSB9aYG1iNU1AyB cslYaA28Jz9l8On5J7Ywj4GRGduzbx8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715010094; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EX3lbGjtZr1MYyBbIkYm5Ykpw+gVZN3D98AWH25Rb0s=; b=BBTgObPkplXvYQC17Ky833tZ4QY6nmelC79vlS1v1KUs6OGWM90yKLDGOBT7Dkmp+6X3IR LlpwUPdmCBD5LLAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A65E113A25; Mon, 6 May 2024 15:41:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SV/vJS36OGblCgAAD6G6ig (envelope-from ); Mon, 06 May 2024 15:41:33 +0000 Date: Mon, 6 May 2024 17:41:28 +0200 From: Oscar Salvador To: Kees Cook Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Vlastimil Babka , Marco Elver , Andrey Konovalov , Alexander Potapenko , Alexandre Ghiti , syzbot+41bbfdb8d41003d12c0f@syzkaller.appspotmail.com Subject: Re: [PATCH v4 2/4] mm,page_owner: Fix refcount imbalance Message-ID: References: <20240404070702.2744-1-osalvador@suse.de> <20240404070702.2744-3-osalvador@suse.de> <202405060754.4405F8402F@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202405060754.4405F8402F@keescook> X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[41bbfdb8d41003d12c0f]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linux-foundation.org,vger.kernel.org,kvack.org,suse.com,suse.cz,google.com,gmail.com,rivosinc.com,syzkaller.appspotmail.com]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] On Mon, May 06, 2024 at 07:59:11AM -0700, Kees Cook wrote: > Does this also fix this? > https://lore.kernel.org/all/202405061514.23fedba1-oliver.sang@intel.com/ Hi Kess, yes, it does. > > This is a report of the backtrace changing, but the warning was > pre-existing. > > > [...] > > -static void dec_stack_record_count(depot_stack_handle_t handle) > > +static void dec_stack_record_count(depot_stack_handle_t handle, > > + int nr_base_pages) > > { > > struct stack_record *stack_record = __stack_depot_get_stack_record(handle); > > > > - if (stack_record) > > - refcount_dec(&stack_record->count); > > + if (!stack_record) > > + return; > > + > > + if (refcount_sub_and_test(nr_base_pages, &stack_record->count)) > > + pr_warn("%s: refcount went to 0 for %u handle\n", __func__, > > + handle); > > This pr_warn() isn't needed: refcount will very loudly say the same > thing. :) Yes, but I wanted to get the handle so I can match it with the backtrace. Thanks -- Oscar Salvador SUSE Labs