Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp299760pxx; Thu, 29 Oct 2020 03:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzkDqFUjIDN+iga3NQc9tETMHjSBGMbO3fzaYj6HqaYxBn9PueNEFEmHsBzyuqaPH09ueN X-Received: by 2002:a17:906:26c6:: with SMTP id u6mr3316524ejc.349.1603965669242; Thu, 29 Oct 2020 03:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603965669; cv=none; d=google.com; s=arc-20160816; b=sGFwkhhg04625TZGbWVjeVS01VaasbWvdsuBA98fA8ZKM37s49ZuhE9SuM3GAuJzv5 z60pQwuM7Yd8XxSeDbP0FXVyHHB0Rd8EBuaaRCx3uXW2T0TFzfAkM54ycpj5IJUln3VT ua6utwqOvetTYBDL/oaj1FuMQiFtFocMnWYMXw9aXL+xxRZ5YWahb8DJ94VoUEqSYC/R hVWd38WFhrGZGsfvYdm6Y4mSxSGeYn/IYPjO23JLgkhIeES6594aw0AZir+j4enGEp7+ 1uDb3qMp/gl8kaRDQst+QQGXHoXCcywyMTeCH7XMOoln+sfoiIq5xJzbNYFjFwo2aE6S hN7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a6vE6h4Lrq3PfD6ZhI4bffn/VCoz5p+kVa9GnDZBqBg=; b=zH0GJd9HSWEgHf334MEa7vkV6XROiNoDRzuvvm4nbEjAPjb2+8RT0A7pRAUMeMcWJh UUsmsO3tg3bRu0XFXMa5mv7baxJUgp19cei4nWME90JD3N5KZ94r0E7QgGx3Rc2bX5cD +0SRUbO6h19zt8ubrTK11vB64MKvT4GATnVot5auts2BguwF6zBr4JgPhOVlHeSzj3Xa Ij2Vdmvm+j4uNPHTHHDg7GZLVdgU21VslmH7eAUyJeJmJw6nTkaHLsgDXltLuO0gfhp4 BnJ0iAPndjF6qfgrxweMMiM0r4IfyfUye+MdlLTkFZKCl1N1asoClHziEadRZjDrdVYa tP6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=K1alOVg7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si1724605ejm.716.2020.10.29.03.00.47; Thu, 29 Oct 2020 03:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=K1alOVg7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389335AbgJ1X4I (ORCPT + 99 others); Wed, 28 Oct 2020 19:56:08 -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-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.