Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9177846rwi; Tue, 25 Oct 2022 16:28:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uDrrBRrffs5h+t0N/HYu1CdMDuxJF+GWzJImw2KxcKxZq8dplScsBemhiXjhbufOE8cXy X-Received: by 2002:a05:6402:524e:b0:461:fa05:aff8 with SMTP id t14-20020a056402524e00b00461fa05aff8mr7786725edd.283.1666740480281; Tue, 25 Oct 2022 16:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666740480; cv=none; d=google.com; s=arc-20160816; b=rq5eF9SbMgdV4EwLrTSaYsXfZT5AgI9mm1NvqUeF+kN5KZo2vCjlQCoOvI46dFNG07 VQX+MUPnaRxqgaXuJl19hBYMXpUZwdwYZJzKWTLOvvVB+lXkCJF3Z+I+jin7navBrNkM vJsjz77fzeSjXahVSZYNpL5kxk/kuha8LB4nY+8xHhoqkLgOc/bpbSI6Iss+m/RVAoIm KQfGm/H+vLYVGUMNW/xDBVPs+OahIZBlDPioe90khK2M416a/DvT5JepnOXBhvr+wv21 Kvsee56jJcIZ0HQTqvac2+AB5JXCxtP2Pu5Pq3XVTcovzUJ8RdmNB8CJAGFCMbMlh5rn 61tg== 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=s6LZP8hvZm1H8c+TGDoLOM2VTr5Lxnor/nw5sFV/2mY=; b=IXTzqtqiDQDA78UMZz96vKeoaBL5MXFXUViuZea3lv0kd0TICXccyA5MSZ1OL3C+Xe +5DixY37pE1u5ZABlitiUZQo4X50QFJj9B1F5SDpidw4udNbEN74JjKE6VNffTYKuDlS nnOCK650LKSgENPpp1EHC2kmufM58HDxY/4lK+phMb7e3DP+RBpJ889e0fvtCwdoy+6l H6AQmD8BP6q00N+pn0FO9eCnqpQ39ANiFvzAi5neVN+WrWeaaohwCAM9mWJRZoeYa6JD NLIwvLnTHmESPfSbdHXfQubKwsYOJv10hCDUkIAXoKd2tdXligqfcFaioUd1Se76XTb9 qBvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eBUosIjw; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb17-20020a170907161100b00791a37e665esi4368474ejc.10.2022.10.25.16.27.35; Tue, 25 Oct 2022 16:28:00 -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=@chromium.org header.s=google header.b=eBUosIjw; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbiJYXAf (ORCPT + 99 others); Tue, 25 Oct 2022 19:00:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbiJYXAe (ORCPT ); Tue, 25 Oct 2022 19:00:34 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 069A5CBFD6 for ; Tue, 25 Oct 2022 16:00:33 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id m2so8320528pjr.3 for ; Tue, 25 Oct 2022 16:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=s6LZP8hvZm1H8c+TGDoLOM2VTr5Lxnor/nw5sFV/2mY=; b=eBUosIjwxzoCivbiFw947tiAH5Kc5Zjv1vE5XKCjauANrPGnJZaAjWvYUDGuc2p3ra D0o1CDbvF+anvekmPVnVtDC7TRRKwRsL6DsbvrN33f10kJRVrqHzLepIxWOfr8YWUHdG 5iP/4geENpl6p+WCcY5oEeLfXkWqGUaRijJpE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=s6LZP8hvZm1H8c+TGDoLOM2VTr5Lxnor/nw5sFV/2mY=; b=ZXE1lq2Zbpis+k4Z/EIAKsIeIWm+APVWjUmeVkJ8poqCG0pF6wnoYYfg5pzYOCc1CI wyBa6CorB8BTR1O/D+aBsZuVbKF5QZ9JgPFRVyw4R2XqKIMyxQd0CtHrDEgPxpjBOQDH W9vPF0GlXFGxZrbr4IgJKw+QG4mxck2PtAkr34UkxxA3gJt+IB+Lv4jDG/RoSti0hyPC HgiBcPeuE7UztJ9WP7kE3IKLA2TxRrkl5F/HlfHFSgijxiTkjrgKVPNoYiY4U6jdQYZk QbvKCJchensSI84pgLAhZj2bOmvUHQ5IXwNX1cr8QNkb2H28BGzrgCcuHhQmoCmAh6N8 SpCw== X-Gm-Message-State: ACrzQf1rcwUjrWO8QZRK5hzeZg0wx1UVELMu83Y43oHP4fgsNnRgX9as KJY9RN+WPVpNj+5ZyEk6suqf2Q== X-Received: by 2002:a17:902:ec8a:b0:185:5462:261a with SMTP id x10-20020a170902ec8a00b001855462261amr40802031plg.160.1666738832501; Tue, 25 Oct 2022 16:00:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id cc21-20020a17090af11500b002086ac07041sm90501pjb.44.2022.10.25.16.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 16:00:31 -0700 (PDT) Date: Tue, 25 Oct 2022 16:00:30 -0700 From: Kees Cook To: Gabriel Paubert Cc: Linus Torvalds , Segher Boessenkool , "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-toolchains@vger.kernel.org, Masahiro Yamada , Andrew Morton , Andy Shevchenko , Greg Kroah-Hartman Subject: Re: [PATCH] kbuild: treat char as always signed Message-ID: <202210251555.88933A57F@keescook> References: <20221019162648.3557490-1-Jason@zx2c4.com> <20221019165455.GL25951@gate.crashing.org> <20221019174345.GM25951@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 Sun, Oct 23, 2022 at 10:23:56PM +0200, Gabriel Paubert wrote: > On Sat, Oct 22, 2022 at 11:16:33AM -0700, Linus Torvalds wrote: > > Practically speaking this might be a bit painful, because we've got > > several different variations of this all due to all the things like > > our debugging versions (see for example), so > > some of our code is this crazy jungle of "with this config, use this > > wrapper". > > I've just had a look at that code, and I don't want to touch it with a > 10 foot pole. If someone else to get his hands dirty... Heh. Yes, fortify-string.h is a twisty maze. I've tried to keep it as regular as possible, but I admit it is weird. On my list is to split compile-time from run-time logic (as suggested by Linus a while back), but I've worried it would end up spilling some of the ugly back into string.h, which should probably not happen. As such, I've tried to keep it all contained in fortify-string.h. Regardless, I think I'd rather avoid yet more special cases in the fortify code, so I'd like to avoid using transparent union if we can. It seems like -funsigned-char and associated fixes will be sufficient, though, yes? -- Kees Cook