Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fix-max-write' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm fix from David Teigland:
"Thanks to Jana who reported the problem and was able to test this fix
so quickly."

This fixes an incorrect size check that triggered for CONFIG_COMPAT
whether the code was actually doing compat or not. The incorrect write
size check broke userland (clvmd) when maximum resource name lengths are
used.

* 'fix-max-write' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
dlm: check the write size from user

+4 -4
+4 -4
fs/dlm/user.c
··· 503 503 #endif 504 504 return -EINVAL; 505 505 506 - #ifdef CONFIG_COMPAT 507 - if (count > sizeof(struct dlm_write_request32) + DLM_RESNAME_MAXLEN) 508 - #else 506 + /* 507 + * can't compare against COMPAT/dlm_write_request32 because 508 + * we don't yet know if is64bit is zero 509 + */ 509 510 if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN) 510 - #endif 511 511 return -EINVAL; 512 512 513 513 kbuf = kzalloc(count + 1, GFP_NOFS);