Repository navigation
Commit aecd6f4
mm: close race between do_fault_around() and fault_around_bytes_set()
Things can go wrong if fault_around_bytes will be changed under
do_fault_around(): between fault_around_mask() and fault_around_pages().
Let's read fault_around_bytes only once during do_fault_around() and
calculate mask based on the reading.
Note: fault_around_bytes can only be updated via debug interface. Also
I've tried but was not able to trigger a bad behaviour without the
patch. So I would not consider this patch as urgent.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 2ab051e commit aecd6f4
1 file changed
Lines changed: 7 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
2771 | | - | |
2772 | | - | |
2773 | | - | |
2774 | | - | |
2775 | | - | |
2776 | | - | |
2777 | | - | |
2778 | | - | |
2779 | | - | |
2780 | | - | |
2781 | 2771 | | |
2782 | 2772 | | |
2783 | 2773 | | |
| |||
2842 | 2832 | | |
2843 | 2833 | | |
2844 | 2834 | | |
2845 | | - | |
| 2835 | + | |
2846 | 2836 | | |
2847 | 2837 | | |
2848 | 2838 | | |
2849 | 2839 | | |
2850 | | - | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
2851 | 2844 | | |
2852 | 2845 | | |
2853 | 2846 | | |
| |||
2859 | 2852 | | |
2860 | 2853 | | |
2861 | 2854 | | |
2862 | | - | |
| 2855 | + | |
2863 | 2856 | | |
2864 | 2857 | | |
2865 | 2858 | | |
| |||
2894 | 2887 | | |
2895 | 2888 | | |
2896 | 2889 | | |
2897 | | - | |
| 2890 | + | |
2898 | 2891 | | |
2899 | 2892 | | |
2900 | 2893 | | |
| |||
0 commit comments