Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8453081rwi; Tue, 25 Oct 2022 06:58:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rE8thM1O9xdUsgWFc1BamXGoAXuUWvG/f4OKjiXrgm4gV+4sznObtj6TvqsbTGMTHV4Tt X-Received: by 2002:a17:906:eecb:b0:73c:5c85:142b with SMTP id wu11-20020a170906eecb00b0073c5c85142bmr33023185ejb.433.1666706288150; Tue, 25 Oct 2022 06:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666706288; cv=none; d=google.com; s=arc-20160816; b=SW3II6bUmGRj6VrC3CBAxXLi1KUEQnsy13wTsWGj9o53C2z4r9Gz9L9Vce4pGhBtDA 4KYfW9QJCtM/HzBy90PK3uNsyYvjMoU6nYW37eu9CQ0WtgzJyf1DbRtzJdn3e1/KethX NH2U4Ylx3XiYLjKDuR2DG/eB/68lWgXQTQ5l0B37NZ8nWvuBFfVugYGcylHiC0CPAMHH JmInlEbKbZIA5IW4WNKGHld88xmULIIDBwHSOqRbNvzsnZHsQqW0dICMIhRc+LOG1u5o RM4y6UvNs/G91zFI8bXylMZjYQwOLi2M3bRo9EKJj808FOrDhe3N3cVyiGTjELi4NXm4 l/kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B/fSj0tR4WcPczoyuKSHqRuQ1gKyntrP8e3NpySAdSA=; b=WDzdJoMq2U5KTGlx/1tRCx20Yybw+nmbNTrRli2UHCE+PAJL0UjleMfD5FNZUJU03D E0qwGcoIDsshQ+MQO/R0NYRMxKUGayVOwh2dxnY0J6UrIYCAO/CtUGYYfRwJvs0maSmU Nd9Vd1edBkHtWoNGo2NTi/TmUOJxK7ukcXSUIonNgc15oNdU/Gwzd9YbFDMQ37qYuVdK n301OC1t590KlWH0VGNO5rWAe3P+H+X1m9McKDE1lZxTPTz1tEZ6NAYaW+8RCQUugThB QBTpGV4kG7sl/+jkGfXGvEiqjPIyDlKamdtCAbvJgWBNUHS8mJgzoksFIfn3QhfQpV3S 0JQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O16r+C8H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a1709065d0c00b007827639faffsi3375188ejt.760.2022.10.25.06.57.42; Tue, 25 Oct 2022 06:58:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O16r+C8H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232442AbiJYMtq (ORCPT + 99 others); Tue, 25 Oct 2022 08:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiJYMtZ (ORCPT ); Tue, 25 Oct 2022 08:49:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 913FD193762; Tue, 25 Oct 2022 05:47:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8155B61919; Tue, 25 Oct 2022 12:47:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60931C433D6; Tue, 25 Oct 2022 12:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666702037; bh=PRmqS5H+nCp9dplF7lCxZ/svls2XGbTUgDWMeIMlsbU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O16r+C8HYrEgaR0P0z3/hFYuLy0xAnu9sEbIfGlOOfQCoSWHULDzBxmppvxU7hE8j lVYQXCmknfIwBbCNw3vBkg5PV5+lZgKV/yNUhkExYtevIQjjb1NDTJrfemJS++jSnA hwV2PWwEAX3vTqQG9BkfOPcOL976KoEVpzlxurmY= Date: Tue, 25 Oct 2022 14:47:15 +0200 From: Greg Kroah-Hartman To: Pavel Machek Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , xen-devel@lists.xenproject.org, Kees Cook , Sasha Levin Subject: Re: [PATCH 4.19 174/229] x86/entry: Work around Clang __bdos() bug Message-ID: References: <20221024112959.085534368@linuxfoundation.org> <20221024113004.718917343@linuxfoundation.org> <20221024174127.GC25198@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221024174127.GC25198@duo.ucw.cz> X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 24, 2022 at 07:41:27PM +0200, Pavel Machek wrote: > Hi! > > > From: Kees Cook > > > > [ Upstream commit 3e1730842f142add55dc658929221521a9ea62b6 ] > > > > Clang produces a false positive when building with CONFIG_FORTIFY_SOURCE=y > > and CONFIG_UBSAN_BOUNDS=y when operating on an array with a dynamic > > offset. Work around this by using a direct assignment of an empty > > instance. Avoids this warning: > > > > ../include/linux/fortify-string.h:309:4: warning: call to __write_overflow_field declared with 'warn > > ing' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wat > > tribute-warning] > > __write_overflow_field(p_size_field, size); > > ^ > > > > which was isolated to the memset() call in xen_load_idt(). > > > > Note that this looks very much like another bug that was worked around: > > https://github.com/ClangBuiltLinux/linux/issues/1592 > > We don't have CONFIG_UBSAN_BOUNDS in 4.19, so maybe we don't need this > one? Good point, I'll drop this from 5.4.y and older now, thanks. greg k-h