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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1CBC4332F for ; Wed, 21 Dec 2022 17:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234835AbiLURQC (ORCPT ); Wed, 21 Dec 2022 12:16:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234803AbiLURP3 (ORCPT ); Wed, 21 Dec 2022 12:15:29 -0500 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726C42BFD for ; Wed, 21 Dec 2022 09:15:00 -0800 (PST) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-45c11d1bfc8so58917837b3.9 for ; Wed, 21 Dec 2022 09:15: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=bDNNvWB68u3pB2icMfweTzk1EztL/1oefKeUuFrYo3eNyojRZOyHjJ7B8WO+biNgyk rRebaVkPkBRT9zl98nxhFEu1btFUiyIMD9pVYVsjxvXu4S8u4+aByBD0VrsSwqCPdZGo x8mBiMyVZxyUe4e5Jxfa3NOAASUo2xgHUWEK6YG1UIG+oVBO2DRmhXq7uzUZreh5Zs5v 0CN839aB2An4oNC9Zxg3/MOqYWVQJSREbq+KJgOVaO6rUfeIhIGdD0D5feDMb/c6u/x0 ZfGUwOT+Av3U0LQFDnVQGmy5Y94Xgkpp9Lzj/DWjcTKj6VWp2YshacblgwRhpDgilW8A mm6Q== X-Gm-Message-State: AFqh2krKoOxQDZtLRkvgea/dMCTpn4jrWo6HrdalxDHoUwqE4T1NKlgX ME78hCMUFYk+lY+xrqtM6ic4oW9vUjy+Ir0d X-Google-Smtp-Source: AMrXdXudyBJYNeHFrCNB7WfmuC7UJ0YrTE/EbuiiiiqnW3IAYC6Az8Oe/HIsZ/0BYg+ZLj2A5PfGlw== X-Received: by 2002:a81:f002:0:b0:36a:c8c:aae5 with SMTP id p2-20020a81f002000000b0036a0c8caae5mr2102461ywm.52.1671642899236; Wed, 21 Dec 2022 09:14:59 -0800 (PST) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com. [209.85.160.174]) by smtp.gmail.com with ESMTPSA id c24-20020a05620a11b800b006fc2cee4486sm10909571qkk.62.2022.12.21.09.14.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 09:14:58 -0800 (PST) Received: by mail-qt1-f174.google.com with SMTP id c7so14140656qtw.8 for ; Wed, 21 Dec 2022 09:14: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 Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@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