Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp294552pxb; Wed, 18 Aug 2021 02:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZlrvx8dJS2uJeEsxiNBwhuGSnHVD1Qp/QfDdW14Js0qJsJpmhOJ4cgw5PoxG1eip/+sdE X-Received: by 2002:a02:a409:: with SMTP id c9mr6980863jal.138.1629279205745; Wed, 18 Aug 2021 02:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629279205; cv=none; d=google.com; s=arc-20160816; b=gI4AR02wAEbtnt2km+UJ2R9GjClS00X2fU96k6d9AWcjoIdHvkMNlz/Vqe2ZVKonBQ BQGFUp8ebuMh5FRVFISmbLvLlphnJRqIu0jKcv1W+A8+O9iI9f/1hROuuLMIeBlEiLrU ceVz1LIn5saTcig8r2noNakff4m2dWVbF7ExY+UGU5+gNHW+RSejRj9/BkOLmpn+nyhe hdDEbnAdC40MgrVa95j1JNNCgCHnN6VY8U4AQqgECoElaKyhXeBeId1ZGskQYsGItiq3 W7hHpdOcIy3/e6RCGC7C5w7iOAjWXbYWh3F+XSB3yO2gMU8ENuJwSqNEhkACNRmglz9A HxpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=MjEVLCKBlTSswofPN1pNmxlP19qpFPg2jUD4se0XdyA=; b=0dtSnX9pM17UwXORXVGCxvvzLe1T013oOf51lgI78BWKiL6ciJ9LbpXJlj73ccoqhn am686AAocjF33B3zWeRyjtmldz48p4Vd57xY7Q/ZdkZa3+sHBYViTYKN37++jwtkZrqZ SyNDBO3NjwX36MeDjBpvoMnCUKU9UaP6SDCMtnNdUuhxbz+vUXdWJ5qOWL5TYaKUR+6L jjH9Hm1T0qtZzYD4SKFzvrLb/HpWgqBdadE2CBg9j3V5e9CdIZsjYl23mI4mycLmHe7w 5+jEnOGJf8lMKPXAsf6/qjp+d5zLUbZYfSmJ+bcmKKkjsL7663E017kZtFrexW3iT9tG M7tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Vce+IAwm; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si5879654ill.40.2021.08.18.02.33.14; Wed, 18 Aug 2021 02:33:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Vce+IAwm; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233158AbhHRJcr (ORCPT + 99 others); Wed, 18 Aug 2021 05:32:47 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:39800 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233703AbhHRJcU (ORCPT ); Wed, 18 Aug 2021 05:32:20 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 6BDC422065; Wed, 18 Aug 2021 09:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629279084; h=from:from:reply-to:reply-to: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=MjEVLCKBlTSswofPN1pNmxlP19qpFPg2jUD4se0XdyA=; b=Vce+IAwmUDcfv2b7QGyi2Dv7EKo/Co6jwhdkPnVadZs3PhYLf7tUr6B9fRUUxtOcBZk6+N B9XQg+cRWkemeBBWnWGk1wfHVQuq5Xnz4OC/hrrv7YBobuFDHB3iZwPRwWeZB5fMRC+UY8 0ZVGoxSYWv4akI4SI4AnM5BUhMcP4k4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629279084; h=from:from:reply-to:reply-to: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=MjEVLCKBlTSswofPN1pNmxlP19qpFPg2jUD4se0XdyA=; b=SFOFKtThDem3M1F/rOZMlyJlFmdOZ4+c7ISuV48nRhjMQ1VbfvtT61ULNqlr3zoJHsVSVM ACnXbdzsW0b8HLBQ== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 4E36EA3B94; Wed, 18 Aug 2021 09:31:24 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id B0437DA72C; Wed, 18 Aug 2021 11:28:27 +0200 (CEST) Date: Wed, 18 Aug 2021 11:28:27 +0200 From: David Sterba To: Kees Cook Cc: linux-kernel@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, "Gustavo A. R. Silva" , Greg Kroah-Hartman , Andrew Morton , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Rasmus Villemoes , linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 49/63] btrfs: Use memset_startat() to clear end of struct Message-ID: <20210818092827.GO5047@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Kees Cook , linux-kernel@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, "Gustavo A. R. Silva" , Greg Kroah-Hartman , Andrew Morton , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Rasmus Villemoes , linux-hardening@vger.kernel.org References: <20210818060533.3569517-1-keescook@chromium.org> <20210818060533.3569517-50-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210818060533.3569517-50-keescook@chromium.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 17, 2021 at 11:05:19PM -0700, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memset(), avoid intentionally writing across > neighboring fields. > > Use memset_startat() so memset() doesn't get confused about writing > beyond the destination member that is intended to be the starting point > of zeroing through the end of the struct. > > Cc: Chris Mason > Cc: Josef Bacik > Cc: David Sterba > Cc: linux-btrfs@vger.kernel.org > Signed-off-by: Kees Cook Acked-by: David Sterba