Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pstore-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore bug fixes from Kees Cook:

- always reset circular buffer state when writing new dump (Aleksandr
Yashkin)

- fix rare error-path memory leak (Kees Cook)

* tag 'pstore-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
pstore/ram: Write new dumps to start of recycled zones
pstore/ram: Fix error-path memory leak in persistent_ram_new() callers

+13
+13
fs/pstore/ram.c
··· 407 407 408 408 prz = cxt->dprzs[cxt->dump_write_cnt]; 409 409 410 + /* 411 + * Since this is a new crash dump, we need to reset the buffer in 412 + * case it still has an old dump present. Without this, the new dump 413 + * will get appended, which would seriously confuse anything trying 414 + * to check dump file contents. Specifically, ramoops_read_kmsg_hdr() 415 + * expects to find a dump header in the beginning of buffer data, so 416 + * we must to reset the buffer values, in order to ensure that the 417 + * header will be written to the beginning of the buffer. 418 + */ 419 + persistent_ram_zap(prz); 420 + 410 421 /* Build header and append record contents. */ 411 422 hlen = ramoops_write_kmsg_hdr(prz, record); 412 423 if (!hlen) ··· 588 577 dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n", 589 578 name, record_size, 590 579 (unsigned long long)*paddr, err); 580 + kfree(label); 591 581 592 582 while (i > 0) { 593 583 i--; ··· 634 622 635 623 dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n", 636 624 name, sz, (unsigned long long)*paddr, err); 625 + kfree(label); 637 626 return err; 638 627 } 639 628