Skip to contentSkip to conversation

New: MSG_TRUNC not regarded in unix_dgram_recvmsg()

Bugme-new Andrew Morton 1 participant 1 message Jul 9, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw
Quoted 35 lines · On Mon, 9 Jul 2007 04:01:58 -0700 (PDT) [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id=8726

           Summary: MSG_TRUNC not regarded in unix_dgram_recvmsg()
           Product: Networking
           Version: 2.5
     KernelVersion: 2.6.19
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [email protected]

Problem Description:

In unix_dgram_recvmsg() in af_unix.c the flag MSG_TRUNC is not regarded as described in the recv(2) man page.

This did work in older kernels (I have a working 2.6.13, but am not sure if that is a plain kernel.org one, nor if it was the last working revision). I believe the bug was introduced when the variable "copied" was removed from the code.

IMHO, the line 1650:

err = size;

should read

err = (flags & MSG_TRUNC) ? skb->len : size;