Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4560929pxv; Tue, 29 Jun 2021 09:49:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz8argSh1GYt4XzqHN59BLC/4y+nOw/9q0SskGq72V0AKA23RXTGXO9PScAAv3GTawAoGo X-Received: by 2002:a17:906:7302:: with SMTP id di2mr30290368ejc.409.1624985356984; Tue, 29 Jun 2021 09:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624985356; cv=none; d=google.com; s=arc-20160816; b=X26KKvzEfAgD+ZKVdff+KlXp3FOKEbmIpxtpHBCEozcVuhgxizjP4o8MTIAGuuI4cB S2mT/7qnGOLPuMqxDIxSx+QiL0fsz/g4fnighwmJDkcyecogxIj16DpRopLQj+cfeFxC w0xdK2P1H8NU7wFJwl1qJho2/2Px6+i8a0pHpb1z5DRuMMhK8maqfvxbIJVxYX+5A5yN 6aT8OKbRgTbuR97TC3rmR1xHUoiWwljfC/mZAgaUKr3Aus4En+pRXKrh5oJ5ka68JzNt S2T8Q9MepiEMG0mvRvoaaSzgg3bWVuuNrrKWMqVjwoFbOhKgzfJRYzfjcqjClbfCIG6N Mt0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=cfbdMSBNRioXD0RiokwRCZqxeJRXrOuC//dlu0v2erc=; b=EocxxOlEOwLpj7nGyUStpKMi7eLPoxg5peLhZ8bgsa99YTaEKpO3uccclawh3l+SMW DBd2qOpZMP7mcnFyAdQ+tvHNhjnRfz/vAOHnQtpZgVDI00+qI6fF6kafgTS8Jxi0fbIH yUI9MJiwMqK+lF2E7os1dpnLYWJErxy0ZfGxVAzXJ/1WItKQwx0fXGkMwrfgY9Su+yNM MZjarA3DiKoXJ47nnYBMwb8q8SyI7kNqcYXFghZMETtVfyjQWhDSzGB8nMhLJyFODilJ LOnPSRn3bBNrj3P7lNTeCi0A/hpk9RLCr+nTjDh59oK9EMylOOULqkJhP8UYS14ju4Dz wIWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=lQVdr11P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si468260edb.295.2021.06.29.09.48.50; Tue, 29 Jun 2021 09:49:16 -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=@ibm.com header.s=pp1 header.b=lQVdr11P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233897AbhF2Pxf (ORCPT + 99 others); Tue, 29 Jun 2021 11:53:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:12504 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233867AbhF2Pxe (ORCPT ); Tue, 29 Jun 2021 11:53:34 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15TFXvoN142597; Tue, 29 Jun 2021 11:51:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=to : cc : references : from : subject : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=cfbdMSBNRioXD0RiokwRCZqxeJRXrOuC//dlu0v2erc=; b=lQVdr11Pwta+j4ZhNFVvTSYEy3vHkOwrE7JuwIRV/D1b7uXxSOAgkmkR/UeZUnO502FT zeyRBmnKWxaxewfnLTL1hGusTvTwBNE6SUSg4Ir0FPRRyzh291OzbarBP4drtgCwpF3N bX/lhuNyPOoeyUjZ/YrDZ0dPyuCFW9JuWogl1ucFfjyr8geojVph0U0IpqI21N0vHdly Yb03wDVUGa5aEhZC63CDzVZn9QHBYSivqgEJn02qEYTHYFm/MmQKpEMDzFOg5l24rnSN 940k/Dm89f5gfSoaISxQ+5OuLlQi0LOcuEI8TDRZLsPu2IXzvh2K/FuIYOqxCTyMn9CY Bw== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 39g63eguj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 11:51:06 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15TFXdpG003248; Tue, 29 Jun 2021 15:51:04 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 39dughhcfq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 15:51:04 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15TFp1rF21168546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Jun 2021 15:51:01 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C391A4090; Tue, 29 Jun 2021 15:51:01 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE001A407D; Tue, 29 Jun 2021 15:51:00 +0000 (GMT) Received: from linux.fritz.box (unknown [9.145.9.112]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 29 Jun 2021 15:51:00 +0000 (GMT) To: Kees Cook , Heiko Carstens Cc: Jan Hoeppner , Vasily Gorbik , Christian Borntraeger , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org References: <20210616201917.1246079-1-keescook@chromium.org> From: Stefan Haberland Subject: Re: [PATCH] s390/dasd: Avoid field over-reading memcpy() Message-ID: Date: Tue, 29 Jun 2021 17:51:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210616201917.1246079-1-keescook@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7v49Gt2J-yt-7Plw4aPn2Fr2marbQg02 X-Proofpoint-GUID: 7v49Gt2J-yt-7Plw4aPn2Fr2marbQg02 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-29_07:2021-06-29,2021-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 bulkscore=0 priorityscore=1501 mlxlogscore=947 phishscore=0 mlxscore=0 spamscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106290102 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 16.06.21 um 22:19 schrieb Kees Cook: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field array bounds checking for memcpy(), memmove(), and memset(), > avoid intentionally reading across neighboring array fields. > > Add a wrapping structure to serve as the memcpy() source, so the compil= er > can do appropriate bounds checking, avoiding this future warning: > > In function '__fortify_memcpy', > inlined from 'create_uid' at drivers/s390/block/dasd_eckd.c:749:2: > ./include/linux/fortify-string.h:246:4: error: call to '__read_overflow= 2_field' declared with attribute error: detected read beyond size of fiel= d (2nd parameter) > > Signed-off-by: Kees Cook