Commit 5011c5a
btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl
The problem is we're copying "inherit" from user space but we don't
necessarily know that we're copying enough data for a 64 byte
struct. Then the next problem is that 'inherit' has a variable size
array at the end, and we have to verify that array is the size we
expected.
Fixes: 6f72c7e ("Btrfs: add qgroup inheritance")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 4f6a49d commit 5011c5a
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1935 | 1935 | | |
1936 | 1936 | | |
1937 | 1937 | | |
1938 | | - | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
1939 | 1942 | | |
1940 | 1943 | | |
1941 | 1944 | | |
| |||
1944 | 1947 | | |
1945 | 1948 | | |
1946 | 1949 | | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
1947 | 1964 | | |
1948 | 1965 | | |
1949 | 1966 | | |
| |||
0 commit comments