Repository navigation
Commit f98bac5
NFSD: Fix crash encoding lock reply on 32-bit
Commit 8c7424c "nfsd4: don't try to encode conflicting owner if low
on space" forgot to free conf->data in nfsd4_encode_lockt and before
sign conf->data to NULL in nfsd4_encode_lock_denied, causing a leak.
Worse, kfree() can be called on an uninitialized pointer in the case of
a succesful lock (or one that fails for a reason other than a conflict).
(Note that lock->lk_denied.ld_owner.data appears it should be zero here,
until you notice that it's one arm of a union the other arm of which is
written to in the succesful case by the
memcpy(&lock->lk_resp_stateid, &lock_stp->st_stid.sc_stateid,
sizeof(stateid_t));
in nfsd4_lock(). In the 32-bit case this overwrites ld_owner.data.)
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Fixes: 8c7424c ""nfsd4: don't try to encode conflicting owner if low on space"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>1 parent c3a4561 commit f98bac5
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2879 | 2879 | | |
2880 | 2880 | | |
2881 | 2881 | | |
| 2882 | + | |
2882 | 2883 | | |
2883 | 2884 | | |
2884 | 2885 | | |
| |||
2891 | 2892 | | |
2892 | 2893 | | |
2893 | 2894 | | |
| 2895 | + | |
2894 | 2896 | | |
2895 | 2897 | | |
2896 | 2898 | | |
| |||
2907 | 2909 | | |
2908 | 2910 | | |
2909 | 2911 | | |
2910 | | - | |
| 2912 | + | |
2911 | 2913 | | |
2912 | 2914 | | |
2913 | 2915 | | |
| |||
0 commit comments