Commit 0ddc942
rpc: fix NULL dereference on kmalloc failure
I think this is unlikely but possible:
svc_authenticate sets rq_authop and calls svcauth_gss_accept. The
kmalloc(sizeof(*svcdata), GFP_KERNEL) fails, leaving rq_auth_data NULL,
and returning SVC_DENIED.
This causes svc_process_common to go to err_bad_auth, and eventually
call svc_authorise. That calls ->release == svcauth_gss_release, which
tries to dereference rq_auth_data.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Link: https://lore.kernel.org/linux-nfs/3F1B347F-B809-478F-A1E9-0BE98E22B0F0@oracle.com/T/#t
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent f1442d6 commit 0ddc942
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
1828 | | - | |
| 1828 | + | |
1829 | 1829 | | |
1830 | 1830 | | |
1831 | 1831 | | |
1832 | 1832 | | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
1833 | 1836 | | |
1834 | 1837 | | |
1835 | 1838 | | |
| |||
1870 | 1873 | | |
1871 | 1874 | | |
1872 | 1875 | | |
1873 | | - | |
| 1876 | + | |
1874 | 1877 | | |
1875 | | - | |
1876 | | - | |
| 1878 | + | |
| 1879 | + | |
1877 | 1880 | | |
1878 | 1881 | | |
1879 | 1882 | | |
| |||
0 commit comments