Message ID | 20170704135521.9696-1-Alexander.Steffen@infineon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <tpmdd-devel-bounces@lists.sourceforge.net> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F254603B5 for <patchwork-tpmdd-devel@patchwork.kernel.org>; Tue, 4 Jul 2017 14:07:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CD4D280B0 for <patchwork-tpmdd-devel@patchwork.kernel.org>; Tue, 4 Jul 2017 14:07:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1102E2811E; Tue, 4 Jul 2017 14:07:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59810200F5 for <patchwork-tpmdd-devel@patchwork.kernel.org>; Tue, 4 Jul 2017 14:07:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from <tpmdd-devel-bounces@lists.sourceforge.net>) id 1dSOTr-0001Xw-7g; Tue, 04 Jul 2017 14:07:07 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from <alexander.steffen@infineon.com>) id 1dSOTq-0001Xp-2L for tpmdd-devel@lists.sourceforge.net; Tue, 04 Jul 2017 14:07:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=1BNuB+jg+QrBcmxz+QtD/bs+YTXDqlv55gNuiytRyBs=; b=WogolY7pkpRSJ+Fy52yjJWtjDr/eGSF+5/Yek9c06e4FluYT8uQ35WwMJPJKIg5KWAjQq4P2Aqmrk7YIw/1FIotO3oq6n1wqHpwTKn8nbHL7pIStEQwxtiSIY/j9Diz4iKbQPZ23RAphUhfHFHrxDxBwCDYk7HOpoBCY2kgks0I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=1BNuB+jg+QrBcmxz+QtD/bs+YTXDqlv55gNuiytRyBs=; b=CSO5Py3hvFC1545jvC+/+tBt15Y0OMIpiiTMfuFt3G9zBYqJkNGypTY81vquagAyypVIjWy54Ke9LhOe+4w0tw3IsJgk6TKcaAKEqfqansBoEs+IGviWbZrymNWi6jUwH2zgT2NPiwwZX4Xp2tuRZrqmTE4ynfMRXKAV75YSYA8=; Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of infineon.com designates 217.10.52.18 as permitted sender) client-ip=217.10.52.18; envelope-from=alexander.steffen@infineon.com; helo=smtp2.infineon.com; Received: from smtp2.infineon.com ([217.10.52.18]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1dSOTp-0002VP-66 for tpmdd-devel@lists.sourceforge.net; Tue, 04 Jul 2017 14:07:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1499177225; x=1530713225; h=from:to:cc:subject:date:message-id:mime-version; bh=C2+Ov3WVJ4/xC0UDBHkCAaxaFIrya5efZhus4H5JA18=; b=In543CXeQwQxA1RumixLnr4BjqNdiiCbNWyjFQWXrT3jTIq+3556Wkmu 5QwbEqOFlTVgcy7Xh6nJrVq9SMY1KaIWldVOJiUaQMOboCRVR/h/wntfc d5R2nwU2zjiRQ+Ho4xZFiItGHmluyFQ2dGr3Zl36du5dpRL5P3Lmnwpq6 Y=; X-SBRS: None Received: from unknown (HELO mucxv002.muc.infineon.com) ([172.23.11.17]) by smtp2.infineon.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Jul 2017 15:55:34 +0200 Received: from MUCSE606.infineon.com (unknown [172.23.7.107]) by mucxv002.muc.infineon.com (Postfix) with ESMTPS for <tpmdd-devel@lists.sourceforge.net>; Tue, 4 Jul 2017 15:55:34 +0200 (CEST) Received: from MUCSE603.infineon.com (172.23.7.104) by MUCSE606.infineon.com (172.23.7.107) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 4 Jul 2017 15:55:33 +0200 Received: from ABGN5CG4522MQD.eu.infineon.com (172.29.170.97) by MUCSE603.infineon.com (172.23.7.104) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 4 Jul 2017 15:55:33 +0200 From: Alexander Steffen <Alexander.Steffen@infineon.com> To: <tpmdd-devel@lists.sourceforge.net> Date: Tue, 4 Jul 2017 15:55:21 +0200 Message-ID: <20170704135521.9696-1-Alexander.Steffen@infineon.com> X-Mailer: git-send-email 2.11.1.windows.1 MIME-Version: 1.0 X-Originating-IP: [172.29.170.97] X-ClientProxiedBy: MUCSE601.infineon.com (172.23.7.102) To MUCSE603.infineon.com (172.23.7.104) X-Headers-End: 1dSOTp-0002VP-66 Subject: [tpmdd-devel] [PATCH] tpm-dev-common: Use sizeof instead of constant X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: Tpm Device Driver maintainance <tpmdd-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/tpmdd-devel>, <mailto:tpmdd-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=tpmdd-devel> List-Post: <mailto:tpmdd-devel@lists.sourceforge.net> List-Help: <mailto:tpmdd-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/tpmdd-devel>, <mailto:tpmdd-devel-request@lists.sourceforge.net?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c index 610638a..192740e 100644 --- a/drivers/char/tpm/tpm-dev-common.c +++ b/drivers/char/tpm/tpm-dev-common.c @@ -99,7 +99,7 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf, if (atomic_read(&priv->data_pending) != 0) return -EBUSY; - if (in_size > TPM_BUFSIZE) + if (in_size > sizeof(priv->data_buffer)) return -E2BIG; mutex_lock(&priv->buffer_mutex);
This avoids accidentially changing the structure definition, without adopting this size check. Signed-off-by: Alexander Steffen <Alexander.Steffen@infineon.com> --- drivers/char/tpm/tpm-dev-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)