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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77CDBC433EF for ; Thu, 18 Nov 2021 07:29:01 +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 4618A610C8 for ; Thu, 18 Nov 2021 07:29:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4618A610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de 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: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=szK9yi4Kxm5u4IyiBkTFaIJMMZAFWXFixHhapDPnOZU=; b=2EdHJ37ugyJIBR mXLCxuDtp31XqLkiOkfudUZLmx3mSDltFPh2mUsTZYS2l15yWaS5PR/A/aJRvSGHBloDNbaICpxSD 2v7s7YZQfExn8Sz9q4Dzdm7jzvvmcDlCcZGyACzXVZQYPoubozeGy/zVfTfYmNFCFcFtsivh3B9hL cUPMo5d3kTAlcd0VY3kjrhRAQ3a/qPL5rbfJLG+D/rQtgl9E2W2oSdl0ekPKoCztJh1AYe8camkiC kwjrJ+xsdbvEktjCtOq5sJTNhJB7mkPBkGKlnM5NnW/Oa7Gfo+9R36Evo1z74JgkXPgWLSMXZMFyF R9lSVeHbaHGUenNkm0dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnbpT-0073PQ-S2; Thu, 18 Nov 2021 07:27:32 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnbpQ-0073P1-Cr for linux-arm-kernel@lists.infradead.org; Thu, 18 Nov 2021 07:27:30 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D00401FD35; Thu, 18 Nov 2021 07:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637220446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6lR2NN1KvVP4Jy99ruifaDovy1lCX/AMdZlr3TKX9DI=; b=1HpnTCZ9U/GMu7P3LSTPoQh3w21KE35/2v8sT4qxlCHO5NbkgNJMlIOwWMQda+6TtnaX9g YqfPmOV5BQZ6PXArGLXJWU+W+7qhXVVdfwhCVGXoptrSgCpyqE5QbwAmX3U1agR3mAnN7x 8knUGlla/ypu+zjraFUsmJPyJYMuNNI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637220446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6lR2NN1KvVP4Jy99ruifaDovy1lCX/AMdZlr3TKX9DI=; b=WL01u1cV8AlwnIgEoh8zaUvwYS9usF7MNUWALOFGFm5BcZBf9Sc5AtO/SJDMqDHTdpDs2/ aV5z9BUNE0T/Q1Cw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id C755EA3B85; Thu, 18 Nov 2021 07:27:26 +0000 (UTC) Date: Thu, 18 Nov 2021 08:27:26 +0100 Message-ID: From: Takashi Iwai To: Kees Cook Cc: Takashi Iwai , Dinh Nguyen , "Ivan T . Ivanov" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE In-Reply-To: <202111171400.618456DCE9@keescook> References: <20211117193244.31162-1-tiwai@suse.de> <202111171400.618456DCE9@keescook> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_232728_626356_5BBD37E5 X-CRM114-Status: GOOD ( 19.41 ) 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 On Wed, 17 Nov 2021 23:01:50 +0100, Kees Cook wrote: > > On Wed, Nov 17, 2021 at 08:32:44PM +0100, Takashi Iwai wrote: > > When CONFIG_FORTIFY_SOURCE is set, memcpy() checks the potential > > buffer overflow and panics. The code in sofcpga bootstrapping > > contains the memcpy() calls are mistakenly translated as the shorter > > size, hence it triggers a panic as if it were overflowing. > > > > This patch adds the __NO_FORTIFY define for avoiding the > > false-positive crash. > > > > Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1192473 > > Signed-off-by: Takashi Iwai > > --- > > > > I took an easier path for now, as the attempt with a foced cast > > failed. If there is a better way to handle, let me know, I'd happily > > resubmit. Thanks! > > > > The way these have been fixed in the past is to declare these as char > arrays (see include/asm-generic/sections.h). I'd prefer something like > this (totally untested): (snip) That looks better, indeed. I'll rebuild the kernel with it and ask the bug reporter for testing it. Thanks! Takashi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel