Commit cf2a2c6
ovl: verify upper dentry in ovl_remove_and_whiteout()
commit cfc9fde0b07c3b44b570057c5f93dda59dca1c94 upstream.
The upper dentry may become stale before we call ovl_lock_rename_workdir.
For example, someone could (mistakenly or maliciously) manually unlink(2)
it directly from upperdir.
To ensure it is not stale, let's lookup it after ovl_lock_rename_workdir
and and check if it matches the upper dentry.
Essentially, it is the same problem and similar solution as in
commit 11f3710417d0 ("ovl: verify upper dentry before unlink and rename").
Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent c12dada commit cf2a2c6
1 file changed
Lines changed: 24 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
514 | 515 | | |
515 | 516 | | |
516 | 517 | | |
| |||
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
543 | | - | |
544 | | - | |
545 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
546 | 548 | | |
547 | 549 | | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
562 | 556 | | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
568 | 561 | | |
569 | | - | |
570 | | - | |
| 562 | + | |
| 563 | + | |
571 | 564 | | |
572 | | - | |
573 | | - | |
574 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
575 | 570 | | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | 571 | | |
580 | 572 | | |
581 | 573 | | |
582 | 574 | | |
| 575 | + | |
| 576 | + | |
583 | 577 | | |
584 | 578 | | |
585 | 579 | | |
| |||
0 commit comments