From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH v4] add the option of fortified string.h functions Date: Fri, 2 Jun 2017 14:07:43 -0700 Message-ID: <20170602140743.274b9babba6118bfd12c7a26@linux-foundation.org> References: <20170526095404.20439-1-danielmicay@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170526095404.20439-1-danielmicay@gmail.com> Sender: owner-linux-mm@kvack.org To: Daniel Micay Cc: linux-mm@kvack.org, Kees Cook , kernel-hardening@lists.openwall.com, linux-kernel , Mark Rutland , Daniel Axtens , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org List-Id: linux-rdma@vger.kernel.org On Fri, 26 May 2017 05:54:04 -0400 Daniel Micay wrote: > This adds support for compiling with a rough equivalent to the glibc > _FORTIFY_SOURCE=1 feature, providing compile-time and runtime buffer > overflow checks for string.h functions when the compiler determines the > size of the source or destination buffer at compile-time. Unlike glibc, > it covers buffer reads in addition to writes. Did we find a bug in drivers/infiniband/sw/rxe/rxe_resp.c? i386 allmodconfig: In file included from ./include/linux/bitmap.h:8:0, from ./include/linux/cpumask.h:11, from ./include/linux/mm_types_task.h:13, from ./include/linux/mm_types.h:4, from ./include/linux/kmemcheck.h:4, from ./include/linux/skbuff.h:18, from drivers/infiniband/sw/rxe/rxe_resp.c:34: In function 'memcpy', inlined from 'send_atomic_ack.constprop' at drivers/infiniband/sw/rxe/rxe_resp.c:998:2, inlined from 'acknowledge' at drivers/infiniband/sw/rxe/rxe_resp.c:1026:3, inlined from 'rxe_responder' at drivers/infiniband/sw/rxe/rxe_resp.c:1286:10: ./include/linux/string.h:309:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter __read_overflow2(); If so, can you please interpret this for the infiniband developers? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242AbdFBVHq (ORCPT ); Fri, 2 Jun 2017 17:07:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42712 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdFBVHo (ORCPT ); Fri, 2 Jun 2017 17:07:44 -0400 Date: Fri, 2 Jun 2017 14:07:43 -0700 From: Andrew Morton To: Daniel Micay Cc: linux-mm@kvack.org, Kees Cook , kernel-hardening@lists.openwall.com, linux-kernel , Mark Rutland , Daniel Axtens , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Subject: Re: [PATCH v4] add the option of fortified string.h functions Message-Id: <20170602140743.274b9babba6118bfd12c7a26@linux-foundation.org> In-Reply-To: <20170526095404.20439-1-danielmicay@gmail.com> References: <20170526095404.20439-1-danielmicay@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 May 2017 05:54:04 -0400 Daniel Micay wrote: > This adds support for compiling with a rough equivalent to the glibc > _FORTIFY_SOURCE=1 feature, providing compile-time and runtime buffer > overflow checks for string.h functions when the compiler determines the > size of the source or destination buffer at compile-time. Unlike glibc, > it covers buffer reads in addition to writes. Did we find a bug in drivers/infiniband/sw/rxe/rxe_resp.c? i386 allmodconfig: In file included from ./include/linux/bitmap.h:8:0, from ./include/linux/cpumask.h:11, from ./include/linux/mm_types_task.h:13, from ./include/linux/mm_types.h:4, from ./include/linux/kmemcheck.h:4, from ./include/linux/skbuff.h:18, from drivers/infiniband/sw/rxe/rxe_resp.c:34: In function 'memcpy', inlined from 'send_atomic_ack.constprop' at drivers/infiniband/sw/rxe/rxe_resp.c:998:2, inlined from 'acknowledge' at drivers/infiniband/sw/rxe/rxe_resp.c:1026:3, inlined from 'rxe_responder' at drivers/infiniband/sw/rxe/rxe_resp.c:1286:10: ./include/linux/string.h:309:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter __read_overflow2(); If so, can you please interpret this for the infiniband developers? From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 2 Jun 2017 14:07:43 -0700 From: Andrew Morton Message-Id: <20170602140743.274b9babba6118bfd12c7a26@linux-foundation.org> In-Reply-To: <20170526095404.20439-1-danielmicay@gmail.com> References: <20170526095404.20439-1-danielmicay@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [kernel-hardening] Re: [PATCH v4] add the option of fortified string.h functions To: Daniel Micay Cc: linux-mm@kvack.org, Kees Cook , kernel-hardening@lists.openwall.com, linux-kernel , Mark Rutland , Daniel Axtens , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org List-ID: On Fri, 26 May 2017 05:54:04 -0400 Daniel Micay wrote: > This adds support for compiling with a rough equivalent to the glibc > _FORTIFY_SOURCE=1 feature, providing compile-time and runtime buffer > overflow checks for string.h functions when the compiler determines the > size of the source or destination buffer at compile-time. Unlike glibc, > it covers buffer reads in addition to writes. Did we find a bug in drivers/infiniband/sw/rxe/rxe_resp.c? i386 allmodconfig: In file included from ./include/linux/bitmap.h:8:0, from ./include/linux/cpumask.h:11, from ./include/linux/mm_types_task.h:13, from ./include/linux/mm_types.h:4, from ./include/linux/kmemcheck.h:4, from ./include/linux/skbuff.h:18, from drivers/infiniband/sw/rxe/rxe_resp.c:34: In function 'memcpy', inlined from 'send_atomic_ack.constprop' at drivers/infiniband/sw/rxe/rxe_resp.c:998:2, inlined from 'acknowledge' at drivers/infiniband/sw/rxe/rxe_resp.c:1026:3, inlined from 'rxe_responder' at drivers/infiniband/sw/rxe/rxe_resp.c:1286:10: ./include/linux/string.h:309:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter __read_overflow2(); If so, can you please interpret this for the infiniband developers?