Re: [RFC PATCH] parisc: Add wrapper syscalls to fix O_NONBLOCK flag usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +#define O_NONBLOCK_OLD		000200004
> +#define O_NONBLOCK_MASK_OUT	(O_NONBLOCK_OLD & ~O_NONBLOCK)
> +static int FIX_O_NONBLOCK(int flags)
> +{
> +	if (flags & O_NONBLOCK_MASK_OUT) {
> +		struct task_struct *tsk = current;
> +		pr_warn("%s(%d) uses old O_NONBLOCK value. "
> +			"Please recompile the application.\n",
> +			tsk->comm, tsk->pid);
> +	}
> +	return flags & ~O_NONBLOCK_MASK_OUT;
> +}

This will also trigger if I just pass 0x4 in flags, no? The check should be 

	if ((flags & O_NONBLOCK_OLD) == O_NONBLOCK_OLD)

because that would correctly reject a bare 0x4, at least I hope that this 
would already happen with the strict checking you mentioned.

Would a pr_warn_once make sense? Otherwise your log may get flooded by them if 
e.g. sudo is the problem and my nagios comes every minute to check something.

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux