Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2174218rwl; Thu, 6 Apr 2023 06:54:36 -0700 (PDT) X-Google-Smtp-Source: AKy350YiIwHEU7meQQJXDPgKY85oZbTfyf/ie+nIroCjK7q6bHWWVTJaJlmmS4QbGHsPzqB6NIDl X-Received: by 2002:a17:90b:3889:b0:240:b3ae:d881 with SMTP id mu9-20020a17090b388900b00240b3aed881mr11477549pjb.5.1680789276236; Thu, 06 Apr 2023 06:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680789276; cv=none; d=google.com; s=arc-20160816; b=yUbhdZT6SHPknUd+QwfvjmSyTF/+8TYBfRW2xo1evn5F79I7kBNlQvKL9SPy75RHKk fDsjpvSjmqzXe6B5q1WmRar4H5OGHS1bGKkd2FFVrPL8QhSXJpVzjI60OFPuroLQjbys i7vT8TfMAspGlyUaRKHV4XOSvLXWfwBKHiTmK1rjhSZcJCoBK0tE0wkq7WagOFtB9I8c V6gU0bkmvDlRnldRnm+WDTmQQQfODJ4uSv4QXOX9/euzKyu91slRswHGIuFfCOnPGYQe UIejlcPoQAm1nIKGJAAyruqmjLmhi+hr4VBlm1+1U+hIeX01S04gQ6b3tIbBwPuIO9IB 7T7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4KhgXC9DXFmj1WgtxHdsXUKjqNnttjWFACOtfeQvRuo=; b=eIQ7/hX5Yxq2WrYbQFB0k7nwAQNhd0JHqoYgHAhil947mceNfug+IgaUG5cygAP36k NoVNYliWimglwQygLv4aFTOu+PuaoT+30dyKReIiEXpWR8CfRmBrVs3WiIQlv2NfjKk0 1t1RJpvvVF0CLCvG+XC7JqXkSDpcmI7AmjkJdnh0jTZj9N2Hklvmjb9VgAIJdaHvs/CB XYQWQJAS5XZyaXsIikKj8WtLJfRdMipgu2Ccxy8Ao7EwUY85ujoWq7qo32YR8mgof/zb gBWCrV7ktzIrXXKYHl5UELc2zXPl+mxdoKiSQddPzaoSzoux6t/kwX/87GOR1SaGtqXi t/eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NfMWpbEi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9-20020a17090a688900b002310ea54599si1373590pjd.149.2023.04.06.06.54.21; Thu, 06 Apr 2023 06:54:36 -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=@gmail.com header.s=20210112 header.b=NfMWpbEi; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238496AbjDFNph (ORCPT + 99 others); Thu, 6 Apr 2023 09:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237561AbjDFNpI (ORCPT ); Thu, 6 Apr 2023 09:45:08 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02FAB59CD; Thu, 6 Apr 2023 06:45:06 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id m16so25849929ybk.0; Thu, 06 Apr 2023 06:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680788705; x=1683380705; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4KhgXC9DXFmj1WgtxHdsXUKjqNnttjWFACOtfeQvRuo=; b=NfMWpbEiHyU83kdpf1M1hzSt71X9hawep43qeU5J/cVYOw7/vCuuyx+XObPcTgqPIT 5uslXlk4gD/VtX9nuMHfMX/CO0fMXJM7SHuZvwU60/DhqDpmxxQ1T1o5co6wj4O5YFBd nooF1u4x2YK/H74ICeQEta7trx9kfKAVkU0JqdZIDxNQzObKq34NPTq+bNB/i+0yE6fn BugseBoTV20FJUlmU7Lm65F4MAFhKseB/QQS60kL/jC/cudtqpNPQ1AcwWAlapiIrB/q SQBU+lqmldR1pcejXSxtAZW0DBPe/cFRJIINapf0lst3/8gHKLiKmIOxJK/iD9Zjo0v6 WuPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680788705; x=1683380705; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4KhgXC9DXFmj1WgtxHdsXUKjqNnttjWFACOtfeQvRuo=; b=YXy1zPCox2NaxPzbZy3KKuC59XaxN4+E6AzcgC63cf1kRxUTrJ1GxbcqRmjv/P4fob TR7ha62cOWUFxira2CpthIvRBFotz5VNWMVELCJf0cHH4f/Q+H6dYOZYtOxUxCKnYQjz ZWbrvNClKe/vy9lH8dmtns+EL/BTd09iIezJpMdcOGeeXOCw2T8u4vCHigHIS3LLnm16 YeR/O3X0J4nakzsY/z6JzqvN4yHZ6zvVXg50vgWWuQrO4Y+q3Y4gab7p6xIpKPYCelpn wpUxV6pI4UlL/YM1z1/ZGjOSbdyy8I1Gwt+hiQXSSaQa9SXNXBmQExj2Ah6N8gB5KAy1 VI7g== X-Gm-Message-State: AAQBX9fDePBCvSVja7snf9pbb9SEk0spjwayDKZxqCJwZFueT70xYzfE B2PyAzrxRfiSPq9OH0eiEFErFHoqJvcrFihpGIs= X-Received: by 2002:a25:d603:0:b0:b21:5fb4:c6e6 with SMTP id n3-20020a25d603000000b00b215fb4c6e6mr1678180ybg.11.1680788705031; Thu, 06 Apr 2023 06:45:05 -0700 (PDT) MIME-Version: 1.0 References: <20230405235832.never.487-kees@kernel.org> <20230406000212.3442647-6-keescook@chromium.org> In-Reply-To: <20230406000212.3442647-6-keescook@chromium.org> From: Miguel Ojeda Date: Thu, 6 Apr 2023 15:44:54 +0200 Message-ID: Subject: Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer To: Kees Cook Cc: linux-hardening@vger.kernel.org, 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 , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 On Thu, Apr 6, 2023 at 2:02=E2=80=AFAM Kees Cook wr= ote: > > +void __fortify_report(u8 reason); > +void __fortify_panic(u8 reason) __cold __noreturn; (snip) > +void __fortify_report(u8 reason) (snip) > +void __fortify_panic(const u8 reason) I am curious: for some reason (no pun intended :) the `reason`s above are not `const` except this one, but then in a later patch they become `const` (including the declarations). So perhaps make everything `const` when they are introduced? Or is there some other reason? (e.g. I saw one patch that moved a function, so there it seemed to make sense to keep things as they are to make the copy 1:1). Cheers, Miguel