From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) (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 539601D7E41 for ; Sun, 22 Mar 2026 04:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774154508; cv=none; b=SnHICANqyfO5UTxJPtlyIlKdtC6tgdl/i4EUjhIHOQpfPzgZBgTeR96Sg//ImITopF/AO6z7RbKk5gnWCxxVzdBmhP+7RaHv2EOo+VlRtm2A0oL1JkmODMdUgTTPhBssfDrT6fuGg7LyElsXUNVTfhM+7qxeNML+N25wluG0cJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774154508; c=relaxed/simple; bh=M196klNKdjhugjhM06zmOK5vG+I9To00mo9zjHIWj6Y=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=O4rqR7b2I65ut8pGP5wKEdKKQYrmP89QzZa/QjtMft+pTTeqbanfA7H6WYoDLx7UKjQAi8+DzVnPBayDV4Ft7HfdmLqlKSyGRRwxDzxAPbW7kRqV2lIbpWCARYa521LE4cGhXxQYMiCCTC3tRrt11EYF7nH4F3+xeM4De45s1dA= 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.160.70 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-oa1-f70.google.com with SMTP id 586e51a60fabf-40eee5d10c5so28992398fac.0 for ; Sat, 21 Mar 2026 21:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774154506; x=1774759306; 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=ETxWTVvqgbR9arNgFYCaN76dDO9ftJCDecPuIrGq6xg=; b=G55mkPymYzBKe90uAJ379ifwoLDJcUd98v5ND1jaK6oEqIr2cNUPFjPCTIUj38Q0QE zautNzZ0aedEXwVkBGZNP8CR/8QHIn1LW1oqTqi0/lMftcPNdlLkhIAu78Dsivyl+itq VwBPguYVnn/0Nx2R/pDLQue+EiS/h7bk/A49SIo8I4z1YToi0VnYC9SmqIdSiqqU5hwp yn3EF46sEd2y2ytO5InyFiB29WM8zAUlwWuIbc2OssmTMCgB5dJZQC0Ir7N3f7cZVNpS gfnb2NOEV5FkXTavtC0WMPmsx/VJXWs1N7Y+xYvB3foQsDJyXq6l4CxOfn+932h0+C/Q +mJw== X-Gm-Message-State: AOJu0Yxb4qK650naTa8aVkt7KSP4dxajBpJ6bDl6ZgsraPcN3eFxGf6D ULn/BpeNHAGBCGPU6juUWQZCyLaQmQO1SZoI7QvZufgkz2YOyJYu8ek9dwKWat6BB8luxDPttAM GtJ94r+qUcOPD01z3kBlHut6nBo3WaxVKVm2HkZkUU4UQ++WvuraWqqZnM1Q= 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:c1e1:b0:45e:edbc:bbd2 with SMTP id 5614622812f47-467e5d8d00fmr4829084b6e.22.1774154506346; Sat, 21 Mar 2026 21:41:46 -0700 (PDT) Date: Sat, 21 Mar 2026 21:41:46 -0700 In-Reply-To: <69bdcdcd.050a0220.3bf4de.0030.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69bf730a.050a0220.3bf4de.0072.GAE@google.com> Subject: Forwarded: [PATCH] blktrace: reject buf_size smaller than struct blk_io_trace 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: [PATCH] blktrace: reject buf_size smaller than struct blk_io_trace Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master blk_trace_setup() accepts any non-zero buf_size from userspace and passes it directly to relay_open(). If buf_size is smaller than sizeof(struct blk_io_trace) = 40 bytes, relay_switch_subbuf() always hits the toobig path and returns 0, causing memory pressure that leads to bio_alloc() failing under GFP_NOIO and a null-ptr-deref in bio_add_folio(). Reject buf_size values too small to hold a single trace event. Reported-by: syzbot+ed8bc247f231c1a48e21@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ed8bc247f231c1a48e21 Signed-off-by: Deepanshu Kartikey --- kernel/trace/blktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 8cd2520b4c99..6cc7d83ed1c2 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -773,7 +773,7 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, if (ret) return -EFAULT; - if (!buts.buf_size || !buts.buf_nr) + if (buts.buf_size < sizeof(struct blk_io_trace) || !buts.buf_nr) return -EINVAL; buts2 = (struct blk_user_trace_setup2) { -- 2.43.0