From nobody Wed Apr 1 08:17:52 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (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 4814B26299 for ; Wed, 1 Apr 2026 01:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775005245; cv=none; b=M0oNIrna3wfqEJ58s1np2aXxByDaRuYRa3Sej/FIi4xD6wiAMr6/hvT2tOraVJ+fD+WN/cyfpADgAQ0CvL15FqTQNdDAp5Ne3WAM/aF+g+Oy8XnvkzCqn8kSjZLyNeoZZIhCNnJPLngPaRDsUkHpj76G0O8gJPiq6toN0hFkmok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775005245; c=relaxed/simple; bh=9QdnLN762PnzzdAhmgstaOC6VqTEJnSlbE14q3NuHGA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=DlI0MT8TmRuDIhy5hcNCE1fgIhWfJZP7GY4NGcc/nHJZ/boYdD0VkdFsuB5vZfiX3jzJG0g70pyXii/5szkUUrvx2HlyJMYM/VHowhSqj/7KIhpz2pdP7iiAzOIXE8cIhWqrFqqnY0GPvh0gq09xqaJbR/YzWdddQKNmrTCliu8= 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.161.72 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-oo1-f72.google.com with SMTP id 006d021491bc7-67df391509fso24545640eaf.3 for ; Tue, 31 Mar 2026 18:00:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775005243; x=1775610043; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a5ymHaDytr2rhOySUnLdPTgsflxhneuuWjo/3u0cDPI=; b=P4sl9MCzFTHdeU0ApqHHRAchYoyxPP022/ECHobmbP3Rh5r2tpCTmpVnnOAjiEeooM /pZd/azz+8P7/Qc6H7WmuVFu9r4Me46QvcerYBZ6AvR1f1mr6eEq0s7IxC9GtVHhYjHs F5oP08tQYRvlp+/o5SmzXCVVhGdTdK9PUyoMoWlcqB0fXgavEf+Sb9+jf5r5b0NmUGrl HQJ3nNraspg3yCo1BZfBePltLhIOY6T4TO9D9QbnZNZQbMNd7DzOc6jp2jplGeYAeN80 +RByaXN9Bstufc20mIwP2NYruOAzaq+a17LE0SUFcUh8PxnE6TEtP5Tg7JR1cobrwgEo 3AoA== X-Gm-Message-State: AOJu0YzS4RmlsbD+iryzfnt2tJ4yzQuWjQVI+aURvFeXCqocQ87DNUJZ p3UNnIoXrVaO4YmbXaiHVobVEDffIdSwUG319K8DbhMUBdU+kQ75Bhj7FTMx/1ChAgvQKf9SczJ OlCCaikhYPAe5WrdqNjt3M6O4YhtcnJp1bOy3pV/jtIOi2FFWozeTBqsaRRw= 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:6820:1c8b:b0:67e:1e52:6e04 with SMTP id 006d021491bc7-67fabcd5c8cmr783701eaf.51.1775005241695; Tue, 31 Mar 2026 18:00:41 -0700 (PDT) Date: Tue, 31 Mar 2026 18:00:41 -0700 In-Reply-To: <69cc20ce.050a0220.183828.0033.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69cc6e39.a70a0220.97f31.02a6.GAE@google.com> Subject: Forwarded: [PATCH] RDMA/cache: fix invalid-free of flex-array data_vec in release_gid_table From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable 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: [PATCH] RDMA/cache: fix invalid-free of flex-array data_vec in rel= ease_gid_table Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master Commit 74e2711bb2af ("RDMA/core: Use kzalloc_flex for GID table") converted alloc_gid_table() to use kzalloc_flex(), which allocates the ib_gid_table struct and its trailing data_vec flex array member in a single contiguous slab block. However, release_gid_table() was not updated accordingly and still calls kfree(table->data_vec), passing a pointer that points 216 bytes into the middle of the slab object rather than its head. This is an invalid free which KASAN catches as: BUG: KASAN: invalid-free in release_gid_table+0x384/0x470 Since data_vec is now a flex array member of ib_gid_table, it is freed implicitly when kfree(table) is called. Remove the redundant and invalid kfree(table->data_vec). Fixes: 74e2711bb2af ("RDMA/core: Use kzalloc_flex for GID table") Reported-by: syzbot+4334f9a250019c1b79b4@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D4334f9a250019c1b79b4 Signed-off-by: Deepanshu --- drivers/infiniband/core/cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cach= e.c index 896486fa6185..647a547e2d7f 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -801,7 +801,6 @@ static void release_gid_table(struct ib_device *device, } =20 mutex_destroy(&table->lock); - kfree(table->data_vec); kfree(table); } =20 --=20 2.43.0