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 E9399C25B7D for ; Wed, 16 Aug 2023 20:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346289AbjHPU5h (ORCPT ); Wed, 16 Aug 2023 16:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346322AbjHPU5S (ORCPT ); Wed, 16 Aug 2023 16:57:18 -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 77C852711 for ; Wed, 16 Aug 2023 13:57:17 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-26b44247123so3092142a91.2 for ; Wed, 16 Aug 2023 13:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692219437; x=1692824237; 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=PTnRjDgF03Eifi7sf3kpv96X0kZ1CgBBnY922J5YppA=; b=YrnJuLkKAUI9GOoFGUyMxaW0N4JvwWCdrMEG+WXxw28UwGdvMagNkGayO+D+VNRv7W tdSXtKKS34K9MQ4zDTHtW6q2rQmnBOa1Cm/YWl1qMYvmdTxQHD3MejqhxJNse7BFpFZ4 taJO9DBM9v9B7HzFifZ/3iQ27MxXyE1MvyhG4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692219437; x=1692824237; 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=PTnRjDgF03Eifi7sf3kpv96X0kZ1CgBBnY922J5YppA=; b=l0UAmUIyP5vuLyvJ047B3aeyrfShIQFTsDLliDhVbnMh5GOZUlZEAmwWBW41vdY/UK zG31y25jVoYPtNAuLfBQTwb3xr1hLuR7o5s77bhVTkX6mOSJSQKlyWXuWW6YbSzLqVF/ 8++1KTqjW2BhV3K5WzP97VQR87+3kW7RaaDq7C1bGJ5wUPW5hSXbYShJNegxuySFzQIo GYDqo9Gjlrzz2swaBBdwBhMofLZPQeGZk3W/er5y5rLwf6YZ2BqCN5QYHcAg4AwLR82g JtZfj1bVmOFT9PAkOB1F7d3LvmMVoAsfZYs4uAlYrCxDNoDFE4l3Dl1sHfaioVt9Hbjc ILUA== X-Gm-Message-State: AOJu0YyuACY6hKpHOb0MktyOrUN0mXHES3Uy49YmEsQY9/wnRFeq9zy2 EP0COQDuQJeTjLLFs2uCnKKKhPE2aAjZYWyPLQ0= X-Google-Smtp-Source: AGHT+IG3SG9qeo0oZfUja9go8C9ZZOvux73Nr1ZbS1VQ53Pv2p6wh5BCDdxyWq4rcnvjgBR0dMyodw== X-Received: by 2002:a17:90a:e38a:b0:268:e43a:dbfd with SMTP id b10-20020a17090ae38a00b00268e43adbfdmr2746938pjz.1.1692219436996; Wed, 16 Aug 2023 13:57:16 -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 rj6-20020a17090b3e8600b002680f0f2886sm158262pjb.12.2023.08.16.13.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 13:57:16 -0700 (PDT) Date: Wed, 16 Aug 2023 13:57:16 -0700 From: Kees Cook To: Tejun Heo Cc: "Gustavo A. R. Silva" , Zefan Li , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2][next] cgroup: Avoid -Wstringop-overflow warnings Message-ID: <202308161356.4AED47263E@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Wed, Aug 16, 2023 at 10:51:12AM -1000, Tejun Heo wrote: > Hello, > > On Wed, Aug 16, 2023 at 02:50:16PM -0600, Gustavo A. R. Silva wrote: > > Change the notation from pointer-to-array to pointer-to-pointer. > > With this, we avoid the compiler complaining about trying > > to access a region of size zero as an argument during function > > calls. > > Haha, I thought the functions were actually accessing the memory. This can't > be an intended behavior on the compiler's side, right? I think it's a result of inlining -- the compiler ends up with a case where it looks like it might be possible to index a zero-sized array, but it is "accidentally safe". -- Kees Cook