Commit db969c5
committed
Fix UnixAddr::size on Linux and Android
SockaddrLike::size() is meant to return the amount of space that can be
used to store the sockaddr. But on Linux-based OSes, UnixAddr contains
an extra field to store the address's length. This field is not part of
the address, and should not contribute to the value of size().
This bug can't cause an out-of-bounds write, and every OS that we test
on can tolerate the greater-than-expected length, but it might confuse
applications that implement functions similar to getsockname in
userland.1 parent 9793aaf commit db969c5
2 files changed
+51
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
6 | 16 | | |
7 | 17 | | |
8 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
956 | 960 | | |
957 | 961 | | |
958 | 962 | | |
| |||
2615 | 2619 | | |
2616 | 2620 | | |
2617 | 2621 | | |
| 2622 | + | |
2618 | 2623 | | |
2619 | 2624 | | |
2620 | 2625 | | |
2621 | 2626 | | |
2622 | | - | |
| 2627 | + | |
2623 | 2628 | | |
2624 | 2629 | | |
2625 | 2630 | | |
| |||
2701 | 2706 | | |
2702 | 2707 | | |
2703 | 2708 | | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
2704 | 2727 | | |
2705 | 2728 | | |
2706 | 2729 | | |
| |||
2713 | 2736 | | |
2714 | 2737 | | |
2715 | 2738 | | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2716 | 2745 | | |
2717 | 2746 | | |
2718 | 2747 | | |
| |||
2725 | 2754 | | |
2726 | 2755 | | |
2727 | 2756 | | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
2728 | 2763 | | |
2729 | 2764 | | |
2730 | 2765 | | |
2731 | | - | |
2732 | 2766 | | |
2733 | 2767 | | |
2734 | 2768 | | |
| |||
2742 | 2776 | | |
2743 | 2777 | | |
2744 | 2778 | | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
2745 | 2784 | | |
2746 | 2785 | | |
0 commit comments