From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A35C4C388F7 for ; Wed, 28 Oct 2020 23:56:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 454FA20725 for ; Wed, 28 Oct 2020 23:56:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="K1alOVg7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389342AbgJ1X4K (ORCPT ); Wed, 28 Oct 2020 19:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgJ1Xyt (ORCPT ); Wed, 28 Oct 2020 19:54:49 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA8F0C0613CF for ; Wed, 28 Oct 2020 16:54:48 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id c5so834795qtw.3 for ; Wed, 28 Oct 2020 16:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a6vE6h4Lrq3PfD6ZhI4bffn/VCoz5p+kVa9GnDZBqBg=; b=K1alOVg7BbsaWoIzM3EPt/XFxBj6CfPzSYGObFnKmJp7VbMWXtUo2wEub9s1GDaGHk lxopwSHtCrI5rbwcViDOKa7z7exOSdV8ylieshQIkI490N7n3HqHk5KCpFK6JRRNHLB9 56qGofT5bOcT1aUgH4aQIAILIIM3qjkChzQL7xSefwfbrA/5wrlPyn/zyWV6NgJcMrqq c4gxYGkhThcN0gedsthpRzw7BxnfOcilw1snStWwIkeoRHuF7DEzT3zEC4pNAYOnL5tg hRSNj6YRCY3J7n/iMsCrY78y942DN0Wi6x+DA1NUcEmjlov4n9/PkkaC+g1wFrR6A3ge sjJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a6vE6h4Lrq3PfD6ZhI4bffn/VCoz5p+kVa9GnDZBqBg=; b=KBEu9tHAfSFIMjc7dpQZLwpN3JcZGhSramoNlg/RyoZsDCN6AsU1M8OIGHbfo+pgoF 9ysIolTWFT8mClaSWirIwj3WoEq56qQuOUxY1Vm6ENo1oQI9KnBMtKphwRQo1neW8lGt a1nxZZV6zbNyL35wRSvuEV+YbeTl6wA0X27oSgkmBSwZ/UxAyNlxllz7HB/rKUoXHlRA IC/tES0fYmvM9YpEZStaOWPjX20tRlq6k/rZOxo1zDzENmZlsmUtXrm3vDgPlvtJRF+L wee4fxfAOZXvtQA3RkAxaDAkGYe1HtLNj2fsZif6i/6t339ijU55akaKPrKqx7hbqZkr 8kcg== X-Gm-Message-State: AOAM531Mx4euWVVTSNgfd7Q22ZTDFO13cCyfx8WEU09L7zfleUtwRrp7 z7Up9UFO4cTkx0lTq0EB0I+TKiEZQzFP3NjG1wEasUSzSqOOww== X-Google-Smtp-Source: ABdhPJzGlSt5aAv1ZLGB7xNjiUUvxmmxT2DKA0N0WRSAio1BCjdgbKuaIweZa1+5o4vyE+PoaK/loQrgkpTt4gNbQmg= X-Received: by 2002:ac8:6c54:: with SMTP id z20mr5877605qtu.337.1603878075857; Wed, 28 Oct 2020 02:41:15 -0700 (PDT) MIME-Version: 1.0 References: <20201026125227.54520-1-a.nogikh@gmail.com> <20201026125227.54520-3-a.nogikh@gmail.com> In-Reply-To: From: Dmitry Vyukov Date: Wed, 28 Oct 2020 10:41:04 +0100 Message-ID: Subject: Re: [RFC PATCH v2 2/2] docs: add fail_lsm_hooks info to fault-injection.rst To: Aleksandr Nogikh Cc: Akinobu Mita , Aleksandr Nogikh , James Morris , "Serge E. Hallyn" , Andrey Konovalov , Marco Elver , Alexander Potapenko , Kees Cook , LKML , linux-security-module Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 6:34 PM Aleksandr Nogikh wrote: > [...] > > In addition to this global one, what do you think about per-hook fault > > injection, > > i.e. /sys/kernel/debug/fail_lsm_hooks//retval ? > > I was thinking about this, but decided to begin with a simple version > that could definitely be useful in practice (for syzbot/syzkaller it is just > necessary to have a fault injection capability that will be triggered via > fail-nth). If per-hook fault injection can also be useful to someone, I > can try to add it as well. Yes, before we add it, it would be useful to have a clear use case (otherwise we can add an unused thing, or implement it in a way that slightly misses the use case). Note that fail-nth allows to fail a single concrete site for testing, though it's not super convenient for this as one would need to figure out the right N first. But as a one-off test it should do. > > In this case, we need a fault_attr for each hook. (Maybe, we can use the same > > technique that is used to define security_hook_heads). > > Yes, that technique should help to implement the feature in a very concise > way. Thanks for the suggestion.