From patchwork Fri Apr 7 19:27:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 81000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp496340vqo; Fri, 7 Apr 2023 12:49:56 -0700 (PDT) X-Google-Smtp-Source: AKy350ZEx/XROTVcl2XvSfKl7cxT5ljORJjlQQwXo2uMSAICIb93BqCc3HfhUvPYcA+l1E4Vi796 X-Received: by 2002:a17:906:cc4d:b0:944:308f:b977 with SMTP id mm13-20020a170906cc4d00b00944308fb977mr399915ejb.16.1680896996390; Fri, 07 Apr 2023 12:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680896996; cv=none; d=google.com; s=arc-20160816; b=rkPAxoO5ZoptVRl4CrKssVYCA/8taneFeT+SCDK5Zd4QB4V5uflxjI0QdS01+t6T3V zcuVoRs3PeedTPkctSjTfFAJc7rqr2HbjpLqXBOOc1g4gC8IIuDQtaWjAKJBpts5pEwr EZhKW9YaSi9EMpianzUhLdI2HwVBuUZ0vjSShAExSF/5O/9A+lhV8QEBdNagBcYjq4hF TEeHvC3Q3bozuhaKqaNGq3urmwtLofSMwWa/yAlXXXhetiiD8Tciw3uQTOGE3SQqx4P1 aO2lsLJEi0C+x+eNkVr3GstMyLE16c4zbzmTfLDe6y2qbynAcReY1+9lwJ+oHa2tlMVK cITQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xyby/EazxIHU080H4IjdTfHbXYv3ut7QI/UHzeQm/pk=; b=GObH/rB/99RS208AndiyiXR5MFa7LPhUA1ui4ZXoHkFefl6XvJdM5pNRUNpe8vWSoP 9+yzk3lDn+yjc+W6mR0meW+axFeL7t5Mi1HA2TPF6aAjNhtUyxhCefttdltlBRm9C9n6 jvuGCROF/uOGBu4jG5JsEYhrnCoNqy/LC71M8AP8sgskf+JGSKWf1MIOg7V92jR79rRQ GxWFrc97Ahvkd+FuJ6aFlsyR/n7FHbc6Fv7Pd2ueT6Z9d2pWoewz7VjVpc81DU9yNEnB 5xG3mwCNZOT8e6J8Sv8/Wh2t8K2W3diTUxgVL1k2qCaD7MolrKU1gKwalnSovWa+OrJx QcJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J0oQIAcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx24-20020a170906af1800b0093959594e50si3648002ejb.248.2023.04.07.12.49.29; Fri, 07 Apr 2023 12:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J0oQIAcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbjDGT1b (ORCPT + 99 others); Fri, 7 Apr 2023 15:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbjDGT1W (ORCPT ); Fri, 7 Apr 2023 15:27:22 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0730DBB98 for ; Fri, 7 Apr 2023 12:27:21 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id o11so40758555ple.1 for ; Fri, 07 Apr 2023 12:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680895640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xyby/EazxIHU080H4IjdTfHbXYv3ut7QI/UHzeQm/pk=; b=J0oQIAcvJHQmNqjl+kzQKyzPrvC17RrlUPVkWtcyilcpofI3iWccvIsy1FWzpsd3Ce 1QCSb08qko1aBpAWce/V41Fs4NGzufTLEc8nf2sd9lnX5LXXKOixq3cKr5Xx59xQC4PL aRXEexQ6aX/UVxWtKcwLYDjLscto/MVfKav/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680895640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xyby/EazxIHU080H4IjdTfHbXYv3ut7QI/UHzeQm/pk=; b=ilDfI/UFVsaAOxx0B8dbNWE6u9wdSvaRKpW3RkDpqvInXlDtswSGAe+9Ks+jkHkkKv aqutgnBbDfnQT7cqyhOBy/SyRcqlsLb0arcdJYVL0/5My9FrAMBWpsb7YdY1wiQrlS/l ulCMfFJa58EDzHrRvP9rLDTLMW4dNNUwHU7i/3vb6WLsIULE/m9de2cIHQdlbQFfV+cF 6s7OWbWQF63UsJmoxY8928hk3JBuqiDixOgWOnlz1Hcny3SwoFa9FZRjzBn1+R/OINgt uoWOfyIeqkfUIwNVy3b1MYjfDY+hiCJSesp8gavl5ObCtS7wsz92PCcFTovr79Idz3aD WV/g== X-Gm-Message-State: AAQBX9foAq+2d5CftEB+XNfOoY64gdGTojzq6/38DlZUBplB6Yz4efQu Id7X1EahEWvx4BH9yYC/SampUA== X-Received: by 2002:a17:903:22d0:b0:19a:7217:32a9 with SMTP id y16-20020a17090322d000b0019a721732a9mr3607916plg.26.1680895640475; Fri, 07 Apr 2023 12:27:20 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id iy18-20020a170903131200b0019e60c645b1sm3251818plb.305.2023.04.07.12.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 12:27:18 -0700 (PDT) From: Kees Cook To: linux-hardening@vger.kernel.org Cc: Kees Cook , "Andy Shevchenko" , "Cezary Rojewski" , "Puyou Lu" , "Mark Brown" , "Josh Poimboeuf" , "Peter Zijlstra" , "Brendan Higgins" , "David Gow" , Andrew Morton , "Nathan Chancellor" , "Alexander Potapenko" , "Zhaoyang Huang" , "Randy Dunlap" , "Geert Uytterhoeven" , "Miguel Ojeda" , Alexander Lobakin , "Nick Desaulniers" , "Liam Howlett" , "Vlastimil Babka" , "Dan Williams" , "Rasmus Villemoes" , "Yury Norov" , "Jason A. Donenfeld" , "Sander Vanheule" , "Eric Biggers" , "Masami Hiramatsu (Google)" , "Andrey Konovalov" , "Linus Walleij" , "Daniel Latypov" , =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= , linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH v2 01/10] kunit: tool: Enable CONFIG_FORTIFY_SOURCE under UML Date: Fri, 7 Apr 2023 12:27:07 -0700 Message-Id: <20230407192717.636137-1-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230407191904.gonna.522-kees@kernel.org> References: <20230407191904.gonna.522-kees@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1293; h=from:subject; bh=jhb9iocAv4NeEPNMASy77h08PjA+GBj0a1PxPk1ekXM=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBkMG6Tf4DfnuEbF/92pn95HJXNG0utK73GQacwi+o+ knpv6+aJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZDBukwAKCRCJcvTf3G3AJm7zEA CBADePyPGdPcFChk93D6qSpqsV5C/AypwKmWlOgxjmalDZ0Ui+lcVeKab4Sblq73Wc4/gXo2ODgUMR xSGUd509Gr44zaB2slorlcXT8oVgp5p7FwaBwCb6YcOWyjFs2Dg9vSxvvaY+V6vZ4IeT+Kq5Fwb6hN cb7+liB/BbS0EEoAefqwVVTTYPn8tGQY0srxskJgejh/UwdYxutTizydw6qRgoO6AUxjdZabnHvVce +AVi9mmWzzwonDy5CvTOO4UlJ3/nNCt9WFCH1uuqSR2jNIdLjcw6eRn3GGCoJs1Fhu82CbHZ/po7m/ q7Grb+HX1BsJgXhh5pM4GNTpgTlykR/c4vCpr+hMNXHjkXqbYx2Vsx4wTLl5qKjU7ob9JLKV25dTOI LNwBv/n/RGM+LbthEgfdL6KpHQiBIEUZDNy/9FDGxpXoyx5mDs5x83vadC+MWP+IVSE7USdi3W5hzw viO8QD5I+E8YyrrB+BR+4wngCVAbMUDZ1CwJZdgSyNx3ls3goI9Vn8m9WuYz0JIuNF3GOHjSRj7m28 fdJAddrJvnt0NCSEfzuXqMUhR4ALlWfmd3lujiJekI14B/g9lJKw56pl109ixcrZcVtmjmHBUbU3q8 xrgqRnk3DKO9D9d2Q40cdw/yWrZhZ747tgv3pLLY8ibSF+YxPWvobWp9dEPg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762548249344539654?= X-GMAIL-MSGID: =?utf-8?q?1762548249344539654?= Since commit ba38961a069b ("um: Enable FORTIFY_SOURCE"), it's possible to run the FORTIFY tests under UML. Enable CONFIG_FORTIFY_SOURCE when running with --altests to gain additional coverage, and by default under UML. Signed-off-by: Kees Cook --- tools/testing/kunit/configs/all_tests.config | 2 ++ tools/testing/kunit/configs/arch_uml.config | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/testing/kunit/configs/all_tests.config b/tools/testing/kunit/configs/all_tests.config index f990cbb73250..0393940c706a 100644 --- a/tools/testing/kunit/configs/all_tests.config +++ b/tools/testing/kunit/configs/all_tests.config @@ -9,6 +9,8 @@ CONFIG_KUNIT=y CONFIG_KUNIT_EXAMPLE_TEST=y CONFIG_KUNIT_ALL_TESTS=y +CONFIG_FORTIFY_SOURCE=y + CONFIG_IIO=y CONFIG_EXT4_FS=y diff --git a/tools/testing/kunit/configs/arch_uml.config b/tools/testing/kunit/configs/arch_uml.config index e824ce43b05a..54ad8972681a 100644 --- a/tools/testing/kunit/configs/arch_uml.config +++ b/tools/testing/kunit/configs/arch_uml.config @@ -3,3 +3,6 @@ # Enable virtio/pci, as a lot of tests require it. CONFIG_VIRTIO_UML=y CONFIG_UML_PCI_OVER_VIRTIO=y + +# Enable FORTIFY_SOURCE for wider checking. +CONFIG_FORTIFY_SOURCE=y