Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2046843lqz; Tue, 2 Apr 2024 06:01:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQcotWMDK/A1QkhPeSsUUVYFQvMkB//cw36HJtAUvWnIwWZoNfCYW3dvNvgXVwIlQth0PsozDAGoJqO7HzZ00/bDhEmRtrvENuQj9fgw== X-Google-Smtp-Source: AGHT+IETA2N6q1/Wpvt8yxAX1GTXWxcHsvxzr4s8c0DRkzhIt5LhWOCXxQOJyja6ZvGuNPbHhR8v X-Received: by 2002:a05:6a20:8f0a:b0:1a3:c505:7bf with SMTP id b10-20020a056a208f0a00b001a3c50507bfmr13230296pzk.37.1712062875845; Tue, 02 Apr 2024 06:01:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712062875; cv=pass; d=google.com; s=arc-20160816; b=Iw2wMTVhGECrNN5rYVru3YMwfugZXyOJ8JWY5PaIOnoTyl353vyOLevTb5YEzvLSYK htBn9dQlEU7jUFGlSXqIYsLqgOd53NyKYp8HMHfYTZBKeUIwPQiQ2Qo/j6ECQkfjRW+C p9PjkSBtpYF4D/0YEUPI/f/wFcUrIIG0fRqDj+qWkrlasYqONmCuzL3o81fWIxzdU46T fKJunEUIgIKLax7fludMGnQjguCCgGEWkKEb0/Cb98AVJlImNnihI/s14jmJMUoDLpmn fiYHk/cxGHuH6NL3EvsEX5EJptHuG+ekPAWwbYYxGaiHMBRAcWq/p8LlAREZZR0/QXYD tLDQ== 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=J9BOOeUNjfGFpU5e/29lpai9VuZ3J44C2k6KMbejGmo=; fh=BNDkaa7ztxnyVPABjzWcFBvjqKuhq5B5pQrn6aDAfrM=; b=tsH6TPgQkiMcJg7CepsHeqleK6LBeD/7jwkww6VWVWs79Xu4qWLkk3vkfh+m00+6qx fjI9V/FVS8L3VJ3+emkA8LTTsYBXLIiZGvJrz7DHjlIRwiyHXcfmQa+rHdlCN+yEdYqZ Zikdt9Th4Rb41U+MX3aKcE11qHJiRpg8z1jf9CcFmz1tA2PAkwIMpPjexjaAc6yZuGQr mJB6R1hydVDy6BqMyFXTsoN4dYYLuaiWCRwKQExip4DjdUwXfC5LtTBplK2hdqCDyveH Rt90AhuQdbCNPIPjU6GxeOc83kHNSo0fuRqSwu0vF3G1jG6VHOTwGS99gKIeQXkuio3+ uZpg==; 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-127990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127990-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g3-20020a63fa43000000b005d8b2b582dfsi11082526pgk.837.2024.04.02.06.01.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:01:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-127990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127990-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EAD7B282D96 for ; Tue, 2 Apr 2024 13:01:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E4D97F7EF; Tue, 2 Apr 2024 13:01:08 +0000 (UTC) Received: from mail115-171.sinamail.sina.com.cn (mail115-171.sinamail.sina.com.cn [218.30.115.171]) (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 1306A7E58A for ; Tue, 2 Apr 2024 13:01:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712062868; cv=none; b=YYaxaWF5k56kGfV0xSqjVW01xyyYgaywjyIfJZCR6IjfcaC+r+fIMX6EqFr6Fay3ZP3AjxYqV9ScSvWG24VO5qusDB1CleoayXDcdoMMYXyR/Nc5YcsyaAhL0ljz6Yqp0lXEUPT39Q+CWSbrooES/ezIHNf0Qb1fn2fIdpmYIac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712062868; c=relaxed/simple; bh=JOw/SYsFLuL+mWLs2z8AGRWIMJ2p3W/kaFJVqb+7TCw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sgIb1I3+Sgt29GGxyCvSp57C9STDkOxX7SaqM2MfK4EpFkvCLUNGvpU/CV94xckg81llZq8AwPnEbjLdGL4bhQpAvihuLTy4GLPHNxjZSVS7ehSK3fmXVFDOPu3LUDTa6wpHDOws9i8gJLtXMqdgIEl2U79O/mzotNqBmgDa8Go= 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=218.30.115.171 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)([116.24.9.84]) by sina.com (172.16.235.25) with ESMTP id 660C0182000061EC; Tue, 2 Apr 2024 21:00:54 +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: 62554134210268 X-SMAIL-UIID: 2161B86758854EB5B26991735528F0B6-20240402-210054-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [mm?] general protection fault in shmem_get_next_id Date: Tue, 2 Apr 2024 21:00:40 +0800 Message-Id: <20240402130040.3715-1-hdanton@sina.com> In-Reply-To: <000000000000a1ff78061517a148@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, 01 Apr 2024 23:58:20 -0700 > syzbot found the following issue on: > > HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=150d3cee180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e --- x/mm/shmem_quota.c +++ y/mm/shmem_quota.c @@ -116,7 +116,7 @@ static int shmem_free_file_info(struct s static int shmem_get_next_id(struct super_block *sb, struct kqid *qid) { struct mem_dqinfo *info = sb_dqinfo(sb, qid->type); - struct rb_node *node = ((struct rb_root *)info->dqi_priv)->rb_node; + struct rb_node *node; qid_t id = from_kqid(&init_user_ns, *qid); struct quota_info *dqopt = sb_dqopt(sb); struct quota_id *entry = NULL; @@ -126,6 +126,11 @@ static int shmem_get_next_id(struct supe return -ESRCH; down_read(&dqopt->dqio_sem); + if (!info->dqi_priv) { + ret = -ENOENT; + goto out_unlock; + } + node = ((struct rb_root *)info->dqi_priv)->rb_node; while (node) { entry = rb_entry(node, struct quota_id, node); --