All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.ibm.com>
To: Denis Kenzior <denkenz@gmail.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org,
	keyrings@vger.kernel.org, Mimi Zohar <zohar@us.ibm.com>,
	David Howells <dhowells@redhat.com>,
	James Morris <jmorris@namei.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	James Morris <james.morris@microsoft.com>
Subject: Re: Bad file pattern in MAINTAINERS section 'KEYS-TRUSTED'
Date: Tue, 26 Mar 2019 16:25:23 +0000	[thread overview]
Message-ID: <1553617523.2900.26.camel@linux.ibm.com> (raw)
In-Reply-To: <c7f70a06-65a5-a1cd-69c5-dae7567b851f@gmail.com>

On Tue, 2019-03-26 at 09:59 -0500, Denis Kenzior wrote:
> Hi James,
> 
> On 03/26/2019 09:25 AM, James Bottomley wrote:
> > Looking at the contents of linux/keys/trusted.h, it looks like the
> > wrong decision to move it.  The contents are way too improperly
> > named
> > and duplicative to be in a standard header.  It's mostly actually
> > TPM
> > code including a redefinition of the tpm_buf structure, so it
> > doesn't
> > even seem to be necessary for trusted keys.
> 
> The reason this was done was because asym_tpm.c needed a bunch of
> the same functionality already provided by trusted.c, e.g.
> TSS_authmac and  friends.

So make a header which only includes those.  We can't have things like
this:

struct tpm_buf {
	int len;
	unsigned char data[MAX_BUF_SIZE];
};

Which means you can't include drivers/char/tpm/tpm.h with this file. 
The storeX functions are also way too generically named and are, in
fact, duplicating the tpm buffer functions in tpm.h

The solution looks to be to elevate agreed tpm_buf functions into
linux/tpm.h and use them.

> > If you want to fix this as a bug, I'd move it back again, but long
> > term I think it should simply be combined with trusted.c because
> > nothing else can include it sanely anyway.
> 
> Ideally I'd like to see the TPM subsystem expose these functions
> using some proper API / library abstraction.  David Howells had an
> RFC patch set that tried to address some of this a while back.  Not
> sure if that went anywhere.

I'm not actually sure I saw it but the solution seems pretty simple:
The TSS functions you want can be renamed tpm1_whatever and we can put
them in tpm1-cmd.c ... tpm2-cmd.c is where all the TPM 2.0 trusted key
stuff is anyway.

James

WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <jejb@linux.ibm.com>
To: Denis Kenzior <denkenz@gmail.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org,
	keyrings@vger.kernel.org, Mimi Zohar <zohar@us.ibm.com>,
	David Howells <dhowells@redhat.com>,
	James Morris <jmorris@namei.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	James Morris <james.morris@microsoft.com>
Subject: Re: Bad file pattern in MAINTAINERS section 'KEYS-TRUSTED'
Date: Tue, 26 Mar 2019 09:25:23 -0700	[thread overview]
Message-ID: <1553617523.2900.26.camel@linux.ibm.com> (raw)
In-Reply-To: <c7f70a06-65a5-a1cd-69c5-dae7567b851f@gmail.com>

On Tue, 2019-03-26 at 09:59 -0500, Denis Kenzior wrote:
> Hi James,
> 
> On 03/26/2019 09:25 AM, James Bottomley wrote:
> > Looking at the contents of linux/keys/trusted.h, it looks like the
> > wrong decision to move it.  The contents are way too improperly
> > named
> > and duplicative to be in a standard header.  It's mostly actually
> > TPM
> > code including a redefinition of the tpm_buf structure, so it
> > doesn't
> > even seem to be necessary for trusted keys.
> 
> The reason this was done was because asym_tpm.c needed a bunch of
> the same functionality already provided by trusted.c, e.g.
> TSS_authmac and  friends.

So make a header which only includes those.  We can't have things like
this:

struct tpm_buf {
	int len;
	unsigned char data[MAX_BUF_SIZE];
};

Which means you can't include drivers/char/tpm/tpm.h with this file. 
The storeX functions are also way too generically named and are, in
fact, duplicating the tpm buffer functions in tpm.h

The solution looks to be to elevate agreed tpm_buf functions into
linux/tpm.h and use them.

> > If you want to fix this as a bug, I'd move it back again, but long
> > term I think it should simply be combined with trusted.c because
> > nothing else can include it sanely anyway.
> 
> Ideally I'd like to see the TPM subsystem expose these functions
> using some proper API / library abstraction.  David Howells had an
> RFC patch set that tried to address some of this a while back.  Not
> sure if that went anywhere.

I'm not actually sure I saw it but the solution seems pretty simple:
The TSS functions you want can be renamed tpm1_whatever and we can put
them in tpm1-cmd.c ... tpm2-cmd.c is where all the TPM 2.0 trusted key
stuff is anyway.

James


  reply	other threads:[~2019-03-26 16:25 UTC|newest]

Thread overview: 163+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 21:22 MAINTAINERS: a scripted set of defective F: patterns and the commits that introduced them Joe Perches
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'ANALOG DEVICES INC AD7606 DRIVER' Joe Perches
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'ARM INTEGRATOR, VERSATILE AND REALVIEW SUPPORT' Joe Perches
2019-03-25 21:24   ` Joe Perches
2019-08-13  6:10   ` [PATCH] MAINTAINERS: Update path to physmap-versatile.c Denis Efremov
2019-08-13  6:10     ` Denis Efremov
2019-08-13  6:32     ` [RESEND PATCH] " Denis Efremov
2019-08-13  6:32       ` Denis Efremov
2019-08-13  7:20       ` Linus Walleij
2019-08-13  7:20         ` Linus Walleij
2019-09-10 11:46         ` Denis Efremov
2019-09-10 11:46           ` Denis Efremov
2019-09-30 20:48     ` [RESEND v2 " Denis Efremov
2019-09-30 20:48       ` Denis Efremov
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'ARM/NUVOTON NPCM ARCHITECTURE' Joe Perches
2019-03-26 12:18   ` Tomer Maimon
2019-03-26 17:41     ` Brendan Higgins
2019-03-26 17:41       ` Brendan Higgins
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'ARM/QUALCOMM SUPPORT' Joe Perches
     [not found]   ` <cover.1553577179.git.amit.kucheria@linaro.org>
2019-03-26  5:18     ` [PATCH v1 1/1] MAINTAINERS: fix typo in file name Amit Kucheria
2019-03-26  5:30       ` Vinod Koul
2019-03-27 13:45       ` Mukesh Ojha
2019-03-26  5:21   ` Bad file pattern in MAINTAINERS section 'ARM/QUALCOMM SUPPORT' Amit Kucheria
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'ARM/UNIPHIER ARCHITECTURE' Joe Perches
2019-03-25 21:24   ` Joe Perches
2019-03-26  5:28   ` Vinod Koul
2019-03-26  5:28     ` Vinod Koul
2019-03-25 21:24 ` Bad file pattern in MAINTAINERS section 'CIRRUS LOGIC LOCHNAGAR DRIVER' Joe Perches
2019-03-26  9:32   ` Charles Keepax
2019-03-25 21:24 ` Joe Perches
2019-03-25 21:25 ` Joe Perches
2019-03-25 21:25 ` Joe Perches
2019-03-25 21:25 ` Bad file pattern in MAINTAINERS section 'EDAC-SKYLAKE' Joe Perches
2019-03-25 23:29   ` [PATCH] MAINTAINERS: Update entry for EDAC-SKYLAKE Luck, Tony
2019-03-25 23:29     ` Luck, Tony
2019-03-25 23:56   ` [PATCH] MAINTAINERS: Add entry for EDAC-I10NM Luck, Tony
2019-03-25 23:56     ` Luck, Tony
2019-03-26  7:33     ` [PATCH] " Borislav Petkov
2019-03-26  7:33       ` Borislav Petkov
2019-03-25 21:25 ` Bad file pattern in MAINTAINERS section 'ETHERNET PHY LIBRARY' Joe Perches
2019-03-25 21:25 ` Bad file pattern in MAINTAINERS section 'FUTEX SUBSYSTEM' Joe Perches
2019-03-25 21:25 ` Bad file pattern in MAINTAINERS section 'Hyper-V CORE AND DRIVERS' Joe Perches
2019-03-26  7:02   ` Tianyu Lan
2019-08-13  6:04   ` [PATCH] MAINTAINERS: Hyper-V: Fix typo in a filepath Denis Efremov
2019-08-13 14:36     ` Tianyu Lan
2019-03-25 21:25 ` Bad file pattern in MAINTAINERS section 'I3C SUBSYSTEM' Joe Perches
2019-03-25 21:25   ` Joe Perches
2019-03-30  7:51   ` Boris Brezillon
2019-03-30  7:51     ` Boris Brezillon
2019-03-25 21:26 ` Bad file pattern in MAINTAINERS section 'IBM Power in-Nest Crypto Acceleration' Joe Perches
2019-08-13  6:06   ` [PATCH] MAINTAINERS: nx crypto: Fix typo in a filepath Denis Efremov
2019-08-22  5:55     ` Herbert Xu
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'IEEE 802.15.4 SUBSYSTEM' Joe Perches
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'KEYS-TRUSTED' Joe Perches
2019-03-25 21:27   ` Joe Perches
2019-03-26 11:37   ` Jarkko Sakkinen
2019-03-26 11:37     ` Jarkko Sakkinen
2019-03-26 12:10     ` Mimi Zohar
2019-03-26 12:10       ` Mimi Zohar
2019-03-26 14:25       ` James Bottomley
2019-03-26 14:25         ` James Bottomley
2019-03-26 14:59         ` Denis Kenzior
2019-03-26 14:59           ` Denis Kenzior
2019-03-26 16:25           ` James Bottomley [this message]
2019-03-26 16:25             ` James Bottomley
2019-03-27  4:58           ` Jarkko Sakkinen
2019-03-27  4:58             ` Jarkko Sakkinen
2019-03-27  4:54         ` Jarkko Sakkinen
2019-03-27  4:54           ` Jarkko Sakkinen
2019-08-13  6:57   ` Denis Efremov
2019-08-13  6:57     ` Denis Efremov
2019-08-15 21:57     ` Jarkko Sakkinen
2019-08-15 21:57       ` Jarkko Sakkinen
2019-08-15 22:12       ` [RESEND PATCH] MAINTAINERS: keys: Update path to trusted.h Denis Efremov
2019-08-16 18:58         ` Jarkko Sakkinen
2019-09-10 11:50           ` Denis Efremov
2019-09-14 13:50             ` Jarkko Sakkinen
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'MELLANOX ETHERNET INNOVA IPSEC DRIVER' Joe Perches
2019-03-25 21:27 ` Joe Perches
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'MIPS/LOONGSON2 ARCHITECTURE' Joe Perches
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'MIPS/LOONGSON3 ARCHITECTURE' Joe Perches
2019-03-25 21:27 ` Joe Perches
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'NET_FAILOVER MODULE' Joe Perches
2019-08-13  6:05   ` [PATCH] MAINTAINERS: net_failover: Fix typo in a filepath Denis Efremov
2019-08-14 17:24     ` David Miller
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'NOKIA N900 POWER SUPPLY DRIVERS' Joe Perches
2019-08-13  6:13   ` [PATCH] MAINTAINERS: N900: Remove isp1704_charger.h record Denis Efremov
2019-08-13  6:54     ` Pali Rohár
2019-09-02  8:00     ` Sebastian Reichel
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'QUALCOMM ETHQOS ETHERNET DRIVER' Joe Perches
2019-03-26  5:12   ` Vinod Koul
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'ROCKCHIP VPU CODEC DRIVER' Joe Perches
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'SAMSUNG EXYNOS TRUE RANDOM NUMBER GENERATOR (TRNG) DRIVER' Joe Perches
2019-03-26 11:42   ` Krzysztof Kozlowski
2019-08-13  7:09     ` Denis Efremov
     [not found]       ` <CGME20190813092250eucas1p268947b3a9e15c2d2721e6311db8c3965@eucas1p2.samsung.com>
2019-08-13  9:22         ` Łukasz Stelmach
2019-08-13  9:22           ` Łukasz Stelmach
2019-03-25 21:27 ` Bad file pattern in MAINTAINERS section 'SELINUX SECURITY MODULE' Joe Perches
2019-03-25 21:58   ` [PATCH] " Casey Schaufler
2019-03-25 22:02     ` Joe Perches
2019-03-25 22:22       ` Casey Schaufler
2019-03-25 21:28 ` Bad file pattern in MAINTAINERS section 'SOC-CAMERA V4L2 SUBSYSTEM' Joe Perches
2019-03-25 21:28 ` Joe Perches
2019-03-25 21:28 ` Bad file pattern in MAINTAINERS section 'SYNOPSYS DESIGNWARE AXI DMAC DRIVER' Joe Perches
2019-08-13  6:00   ` [PATCH] MAINTAINERS: dw axi dmac: Fix typo in a path Denis Efremov
2019-08-13  6:36     ` [RESEND PATCH] " Denis Efremov
2019-08-20 11:33     ` [PATCH] " Vinod Koul
2019-03-25 21:28 ` Bad file pattern in MAINTAINERS section 'X86 MCE INFRASTRUCTURE' Joe Perches
2019-03-25 23:34   ` [PATCH] MAINTAINERS: Fix file pattern for X86 MCE INFRASTRUCTURE Luck, Tony
2019-03-25 23:34     ` Luck, Tony
2019-03-26  7:28     ` [tip:ras/core] " tip-bot for Tony Luck
2019-03-26  7:28       ` tip-bot for Borislav Petkov
2019-03-25 23:30 ` Bad file pattern in MAINTAINERS section 'ARM KOMEDA DRM-KMS DRIVER' Joe Perches
2019-03-26 10:25   ` Liviu Dudau
2019-03-26 10:32   ` [PATCH] MAINTAINERS: Fix pattern for Documentation path for Arm Mali Komeda Liviu Dudau
2019-03-27  6:21     ` james qian wang (Arm Technology China)
2019-03-25 23:35 ` Bad file pattern in MAINTAINERS section 'IBM Power Virtual Accelerator Switchboard' Joe Perches
2019-03-25 23:35   ` Joe Perches
2019-03-25 23:38   ` Joe Perches
2019-03-25 23:38     ` Joe Perches
2019-03-27 11:39   ` Michael Ellerman
2019-08-13  5:58 ` [PATCH] MAINTAINERS: altera-sysmgr: Fix typo in a filepath Denis Efremov
2019-08-13  6:16   ` Lee Jones
2019-08-13  6:02 ` [PATCH] MAINTAINERS: ftm-quaddec: " Denis Efremov
2019-08-13  9:26   ` Patrick Havelange
2019-08-13  6:03 ` [PATCH] MAINTAINERS: hantro: " Denis Efremov
2019-08-13  6:07 ` [PATCH] MAINTAINERS: r8169: Update path to the driver Denis Efremov
2019-08-13 21:52   ` Heiner Kallweit
2019-08-14 12:12     ` Denis Efremov
2019-08-14 12:14       ` Denis Efremov
2019-08-14 18:33       ` Heiner Kallweit
2019-08-16 19:58       ` David Miller
2019-08-13  6:09 ` [PATCH] MAINTAINERS: i2c mv64xxx: Update documentation path Denis Efremov
2019-08-29 20:00   ` Wolfram Sang
2019-08-30  8:28     ` Maxime Ripard
2019-08-30  8:31     ` Gregory CLEMENT
2019-08-30 12:38   ` Wolfram Sang
2019-08-13  6:09 ` [PATCH] MAINTAINERS: ip masquerading: Update path to the driver Denis Efremov
2019-08-13  8:58   ` Pablo Neira Ayuso
2019-08-14 12:35     ` [PATCH] MAINTAINERS: Remove IP MASQUERADING record Denis Efremov
2019-08-19 10:19       ` Pablo Neira Ayuso
2019-08-13  6:10 ` [PATCH] MAINTAINERS: Update path to tcb_clksrc.c Denis Efremov
2019-08-13  6:10   ` Denis Efremov
2019-08-13  8:11   ` Nicolas.Ferre
2019-08-13  8:11     ` Nicolas.Ferre
2019-08-14  9:08     ` Alexandre Belloni
2019-08-14  9:08       ` Alexandre Belloni
2019-08-23  8:20       ` Nicolas.Ferre
2019-08-23  8:20         ` Nicolas.Ferre
2019-08-13  6:13 ` [PATCH] MAINTAINERS: iomap: Remove fs/iomap.c record Denis Efremov
2019-08-13 15:13   ` Darrick J. Wong
2019-08-13  6:14 ` [PATCH] MAINTAINERS: PHY LIBRARY: Remove sysfs-bus-mdio record Denis Efremov
2019-08-13 11:45   ` Andrew Lunn
2019-08-14  0:55   ` Florian Fainelli
2019-08-14 12:58     ` [PATCH] MAINTAINERS: PHY LIBRARY: Update files in the record Denis Efremov
2019-08-14 18:39       ` Florian Fainelli
2019-08-16 19:55       ` David Miller
2019-08-13  6:15 ` [PATCH] MAINTAINERS: Remove FMC subsystem Denis Efremov
2019-08-13  8:54   ` Linus Walleij
2019-08-13 21:20     ` Denis Efremov
2019-08-23  7:54       ` Linus Walleij
2019-08-13  9:41   ` Federico Vaga
2019-08-13  6:16 ` [PATCH] MAINTAINERS: Remove zoran driver Denis Efremov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1553617523.2900.26.camel@linux.ibm.com \
    --to=jejb@linux.ibm.com \
    --cc=denkenz@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=james.morris@microsoft.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jmorris@namei.org \
    --cc=joe@perches.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=zohar@linux.ibm.com \
    --cc=zohar@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.