Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1752236lqe; Mon, 8 Apr 2024 21:23:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLJHyVTNNHSlDYJSoJ/5+2YYW7kgjQRhOZ0H7bOia+8xGm8+9Yjsn7JUrSjMGNSLhf2A559CKjM8C8CUp37SUOMpxp+0X3MGvXAGljbA== X-Google-Smtp-Source: AGHT+IFEGxsfSD71O0vA2iQJJkSsI0HER4Btptm7lR1ltb8/qpeM8IELs6MH7mcrJjgJlnFZOP37 X-Received: by 2002:a05:6512:2398:b0:513:e9cf:34ca with SMTP id c24-20020a056512239800b00513e9cf34camr8128357lfv.46.1712636632329; Mon, 08 Apr 2024 21:23:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712636632; cv=pass; d=google.com; s=arc-20160816; b=hKIfxWXqLMW1IRTHBbSX+cX0vpvPFHS4thX5y0IarGHsOcUdQSBvoXDqLhbntbD96x /VwSEq5KeOizcmkb9sIF0XVWQd5xQ5qGB6McxHIaUKkeuhkJi/3m8sE30oQOFk39aVqE fDhYN9dCV6CEixoE7OGHno5aSLohW9Lqs4AWC0ETnlcA+WUjdf2mphbMxr5+CGFEN5+8 LlQiFo5UL3yLhpJNBQZQFxgpZfq/76vv4xEto8zO0IqXwNOVB7j76/R6cqqLsnaNRFhv O5ko77frx7m5pgYsXpyybp5QQBlqcIRHalFS3wpocCXP1lynYi8HqgMmWv4TA0bEiie0 EMxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=mmMw7a5O50tj9x9X/rTKi3+asqjaHKmEWJL4jpB0MIM=; fh=WWPWQZgX2jUOi+lZDfOKGPgWeWDtzl7+d7/JQNOvGaI=; b=iElPIccgG95iWxP93PUoqINzTXOf0goo6SdI4dx3TQqyxKlRe2qBEnLmuv5R8rYmpB X511VZB9UIYqcqTxY5a7Dy9ECUL2/aMpN6nqFmZg5VoRZ+IIPkGA9mvQZbQK5rZPr6QK Q/lZ0ozZO3uieEWBTFQOLg8dg6usQ7jel0KYeFyx1mu2zl8xogE2Nts3YtN3fQ9kDE0f MRyOkkFkBvVY+UP8KP6zGbakxMjucQVjd2XwmkvyM4ZhgODmtCWNG8xVnnsYJomfGPSO LMcSv91yuqmMx5a1soltvv/W+2c/eGZZpplSEbqQwfyUhnOITijiOgt3WmrvG1P8CITJ fUAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y3t8dqR9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-136225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e15-20020a17090681cf00b00a457907b21esi4136707ejx.339.2024.04.08.21.23.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 21:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y3t8dqR9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-136225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 69BB31F2606C for ; Tue, 9 Apr 2024 04:23:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3502762DF; Tue, 9 Apr 2024 04:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y3t8dqR9" Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 4C67D7604D for ; Tue, 9 Apr 2024 04:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712636599; cv=none; b=uchqHGbaZHkOCnOHkd26lMZsNeyCc4tILGmcMnsj7VxgPNqkPt8bhzv9bVyiGgx9Ju6d83tbwyMQyiGEQqt0ffnZHDggadnyRX0ar6D69dSs/RpJl4nXzYzdmtebcIM4kQ5PBop6InHa7+SgAtorB35tCyNtKuDTR0/T7fpmJTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712636599; c=relaxed/simple; bh=beTkpYwtJV+t5CxYWh0zckfi7M3IpQimrt25Wfmutgs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FgMIc3xH8BS6gbbgPqq5+30/bNq+LQkfTjtVWQIxK0gMi+AKquDHWWT7z10CxBNIAzHH7Rzaj4b2ykaa6knCP6/ezlw4ZScvYSOS9/bCMIJV/l3988VviI+L4EWM+IxDSk+z0Z5JSmgZc7zD6pgc+oB9TexjNRX3hdsBnHsiZJE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y3t8dqR9; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so4300536a12.1 for ; Mon, 08 Apr 2024 21:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712636597; x=1713241397; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mmMw7a5O50tj9x9X/rTKi3+asqjaHKmEWJL4jpB0MIM=; b=Y3t8dqR96GhluqRs55RQe7vbRDLzm/SES2oM0qo8ggLGkrjQYTxaB7yvNgkuSWjWZ9 3olQBNjwaXDobUQzup6m4JYGwkEZxLPEKX0L85QHCsx7MmTimQvURvsyAWP9iZbz2PB8 jiFfByN2ZXFGdTUr+9Jz8vD8P25Z0yI6culINlKrSuORgbopoYIjGiMOb4V1DQ60C/xB 1hcM0AUkkW+cgCGYV2NsK7AZTDVWpIl4l3ABU/OVS00yrENmDAS5NSxnhfN0T8ZUxsqc o1jcYbTfMk4RlAsRHQj6VJIHjvNt209/CrPGezvbnulyaFMuqzsQ1jybaeF2kjyO1jjC KjSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712636597; x=1713241397; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mmMw7a5O50tj9x9X/rTKi3+asqjaHKmEWJL4jpB0MIM=; b=UDorniXKzqc0w4+aDSqe77nksgZ5GFHDJVDURX6lFhhPHFBcwz5GKYUuswGh9Hman1 aiDni5DNvIVxGPFEdnBJrHNauSRrsF6wt2BUUuTYZsLBLxwCzwHQiSAd41j323y9RBiV ByuFCCafO+szvTCtHBnC7XWzGSkJs8U/KQpDGhlatjKF1tQoppagJrhFeqHDOejAI1Cq e6GGQl8s7SNaoZ5nHLWLkugRysLgXlx7JmBTJcIQAQaiw/QA8EenKZwWnQ/CtzMAbXHa 4uUwvDNocMAKYtw1GaZwadn4rk0+7U/NhxrSbypMn7syN4OC2IjTM5zGsYN+6hSR4NWs jprA== X-Forwarded-Encrypted: i=1; AJvYcCWKrxwVU8i3m4BGsLw9eBCtLgKih3sJTykSmxh6QETdtiQsJFc0EPH8VsuGKNMvLhahnA/ChAIVG/Ytp5Yc/8KBONeYpkus9rF8DReV X-Gm-Message-State: AOJu0YzjDXaOCopDJzg0fnMu3aiQ748rYdjq7TmyY8aZDTGesayEiqRM g35SUFzHWRVYX7e5vB2rI37YxUbMRLwM5itaqdrBJtkmqzLwdN8gNvHpSmZBs4o5OwhCaokU98b J3K6PTL4co34xfEH4rz8xVdkcG34= X-Received: by 2002:a05:6a20:5603:b0:1a7:9ce4:bd1d with SMTP id ir3-20020a056a20560300b001a79ce4bd1dmr1604314pzc.34.1712636597462; Mon, 08 Apr 2024 21:23:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Tue, 9 Apr 2024 00:23:05 -0400 Message-ID: Subject: Re: 6.5.5: UBSAN: radeon_atombios.c: index 1 is out of range for type 'UCHAR [1]' To: Kees Cook Cc: Jeff Johnson , Justin Piszcz , Bagas Sanjaya , "Pan, Xinhui" , Linux Kernel Mailing List , Linux AMDGPU , Alex Deucher , Dave Airlie , =?UTF-8?Q?Christian_K=C3=B6nig?= , Kees Cook Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 8, 2024 at 9:45=E2=80=AFPM Kees Cook wrote: > > > > On April 8, 2024 5:45:29 PM PDT, Jeff Johnson = wrote: > >On 10/1/23 17:12, Justin Piszcz wrote: > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > >>>> [Sun Oct 1 15:59:04 2023] UBSAN: array-index-out-of-bounds in > >>>> drivers/gpu/drm/radeon/radeon_atombios.c:2620:43 > >>>> [Sun Oct 1 15:59:04 2023] index 1 is out of range for type 'UCHAR [= 1]' > >>>> [Sun Oct 1 15:59:04 2023] CPU: 5 PID: 1 Comm: swapper/0 Tainted: G > >>>> T 6.5.5 #13 55df8de52754ef95effc50a55e9206abdea304ac > >>>> [Sun Oct 1 15:59:04 2023] Hardware name: Supermicro X9SRL-F/X9SRL-F= , > >>>> BIOS 3.3 11/13/2018 > >>>> [Sun Oct 1 15:59:04 2023] Call Trace: > >>>> [Sun Oct 1 15:59:04 2023] > >>>> [Sun Oct 1 15:59:04 2023] dump_stack_lvl+0x36/0x50 > >>>> [Sun Oct 1 15:59:04 2023] __ubsan_handle_out_of_bounds+0xc7/0x110 > >>>> [Sun Oct 1 15:59:04 2023] radeon_atombios_get_power_modes+0x87a/0x= 8f0 > >>>> [Sun Oct 1 15:59:04 2023] radeon_pm_init+0x13a/0x7e0 > >>>> [Sun Oct 1 15:59:04 2023] evergreen_init+0x13d/0x3d0 > >>>> [Sun Oct 1 15:59:04 2023] radeon_device_init+0x60a/0xbf0 > >>>> [Sun Oct 1 15:59:04 2023] radeon_driver_load_kms+0xb1/0x250 > >>>> [Sun Oct 1 15:59:04 2023] drm_dev_register+0xfc/0x250 > >>>> [Sun Oct 1 15:59:04 2023] radeon_pci_probe+0xd0/0x150 > >>>> [Sun Oct 1 15:59:04 2023] pci_device_probe+0x97/0x130 > >>>> [Sun Oct 1 15:59:04 2023] really_probe+0xbe/0x2f0 > >>>> [Sun Oct 1 15:59:04 2023] ? __pfx___driver_attach+0x10/0x10 > >>>> [Sun Oct 1 15:59:04 2023] __driver_probe_device+0x6e/0x120 > >>>> [Sun Oct 1 15:59:04 2023] driver_probe_device+0x1a/0x90 > >>>> [Sun Oct 1 15:59:04 2023] __driver_attach+0xd4/0x170 > >>>> [Sun Oct 1 15:59:04 2023] bus_for_each_dev+0x87/0xe0 > >>>> [Sun Oct 1 15:59:04 2023] bus_add_driver+0xf3/0x1f0 > >>>> [Sun Oct 1 15:59:04 2023] driver_register+0x58/0x120 > >>>> [Sun Oct 1 15:59:04 2023] ? __pfx_radeon_module_init+0x10/0x10 > >>>> [Sun Oct 1 15:59:04 2023] do_one_initcall+0x93/0x4a0 > >>>> [Sun Oct 1 15:59:04 2023] kernel_init_freeable+0x301/0x580 > >>>> [Sun Oct 1 15:59:04 2023] ? __pfx_kernel_init+0x10/0x10 > >>>> [Sun Oct 1 15:59:04 2023] kernel_init+0x15/0x1b0 > >>>> [Sun Oct 1 15:59:04 2023] ret_from_fork+0x2f/0x50 > >>>> [Sun Oct 1 15:59:04 2023] ? __pfx_kernel_init+0x10/0x10 > >>>> [Sun Oct 1 15:59:04 2023] ret_from_fork_asm+0x1b/0x30 > >>>> [Sun Oct 1 15:59:04 2023] > >>>> [Sun Oct 1 15:59:04 2023] > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > >>>> [Sun Oct 1 15:59:04 2023] [drm] radeon: dpm initialized > >>>> [Sun Oct 1 15:59:04 2023] [drm] GART: num cpu pages 262144, num gpu > >>>> pages 262144 > >>>> [Sun Oct 1 15:59:04 2023] [drm] enabling PCIE gen 2 link speeds, > >>>> disable with radeon.pcie_gen2=3D0 > >>>> [Sun Oct 1 15:59:04 2023] [drm] PCIE GART of 1024M enabled (table a= t > >>>> 0x000000000014C000). > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: WB enabled > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: fence driver on ring= 0 > >>>> use gpu addr 0x0000000040000c00 > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: fence driver on ring= 3 > >>>> use gpu addr 0x0000000040000c0c > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: fence driver on ring= 5 > >>>> use gpu addr 0x000000000005c418 > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: radeon: MSI limited = to 32-bit > >>>> [Sun Oct 1 15:59:04 2023] radeon 0000:03:00.0: radeon: using MSI. > >>>> [Sun Oct 1 15:59:04 2023] [drm] radeon: irq initialized. > >>>> > >>> > >>> Please also open an issue on freedesktop tracker [1]. > >>> > >>> Thanks. > >>> > >>> [1]: https://gitlab.freedesktop.org/drm/amd/-/issues > >> > >> Issue opened: https://gitlab.freedesktop.org/drm/amd/-/issues/2894 > >> > >> Regards, > >> Justin > > > >+Kees since I've worked with him on several of these flexible array issu= es. > > > >I just happened to look at kernel logs today for my ath1*k driver mainte= nance and see the subject issue is present on my device, running 6.9.0-rc1.= The freedesktop issue tracker says the issue is closed, but any fix has no= t landed in the upstream kernel. Is there a -next patch somewhere? > > > >[ 12.105270] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/radeo= n/radeon_atombios.c:2718:34 > >[ 12.105272] index 48 is out of range for type 'UCHAR [1]' > >[ > > > >If there isn't really an upstream fix, I can probably supply one. > > I would expect this to have fixed it: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /drivers/gpu/drm/radeon/pptable.h?id=3Dc63079c61177ba1b17fa05c6875699a36924= fe39 > > If not, there must be something else happening? This patch should silence it I think: https://patchwork.freedesktop.org/patch/588305/ Alex > > -Kees > > -- > Kees Cook