Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2328106ybk; Sun, 17 May 2020 17:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9JZGI0XUQcZd6H8C12bTVcug91SVuyR1wuDw50FgInwJYXM9vhAPpCRM5Dfm0zfbFnsiR X-Received: by 2002:aa7:c942:: with SMTP id h2mr11795511edt.23.1589763162996; Sun, 17 May 2020 17:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589763162; cv=none; d=google.com; s=arc-20160816; b=jTydZfm5LG1wVjVm94inCWUoJLFW+pwg94eq4vlu8Ta4CxILAFi8AdM9xiY3MfnuNc 1h8jkDkH36ok954tpQRPb84OrwZKKBCy/afYcE5k1nVmUavUB/SiFUUbykwBwOwG/7rV af9OZEss01H4zvqJ7nzds0ug48SItr8/mUZnQem3C6kolcJCtRNXY2HaepiEIP7YDUW2 fMMew2353RhDZ46moLJdYbdHSDVix9WQG4L9QfbCAntkqJrFanlS8p8w7+NBNchYSwO6 uiqd3Tdy7pJDOWo5Du2X2kt8In5jmYkNNJsv7rdkKP2v2jpukjiPBgcAJTShZp6eNEs9 XXvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=WYkrLdGeuqCWFbXVmvqfnkVYNN+ylfEEVvtH8uGYp1o=; b=ktQpBK3b86DtharojaVFEeM0bZbRdO1B1JarlTEdnLoziCZembMdjlAdORnh1rhErR d6FqhcTtVJNOns2tBX91KpGkkCmjxWjTMQWxOr+ZKJ+7zpfaZvkPpXbVTkvRIaXZ9Zm+ TLtN5w6/lJuk3n2ktraXzjeKNtBC9gOonVgG6RrZNv1/cE1DEwp74CgqT5Fy5ncIBiWU +sLBZTS+dffcsOiwi4wYAtEfxhM2KFU3RECo73c+TFdgnHZhtKCePyMEWVwlPjqiP+fT 2eyZP3fdZEmkorwKCdxvDsmO0Q5R/BzkT/tKjcqSnWFDaHcaAtXLlIZMAji0MjZksftG SmQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=ERzzZt1C; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=t8OjfMRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si5642285ejq.15.2020.05.17.17.52.20; Sun, 17 May 2020 17:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=ERzzZt1C; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=t8OjfMRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgERAuK (ORCPT + 99 others); Sun, 17 May 2020 20:50:10 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41189 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgERAuJ (ORCPT ); Sun, 17 May 2020 20:50:09 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 4299D5C010D; Sun, 17 May 2020 20:50:08 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Sun, 17 May 2020 20:50:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=WYkrLdGeuqCWFbXVmvqfnkVYNN+ylfE EVvtH8uGYp1o=; b=ERzzZt1CW4/sUq6vbGAtfmPQDH6uI56VKaSVH5m05RlSJvp GN1bzqtHMYpAARLmyX6sx6kGyQhXLyZ77/rotq7zt/ekr51CmWk7XeQTNdxsvFnZ MCZhrXW5+I+WTW2/cjyjQ4ReVMG552iPUbslUuUeNaxe31as8dNyBgM/lCbq2cJ6 cU7Ci570bcNbS2q48aOnvagTC/MiA9bUJJ9fVZrbOokrN6dK3ZA95dEQF3KDRfqS uNBm+HBI//OfLOj7How0nAErm4TMSBQdR9KHKKO0MKgCDjqbFyUnr2WEWrlDhYgR P+n+erwN6hbOlaFWSve4axE2yD6hBzsYu9Ymqvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=fm2; bh=WYkrLd GeuqCWFbXVmvqfnkVYNN+ylfEEVvtH8uGYp1o=; b=t8OjfMRjxHIA6/4OUbeAff D4iJ54SzjaM4W45mdcOKnvmfAplQAWcL6apI3W8zsDc83P767gK17pbFaEzGbF2i mFTOJk7iLPOAmu23/+3W6/g+wvzjBXusq61S7hdcezD84oINppnLWrBpRodQHbzZ RJQZKpoitN8TJDODoOIaqRAfnFEh5gWzWVk0C6z5EGFXLVJy0EMPUu8TiyBd3eob yYSB2ldtP694/Y/eiOnhWiuyl2NZr3ob2qTw+itoEh3EBtqwzNYvKS7R5bpKBfoY 1oHdZwrOg6XJAPNiRnFuIrQXBhPoBlkbv9g9Sg5MOJzNgbF0wW6oeXvhphB1D9vw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddtgedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecuggftrf grthhtvghrnhepuddttdekueeggedvtddtueekiedutdfguedutdefieeuteefieelteet vddthfeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvgifsegrjhdrihgurdgruh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6C7AEE00B3; Sun, 17 May 2020 20:50:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-413-g750b809-fmstable-20200507v1 Mime-Version: 1.0 Message-Id: <8a30fb45-779d-4459-984b-f7792858c92e@www.fastmail.com> In-Reply-To: <202005171447.00CFE0C@keescook> References: <20200517153959.293224-1-andrew@aj.id.au> <202005171447.00CFE0C@keescook> Date: Mon, 18 May 2020 10:19:45 +0930 From: "Andrew Jeffery" To: "Kees Cook" Cc: linux-arm-kernel@lists.infradead.org, "Russell King" , mhiramat@kernel.org, labbott@redhat.com, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org Subject: =?UTF-8?Q?Re:_[PATCH]_ARM:_kprobes:_Avoid_fortify=5Fpanic()_when_copying?= =?UTF-8?Q?_optprobe_template?= Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 May 2020, at 07:18, Kees Cook wrote: > On Mon, May 18, 2020 at 01:09:59AM +0930, Andrew Jeffery wrote: > > As mentioned, a couple of attempts have been made to address the issue > > by casting a pointer to optprobe_template_entry before providing it to > > memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc > > 9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts. > > Ah, dang. :P > > How about converting them all to unsized arrays, which would also allow > the code to drop the "&" everywhere, I think. This is untested: Looks better than my hack. Took it for a spin under qemu and it works for me. Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Thanks Kees! Andrew