From patchwork Wed Nov 20 08:52:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 844511 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:8b:b0:382:43a8:7b94 with SMTP id m11csp1596448wrx; Wed, 20 Nov 2024 00:54:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWMtWev05qXL3gaFXf77xlseDXj08/He7iLBFXDgIKsLHEO+2Bub7sa523ccFprY0i9v2DrYA==@linaro.org X-Google-Smtp-Source: AGHT+IHA7+VK4fdUJVjcXowKCQAWY51jZ5/uShg/utElD04oiUhnnsczByHJAf4EFgjjxSC7QCt/ X-Received: by 2002:a05:622a:480f:b0:460:8993:cab4 with SMTP id d75a77b69052e-4642682786amr33685231cf.23.1732092851329; Wed, 20 Nov 2024 00:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732092851; cv=none; d=google.com; s=arc-20240605; b=Hz2Q3BDY/9D1Szfpmf1/W+3ShjKUX6S58MGbIdjeq5cxg0BkB5+B4bozb5EGuhCSao qei0pDrUO4tAQxAWLneRS+vGWCbzWeG54NfzPisJn42kYu2xtO6HFV9bR0Y8OeTrNhJn s5oxXMPchhkPfdVlp3mU2mM6E512fK0dDE3lQPp9tHVYvfUSIDRelUrZVxXcs4jQX2nj XYzF4Ap61m+h7k5Pg8vB02liJDRq7c1GQuwQ9fwbYwmVkXk1VjoDIowXpvU9CnIbpQ0T F6oOpPJ9x0Wp3+ytnWr5zm4BBqRQEE+pxjsiq8LbEOKYSgNsNTKD/4uTD9WDYR55gf8H cJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=AKRf522PiZvbyscqQiXBRA8lbsjpyWsajE/CJmlcFBY=; fh=JRsHzxK01eLxlrW9CdJaXAIZWt4OVEECApBliHEub6o=; b=UbLcYX/Tobk7gLrV9FC/G8r+qTu7DnHGSS63XXNMeCKSvhuk1WsrLSz1JMfi0LLu17 y9FK2X6Q7j7DSDij56BPh0qwLz1uMdqI7oRFRrmloDaMq9i4V2/k7y6AKpdvQrITZIKc EqFD95dsGKS1FY1pCnqM09Lkh7IWZvnqq89ycHnXxm0N8hR1hCeHRWrZwZEy9WKABfmB 4+i/ciMq4krHmDZvEuytDeyL2NLL0HVcfknic24RSPKZCrK1GHCcOCGAxLmNHqr9L1r7 wlopLld2o4cXx4lS8RGnFE9jK9+8GEJTlaqjsaVD/rF0xDFXaXZS3l52/y3bKhAue0eu qAoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsWiI99K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-464678da31bsi13414231cf.47.2024.11.20.00.54.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Nov 2024 00:54:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsWiI99K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDgSW-000055-H1; Wed, 20 Nov 2024 03:53:12 -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 1tDgSR-0008W9-PD for qemu-devel@nongnu.org; Wed, 20 Nov 2024 03:53:08 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDgSP-0004Vb-Pc for qemu-devel@nongnu.org; Wed, 20 Nov 2024 03:53:07 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4315df7b43fso16919465e9.0 for ; Wed, 20 Nov 2024 00:53:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732092784; x=1732697584; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AKRf522PiZvbyscqQiXBRA8lbsjpyWsajE/CJmlcFBY=; b=tsWiI99KXWMYOurgJfYevO+S/o9M6qvLgDxjeseLYn6lWXCRLTL8vmT+EIamJC1zYH 0tA+3WgvdjpIa1UzIfiX458WjlO+wsxlSQzKPOMUtxYw/qVjADNwoRaCrOnvtS9c3VHg gont5aTvJgYwxZ3hrBF10NFp5msnO2nfdgpV9/gb77KnewRI4nchP3ijkeWhq3yRHY62 VHKutYuS9vxnDZvpFHEyi82gBNrQFSUzAiFQw72mjdcRQXCmQPsT1G3UV9Y1LWAvqlvZ aZM+tsJbPwNEgzcioIfVg6lB/3UijEbXXLoLTVMn8f2s8zorOom9AGnUE13u6NEaDtTd +Czw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732092784; x=1732697584; 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=AKRf522PiZvbyscqQiXBRA8lbsjpyWsajE/CJmlcFBY=; b=R4Qxa5DiLLB7R+pOg9Lq3xoIse6GRykGs+IsF0QvMy4/3Svm47gvF1gzZqLK8bhsDq EM4r42Yrc00iaPv1zgRkg0TEWJHKO3jXIUW9+DAN23+FZRyJ8JhsCOCgNDKFv1VkFsAS LqPCFtOFKWSMEU4ZZm+vQgz84TfVgY3CwyYKz/2/hhwKoE8Kjwia99cVM6LzLxohxsyU GZcwO3Zza6c62jLshzzMj52JtjX2RI7CiMa6FAUwbNdqx2CPnbPmSHJmz28Q46EvySjU dthv+412SiQ/WWE2dO6AqqcZTMshONA6lmRN+/biyIS5gdnJJdizhmEoVy4XduuLYrfa /huQ== X-Gm-Message-State: AOJu0YzMC2ggJWFUyqDmTZiuBI4zo80ewaiKPktauxBgCcfK7ZQdYX++ Tu3hMhiBDAtD1btoVPjGyLJo9lvMTWqfXa0QbrtnJCc+uZOaab1ea+lfoms34eB/WBhr3HOyM6l 4fOI= X-Gm-Gg: ASbGncvA7FgPT2sAEzLlQLciNACLEAEOaMMBpPUVl+cx9fcwfSwtB5mF05FxNBaouZC Jq1JAS7Uj/AewiviZJXBDwIXbwU4zQ+38vLYhsYNe1l/T4lzmFvDtqs1GKTzi7HZ6sR3G94LS1z xNTZ3Qy6+OOtqSR5I6CWVRGj3GdF2aNR53ypKV+DYue+qOMnsGwU5Sut/1Th3Esr1C0DeufV8dA BQbE0r7Ofaj2E1iE3/GliYjWUIzq/RWq1H9m1hKxQdG1qNOIjcsVlC/3ZiWZ5zM3U3kbx0= X-Received: by 2002:a05:600c:4e04:b0:42c:de34:34be with SMTP id 5b1f17b1804b1-43348987112mr17936265e9.3.1732092783621; Wed, 20 Nov 2024 00:53:03 -0800 (PST) Received: from localhost.localdomain ([176.187.208.27]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b45d1d09sm11681265e9.4.2024.11.20.00.53.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 20 Nov 2024 00:53:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Thomas Huth , Jared Rossi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 0/2] hw/scsi/scsi-disk: Avoid buffer overrun parsing loadparam (CID 1565746) Date: Wed, 20 Nov 2024 09:52:58 +0100 Message-ID: <20241120085300.49866-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Replace magic 8 by proper LOADPARM_LEN definition, use array of char, allocate loadparam[] within qdev state, fixing Coverity overrun report (CID 1565746). Philippe Mathieu-Daudé (2): hw/s390x: Declare loadparm as char[LOADPARM_LEN] hw/scsi/scsi-disk: Avoid buffer overrun parsing 'loadparam' hw/s390x/ccw-device.h | 5 +++-- hw/s390x/ipl.h | 2 +- include/hw/qdev-properties-system.h | 2 +- include/hw/s390x/s390-virtio-ccw.h | 3 ++- hw/core/qdev-properties-system.c | 8 +++++--- hw/s390x/ipl.c | 6 +++--- hw/scsi/scsi-disk.c | 12 +++--------- 7 files changed, 18 insertions(+), 20 deletions(-)