lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <MWHPR03MB26695762E11D248A4181F43EBFB80@MWHPR03MB2669.namprd03.prod.outlook.com>
Date:   Thu, 10 Nov 2016 07:17:48 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     Bjorn Helgaas <bhelgaas@...gle.com>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        "Stephen Hemminger" <sthemmin@...rosoft.com>,
        Jake Oshins <jakeo@...rosoft.com>,
        "Hadden Hoppert" <haddenh@...rosoft.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        "jasowang@...hat.com" <jasowang@...hat.com>,
        "apw@...onical.com" <apw@...onical.com>,
        "olaf@...fle.de" <olaf@...fle.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/3] PCI: hv: use the correct buffer size in
 new_pcichild_device()

We don't really need such a big on-stack buffer.
vmbus_sendpacket() here only uses sizeof(struct pci_child_message).

Signed-off-by: Dexuan Cui <decui@...rosoft.com>
CC: Jake Oshins <jakeo@...rosoft.com>
Cc: KY Srinivasan <kys@...rosoft.com>
CC: Haiyang Zhang <haiyangz@...rosoft.com>
CC: Vitaly Kuznetsov <vkuznets@...hat.com>
---
 drivers/pci/host/pci-hyperv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 763ff87..93ed64a 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1271,9 +1271,9 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus,
 	struct hv_pci_dev *hpdev;
 	struct pci_child_message *res_req;
 	struct q_res_req_compl comp_pkt;
-	union {
-	struct pci_packet init_packet;
-		u8 buffer[0x100];
+	struct {
+		struct pci_packet init_packet;
+		u8 buffer[sizeof(struct pci_child_message)];
 	} pkt;
 	unsigned long flags;
 	int ret;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ