Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4456909pxv; Tue, 29 Jun 2021 07:28:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEEYS+Q9VvbQPRZX39fkPKkfc21dlRHx6CyjiGBDe/uP9SXlXsAkrnGspz8bt9XniQIdZF X-Received: by 2002:a17:906:11db:: with SMTP id o27mr30460824eja.34.1624976919670; Tue, 29 Jun 2021 07:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624976919; cv=none; d=google.com; s=arc-20160816; b=w4kfufHvmDQrEDZdhP+VKbMV4bgTeP4kq6RJkpOxxPeU/XZ/oWDKuz57Bq3yzqiU8t +UqqwVtauLkWJP59/GZYnuhM0aZdgfITs9wILKP9s2Hi4AIfFfeKZinPz5ehzLCS5jSn 18uLUDJL8kKP3KvYG+vIyDG97K4A1C7RejTEZRWkL790/wHGM5ks6JWu7pPCVGdfTupq LgZBi/Kfc2L+UiaSJ5tnrL/9nkKBVatQAq5A4ZoZzCFE/nef/rpFEDMCzCYre/3rg5cR HvOhur+QVuDpHXuMT/sdsTiua6fKUevIplcwkD/pPZG4t3xgfrE5u9juTDmgfo+z6MMI qrBg== 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=4XHdTDx+f1fuX9iH8cUMgK1N4wwfAyYJN1OtpzY0PJQ=; b=wLOFjnmTBQ82KrK5nVnhlPZemlqdjfVDaIOB12MZ9BxUwlqFhcgwsqYOsjR1rXHCmG wTASyzjrXxuXFshZudcPMKqu0WtwmKfm0eyilafyyphlRrKfeC0vPEyhLbsNtLulYQnT C678UElmi0BdEFwN8a0P658Pi0PWFYz5XLyJ1eZN+5iXyjjPeyfuj87GMUFx/Ao7me0f 4V4xfURrMMJfxSa2HRp4T13xWNiHXJk+61gJsQX1JnnHwKOMgArElmduQWTL5lwP+p8P whj9XGsdWMUoe6ovBXxfR7qNZYVwALS4+1N6HEcUWTJvwnamv3mqqflQwjnQlJHja+y2 oA+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QPdtv7FV; 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 nc38si14891697ejc.36.2021.06.29.07.28.13; Tue, 29 Jun 2021 07:28:39 -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=QPdtv7FV; 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 S234405AbhF2O2e (ORCPT + 99 others); Tue, 29 Jun 2021 10:28:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41860 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbhF2O2d (ORCPT ); Tue, 29 Jun 2021 10:28:33 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15TE3uKv027571; Tue, 29 Jun 2021 10:26:01 -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=4XHdTDx+f1fuX9iH8cUMgK1N4wwfAyYJN1OtpzY0PJQ=; b=QPdtv7FVlz+Pv/i7jvwlP89vsb7Z7ofj+H4EePBc7cFzn7d7O0DQqYHdaCxtlVVYhmFm JCcZgjdL0JCGWqd9QhkIwEcj6tRpy+VQd9shsqmHe6E4u4tGbbFtt/0y8rZf0ncETw+i 3dDY7TRWyF9jwPGb/e4+cZCz3r+QvYZzd6dwCkOly8P+FMF5d27lxD3ZLU+N+4np51x6 0HdfSBFsKMbFCDvYmIcNxVxi9PC32MtXmZc5b0IU2fC99bDJLLEhU7LiotjII7dRukr1 hxH2dXb3gFtWiQl+UKEwhM9accY438SsjQytY76DJmRXZ4syD+UIch5LF5D/fMgFD9Sf uw== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 39g4bv1ub2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 10:26:01 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15TEPx2g009736; Tue, 29 Jun 2021 14:25:59 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 39duv89b5y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 14:25:59 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15TEPuWL34472348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Jun 2021 14:25:56 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F99FA4D59; Tue, 29 Jun 2021 14:25:56 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45E0DA4D67; Tue, 29 Jun 2021 14:25:56 +0000 (GMT) Received: from osiris (unknown [9.145.27.87]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 29 Jun 2021 14:25:56 +0000 (GMT) Date: Tue, 29 Jun 2021 16:25:54 +0200 From: Heiko Carstens To: Kees Cook Cc: Julian Wiedmann , Karsten Graul , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] s390: iucv: Avoid field over-reading memcpy() Message-ID: References: <20210616201942.1246211-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210616201942.1246211-1-keescook@chromium.org> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0N5-G2kN8AAM3oReH1CNRvNPphV9_ntC X-Proofpoint-GUID: 0N5-G2kN8AAM3oReH1CNRvNPphV9_ntC 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 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 suspectscore=0 mlxlogscore=610 clxscore=1011 priorityscore=1501 spamscore=0 adultscore=0 mlxscore=0 bulkscore=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:42PM -0700, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memcpy(), memmove(), and memset(), avoid > intentionally reading across neighboring array fields. > > Add a wrapping struct to serve as the memcpy() source so the compiler > can perform appropriate bounds checking, avoiding this future warning: > > In function '__fortify_memcpy', > inlined from 'iucv_message_pending' at net/iucv/iucv.c:1663:4: > ./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 > --- > net/iucv/iucv.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) This one is for Julian Wiedmann and Karsten Graul.