Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp81873lqb; Tue, 4 Jun 2024 05:56:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9qZABjQx5Q92IJKL4OYInE2MreppTEXKL7I+E+N4q0/STiAm+WNSIjBE8csCy7yFHWezrYKgI2+WMGLQfLwMS/C24Rg45IStAz6AVtA== X-Google-Smtp-Source: AGHT+IGt1vHL8Zulbb0AuNSKiBzTlwQsYNstb2JBvpFikBqmm4JiorHNzVL2VCB2nmCSqqQQJksu X-Received: by 2002:a05:6870:c184:b0:250:7973:8092 with SMTP id 586e51a60fabf-2508bcbae89mr12046038fac.56.1717505800739; Tue, 04 Jun 2024 05:56:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717505800; cv=pass; d=google.com; s=arc-20160816; b=HkAv0MxGVw4aT5DC9CcSqaD8H8DySqEOwD3DoqFlv4gm5SC2fHNKgdD2FylG1F16z3 VWt8GNDkVdKQEf976L1c48Ce3y5mrAtob5eqhobiT6fVMslSh7T9n0YxtRCPEV7jqxjJ HeI+TU+576WT6FLMeX2uGyI9AE3ULn9kRN1mhjQkgZxB4AV5U+nlxCnyieM6d5gY2kpE 5t+Sro731xsTeQBJG/7/AGlFJj0nqk73FnXmTM3s+yuuzzc2/+8xE4E+lu6jVUlosfHB 2XerCOaYHnVuiLnqRedwDn5zift0jIURdcdLgnQDoRM/bC0upaK4B6e3M0VJ6pTOI2jq UjEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=BwL8mT1x+05KwXfrHJBtGJb65I068Uw0ZI+7u4gDapk=; fh=y6g/PteXmetmOJrh/l3fgF6ucz1AfCRQ4lAus1hfQj4=; b=cjj72e4y2D+nK8J+a4sPbVMOTxaU/i7ERa5B0ZWUjggfGs+3HqaaXfHLJBT08898rm CO29gW9NYlp/Nx7HUajPZ1gSHVhA/9iJYbGQbt5ZR3aIKD8HgEaW8wUkffXgmPyPnCq1 XMSKnWrby+Cx/ZpB8KjJJpqqsE2PwMS7ybNJ2dFv7DD9Vy5Wa/fB6OsNzTUMae6nQD4x +WJIo3y3VGsP2grSr4Qhz+ncHAP1ybtj4H7Sn6NnwrjBJMtoZE4IeQJII2r09IzBasLz Di/31MdVnO7nkF9EoWTpc0rBNEcH9hoCY4kVpI0jGN/gxu08lABZkKshqRhi203EwhTp fEww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-200612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200612-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f913csi1414420a12.56.2024.06.04.05.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200612-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; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-200612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200612-linux.lists.archive=gmail.com@vger.kernel.org" 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 BC406B23C13 for ; Tue, 4 Jun 2024 12:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B9E7146A70; Tue, 4 Jun 2024 12:37:55 +0000 (UTC) Received: from mail78-36.sinamail.sina.com.cn (mail78-36.sinamail.sina.com.cn [219.142.78.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926D6146582 for ; Tue, 4 Jun 2024 12:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504674; cv=none; b=MLjT95Rs/Y6cfIfySIDrQHll3IqKuPCM/VseIocHB4vxRtOMOMatEfUs7tKFfOp9+AqGYKUHMirr1KyYowDc4K0TTixdoh1MDiXBSKuhg/Nr8Fb7K6pdAydpELWgq2FSC5MFaFCj75OdK3WJLVI/7wItERZ0j28TsE7XOCk2Jmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504674; c=relaxed/simple; bh=TNuljGCIjYraC1j8XPFvGeBDRiILJdeJOQEZcYiIDHk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ETPsRw8vFVr5jYHZ8AGy0dA9oNmBVNXf2/h1ckkCQ1uNs+kdqkNJpH4fVkW/8YawAV4+UEMLuOMXIuRuVxS8UqRb3GUHt9+9XcHa4BczAFAzH9fOVrMA9Oby5u/edfaAtyYO5JenzEqDxDVuQims3kRFb4Ftr4Epz9JRUT9hgVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=219.142.78.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.69.129]) by sina.com (172.16.235.25) with ESMTP id 665F0A7000003CF9; Tue, 4 Jun 2024 20:37:07 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 60384634210408 X-SMAIL-UIID: 572F591C2B6A4CCAABC88C7DE272A6B0-20240604-203707-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [mm?] kernel panic: corrupted stack end in userfaultfd_ioctl Date: Tue, 4 Jun 2024 20:36:56 +0800 Message-Id: <20240604123656.1730-1-hdanton@sina.com> In-Reply-To: <000000000000109e6b0619fbfd44@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Mon, 03 Jun 2024 06:05:33 -0700 > syzbot found the following issue on: > > HEAD commit: 4a4be1ad3a6e Revert "vfs: Delete the associated dentry whe.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15683162980000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- a/arch/arm64/mm/contpte.c +++ b/arch/arm64/mm/contpte.c @@ -376,7 +376,7 @@ void contpte_clear_young_dirty_ptes(struct vm_area_struct *vma, * clearing access/dirty for the whole block. */ unsigned long start = addr; - unsigned long end = start + nr; + unsigned long end = start + nr * PAGE_SIZE; if (pte_cont(__ptep_get(ptep + nr - 1))) end = ALIGN(end, CONT_PTE_SIZE); @@ -386,7 +386,7 @@ void contpte_clear_young_dirty_ptes(struct vm_area_struct *vma, ptep = contpte_align_down(ptep); } - __clear_young_dirty_ptes(vma, start, ptep, end - start, flags); + __clear_young_dirty_ptes(vma, start, ptep, (end - start) / PAGE_SIZE, flags); } EXPORT_SYMBOL_GPL(contpte_clear_young_dirty_ptes); --