From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.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 1C0E32BD022 for ; Thu, 6 Aug 2026 10:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786012876; cv=none; b=fduGcSQ+y8dRNZg0rWnRQOGHPk/B9Yaqu+4EOrwn3jSuZYOLCZEp9qFbsMtf5NKTE7P/zoEciqXJ+Dq0vIznFj3oAwtyCkY5kF2w01edue268ILpNS+ZCrAJ6TGW4E7Pd2pgjacatjNKSEp5joR8bApFqYttYxsY4ps6BSw/0bc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786012876; c=relaxed/simple; bh=YNUpT/5Npp/ZblJpGft7nLGxS4O605j9XsotGkz2DUI=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Nh9vJ14kVnFmeQ4yB6SRAu6ZGgTWk+Mdd5lDiMZfRiKRsDzxMgjWoNHm9PxxVfgjdUgV7AVFobh5qk5CTa1TdnTG0Iv2xQ6c+PrgloIvkRpYuQ7UeXB2RTcITLZB5U4sGpJUcJfJc4I0u4L9poAt3w8wruG3QahqQWkPuThPW0c= 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.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-oo1-f70.google.com with SMTP id 006d021491bc7-6a196857c7aso2161559eaf.2 for ; Thu, 06 Aug 2026 03:41:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786012874; x=1786617674; 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=7iWfezF/V6v7FgTfusMJIzpFWw0HfVBTPfveINtxlAs=; b=cZrz8hGYUdjL778aP88mKOxpKMilZrWTk5b9jIFANIJ9BPkFfcbrxlKumoku3GDRgT /jX8UbjfRISJBEf7Gdm4uOm386GLvACLTfwGT2j/UPuOF1FtOZ9QgT7p+Y8n92CqdkFG Lr8wUyPfzNwX3UoNLCo4jCuj+w/zkhpffRyyLSZTr7YU8g/n7dDGQKGIPmbK7RgYJyo8 BTGWZXHopqt1jl7sGXxaPHClp0FBfoshXWOBvyLIVJNxYZbs0bEKy1IHzAlXpJRdUb9q NLZV7xuUhYtOzCJQEJQ1Gvg7/pWaWJRAcswN/IiIGv6sK3f/Z9dTolj2J/fIb8hJ9c9W P4Tg== X-Gm-Message-State: AOJu0Yyx813mfV5aPvEp0NHFxwQrOG+3WCkw2yAMShwC/McbVqje22xP M9MuopFgleei4o4rDLpY75RxPHFb1Z7i2UVa9hSer3eoKxFRjk4iYpnmTlz6EPj0XddvPi5FZFl BWDjOf4xtRZ2TFVy65uY68O2RFVVRViqgPFl7VMJbDxfT11H4jN0nDB0oK/I= 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:1793:b0:6aa:8fb6:b951 with SMTP id 006d021491bc7-6ae96ef2e46mr7207717eaf.19.1786012873952; Thu, 06 Aug 2026 03:41:13 -0700 (PDT) Date: Thu, 06 Aug 2026 03:41:13 -0700 In-Reply-To: <6a73bd4e.01d0871a.3a0d52.0007.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a7464c9.b50370da.49fe0.000e.GAE@google.com> Subject: Forwarded: [PATCH] media: dw2102: fix OOB read on firmware size not a multiple of 64 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] media: dw2102: fix OOB read on firmware size not a multiple of 64 Author: vasilisalmpanis@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 848acc8ffe1b diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 4fecf2f965e9..4e26e1776977 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -1902,9 +1902,11 @@ static int dw2102_load_firmware(struct usb_device *dev, if (p) { memcpy(p, fw->data, fw->size); for (i = 0; i < fw->size; i += 0x40) { + int len = min_t(size_t, fw->size - i, 0x40); + b = (u8 *)p + i; - if (dw210x_op_rw(dev, 0xa0, i, 0, b, 0x40, - DW210X_WRITE_MSG) != 0x40) { + if (dw210x_op_rw(dev, 0xa0, i, 0, b, len, + DW210X_WRITE_MSG) != len) { err("error while transferring firmware"); ret = -EINVAL; break; -- 2.47.3