Commit 29b5eb5
metag/usercopy: Zero rest of buffer from copy_from_user
commit 563ddc1076109f2b3f88e6d355eab7b6fd4662cb upstream.
Currently we try to zero the destination for a failed read from userland
in fixup code in the usercopy.c macros. The rest of the destination
buffer is then zeroed from __copy_user_zeroing(), which is used for both
copy_from_user() and __copy_from_user().
Unfortunately we fail to zero in the fixup code as D1Ar1 is set to 0
before the fixup code entry labels, and __copy_from_user() shouldn't even
be zeroing the rest of the buffer.
Move the zeroing out into copy_from_user() and rename
__copy_user_zeroing() to raw_copy_from_user() since it no longer does
any zeroing. This also conveniently matches the name needed for
RAW_COPY_USER support in a later patch.
Fixes: 373cd78 ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent dde6f22 commit 29b5eb5
2 files changed
Lines changed: 26 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
| 200 | + | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
| 206 | + | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | | - | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
637 | 636 | | |
638 | 637 | | |
639 | 638 | | |
640 | | - | |
641 | | - | |
| 639 | + | |
642 | 640 | | |
643 | 641 | | |
644 | 642 | | |
645 | 643 | | |
646 | 644 | | |
647 | 645 | | |
648 | | - | |
649 | | - | |
| 646 | + | |
650 | 647 | | |
651 | 648 | | |
652 | 649 | | |
| |||
656 | 653 | | |
657 | 654 | | |
658 | 655 | | |
659 | | - | |
660 | | - | |
| 656 | + | |
661 | 657 | | |
662 | 658 | | |
663 | 659 | | |
664 | 660 | | |
665 | 661 | | |
666 | 662 | | |
667 | | - | |
668 | | - | |
| 663 | + | |
669 | 664 | | |
670 | 665 | | |
671 | 666 | | |
672 | 667 | | |
673 | 668 | | |
674 | | - | |
675 | 669 | | |
676 | 670 | | |
677 | 671 | | |
678 | 672 | | |
679 | 673 | | |
680 | 674 | | |
681 | | - | |
682 | | - | |
683 | 675 | | |
684 | | - | |
685 | 676 | | |
686 | 677 | | |
687 | 678 | | |
| |||
721 | 712 | | |
722 | 713 | | |
723 | 714 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
729 | 721 | | |
730 | 722 | | |
731 | 723 | | |
| |||
738 | 730 | | |
739 | 731 | | |
740 | 732 | | |
741 | | - | |
| 733 | + | |
742 | 734 | | |
743 | 735 | | |
744 | 736 | | |
745 | 737 | | |
746 | 738 | | |
747 | 739 | | |
748 | 740 | | |
749 | | - | |
| 741 | + | |
750 | 742 | | |
751 | 743 | | |
752 | 744 | | |
753 | 745 | | |
754 | 746 | | |
755 | 747 | | |
756 | | - | |
| 748 | + | |
757 | 749 | | |
758 | 750 | | |
759 | 751 | | |
760 | 752 | | |
761 | 753 | | |
762 | 754 | | |
763 | 755 | | |
764 | | - | |
| 756 | + | |
765 | 757 | | |
766 | 758 | | |
767 | 759 | | |
| |||
777 | 769 | | |
778 | 770 | | |
779 | 771 | | |
780 | | - | |
| 772 | + | |
781 | 773 | | |
782 | 774 | | |
783 | 775 | | |
| |||
793 | 785 | | |
794 | 786 | | |
795 | 787 | | |
796 | | - | |
| 788 | + | |
797 | 789 | | |
798 | 790 | | |
799 | 791 | | |
| |||
803 | 795 | | |
804 | 796 | | |
805 | 797 | | |
806 | | - | |
| 798 | + | |
807 | 799 | | |
808 | 800 | | |
809 | 801 | | |
| |||
829 | 821 | | |
830 | 822 | | |
831 | 823 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | 824 | | |
846 | | - | |
| 825 | + | |
847 | 826 | | |
848 | 827 | | |
849 | 828 | | |
| |||
0 commit comments