Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2221543rda; Tue, 24 Oct 2023 16:57:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs2OXG+VuPwDmpODZWFC4uac3cLN6LnSoJ77YEwM6IPxJLvQhH7uripdj+SqONLEF/6wDE X-Received: by 2002:a05:690c:ec2:b0:5a7:af46:d79d with SMTP id cs2-20020a05690c0ec200b005a7af46d79dmr19736075ywb.43.1698191866434; Tue, 24 Oct 2023 16:57:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698191866; cv=none; d=google.com; s=arc-20160816; b=mmliTiyypmFIImus1JjZ1OSO4sm5UZGAVQc1Xy3MFXhQTDQ4Izaj8OanpWvri/J+bo Y7exErwlVPwNpOayf2hHIRVVAU9ZpASufLbe8V6xL7V0RKkfjC9KvRnbswosfAY/Hb+7 KXO7JNXZEq9c0oETuGJ2P4BFOW5Ef8V6Wid5QbdNqJTwRiKu0jYWHW19fhcNhF2kufqW j+24o4O9Av2FvzNU8hWhoy6AYMxQ9vGEIP7eH7EU5UlKzX6WAJHIHLmHlGJUJeY8Yqyi GeCeePmOXDwiOVuF9/8h0deiuWtNGooAjXTnYCTB2WZSp7VDGn6kot/AGaPTIP17Xlcc Qa1g== 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=+jb2uj/CUvYCQb1nd+7JiDUO6KWcdpkh68n2gxqAFo4=; fh=0d35BN/Wil7WlpOkhrD8uKYaB5WiVF0R1J1erak2/x4=; b=FP4R15+Ny04z9z3Jf3ZxPiu36Zke4w+PkhkcwlF+vz1Kp36ipx5fhJTeA0TcTM3XUb 3nrn3to7k+u4w0CCKWAZJSyuDFSaeX3n19/urfBz5kowsD9rh+4sdc8Yp2TgttXWtayS bhZJZCNsSVT6qD6nB/2dK1rdUuOqGL0PqdZpwrvjHuFzssNG96hxhj+ZKIFfTsAyyG+J pjy4qLywJ1DeLo0UWVT5h43cDnFnGA5HL0pMciMBvcUniiqklCC9AgGZfOvtIN0/AUFc glOb3Hkt4B4oJFa02y/vtIL8YC8kojMcTTGUeWW+6AXHWx804NqOUI0ZJA0rLYaGwAde RxuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dFVTLNtv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f129-20020a0ddc87000000b0059f65cfba95si9783786ywe.209.2023.10.24.16.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 16:57:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dFVTLNtv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 098D8802541B; Tue, 24 Oct 2023 16:57:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344700AbjJXX5a (ORCPT + 99 others); Tue, 24 Oct 2023 19:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344663AbjJXX5a (ORCPT ); Tue, 24 Oct 2023 19:57:30 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A1CDA for ; Tue, 24 Oct 2023 16:57:28 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b497c8575aso5039209b3a.1 for ; Tue, 24 Oct 2023 16:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698191848; x=1698796648; darn=vger.kernel.org; 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=+jb2uj/CUvYCQb1nd+7JiDUO6KWcdpkh68n2gxqAFo4=; b=dFVTLNtvHQfbRipS98kn+yVzA+Agdcob15SjfGynY2TXh6lBmY5+yVtDG7YL0u2P3x boX3eatRc/mV8CPlTZ3o09QO45iBV1nKsGaA5wAplbcsD8bfPpMfFUPiYzHGqb2CoDJs N5hBnmo3GkAaB4reJF0hk0iIVBQA6fLl7MCfU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698191848; x=1698796648; 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=+jb2uj/CUvYCQb1nd+7JiDUO6KWcdpkh68n2gxqAFo4=; b=E+qhdxrvcaXsoiglFaib2VsGaxJgrFdt30qaayLHDDcfwWa9twh5rjtV3XRRuhP4Hu dzq3WJxQGsu3LfwFhDGTtc+EkgpdsWIyISoMyw3shqPB1lIopcy+2lscIrkr82G4ga5P Jb5MX440F66mcbkjpzKoc9iIz8vOHideX/7bi3VRwoZKDn2jse6SudGr8/qcsJnq9nKz f++93Ine3w6hlrtzO6IxlkbiUQU8AAgpRsaTnbSQdEihMut0FarbUaNn1RXo6CowVs3x RlB+2l1KO3kpmGpjdefXu3sX72Kqz6cySODFxjSbQPZBM6iu+4gJ23797mzTjH9IlZMJ fOlw== X-Gm-Message-State: AOJu0YyfhOmkJrT1Mbem8aPIQh+RTcDX9UE30R0oogCwt90xcqh//Sy3 YnDWS1BAIkQHpvcXRYbNoGVYZA== X-Received: by 2002:a05:6a00:10c4:b0:6b5:608d:64f6 with SMTP id d4-20020a056a0010c400b006b5608d64f6mr15661946pfu.20.1698191847785; Tue, 24 Oct 2023 16:57:27 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id v13-20020aa799cd000000b006933f657db3sm8127484pfi.21.2023.10.24.16.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 16:57:27 -0700 (PDT) Date: Tue, 24 Oct 2023 16:57:26 -0700 From: Kees Cook To: Justin Stitt Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] s390/sclp: replace deprecated strncpy with strtomem Message-ID: <202310241652.0A3460C@keescook> References: <20231023-strncpy-drivers-s390-char-sclp-c-v1-1-eaeef80522bb@google.com> <202310241645.62B11FE65@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202310241645.62B11FE65@keescook> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 16:57:44 -0700 (PDT) On Tue, Oct 24, 2023 at 04:46:04PM -0700, Kees Cook wrote: > > Instead use strtomem() as `e.id` is already marked as nonstring: > > | char id[4] __nonstring; > > I'm surprised the compiler didn't complain about this -- I thought that > was the point of the __nonstring attribute: to diagnose when used with a > string function. Hmpf. Wow. GCC only warns if you call strlen() on it, but literally nothing else... :( -- Kees Cook