From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A4E6C4338F for ; Thu, 19 Aug 2021 02:26:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 221D4610FB for ; Thu, 19 Aug 2021 02:26:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 221D4610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=veryspeedy.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=phlQ1pS5WMT30r9QTtbr5ycZD79UUWh4vBeh28lSjCg=; b=TpGa3sCwtWsqLv 5pp6eHrH2F3DamLBBYU28PO4qiNDC++xBa+kQfkk5nCHSWqMNrIVn2ALk7p/65xUG/hCyrBHw1pOL 1Ji69oAPFtPKbQi8eq9hFZHgw1F58/+AQqZn7q+Mpe2hC8nweSvYjaKiTvktFBKIbyP0iQaeSOC0b vyaSYEWjFkYiCLynMMP6f7UOrDPFVbiVqnsBSv9OrwXLdFHywKKNH8NO51tZPZJY+ZiKgmq44H0qc OAPwaCWtn4oeYVioBMhL0NMuqM7J5/Ocob3em/iTvpljVpNSiH3nRGsjkZDEc7JDvIRE/hJr+1J3y +v3rFQLcZ6id3wX7stQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGXim-006ztX-5z; Thu, 19 Aug 2021 02:23:56 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGXie-006zr3-Tb for linux-arm-kernel@lists.infradead.org; Thu, 19 Aug 2021 02:23:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 26FB35C00DA; Wed, 18 Aug 2021 22:23:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 18 Aug 2021 22:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryspeedy.net; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=7A71MB9Pix019 XDbFKd5+Ig03MCi23+Oyv/lGxbN5wM=; b=C8Kh4GY+9XndE3Fp2kJpRKJrjARz3 pSkUNxb/pl5SGp9ijDpJH9mJ4lmvwuRG26sOXKcYzptOu5Diu6sa1DLQnPCKE1Aa 4a7VBXfUnZ8oQV19pbkJ7iFGRq2+U4tSnTeTbn244dPo5QUGUIK69AnuhdZZipiM ttCrNhzId213ZIZzP6ysTXpluzQkqsK0lUotO+DPSZQ4aBWTLf7IVLUtBvILFQMX p85sMz1T8KMCBZEtWxgaAg+4NF1PFDT6oLC0NXy1QR9mxGDSttcKdDZ3PCQbEnL2 CrRo3+dE5Dxk1BPniSSwx8FBT3+l3aa0BwOn+AjOPxSvEH6o0vzgNG1GA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=7A71MB9Pix019XDbFKd5+Ig03MCi23+Oyv/lGxbN5wM=; b=XHEs/0p3 oRqSYUUV9d3DDYAV003GplElygL4YuaMT+HyH8e2CjCf3mWIIuK6IUz8qz9pOY2I 4KoX0h2NnxAzKDwPZUYZ52fJeaCpEYvdZY6qxMZyLOJzTc7WptuIUSha+j8yTUEP pb5EPRTQM7KS7aywL1yAvXKnuRthpHdMgPG1JIZYWzVGT8vs6yv35aF9nYc5zkCe Y0otpMo+3obDmGD0PnA+zJUF3JAt1CPjZGyOCc3ZXk8RKpnR2i2ZZkHPex1rDxmB 9eJOxSuCM/3Y8fZXH479jnY+7pWJR5pX7SHX2lhHtRMvgoBcZZv73JYdRbxzJMif 1WTw93pVvEq9RQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleeigdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpegsfhhgihhthhhusgesvhgvrhihshhpvggvugihrdhnvghtnecu ggftrfgrthhtvghrnhepuedugeeuudejieeljeejveelveeuffeuhfejgfduheeghfeuue eiheehueejhefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepsghfghhithhhuhgssehvvghrhihsphgvvgguhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Aug 2021 22:23:46 -0400 (EDT) From: bfgithub@veryspeedy.net To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Cc: Berto Furth Subject: [PATCH v1 1/1] Set cmdline array size to COMMAND_LINE_SIZE Date: Thu, 19 Aug 2021 12:21:46 +1000 Message-Id: <20210819022144.22719-2-bfgithub@veryspeedy.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210819022144.22719-1-bfgithub@veryspeedy.net> References: <20210819022144.22719-1-bfgithub@veryspeedy.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210818_192349_065779_60CD980A X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Berto Furth Use maximum size in declaration of ATAG cmdline string. The declaration of the cmdline string in the ATAG type tag_cmdline uses an array size of 1. This means that the fortified versions of string functions (like strlcpy) will panic when they see that the actual contents of the cmdline string are bigger than 1 byte. Fix is to simply indicate that the string can actually be up to COMMAND_LINE_SIZE bytes by setting the array size as such. Signed-off-by: Berto Furth Tested-by: Berto Furth --- arch/arm/include/uapi/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h index 25ceda63b284..9c88c919467b 100644 --- a/arch/arm/include/uapi/asm/setup.h +++ b/arch/arm/include/uapi/asm/setup.h @@ -124,7 +124,7 @@ struct tag_videolfb { #define ATAG_CMDLINE 0x54410009 struct tag_cmdline { - char cmdline[1]; /* this is the minimum size */ + char cmdline[COMMAND_LINE_SIZE]; }; /* acorn RiscPC specific information */ -- 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel