Commit 3e8c1a0
mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length
[ Upstream commit ff4dd73dd2b4806419f8ff65cbce11d5019548d0 ]
Unfortunately, the nla policy was defined to have HWSIM_ATTR_RADIO_NAME
as an NLA_STRING, rather than NLA_NUL_STRING, so we can't use it as a
NUL-terminated string in the kernel.
Rather than break the API, kasprintf() the string to a new buffer to
guarantee NUL termination.
Reported-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 4a464da commit 3e8c1a0
1 file changed
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2884 | 2884 | | |
2885 | 2885 | | |
2886 | 2886 | | |
| 2887 | + | |
2887 | 2888 | | |
2888 | 2889 | | |
2889 | 2890 | | |
| |||
2897 | 2898 | | |
2898 | 2899 | | |
2899 | 2900 | | |
2900 | | - | |
2901 | | - | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
2902 | 2909 | | |
2903 | 2910 | | |
2904 | 2911 | | |
| |||
2926 | 2933 | | |
2927 | 2934 | | |
2928 | 2935 | | |
2929 | | - | |
| 2936 | + | |
2930 | 2937 | | |
2931 | | - | |
2932 | | - | |
2933 | | - | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
2934 | 2945 | | |
2935 | 2946 | | |
2936 | 2947 | | |
| |||
2939 | 2950 | | |
2940 | 2951 | | |
2941 | 2952 | | |
2942 | | - | |
| 2953 | + | |
| 2954 | + | |
2943 | 2955 | | |
2944 | 2956 | | |
2945 | 2957 | | |
2946 | 2958 | | |
2947 | 2959 | | |
2948 | 2960 | | |
2949 | 2961 | | |
| 2962 | + | |
2950 | 2963 | | |
2951 | 2964 | | |
2952 | 2965 | | |
2953 | 2966 | | |
| 2967 | + | |
2954 | 2968 | | |
2955 | 2969 | | |
2956 | 2970 | | |
| |||
0 commit comments