Skip to content

Commit

Permalink
rpc: gss: fix a kmap_atomic race in krb5 code
Browse files Browse the repository at this point in the history
This code is never called from interrupt context; it's always run by either
a user thread or rpciod.  So KM_SKB_SUNRPC_DATA is inappropriate here.

Thanks to Aimé Le Rouzic for capturing an oops which showed the kernel
taking an interrupt while we were in this piece of code, resulting in a
nested kmap_atomic(.,KM_SKB_SUNRPC_DATA) call from
xdr_partial_copy_from_skb().

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
J. Bruce Fields authored and Trond Myklebust committed Dec 6, 2006
1 parent 8fc7500 commit 87d918d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/auth_gss/gss_krb5_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ gss_krb5_remove_padding(struct xdr_buf *buf, int blocksize)
>>PAGE_CACHE_SHIFT;
int offset = (buf->page_base + len - 1)
& (PAGE_CACHE_SIZE - 1);
ptr = kmap_atomic(buf->pages[last], KM_SKB_SUNRPC_DATA);
ptr = kmap_atomic(buf->pages[last], KM_USER0);
pad = *(ptr + offset);
kunmap_atomic(ptr, KM_SKB_SUNRPC_DATA);
kunmap_atomic(ptr, KM_USER0);
goto out;
} else
len -= buf->page_len;
Expand Down

0 comments on commit 87d918d

Please sign in to comment.