From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (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 02DA03A9636 for ; Wed, 29 Jul 2026 08:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785312688; cv=none; b=rKYxDZHIeByaHTyuZBjPZPHk3+dHBYCUug+reGBjW4UsH3j5ktBNe46foFsh+jg7cJdBiAjrCgsbjculcQDWLkYD5nRDu0AS31g12lzP8EM0Nony+vXxKS7psE4wOtV41+xrtn0JIfDwjuNldcOCMTBEkKX9+iM4p/SxzKZiwp4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785312688; c=relaxed/simple; bh=cLV8uonsOYbiwl0ZBUDrJDlRQ8VKMCuRnT5etHf9W/M=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=M+NlYCvFZwBUdUcXSKw4Nd6bi2xnkxjqqvfXjwiX98fFMY1kN8eqJHQ9RtiA0psXrhflBh3EUvsglSOcz3C1zRyDz9P/0g674U6RCGwMC7QAGkqbri33kMFhezL6hHcD4u2BUjcJN6oOS6IDnbccnphD7CYiZbsN7uAn7sIX90E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.167.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-495b8b30310so753224b6e.1 for ; Wed, 29 Jul 2026 01:11:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785312686; x=1785917486; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=DnwkYUaoeWi4qyFv/bHDPqPZ/GwyCuqqg8RDBMjKrkE=; b=GzB6zFzE7Pyu6LtPJL2TN8o57wvbm/jtQjJPlIilCzwbp0/915zsgq8itB52abdypP wtGkBLnrzfkUw0G58R02+BwxjQngRbT5q1wXnVr/i+J4qcax3qKc4WsaXeJcXetq1Zkt iwbcncZIMen0CSFzLQHaBHJyFEAhNBP3vrS30Wknl4kYKj+GPZe/+bOWGVaZLjSZanau nhdvZmebeLZvobl27GOZiFJ9DVyL2KghNwt1uet8VAPeQ2H+09BcMlUguTI4Gaqgun+M QOxCvLdQi+HLvjC0JKyYrsjXRl/v7+LnV9qw8fSU2N+VAUwemiJp+hBMUdHB2jc64alA WQeA== X-Gm-Message-State: AOJu0Yzp9H4M0Thqp7igUliwMMNSIjUkq4F/7LAtdZ3IDOQz+WkCr3DD cgGwQXyrjDPXTZZg/V5y+Ti9aJiJmzB8AFprLU4CEGGCEmMWM1TCuUaNBuD/xZgmy9CFAYgfA2P OwDwp1xMR7S1JJrNIaid3qLevvnLifbU8EE+eTxXW73DrdfP/8k+n+l4Wnds= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:198e:b0:485:a99c:cfe3 with SMTP id 5614622812f47-4ad5b91b9d3mr4091911b6e.42.1785312685895; Wed, 29 Jul 2026 01:11:25 -0700 (PDT) Date: Wed, 29 Jul 2026 01:11:25 -0700 In-Reply-To: <6a69447f.6bd615f2.c0aa.0002.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a69b5ad.d9e86bb5.297b12.0056.GAE@google.com> Subject: Forwarded: Re: [syzbot] [kernel?] WARNING in its_msi_teardown From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [syzbot] [kernel?] WARNING in its_msi_teardown Author: rihyeon8648@gmail.com #syz test diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 6f5811aae59c..f324d3df56c0 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -2108,11 +2108,15 @@ static struct lpi_range *mk_lpi_range(u32 base, u32 span) { struct lpi_range *range; - range = kmalloc_obj(*range); - if (range) { - range->base_id = base; - range->span = span; - } + /* + * Handing a range back is not allowed to fail: the callers of + * free_lpi_range() have no way of reporting an error, and losing the + * range here would leak the LPIs for good. This is a small, order-0 + * request and lpi_range_lock is a mutex, so the context is sleepable. + */ + range = kmalloc_obj(*range, GFP_KERNEL | __GFP_NOFAIL); + range->base_id = base; + range->span = span; return range; } @@ -2158,13 +2162,11 @@ static void merge_lpi_ranges(struct lpi_range *a, struct lpi_range *b) kfree(a); } -static int free_lpi_range(u32 base, u32 nr_lpis) +static void free_lpi_range(u32 base, u32 nr_lpis) { struct lpi_range *new, *old; new = mk_lpi_range(base, nr_lpis); - if (!new) - return -ENOMEM; mutex_lock(&lpi_range_lock); @@ -2188,14 +2190,12 @@ static int free_lpi_range(u32 base, u32 nr_lpis) merge_lpi_ranges(new, list_next_entry(new, entry)); mutex_unlock(&lpi_range_lock); - return 0; } -static int __init its_lpi_init(u32 id_bits) +static void __init its_lpi_init(u32 id_bits) { u32 lpis = (1UL << id_bits) - 8192; u32 numlpis; - int err; numlpis = 1UL << GICD_TYPER_NUM_LPIS(gic_rdists->gicd_typer); @@ -2209,9 +2209,8 @@ static int __init its_lpi_init(u32 id_bits) * Initializing the allocator is just the same as freeing the * full range of LPIs. */ - err = free_lpi_range(8192, lpis); + free_lpi_range(8192, lpis); pr_debug("ITS: Allocator initialized for %u LPIs\n", lpis); - return err; } static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) @@ -2248,7 +2247,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) static void its_lpi_free(unsigned long *bitmap, u32 base, u32 nr_ids) { - WARN_ON(free_lpi_range(base, nr_ids)); + free_lpi_range(base, nr_ids); bitmap_free(bitmap); } @@ -2349,7 +2348,9 @@ static int __init its_setup_lpi_prop_table(void) pr_info("GICv3: using LPI property table @%pa\n", &gic_rdists->prop_table_pa); - return its_lpi_init(lpi_id_bits); + its_lpi_init(lpi_id_bits); + + return 0; } static const char *its_base_type_string[] = {