Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4455049pxv; Tue, 29 Jun 2021 07:26:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWPYr59tuDeKGswYTfnQwSmeFXif7YcDJVrz/exkeZJOZeK44ty1EVccDqsfBTk6HWc+N9 X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr40949866edv.268.1624976775969; Tue, 29 Jun 2021 07:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624976775; cv=none; d=google.com; s=arc-20160816; b=M/D9zDv5eMPbahj5sscx/YMVZ7wcJ1hV/nPjmU7qzOtXi+e1te4ddELOm/wIwcVbWP WOucNrDn9sROhuhJ4rRD3gQ/VDOnPAYMA3nqR5ItXy9GBMXYQMp88wWvSyN+4WHr+p2S IMcLP93fjxSK/2ayHs+nRL2hOlMnj9PFrThzC60JsNUk0oU5mK3BGMznAY1Uxv9bdbak 4cuEdQoybtTSq90xuIq/9xuHFf8Bb0+Pm/an2hvlWdwXrDKDEvnhibAL4bk1S09VzV0i +YhkIevwurC8XORsIylhk0KJbQRqfwSHaPysf+r/jNAUsH6OyqqGJ9wBoHMrEPUlvudA gpiw== 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=9H/pQ04FCs/tQ0avegBXhMmlE+E+8CGDVZnid+F/UX0=; b=PRumo6CFtoVsftAhR9KX/SngadOKUyHrAd8aRqIRHfIKAUCPt9fMr4XNnUmqKnKrAU szszdyvGPiiJc5yW5ZqWEHu8LakbIFtgRbWaphB4YS7vuzsoPrYqHyNOwR6gGhjAv6Lz B15IXskV+v7GpY5yF94MW2uiF2Jz3vxND0+ZHvwRQLG6zs1mH+jfzmH8PSJJ4L7isPBQ TMhMw8A/bPR/GXZg07qJbyxNilDgVWe4QFdykB/bI9KLHfgNCGNFhlpCFANjOAqLDVZY ABVCEfDjU0hMhjQQWUhO6656EsIstajuLcVubSGfbXp9uKJSGf7q6CJu/5APQseKUV28 XYfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EyYgyu1u; 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 zp23si2054762ejb.718.2021.06.29.07.25.50; Tue, 29 Jun 2021 07:26:15 -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=EyYgyu1u; 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 S234330AbhF2O0g (ORCPT + 99 others); Tue, 29 Jun 2021 10:26:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:27034 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbhF2O0g (ORCPT ); Tue, 29 Jun 2021 10:26:36 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15TE4JhQ078971; Tue, 29 Jun 2021 10:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=9H/pQ04FCs/tQ0avegBXhMmlE+E+8CGDVZnid+F/UX0=; b=EyYgyu1u3lSzNqjxXV7HPXd/IlxdktxE3sFp6FNwl8ku1B2FfAKFQM8CawEmdTlAOpR2 YPWdx6FRrizyYy2Pc0kTuWbXNNuWgT9zrvS55KclB8XnzYlfQipYUnZoZMzV9VCNEZrj fcBCEJXsE0st1l7QoxwrpN3QuPO01h7Yd8raOZ6B8mTGLydj4KmE4Dhgh9gOjmQHMXGj X9Rw0E01smzOdIrzbafPEXY9w5NxOjzvzx/oBjna7ccvQAh47ebbzs+bqULEJg+4/MyH zzhlpGSB0kczvoOtkJHbZuBn2U9ynVhY0BmNetWZ5j05Dhbz6+2gpy1s24u4iaOmM2/L Cg== Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 39g4e3spa4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 10:24:07 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15TEF5or000800; Tue, 29 Jun 2021 14:24:05 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma02fra.de.ibm.com with ESMTP id 39duv8gpqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 14:24:04 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15TEO1dv22020582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Jun 2021 14:24:01 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA8A2A4D76; Tue, 29 Jun 2021 14:24:01 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6AB46A4D67; Tue, 29 Jun 2021 14:24:01 +0000 (GMT) Received: from osiris (unknown [9.145.27.87]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 29 Jun 2021 14:24:01 +0000 (GMT) Date: Tue, 29 Jun 2021 16:24:00 +0200 From: Heiko Carstens To: Kees Cook Cc: Stefan Haberland , Jan Hoeppner , Vasily Gorbik , Christian Borntraeger , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] s390/dasd: Avoid field over-reading memcpy() Message-ID: References: <20210616201917.1246079-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210616201917.1246079-1-keescook@chromium.org> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: tsp18nn4WU_Zg5zCKmyk3cC-XCkPbsY2 X-Proofpoint-ORIG-GUID: tsp18nn4WU_Zg5zCKmyk3cC-XCkPbsY2 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-29_06:2021-06-28,2021-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 bulkscore=0 spamscore=0 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=735 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106290095 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 01:19:17PM -0700, Kees Cook wrote: > 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 compiler > 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_overflow2_field' declared with attribute error: detected read beyond size of field (2nd parameter) > > Signed-off-by: Kees Cook > --- > drivers/s390/block/dasd_eckd.c | 2 +- > drivers/s390/block/dasd_eckd.h | 6 ++++-- > 2 files changed, 5 insertions(+), 3 deletions(-) I'll leave it up to Stefan Haberland and Jan Hoeppner to handle this one.