Re: [PATCH v1 1/5] crypto: talitos - fix ECB and CBC algs ivsize

2019-06-11 Thread Christophe Leroy
Le 11/06/2019 à 13:52, Horia Geanta a écrit : On 6/6/2019 2:31 PM, Christophe Leroy wrote: commit d84cc9c9524e ("crypto: talitos - fix ECB algs ivsize") wrongly modified CBC algs ivsize instead of ECB aggs ivsize. This restore the CBC algs original ivsize of removes ECB's ones.

Re: [PATCH v1 2/5] crypto: talitos - move struct talitos_edesc into talitos.h

2019-06-11 Thread Horia Geanta
On 6/11/2019 3:38 PM, Christophe Leroy wrote: > > > Le 11/06/2019 à 13:57, Horia Geanta a écrit : >> On 6/6/2019 2:31 PM, Christophe Leroy wrote: >>> Next patch will require struct talitos_edesc to be defined >>> earlier in talitos.c >>> >>> This patch moves it into talitos.h so that it can be

Re: [PATCH v1 2/5] crypto: talitos - move struct talitos_edesc into talitos.h

2019-06-11 Thread Christophe Leroy
Le 11/06/2019 à 13:57, Horia Geanta a écrit : On 6/6/2019 2:31 PM, Christophe Leroy wrote: Next patch will require struct talitos_edesc to be defined earlier in talitos.c This patch moves it into talitos.h so that it can be used from any place in talitos.c Fixes: 37b5e8897eb5 ("crypto:

Question - check in runtime which architecture am I running on

2019-06-11 Thread Oded Gabbay
Hello POWER developers, I'm trying to find out if there is an internal kernel API so that a PCI driver can call it to check if its PCI device is running inside a POWER9 machine. Alternatively, if that's not available, if it is running on a machine with powerpc architecture. I need this

Re: [PATCH v1 0/5] Additional fixes on Talitos driver

2019-06-11 Thread Horia Geanta
On 6/6/2019 2:31 PM, Christophe Leroy wrote: > This series is the last set of fixes for the Talitos driver. > > We now get a fully clean boot on both SEC1 (SEC1.2 on mpc885) and > SEC2 (SEC2.2 on mpc8321E) with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS: > I get failures, probably due to patch 1/5: alg:

Re: [PATCH v1 2/5] crypto: talitos - move struct talitos_edesc into talitos.h

2019-06-11 Thread Horia Geanta
On 6/6/2019 2:31 PM, Christophe Leroy wrote: > Next patch will require struct talitos_edesc to be defined > earlier in talitos.c > > This patch moves it into talitos.h so that it can be used > from any place in talitos.c > > Fixes: 37b5e8897eb5 ("crypto: talitos - chain in buffered data for

Re: [PATCH v1 1/5] crypto: talitos - fix ECB and CBC algs ivsize

2019-06-11 Thread Horia Geanta
On 6/6/2019 2:31 PM, Christophe Leroy wrote: > commit d84cc9c9524e ("crypto: talitos - fix ECB algs ivsize") > wrongly modified CBC algs ivsize instead of ECB aggs ivsize. > > This restore the CBC algs original ivsize of removes ECB's ones. > > Signed-off-by: Christophe Leroy > Fixes:

Re: [PATCH v3 3/6] mm/nvdimm: Add page size and struct page size to pfn superblock

2019-06-11 Thread Jan Kara
On Tue 04-06-19 14:43:54, Aneesh Kumar K.V wrote: > This is needed so that we don't wrongly initialize a namespace > which doesn't have enough space reserved for holding struct pages > with the current kernel. > > We also increment PFN_MIN_VERSION to make sure that older kernel > won't initialize

[Bug 203839] Kernel 5.2-rc3 fails to boot on a PowerMac G4 3,6: systemd[1]: Failed to bump fs.file-max, ignoring: invalid argument

2019-06-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203839 --- Comment #9 from Erhard F. (erhar...@mailbox.org) --- (In reply to Christophe Leroy from comment #8) > Argh ! > > CONFIG_SMP must (again) be the reason we missed it. > > Can you please try the change below ? Applied your change on top of

Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option

2019-06-11 Thread Michael Neuling
On Tue, 2019-06-11 at 09:51 +0200, Christophe Leroy wrote: > > Le 11/06/2019 à 09:24, Michael Neuling a écrit : > > On Tue, 2019-06-11 at 08:48 +0200, Cédric Le Goater wrote: > > > On 11/06/2019 08:44, Michael Neuling wrote: > > > > > > 2: > > > > > > -BEGIN_FTR_SECTION > > > > > > - /*

Re: [PATCH v3 1/6] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-06-11 Thread Aneesh Kumar K.V
Hi Dan, Any feedback on this? A change I would like to get done on top of this series is + if (__le16_to_cpu(pfn_sb->version_minor) < 3) { + /* +* For a large part we use PAGE_SIZE. But we +* do have some accounting code using SZ_4K. +

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 09:54 +0200, Christoph Hellwig wrote: > On Tue, Jun 11, 2019 at 04:59:54PM +1000, Benjamin Herrenschmidt > wrote: > > Ah stupid me ... it's dma_set_mask that failed, since it has no > > idea > > that the calling driver is limited to lowmem. > > > > That's also why the

Re: [PATCH v2] mm: hwpoison: disable memory error handling on 1GB hugepage

2019-06-11 Thread Wanpeng Li
On Tue, 11 Jun 2019 at 07:51, Naoya Horiguchi wrote: > > On Wed, May 29, 2019 at 04:31:01PM -0700, Mike Kravetz wrote: > > On 5/28/19 2:49 AM, Wanpeng Li wrote: > > > Cc Paolo, > > > Hi all, > > > On Wed, 14 Feb 2018 at 06:34, Mike Kravetz > > > wrote: > > >> > > >> On 02/12/2018 06:48 PM,

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 04:59:54PM +1000, Benjamin Herrenschmidt wrote: > Ah stupid me ... it's dma_set_mask that failed, since it has no idea > that the calling driver is limited to lowmem. > > That's also why the "wrong" patch worked. > > So yes, a ZONE_DMA at 30-bits will work, though it's

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 04:58:12PM +1000, Benjamin Herrenschmidt wrote: > ... which b43legacy doesn't set to the best of my knowledge ... > > Which makes me wonder how come it didn't work even with your patches ? > AFAIK, we have less than 1GB of lowmem unless the config has been > tweaked

Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option

2019-06-11 Thread Christophe Leroy
Le 11/06/2019 à 09:24, Michael Neuling a écrit : On Tue, 2019-06-11 at 08:48 +0200, Cédric Le Goater wrote: On 11/06/2019 08:44, Michael Neuling wrote: 2: -BEGIN_FTR_SECTION - /* POWER9 with disabled DAWR */ + LOAD_REG_ADDR(r11, dawr_force_enable) + lbz r11, 0(r11) +

[Bug 203839] Kernel 5.2-rc3 fails to boot on a PowerMac G4 3,6: systemd[1]: Failed to bump fs.file-max, ignoring: invalid argument

2019-06-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203839 --- Comment #8 from Christophe Leroy (christophe.le...@c-s.fr) --- Argh ! CONFIG_SMP must (again) be the reason we missed it. Can you please try the change below ? diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S

Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option

2019-06-11 Thread Michael Neuling
On Tue, 2019-06-11 at 08:48 +0200, Cédric Le Goater wrote: > On 11/06/2019 08:44, Michael Neuling wrote: > > > > 2: > > > > -BEGIN_FTR_SECTION > > > > - /* POWER9 with disabled DAWR */ > > > > + LOAD_REG_ADDR(r11, dawr_force_enable) > > > > + lbz r11, 0(r11) > > > > +

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 16:58 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2019-06-11 at 08:08 +0200, Christoph Hellwig wrote: > > On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt > > wrote: > > > The reason I think it sort-of-mostly-worked is that to get more > > > than > > > 1GB

Re: [PATCH 4/4] mm/vmalloc: Hugepage vmalloc mappings

2019-06-11 Thread Anshuman Khandual
On 06/11/2019 05:46 AM, Nicholas Piggin wrote: > Anshuman Khandual's on June 10, 2019 6:53 pm: >> On 06/10/2019 10:08 AM, Nicholas Piggin wrote: >>> For platforms that define HAVE_ARCH_HUGE_VMAP, have vmap allow vmalloc to >>> allocate huge pages and map them. >> >> IIUC that extends

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Benjamin Herrenschmidt
On Tue, 2019-06-11 at 08:08 +0200, Christoph Hellwig wrote: > On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt > wrote: > > The reason I think it sort-of-mostly-worked is that to get more > > than > > 1GB of RAM, those machines use CONFIG_HIGHMEM. And *most* network > > buffers

Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option

2019-06-11 Thread Cédric Le Goater
On 11/06/2019 08:44, Michael Neuling wrote: > >>> 2: >>> -BEGIN_FTR_SECTION >>> - /* POWER9 with disabled DAWR */ >>> + LOAD_REG_ADDR(r11, dawr_force_enable) >>> + lbz r11, 0(r11) >>> + cmpdi r11, 0 >>> li r3, H_HARDWARE >>> - blr >>> -END_FTR_SECTION_IFCLR(CPU_FTR_DAWR)

Re: [PATCH 2/3] powerpc/64s/radix: ioremap use ioremap_page_range

2019-06-11 Thread Christophe Leroy
Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : Radix can use ioremap_page_range for ioremap, after slab is available. This makes it possible to enable huge ioremap mapping support. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/book3s/64/radix.h | 3 +++

Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option

2019-06-11 Thread Michael Neuling
> > 2: > > -BEGIN_FTR_SECTION > > - /* POWER9 with disabled DAWR */ > > + LOAD_REG_ADDR(r11, dawr_force_enable) > > + lbz r11, 0(r11) > > + cmpdi r11, 0 > > li r3, H_HARDWARE > > - blr > > -END_FTR_SECTION_IFCLR(CPU_FTR_DAWR) > > + beqlr > > Why is this a 'beqlr' ?

[PATCH v11 13/13] ima: Allow template= option for appraise rules as well

2019-06-11 Thread Thiago Jung Bauermann
It's useful being able to specify a different IMA template on appraise policy rules, so allow it. Signed-off-by: Thiago Jung Bauermann Suggested-by: Mimi Zohar --- security/integrity/ima/ima_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v11 11/13] ima: Define ima-modsig template

2019-06-11 Thread Thiago Jung Bauermann
Define new "d-modsig" template field which holds the digest that is expected to match the one contained in the modsig, and also new "modsig" template field which holds the appended file signature. Add a new "ima-modsig" defined template descriptor with the new fields as well as the ones from the

[PATCH v11 12/13] ima: Store the measurement again when appraising a modsig

2019-06-11 Thread Thiago Jung Bauermann
If the IMA template contains the "modsig" or "d-modsig" field, then the modsig should be added to the measurement list when the file is appraised. And that is what normally happens, but if a measurement rule caused a file containing a modsig to be measured before a different rule causes it to be

[PATCH v11 10/13] ima: Collect modsig

2019-06-11 Thread Thiago Jung Bauermann
Obtain the modsig and calculate its corresponding hash in ima_collect_measurement(). Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8 - security/integrity/ima/ima_api.c | 5 ++- security/integrity/ima/ima_appraise.c | 2 +-

[PATCH v11 09/13] ima: Implement support for module-style appended signatures

2019-06-11 Thread Thiago Jung Bauermann
Implement the appraise_type=imasig|modsig option, allowing IMA to read and verify modsig signatures. In case a file has both an xattr signature and an appended modsig, IMA will only use the appended signature if the key used by the xattr signature isn't present in the IMA or platform keyring.

[PATCH v11 08/13] ima: Factor xattr_verify() out of ima_appraise_measurement()

2019-06-11 Thread Thiago Jung Bauermann
Verify xattr signature in a separate function so that the logic in ima_appraise_measurement() remains clear when it gains the ability to also verify an appended module signature. The code in the switch statement is unchanged except for having to dereference the status and cause variables (since

[PATCH v11 07/13] ima: Add modsig appraise_type option for module-style appended signatures

2019-06-11 Thread Thiago Jung Bauermann
Introduce the modsig keyword to the IMA policy syntax to specify that a given hook should expect the file to have the IMA signature appended to it. Here is how it can be used in a rule: appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig|modsig With this rule, IMA will accept either a

[PATCH v11 05/13] integrity: Select CONFIG_KEYS instead of depending on it

2019-06-11 Thread Thiago Jung Bauermann
This avoids a dependency cycle in soon-to-be-introduced CONFIG_IMA_APPRAISE_MODSIG: it will select CONFIG_MODULE_SIG_FORMAT which in turn selects CONFIG_KEYS. Kconfig then complains that CONFIG_INTEGRITY_SIGNATURE depends on CONFIG_KEYS. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi

[PATCH v11 06/13] ima: Use designated initializers for struct ima_event_data

2019-06-11 Thread Thiago Jung Bauermann
Designated initializers allow specifying only the members of the struct that need initialization. Non-mentioned members are initialized to zero. This makes the code a bit clearer (particularly in ima_add_boot_aggregate) and also allows adding a new member to the struct without having to update

[PATCH v11 04/13] integrity: Introduce struct evm_xattr

2019-06-11 Thread Thiago Jung Bauermann
Even though struct evm_ima_xattr_data includes a fixed-size array to hold a SHA1 digest, most of the code ignores the array and uses the struct to mean "type indicator followed by data of unspecified size" and tracks the real size of what the struct represents in a separate length variable. The

[PATCH v11 03/13] PKCS#7: Introduce pkcs7_get_digest()

2019-06-11 Thread Thiago Jung Bauermann
IMA will need to access the digest of the PKCS7 message (as calculated by the kernel) before the signature is verified, so introduce pkcs7_get_digest() for that purpose. Also, modify pkcs7_digest() to detect when the digest was already calculated so that it doesn't have to do redundant work.

[PATCH v11 02/13] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-11 Thread Thiago Jung Bauermann
IMA will need to verify a PKCS#7 signature which has already been parsed. For this reason, factor out the code which does that from verify_pkcs7_signature() into a new function which takes a struct pkcs7_message instead of a data buffer. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi

[PATCH v11 01/13] MODSIGN: Export module signature definitions

2019-06-11 Thread Thiago Jung Bauermann
IMA will use the module_signature format for append signatures, so export the relevant definitions and factor out the code which verifies that the appended signature trailer is valid. Also, create a CONFIG_MODULE_SIG_FORMAT option so that IMA can select it and be able to use mod_check_sig()

[PATCH v11 00/13] Appended signatures support for IMA appraisal

2019-06-11 Thread Thiago Jung Bauermann
Hello, Nothing big in this version. Noteworthy changes are: 1. Fixes for two bugs in ima_appraise_measurements() which were spotted and resolved by Mimi Zohar. The changelog points them out. 2. One bugfix in process_measurement() which would cause all files appraised with modsig to be measured

Re: [PATCH 1/3] powerpc/64: __ioremap_at clean up in the error case

2019-06-11 Thread Christophe Leroy
Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : __ioremap_at error handling is wonky, it requires caller to clean up after it. Implement a helper that does the map and error cleanup and remove the requirement from the caller. Signed-off-by: Nicholas Piggin --- This series is a different

Re: [PATCH 4/4] mm/vmalloc: Hugepage vmalloc mappings

2019-06-11 Thread Anshuman Khandual
On 06/10/2019 08:14 PM, Nicholas Piggin wrote: > Mark Rutland's on June 11, 2019 12:10 am: >> Hi, >> >> On Mon, Jun 10, 2019 at 02:38:38PM +1000, Nicholas Piggin wrote: >>> For platforms that define HAVE_ARCH_HUGE_VMAP, have vmap allow vmalloc to >>> allocate huge pages and map them >>> >>>

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 03:56:33PM +1000, Benjamin Herrenschmidt wrote: > The reason I think it sort-of-mostly-worked is that to get more than > 1GB of RAM, those machines use CONFIG_HIGHMEM. And *most* network > buffers aren't allocated in Highmem so you got lucky. > > That said, there is

Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Christoph Hellwig
On Mon, Jun 10, 2019 at 11:09:47AM -0500, Larry Finger wrote: >>> return -EIO; >>> >>> For b43legacy, dev->dma_mask is 0xc2656848. >>> dma_supported(dev, mask) is 0xc08b, mask is 0x3fff, and >>> the routine returns -EIO. >>> >>> For b43,

<    1   2