Description: Allow masking D_WARNING, D_ERROR messages from console
Details : Console messages can now be disabled via lnet.printk.
+Severity : normal
+Bugzilla : 14614
+Description: User code with malformed file open parameter crashes client node
+Details : Before packing join_file req, all the related reference should be
+ checked carefully in case some malformed flags cause fake
+ join_file req on client.
+
--------------------------------------------------------------------------------
2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com>
LASSERTF(einfo->ei_type == LDLM_IBITS,"lock type %d\n", einfo->ei_type);
if (it->it_op & IT_OPEN) {
- int do_join = !!(it->it_flags & O_JOIN_FILE);
+ int do_join = (!!(it->it_flags & O_JOIN_FILE) &&
+ op_data->op_data);
CFS_LIST_HEAD(cancels);
int count = 0;
int mode;
}
/* If CREATE or JOIN_FILE, cancel parent's UPDATE lock. */
- if (it->it_op & IT_CREAT || it->it_flags & O_JOIN_FILE)
+ if (it->it_op & IT_CREAT || do_join)
mode = LCK_EX;
else
mode = LCK_CR;
if (do_join)
size[DLM_INTENT_REC_OFF + 5] =
sizeof(struct mdt_rec_join);
+ else
+ it->it_flags &= ~O_JOIN_FILE;
req = ldlm_prep_enqueue_req(exp, 8 + do_join, size, &cancels,
count);
if (do_join) {
/* join is like an unlink of the tail */
policy.l_inodebits.bits = MDS_INODELOCK_UPDATE;
- mdc_join_pack(req, DLM_INTENT_REC_OFF + 5, op_data,
+ mdc_join_pack(req, DLM_INTENT_REC_OFF + 5, op_data,
(*(__u64 *)op_data->op_data));
}
}
strncpy(cloned_flags, optarg, strlen(optarg)+1);
+ flags = atoi(cloned_flags);
+ if (flags > 0) {
+ flag_set = 1;
+#ifdef DEBUG
+ printf("flags = %d\n",flags);
+#endif
+ break;
+ } else
+ flags = 0;
+
for (tmp = strtok(cloned_flags, ":|"); tmp;
tmp = strtok(NULL, ":|")) {
int i = 0;
}
run_test 33a "test open file(mode=0444) with O_RDWR (should return error)"
+test_33b() {
+ rm -fr $DIR/d33
+ mkdir -p $DIR/d33
+ chown $RUNAS_ID $DIR/d33
+ $RUNAS $OPENFILE -f 1286739555 $DIR/d33/f33 && error "create" || true
+}
+run_test 33b "test open file with malformed flags (No panic and return error)"
+
TEST_34_SIZE=${TEST_34_SIZE:-2000000000000}
test_34a() {
rm -f $DIR/f34