Commit 667121a
Stefan Richter
firewire: net: guard against rx buffer overflows
The IP-over-1394 driver firewire-net lacked input validation when
handling incoming fragmented datagrams. A maliciously formed fragment
with a respectively large datagram_offset would cause a memcpy past the
datagram buffer.
So, drop any packets carrying a fragment with offset + length larger
than datagram_size.
In addition, ensure that
- GASP header, unfragmented encapsulation header, or fragment
encapsulation header actually exists before we access it,
- the encapsulated datagram or fragment is of nonzero size.
Reported-by: Eyal Itkin <eyal.itkin@gmail.com>
Reviewed-by: Eyal Itkin <eyal.itkin@gmail.com>
Fixes: CVE 2016-8633
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>1 parent 6449e31 commit 667121a
1 file changed
Lines changed: 35 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
581 | 584 | | |
582 | 585 | | |
583 | 586 | | |
| |||
602 | 605 | | |
603 | 606 | | |
604 | 607 | | |
| 608 | + | |
605 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
606 | 614 | | |
607 | 615 | | |
608 | 616 | | |
| |||
616 | 624 | | |
617 | 625 | | |
618 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
619 | 630 | | |
620 | 631 | | |
621 | 632 | | |
| |||
722 | 733 | | |
723 | 734 | | |
724 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
725 | 752 | | |
726 | 753 | | |
727 | 754 | | |
| |||
731 | 758 | | |
732 | 759 | | |
733 | 760 | | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | 761 | | |
738 | 762 | | |
739 | 763 | | |
| |||
750 | 774 | | |
751 | 775 | | |
752 | 776 | | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
760 | 780 | | |
761 | | - | |
| 781 | + | |
762 | 782 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
767 | 787 | | |
768 | | - | |
769 | 788 | | |
770 | 789 | | |
771 | 790 | | |
| |||
0 commit comments