lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53784ABD.8080209@colorfullife.com>
Date:	Sun, 18 May 2014 07:53:01 +0200
From:	Manfred Spraul <manfred@...orfullife.com>
To:	Davidlohr Bueso <davidlohr@...com>, akpm@...ux-foundation.org
CC:	aswin@...com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] ipc,msg: always respect MSG_NOERROR

On 05/13/2014 10:27 PM, Davidlohr Bueso wrote:
> When specifying the MSG_NOERROR flag, receivers can avoid returning
> error (E2BIG) and just truncate the message text, if it is too large.
>
> Currently, this logic is only respected when there are already pending
> messages in the queue.
Do you have a test case? The code should handle that
(See below)
>   Fix this for the case when there are only
> receivers waiting for a msg to be sent. In order for this to work, save
> the flags in the msg_receiver struct as it must be used later when
> doing the pipeline send.
No, it is sufficient to set the message size to infinity.

> Also do some pipeline_send() cleanups while at it.
No - please don't mix cleanups with bugfixes.

>   
>   long do_msgsnd(int msqid, long mtype, void __user *mtext,
> @@ -901,6 +907,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
>   		list_add_tail(&msr_d.r_list, &msq->q_receivers);
>   		msr_d.r_tsk = current;
>   		msr_d.r_msgtype = msgtyp;
> +		msr_d.r_msgflg = msgflg;
>   		msr_d.r_mode = mode;
>   		if (msgflg & MSG_NOERROR)
>   			msr_d.r_maxsize = INT_MAX;
    ^^^^^^
This code should handle MSG_NOERROR:
If MSG_NOERROR is set, then maxsize is set to INT_MAX, therefore -E2BIG 
should never be returned.

--
     Manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ