From patchwork Wed Oct 2 09:44:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1991910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XJVKT0wkyz1xtq for ; Wed, 2 Oct 2024 19:45:16 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1svvur-0006MI-HD; Wed, 02 Oct 2024 09:45:05 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1svvuo-0006M8-Vy for kernel-team@lists.ubuntu.com; Wed, 02 Oct 2024 09:45:03 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 30FFF3F1AF for ; Wed, 2 Oct 2024 09:45:02 +0000 (UTC) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42cb9e14ab6so49706295e9.3 for ; Wed, 02 Oct 2024 02:45:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727862300; x=1728467100; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2kY8qKRKfFroyPhJNGQV/EtDH9+z69nrL9GOJxRTH3M=; b=X/4sfHdV6JuhEInBUJQAf7lZSDxONTzGrZMnb1HpMwK56oXjIiEl4cz8hJ19MptV5V W+Puq+KJwKGI4bXLO+q4H3VjqdwlUfZOye6q8pvc1NNrhBH+3yktc8ENkz634c8aQ20W 8vfwFwRGNyPMZiKs1I3zxd+XFAk5VDGu4BkZeWFgjNis+kKgVnh2hLCwvUA9UKAM1tSh R1R9HhUe1Hc2b3cF3kbO19x3Vy/aIhdJtHzbcZV/bAvoh2yu+qp+8qXNLRdMVexXZBFk oCpqKc3aOoNSXRtuzOG5f+cOrioU27Z3gQ2h/0dJ1lQ0sw7cdzPyhdA8mV8HNXRe1rxf qxrg== X-Gm-Message-State: AOJu0YyzkCwWex7XSeG0ERDOLcPSu5WbSnzBWSaw2fhh3dQIseEjZZ39 Vv7SpPTVFIZmaKWLZaSOvwgZw2nfSPek8BjwowI5LBlapt8hqrr/nrQFDzeWVhFBxMfs1TndzVx UObnMKv2AHcjbM382ULd60qwc2VCmTEjPRUH+ZvF8SX5LwAwMIKKvjVNT/hIM/gDPUENgNR9TQB gCf0aogF6UYA== X-Received: by 2002:a5d:5f4e:0:b0:374:c4c2:fc23 with SMTP id ffacd0b85a97d-37cfba182d9mr1967169f8f.56.1727862300209; Wed, 02 Oct 2024 02:45:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ8dmevmP50xjr/1JXm7MjGY2Epg1HRsOfTaBo/ZkItG1O+l97XWTwms11U7oSbofVI7OwSA== X-Received: by 2002:a5d:5f4e:0:b0:374:c4c2:fc23 with SMTP id ffacd0b85a97d-37cfba182d9mr1967156f8f.56.1727862299760; Wed, 02 Oct 2024 02:44:59 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd572fd9asm13619649f8f.75.2024.10.02.02.44.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 02:44:59 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 0/6] UBSAN array-index-out-of-bounds reported with N-6.8 on P9 node baltar (LP: #2078038) Date: Wed, 2 Oct 2024 11:44:51 +0200 Message-ID: <20241002094457.1777904-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2078038 [Impact] Issue found with Noble 6.8.0-41-generic on P9 node baltar. [ 1.628868] i40e 0002:01:00.0: enabling device (0140 -> 0142) [ 1.631444] ------------[ cut here ]------------ [ 1.631460] UBSAN: array-index-out-of-bounds in /build/linux-k1IV9m/linux-6.8.0/drivers/scsi/aacraid/comminit.c:130:16 [ 1.631497] index 1 is out of range for type '_rrq [1]' [ 1.631526] CPU: 0 PID: 974 Comm: kworker/0:2 Not tainted 6.8.0-41-generic #41-Ubuntu [ 1.631551] Hardware name: 9006-12C POWER9 0x4e1202 opal:skiboot-v6.0.19 PowerNV [ 1.631587] Workqueue: events work_for_cpu_fn [ 1.631621] Call Trace: [ 1.631628] [c00000000df938c0] [c0000000016bfec8] dump_stack_lvl+0x80/0x10c (unreliable) [ 1.631663] [c00000000df938f0] [c000000000c83458] __ubsan_handle_out_of_bounds+0xc4/0x12c [ 1.631699] [c00000000df939a0] [c00800000c460a28] aac_alloc_comm.constprop.0+0x580/0x620 [aacraid] [ 1.631742] [c00000000df93a80] [c00800000c460b18] aac_comm_init+0x50/0x4f0 [aacraid] [ 1.631776] [c00000000df93b10] [c00800000c4616ec] aac_init_adapter+0x234/0x660 [aacraid] [ 1.631808] [c00000000df93c10] [c00800000c46ee0c] aac_srcv_init+0x28c/0x7b4 [aacraid] [ 1.631844] [c00000000df93ce0] [c00800000c45395c] aac_probe_one+0x334/0x924 [aacraid] [ 1.631882] [c00000000df93da0] [c000000000cef564] local_pci_probe+0x68/0x124 [ 1.631919] [c00000000df93e20] [c0000000001c224c] work_for_cpu_fn+0x38/0x60 [ 1.631957] [c00000000df93e50] [c0000000001c8ab8] process_one_work+0x1d4/0x4dc [ 1.631993] [c00000000df93ef0] [c0000000001ca60c] worker_thread+0x470/0x648 [ 1.632031] [c00000000df93f90] [c0000000001d90bc] kthread+0x138/0x140 [ 1.632068] [c00000000df93fe0] [c00000000000ded8] start_kernel_thread+0x14/0x18 [ 1.632109] ---[ end trace ]--- [ 1.676253] aacraid: Comm Interface type3 enabled [Test Case] Boot kernel on affected machine and check dmesg. [Where Problems Could Occur] Modifications are limited to the aacraid driver, so only machines that use that driver are affected. Potential side-effects include kernel crashes, disk access failures, ... Alexander Lobakin (1): compiler_types: add Endianness-dependent __counted_by_{le,be} Kees Cook (4): scsi: aacraid: union aac_init: Replace 1-element array with flexible array scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array scsi: aacraid: Rearrange order of struct aac_srb_unit scsi: aacraid: struct {user,}sgmap{,64,raw}: Replace 1-element arrays with flexible arrays Vegard Nossum (1): scripts/kernel-doc: reindent Documentation/conf.py | 2 + drivers/scsi/aacraid/aachba.c | 28 +- drivers/scsi/aacraid/aacraid.h | 21 +- drivers/scsi/aacraid/commctrl.c | 4 +- drivers/scsi/aacraid/comminit.c | 3 +- drivers/scsi/aacraid/commsup.c | 5 +- drivers/scsi/aacraid/src.c | 2 +- include/linux/compiler_types.h | 11 + scripts/kernel-doc | 2505 +++++++++++++++---------------- 9 files changed, 1291 insertions(+), 1290 deletions(-) Acked-by: Ivan Hu Acked-by: Guoqing Jiang