Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oz3fw-0003Tm-KI for mharc-grub-devel@gnu.org; Sat, 26 Nov 2022 17:29:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oz3a5-0002ap-Sh for grub-devel@gnu.org; Sat, 26 Nov 2022 17:23:29 -0500 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oz3a4-0004ob-EG for grub-devel@gnu.org; Sat, 26 Nov 2022 17:23:29 -0500 Received: by mail-qt1-x82f.google.com with SMTP id w9so4472685qtv.13 for ; Sat, 26 Nov 2022 14:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GpdsqRnFsrjXk/YqVBnNdF239g5RggSftdhVsWKeO/I=; b=HpEAZ5PKC6/F/jpCozU/fMHwdMchdeiTgB6m4RMh8e53rXyolUPUwPYpjFSrHL8295 ME6NrejkT2p72yPcg5UrokrQ+QGi7jdqqA09Log37kJNJ2U3aejd6T6kMmsusLAM22qi /RX3D1PsB0ER0vv++FDLeHgIwJYmqWk6j81SfkLY1plEOpSM2eI4TyC2tKoUR+3rMlCQ bILzbwJDZZU5CcUE8qGQky9b8vRCWMjRO4VwIHccYK5v68NW/4ncBp6ufSfx15Gxd4PR dP+1Px+lBOtSx3obaNFFlx2oxgRzs4e4+27J56V5Y0H8+JjDfQqhxLpM+7jSoTdxyWcW IO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GpdsqRnFsrjXk/YqVBnNdF239g5RggSftdhVsWKeO/I=; b=rLh0QCOxn/Td6Ho9z3XVc0nybjwsTwnHykjLDnO8mI1CxmsHOhwoYIwZWVpr+TgUJj vfXtcyyG75UeG9KzCOimXYHSRXpvHRSWgM5jsqvP+Bdv6jQBuH4chOeJwP9gWJelex7w XjN0PVAg9abbezSqkLRmy6jEqsxsRiZI+lRVKFp9drgxCKTYcl/H9Ub3vLnHzlUBcnTk ROPvXulYUM0NDlYHfnEhVYyAMlq5Arjo3f/Ar7ZlOLjmmO3eKhuC9Osd5duPuA8e5rkn MJMtEFaHrFoGVXMHwQtGJtle6gtH+GVvPaOSklrO5Vp+JmFUcCv6MUY2f53kp+yF9+pR 02bA== X-Gm-Message-State: ANoB5pmHIROF/7Pn94+UB5roSxRMZa5ACAcQmq6ga1uAEri79JS1oSrm jJJ4kXeSin8CQAQ/uRptC3HzJhmekNc= X-Google-Smtp-Source: AA0mqf5v4/sip3u1jsgFQ0vmX6YLftQ1X3xLlAI9GGlejwwO1BWSXi2uonlG+MvIzfSdpZiRlMrC/Q== X-Received: by 2002:ac8:6898:0:b0:3a5:2033:18a1 with SMTP id m24-20020ac86898000000b003a5203318a1mr42375920qtq.149.1669501406869; Sat, 26 Nov 2022 14:23:26 -0800 (PST) Received: from localhost.localdomain ([2601:195:c000:2821:5ced:866d:36e0:6fcd]) by smtp.gmail.com with ESMTPSA id y18-20020a05620a25d200b006eeb3165565sm5314286qko.80.2022.11.26.14.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 14:23:26 -0800 (PST) From: Ryan Cohen To: grub-devel@gnu.org Cc: Ryan Cohen Subject: [PATCH 0/2] Fix command line underflows and out-of-bounds write Date: Sat, 26 Nov 2022 17:22:50 -0500 Message-Id: <20221126222252.764937-1-rcohenprogramming@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=rcohenprogramming@gmail.com; helo=mail-qt1-x82f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 26 Nov 2022 17:29:29 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2022 22:23:30 -0000 Hello everyone, I was messing around in the GRUB command line and I found two related integer underflows that occur on all platforms. I also found an out-of-bounds write that occurs only on i386 systems using the VGA text terminal. This out-of-bounds write is caused by one of the underflows, but I've included 2 patches so that each bug is fixed. This is my first patch submission for GRUB, so please let me know if there is anything I should change or fix. I really appreciate feedback! Thanks to Daniel Kiper for helping me figure out the process of submitting a patch. :) Ryan Cohen (2): vga_text: Prevent out-of-bounds writes to VGA text buffer cmdline: Fix two related integer underflows grub-core/normal/cmdline.c | 7 ++++++- grub-core/term/i386/pc/vga_text.c | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.38.1