Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1663095rwi; Wed, 19 Oct 2022 13:42:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65ParFLO/Zhwpx1nm6Qt0VeoaCI6xRGImUk00oYW/dNIZhmrFvN55FJ4prYgI1csHXCPF4 X-Received: by 2002:a63:54b:0:b0:464:8e6:11e7 with SMTP id 72-20020a63054b000000b0046408e611e7mr8885956pgf.212.1666212150260; Wed, 19 Oct 2022 13:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666212150; cv=none; d=google.com; s=arc-20160816; b=Q4FssHPQnSGbcDU06KnfmLKVUF1CYV0vqnMTI/1UHNAWH1cnX+WKb68qfcaLtSYTQt 0mTkDoEZUdRMt4J3y1zQuWOyOKP3WaEFXprgoTOvIh4yOWeS2v8C0lb4BS0vrS5jW7UH 6GFziYRzS+AuqOv8GqCCem6Y7FyLERjfSY3pUC6fzKa/f34ZVqmlCrvXQzBxw5Ze3OKN DZSXPgPqwywH9de8CmnjFs1O8GCw2eKDuiWbSjjRemGxvu/MyXcheScVKMiYTXw3o5Q6 6juqJq0Hp2fLG6PC9qrlimciFLw1QY5LjrBYgFOVPcz6QfN0OQNutHZ7EPrbPMIrMdFn yhIA== 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=6TSG2vrF4L7U0TmIuYTMcX432T1AzPyXPqLh8FCHzYM=; b=MFb4Utz4ilHxAsQSDOWPFlKAnl5mHFbKrXQ6mKfKOHHOLHPHIPf/f6CHNp+M6TO+nf ZRyDNGheY2G1Fu1ATsCTqBzxa9b9rIZPC8fOPaPQJLzr/p2rYWsEW9cTg5dMi3vTPTuA fjvQsD6NrR3b7IIxa2x7+nACk+GoeUGWw8RvvpvthjBPdKngNjdY+HKPtu79FHlw77Q3 JF380iFBj2aCpu4tuV+LseexwRkDOzqFi6/DfFyokJVlC8YZAFn9Zp3z/BsS1SmQp9F4 eoeNRuIWFHxdxu8EphZbsvZ1yHQ5jq4JUVKYI79iOnbEc1Q7aAKmiy/RWhz0pZj15pIY Jzjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=lqPZ2kwy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls15-20020a17090b350f00b0020d5dfb9d69si887328pjb.187.2022.10.19.13.42.18; Wed, 19 Oct 2022 13:42:30 -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=@zx2c4.com header.s=20210105 header.b=lqPZ2kwy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbiJSUXS (ORCPT + 99 others); Wed, 19 Oct 2022 16:23:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbiJSUXO (ORCPT ); Wed, 19 Oct 2022 16:23:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9FC1C7134; Wed, 19 Oct 2022 13:23:13 -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 ams.source.kernel.org (Postfix) with ESMTPS id 13EE1B822EB; Wed, 19 Oct 2022 20:23:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5818C433D6; Wed, 19 Oct 2022 20:23:09 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="lqPZ2kwy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666210988; h=from:from:reply-to:subject:subject: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=6TSG2vrF4L7U0TmIuYTMcX432T1AzPyXPqLh8FCHzYM=; b=lqPZ2kwyeB5qBygjZyi5SR7/J0j5oEwteqw5LXX4ixsXcBUi4I/WVv6IXWL4k2UxEVHj+E WaXtd5/5DlP8yuvKLqjg+tQ+YWXoFMnUKOYEXPQOc+aUfnxpvhaHFxhvvANWnGMDg2lu2p dJauqgiam8nth1lXao18VDlv8Jkt1+k= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8bccd0b3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 19 Oct 2022 20:23:08 +0000 (UTC) Date: Wed, 19 Oct 2022 14:23:01 -0600 From: "Jason A. Donenfeld" To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-toolchains@vger.kernel.org, Masahiro Yamada , Kees Cook , Andrew Morton , Andy Shevchenko , Greg Kroah-Hartman Subject: Re: [PATCH] kbuild: treat char as always signed Message-ID: References: <20221019162648.3557490-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Hi Linus, On Wed, Oct 19, 2022 at 12:54:06PM -0700, Linus Torvalds wrote: > On Wed, Oct 19, 2022 at 9:27 AM Jason A. Donenfeld wrote: > > > > So let's just eliminate this particular variety of heisensigned bugs > > entirely. Set `-fsigned-char` globally, so that gcc makes the type > > signed on all architectures. > > Btw, I do wonder if we might actually be better off doing this - but > doing it the other way around. That could work. The argument here would be that most people indeed treat char as a byte. I'll send a v2 doing this. This will probably break some things, though, on drivers that are already broken on e.g. ARM. For example, the wifi driver I fixed that started this whole thing would now be broken on x86 too. But also, we're barely past rc1, so maybe this is something to do now, and then we'll spend the rest of the 6.1 cycle fixing issues as the pop up? Sounds fine to me if you think that's doable. Either way, I'll send a patch and you can do with it what you think is best. Jason