Commit 93f3aff
mpls, nospec: Sanitize array index in mpls_label_ok()
commit 3968523 upstream.
mpls_label_ok() validates that the 'platform_label' array index from a
userspace netlink message payload is valid. Under speculation the
mpls_label_ok() result may not resolve in the CPU pipeline until after
the index is used to access an array element. Sanitize the index to zero
to prevent userspace-controlled arbitrary out-of-bounds speculation, a
precursor for a speculative execution side channel vulnerability.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 4.4:
- mpls_label_ok() doesn't take an extack parameter
- Drop change in mpls_getroute()]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent d77763d commit 93f3aff
1 file changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
759 | | - | |
| 760 | + | |
760 | 761 | | |
| 762 | + | |
| 763 | + | |
761 | 764 | | |
762 | | - | |
763 | | - | |
| 765 | + | |
| 766 | + | |
764 | 767 | | |
765 | 768 | | |
766 | | - | |
767 | | - | |
| 769 | + | |
| 770 | + | |
768 | 771 | | |
769 | | - | |
| 772 | + | |
| 773 | + | |
770 | 774 | | |
771 | 775 | | |
772 | 776 | | |
| |||
787 | 791 | | |
788 | 792 | | |
789 | 793 | | |
790 | | - | |
| 794 | + | |
791 | 795 | | |
792 | 796 | | |
793 | 797 | | |
| |||
848 | 852 | | |
849 | 853 | | |
850 | 854 | | |
851 | | - | |
| 855 | + | |
852 | 856 | | |
853 | 857 | | |
854 | 858 | | |
| |||
1283 | 1287 | | |
1284 | 1288 | | |
1285 | 1289 | | |
1286 | | - | |
| 1290 | + | |
1287 | 1291 | | |
1288 | 1292 | | |
1289 | 1293 | | |
| |||
0 commit comments