From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753489AbdHOTHO (ORCPT ); Tue, 15 Aug 2017 15:07:14 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:33082 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbdHOTHN (ORCPT ); Tue, 15 Aug 2017 15:07:13 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170807111615.4187078-1-arnd@arndb.de> From: Kees Cook Date: Tue, 15 Aug 2017 12:07:11 -0700 X-Google-Sender-Auth: NRyCzhVGNgcITj-Z9WvspXsNubc Message-ID: Subject: Re: [PATCH] string.h: work around __builtin_constant_p quirk To: Arnd Bergmann Cc: Andrew Morton , Daniel Micay , Dan Williams , David Howells , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 7, 2017 at 3:29 PM, Arnd Bergmann wrote: > On Mon, Aug 7, 2017 at 11:15 AM, Arnd Bergmann wrote: >> The compile-time check in the hardened memcpy() triggered a build >> error in code that should not have: >> >> In function 'memcpy', >> inlined from '__adfs_dir_put' at fs/adfs/dir_f.c:318:2, >> inlined from 'adfs_f_update' at fs/adfs/dir_f.c:403:2: >> include/linux/string.h:305:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter >> __read_overflow2(); >> ^~~~~~~~~~~~~~~~~~ >> >> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 >> Fixes: mmotm ("fortify: use WARN instead of BUG for now") >> Fixes: 6974f0c4555e ("include/linux/string.h: add the option of fortified string.h functions") >> Signed-off-by: Arnd Bergmann > > Please ignore this version for now, it seems that I accidentally > disabled all the compile-time > checks with the __builtin_choose_expr Just double-checking on this patch. Last I saw you were testing a tweak to not use __builtin_choose_expr()? I don't see it in -next so I just wanted to see what was still needed here... Thanks! -Kees -- Kees Cook Pixel Security