Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp6022177rwj; Wed, 21 Dec 2022 09:45:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtDqPU/Rn3fG5PALnmZRpmVR+YuG0pYuyH70borB4Y9HoYD3yVDxRuMy+yACwV95a4mEivp X-Received: by 2002:a17:907:d302:b0:7c1:3472:5e75 with SMTP id vg2-20020a170907d30200b007c134725e75mr2333241ejc.29.1671644722351; Wed, 21 Dec 2022 09:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671644722; cv=none; d=google.com; s=arc-20160816; b=AhRbznr8iDFeNGrJFDu0arM0PuRnipwvNdEH7AwDp30eEPjLdawpiVSueTB5FRf1XC XNh5Z1stNtIbRtjQVOOlEbMiYD63WPDOZwhz//BGmdDomcxgss9qVveMpLiZO0btR6T+ 0YLFzuuGDAwvP7+pCnQPPV8SQbFnU64U4cxYjKF0X5xLrZiGGg+wqe1/zv4Yxv+nGt+s 9JADMsUuWsnB2hSs8JfRQszxqm6mZsiojCeRAoEUYWucEQtdyFtKvlci0kszF1r157zE KzqsYLLDhSuc+VFrfJUVFWp+a/G1CXb9LR1OtCwCT+xMkeCNR+bgYC01ASiYplvxz8FY vK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=SYOKcpVH/CwZxAmDD07aAMcukw6jGJ7fZk2tWZQJ5Co=; b=SW+ve9IUIc1ZntDN1jQCU71hWWEGq5HTNiQDrKKoBmUM4ZVobxQ8eU6Qt7ykN6vcmU iOG3WAHY0jM+oigmWEaxg0UIg2qRwM1B4evSHfm8qQDiK5ySDRydd4f+ZytOThR1QpCp SkzMfqGP8OrvN2rjHuwBuLYx6jXBqZI0xi5lH548PKlfjBB6I9rOfk8vxCJ/tNe+TLHt /BxjiBdA5YJ9q/JlznnVzpTSeA6hQ3gXKy7wgMVuYy06SRiBPYNy2ulcJPLH6IzM6Ist M1HsaGDSGn6lNLYN8+OMwSQzAZDOv2WHqHYpkYRj64wRvXQ68zDNnBw0xPm8u04UBB7W 99Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EmYCuGZi; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a50fb93000000b0046c0f2a94dbsi13055769edq.353.2022.12.21.09.45.06; Wed, 21 Dec 2022 09:45:22 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=EmYCuGZi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234690AbiLURHF (ORCPT + 68 others); Wed, 21 Dec 2022 12:07:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234658AbiLURHC (ORCPT ); Wed, 21 Dec 2022 12:07:02 -0500 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE8A19033 for ; Wed, 21 Dec 2022 09:07:00 -0800 (PST) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-3b56782b3f6so219376687b3.13 for ; Wed, 21 Dec 2022 09:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SYOKcpVH/CwZxAmDD07aAMcukw6jGJ7fZk2tWZQJ5Co=; b=EmYCuGZi1aBhi0+7PLOQjdb/1nrr3I38sgxXNpnj2Ob5gPWVW+wHeaOB0rT2rW9ia1 2eC+kMDfVwn1Aw6vUx9l+Y+mROuW36ElXsnZxVtkTOtX3gWfd+EaTqrQgaKdEDoFyGkW RPvMC8bGtPA+mM+/6Yrg5RydYu4wMK+vVcANc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SYOKcpVH/CwZxAmDD07aAMcukw6jGJ7fZk2tWZQJ5Co=; b=VytoVCVPv3jaqLLWyZH6637dWJVm+q3Q+luuphgYdgkgdMIJZEf+UAXyduhezxa9+c X3ZWALo2H4O8Tb4F4hFpGZXGz95C6B/Om7w27MGphTdtysf6T3SALb6re+VoRVcEQsCD MSX2rBf8vRv1mRNSNk6BqQO5x7otmWXDMXyRrdHG+DjZyd1sozXQYmPpGpz40ETsxhR8 zY9V5TYjGjMaMqULlpdKcDWVFs3X/aTUsNfq2et4UV2koLy4vOTDgxR23kFEHkAtC/rX hLyeSJCY4uoOdCgmuOnBqc5A8sv5OjnOQvGULa4/QbNaNWeh6+QLRkr7HWwqCT7si4U8 2biA== X-Gm-Message-State: AFqh2kpeqZUkw63D7rHHuYPc821uJfw01lEqmpYwf1VQh8trGInZuYca XPbCCle1cEDmb7CfocYbNMI2rh2le1owINRX X-Received: by 2002:a05:7500:3e13:b0:ea:6f63:ae0e with SMTP id lh19-20020a0575003e1300b000ea6f63ae0emr229172gab.74.1671642419583; Wed, 21 Dec 2022 09:06:59 -0800 (PST) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com. [209.85.222.182]) by smtp.gmail.com with ESMTPSA id c7-20020a05620a268700b006f87d28ea3asm11167076qkp.54.2022.12.21.09.06.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 09:06:58 -0800 (PST) Received: by mail-qk1-f182.google.com with SMTP id z17so7060807qki.11 for ; Wed, 21 Dec 2022 09:06:58 -0800 (PST) X-Received: by 2002:ae9:ef49:0:b0:6fe:d4a6:dcef with SMTP id d70-20020ae9ef49000000b006fed4a6dcefmr84873qkg.594.1671642417917; Wed, 21 Dec 2022 09:06:57 -0800 (PST) MIME-Version: 1.0 References: <20221019203034.3795710-1-Jason@zx2c4.com> <20221221145332.GA2399037@roeck-us.net> <1a27385c-cca6-888b-1125-d6383e48c0f5@prevas.dk> <20221221155641.GB2468105@roeck-us.net> In-Reply-To: <20221221155641.GB2468105@roeck-us.net> From: Linus Torvalds Date: Wed, 21 Dec 2022 09:06:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: treat char as always unsigned To: Guenter Roeck Cc: Rasmus Villemoes , Geert Uytterhoeven , "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 , Kees Cook , Andrew Morton , Andy Shevchenko , Greg Kroah-Hartman , linux-m68k@lists.linux-m68k.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Wed, Dec 21, 2022 at 7:56 AM Guenter Roeck wrote: > > The above assumes an unsigned char as input to strcmp(). I consider that > a hypothetical problem because "comparing" strings with upper bits > set doesn't really make sense in practice (How does one compare G=C3=BCnt= er > against Gunter ? And how about G=C7=96nter ?). On the other side, the pro= blem > observed here is real and immediate. POSIX does actually specify "G=C3=BCnter" vs "Gunter". The way strcmp is supposed to work is to return the sign of the difference between the byte values ("unsigned char"). But that sign has to be computed in 'int', not in 'signed char'. So yes, the m68k implementation is broken regardless, but with a signed char it just happened to work for the US-ASCII case that the crypto case tested. I think the real fix is to just remove that broken implementation entirely, and rely on the generic one. I'll commit that, and see what happens. Linus